diff --git a/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/__init__.py b/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/__init__.py index d6c255165100..c8c11052420f 100644 --- a/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/__init__.py +++ b/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/__init__.py @@ -9,15 +9,26 @@ # regenerated. # -------------------------------------------------------------------------- -from .spelling_token_suggestion import SpellingTokenSuggestion -from .spelling_flagged_token import SpellingFlaggedToken -from .spell_check import SpellCheck -from .answer import Answer -from .response import Response -from .identifiable import Identifiable -from .error import Error -from .error_response import ErrorResponse, ErrorResponseException -from .response_base import ResponseBase +try: + from .spelling_token_suggestion_py3 import SpellingTokenSuggestion + from .spelling_flagged_token_py3 import SpellingFlaggedToken + from .spell_check_py3 import SpellCheck + from .answer_py3 import Answer + from .response_py3 import Response + from .identifiable_py3 import Identifiable + from .error_py3 import Error + from .error_response_py3 import ErrorResponse, ErrorResponseException + from .response_base_py3 import ResponseBase +except (SyntaxError, ImportError): + from .spelling_token_suggestion import SpellingTokenSuggestion + from .spelling_flagged_token import SpellingFlaggedToken + from .spell_check import SpellCheck + from .answer import Answer + from .response import Response + from .identifiable import Identifiable + from .error import Error + from .error_response import ErrorResponse, ErrorResponseException + from .response_base import ResponseBase from .spell_check_api_enums import ( ErrorType, ErrorCode, diff --git a/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/answer.py b/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/answer.py index f24affbefdb9..b957e138ffb0 100644 --- a/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/answer.py +++ b/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/answer.py @@ -21,7 +21,9 @@ class Answer(Response): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -32,10 +34,15 @@ class Answer(Response): 'id': {'readonly': True}, } + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + } + _subtype_map = { '_type': {'SpellCheck': 'SpellCheck'} } - def __init__(self): - super(Answer, self).__init__() + def __init__(self, **kwargs): + super(Answer, self).__init__(**kwargs) self._type = 'Answer' diff --git a/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/answer_py3.py b/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/answer_py3.py new file mode 100644 index 000000000000..2e899d349612 --- /dev/null +++ b/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/answer_py3.py @@ -0,0 +1,48 @@ +# 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 .response import Response + + +class Answer(Response): + """Answer. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: SpellCheck + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'SpellCheck': 'SpellCheck'} + } + + def __init__(self, **kwargs) -> None: + super(Answer, self).__init__(**kwargs) + self._type = 'Answer' diff --git a/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/error.py b/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/error.py index a714c8a95a09..47dd14240756 100644 --- a/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/error.py +++ b/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/error.py @@ -18,8 +18,10 @@ class Error(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param code: The error code that identifies the category of error. - Possible values include: 'None', 'ServerError', 'InvalidRequest', + All required parameters must be populated in order to send to Azure. + + :param code: Required. The error code that identifies the category of + error. Possible values include: 'None', 'ServerError', 'InvalidRequest', 'RateLimitExceeded', 'InvalidAuthorization', 'InsufficientAuthorization'. Default value: "None" . :type code: str or @@ -31,7 +33,7 @@ class Error(Model): 'AuthorizationRedundancy', 'AuthorizationDisabled', 'AuthorizationExpired' :vartype sub_code: str or ~azure.cognitiveservices.language.spellcheck.models.ErrorSubCode - :param message: A description of the error. + :param message: Required. A description of the error. :type message: str :ivar more_details: A description that provides additional information about the error. @@ -60,11 +62,11 @@ class Error(Model): 'value': {'key': 'value', 'type': 'str'}, } - def __init__(self, message, code="None"): - super(Error, self).__init__() - self.code = code + def __init__(self, **kwargs): + super(Error, self).__init__(**kwargs) + self.code = kwargs.get('code', "None") self.sub_code = None - self.message = message + self.message = kwargs.get('message', None) self.more_details = None self.parameter = None self.value = None diff --git a/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/error_py3.py b/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/error_py3.py new file mode 100644 index 000000000000..5b542c491006 --- /dev/null +++ b/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/error_py3.py @@ -0,0 +1,72 @@ +# 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 msrest.serialization import Model + + +class Error(Model): + """Defines the error that occurred. + + 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 Azure. + + :param code: Required. The error code that identifies the category of + error. Possible values include: 'None', 'ServerError', 'InvalidRequest', + 'RateLimitExceeded', 'InvalidAuthorization', 'InsufficientAuthorization'. + Default value: "None" . + :type code: str or + ~azure.cognitiveservices.language.spellcheck.models.ErrorCode + :ivar sub_code: The error code that further helps to identify the error. + Possible values include: 'UnexpectedError', 'ResourceError', + 'NotImplemented', 'ParameterMissing', 'ParameterInvalidValue', + 'HttpNotAllowed', 'Blocked', 'AuthorizationMissing', + 'AuthorizationRedundancy', 'AuthorizationDisabled', 'AuthorizationExpired' + :vartype sub_code: str or + ~azure.cognitiveservices.language.spellcheck.models.ErrorSubCode + :param message: Required. A description of the error. + :type message: str + :ivar more_details: A description that provides additional information + about the error. + :vartype more_details: str + :ivar parameter: The parameter in the request that caused the error. + :vartype parameter: str + :ivar value: The parameter's value in the request that was not valid. + :vartype value: str + """ + + _validation = { + 'code': {'required': True}, + 'sub_code': {'readonly': True}, + 'message': {'required': True}, + 'more_details': {'readonly': True}, + 'parameter': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'sub_code': {'key': 'subCode', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'more_details': {'key': 'moreDetails', 'type': 'str'}, + 'parameter': {'key': 'parameter', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, message: str, code="None", **kwargs) -> None: + super(Error, self).__init__(**kwargs) + self.code = code + self.sub_code = None + self.message = message + self.more_details = None + self.parameter = None + self.value = None diff --git a/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/error_response.py b/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/error_response.py index 803ea329ee79..23f7f77779b9 100644 --- a/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/error_response.py +++ b/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/error_response.py @@ -19,12 +19,14 @@ class ErrorResponse(Response): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str - :param errors: A list of errors that describe the reasons why the request - failed. + :param errors: Required. A list of errors that describe the reasons why + the request failed. :type errors: list[~azure.cognitiveservices.language.spellcheck.models.Error] """ @@ -41,9 +43,9 @@ class ErrorResponse(Response): 'errors': {'key': 'errors', 'type': '[Error]'}, } - def __init__(self, errors): - super(ErrorResponse, self).__init__() - self.errors = errors + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.errors = kwargs.get('errors', None) self._type = 'ErrorResponse' diff --git a/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/error_response_py3.py b/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/error_response_py3.py new file mode 100644 index 000000000000..7c3804f78124 --- /dev/null +++ b/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/error_response_py3.py @@ -0,0 +1,61 @@ +# 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 .response import Response +from msrest.exceptions import HttpOperationError + + +class ErrorResponse(Response): + """The top-level response that represents a failed request. + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :param errors: Required. A list of errors that describe the reasons why + the request failed. + :type errors: + list[~azure.cognitiveservices.language.spellcheck.models.Error] + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'errors': {'required': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'errors': {'key': 'errors', 'type': '[Error]'}, + } + + def __init__(self, *, errors, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.errors = errors + self._type = 'ErrorResponse' + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/identifiable.py b/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/identifiable.py index 133e93fa8f94..513e53d238bb 100644 --- a/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/identifiable.py +++ b/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/identifiable.py @@ -21,7 +21,9 @@ class Identifiable(ResponseBase): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -41,7 +43,7 @@ class Identifiable(ResponseBase): '_type': {'Response': 'Response'} } - def __init__(self): - super(Identifiable, self).__init__() + def __init__(self, **kwargs): + super(Identifiable, self).__init__(**kwargs) self.id = None self._type = 'Identifiable' diff --git a/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/identifiable_py3.py b/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/identifiable_py3.py new file mode 100644 index 000000000000..c87dc0347e3d --- /dev/null +++ b/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/identifiable_py3.py @@ -0,0 +1,49 @@ +# 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 .response_base import ResponseBase + + +class Identifiable(ResponseBase): + """Defines the identity of a resource. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: Response + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'Response': 'Response'} + } + + def __init__(self, **kwargs) -> None: + super(Identifiable, self).__init__(**kwargs) + self.id = None + self._type = 'Identifiable' diff --git a/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/response.py b/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/response.py index 7e0fd792b145..638d4692f623 100644 --- a/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/response.py +++ b/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/response.py @@ -22,7 +22,9 @@ class Response(Identifiable): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -33,10 +35,15 @@ class Response(Identifiable): 'id': {'readonly': True}, } + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + } + _subtype_map = { '_type': {'Answer': 'Answer', 'ErrorResponse': 'ErrorResponse'} } - def __init__(self): - super(Response, self).__init__() + def __init__(self, **kwargs): + super(Response, self).__init__(**kwargs) self._type = 'Response' diff --git a/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/response_base.py b/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/response_base.py index 0b5b11b43039..5a09ce0f95d6 100644 --- a/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/response_base.py +++ b/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/response_base.py @@ -18,7 +18,9 @@ class ResponseBase(Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: Identifiable - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str """ @@ -34,6 +36,6 @@ class ResponseBase(Model): '_type': {'Identifiable': 'Identifiable'} } - def __init__(self): - super(ResponseBase, self).__init__() + def __init__(self, **kwargs): + super(ResponseBase, self).__init__(**kwargs) self._type = None diff --git a/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/response_base_py3.py b/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/response_base_py3.py new file mode 100644 index 000000000000..0ac9762f5cd7 --- /dev/null +++ b/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/response_base_py3.py @@ -0,0 +1,41 @@ +# 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 msrest.serialization import Model + + +class ResponseBase(Model): + """ResponseBase. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: Identifiable + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + """ + + _validation = { + '_type': {'required': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'Identifiable': 'Identifiable'} + } + + def __init__(self, **kwargs) -> None: + super(ResponseBase, self).__init__(**kwargs) + self._type = None diff --git a/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/response_py3.py b/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/response_py3.py new file mode 100644 index 000000000000..d936df09e664 --- /dev/null +++ b/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/response_py3.py @@ -0,0 +1,49 @@ +# 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 .identifiable import Identifiable + + +class Response(Identifiable): + """Defines a response. All schemas that could be returned at the root of a + response should inherit from this. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: Answer, ErrorResponse + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'Answer': 'Answer', 'ErrorResponse': 'ErrorResponse'} + } + + def __init__(self, **kwargs) -> None: + super(Response, self).__init__(**kwargs) + self._type = 'Response' diff --git a/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/spell_check.py b/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/spell_check.py index 2060e708de97..945fc3c50cad 100644 --- a/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/spell_check.py +++ b/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/spell_check.py @@ -18,11 +18,13 @@ class SpellCheck(Answer): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str - :param flagged_tokens: + :param flagged_tokens: Required. :type flagged_tokens: list[~azure.cognitiveservices.language.spellcheck.models.SpellingFlaggedToken] """ @@ -39,7 +41,7 @@ class SpellCheck(Answer): 'flagged_tokens': {'key': 'flaggedTokens', 'type': '[SpellingFlaggedToken]'}, } - def __init__(self, flagged_tokens): - super(SpellCheck, self).__init__() - self.flagged_tokens = flagged_tokens + def __init__(self, **kwargs): + super(SpellCheck, self).__init__(**kwargs) + self.flagged_tokens = kwargs.get('flagged_tokens', None) self._type = 'SpellCheck' diff --git a/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/spell_check_api_enums.py b/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/spell_check_api_enums.py index 863d30ab9a73..35e88466a5e8 100644 --- a/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/spell_check_api_enums.py +++ b/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/spell_check_api_enums.py @@ -12,13 +12,13 @@ from enum import Enum -class ErrorType(Enum): +class ErrorType(str, Enum): unknown_token = "UnknownToken" repeated_token = "RepeatedToken" -class ErrorCode(Enum): +class ErrorCode(str, Enum): none = "None" server_error = "ServerError" @@ -28,7 +28,7 @@ class ErrorCode(Enum): insufficient_authorization = "InsufficientAuthorization" -class ErrorSubCode(Enum): +class ErrorSubCode(str, Enum): unexpected_error = "UnexpectedError" resource_error = "ResourceError" @@ -43,7 +43,7 @@ class ErrorSubCode(Enum): authorization_expired = "AuthorizationExpired" -class ActionType(Enum): +class ActionType(str, Enum): edit = "Edit" load = "Load" diff --git a/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/spell_check_py3.py b/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/spell_check_py3.py new file mode 100644 index 000000000000..24f5476e812b --- /dev/null +++ b/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/spell_check_py3.py @@ -0,0 +1,47 @@ +# 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 .answer import Answer + + +class SpellCheck(Answer): + """SpellCheck. + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :param flagged_tokens: Required. + :type flagged_tokens: + list[~azure.cognitiveservices.language.spellcheck.models.SpellingFlaggedToken] + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'flagged_tokens': {'required': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'flagged_tokens': {'key': 'flaggedTokens', 'type': '[SpellingFlaggedToken]'}, + } + + def __init__(self, *, flagged_tokens, **kwargs) -> None: + super(SpellCheck, self).__init__(**kwargs) + self.flagged_tokens = flagged_tokens + self._type = 'SpellCheck' diff --git a/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/spelling_flagged_token.py b/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/spelling_flagged_token.py index f0129da07a6e..db39f1f969ff 100644 --- a/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/spelling_flagged_token.py +++ b/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/spelling_flagged_token.py @@ -18,12 +18,14 @@ class SpellingFlaggedToken(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param offset: + All required parameters must be populated in order to send to Azure. + + :param offset: Required. :type offset: int - :param token: + :param token: Required. :type token: str - :param type: Possible values include: 'UnknownToken', 'RepeatedToken'. - Default value: "UnknownToken" . + :param type: Required. Possible values include: 'UnknownToken', + 'RepeatedToken'. Default value: "UnknownToken" . :type type: str or ~azure.cognitiveservices.language.spellcheck.models.ErrorType :ivar suggestions: @@ -49,10 +51,10 @@ class SpellingFlaggedToken(Model): 'ping_url_suffix': {'key': 'pingUrlSuffix', 'type': 'str'}, } - def __init__(self, offset, token, type="UnknownToken"): - super(SpellingFlaggedToken, self).__init__() - self.offset = offset - self.token = token - self.type = type + def __init__(self, **kwargs): + super(SpellingFlaggedToken, self).__init__(**kwargs) + self.offset = kwargs.get('offset', None) + self.token = kwargs.get('token', None) + self.type = kwargs.get('type', "UnknownToken") self.suggestions = None self.ping_url_suffix = None diff --git a/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/spelling_flagged_token_py3.py b/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/spelling_flagged_token_py3.py new file mode 100644 index 000000000000..6df12e3ae6dd --- /dev/null +++ b/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/spelling_flagged_token_py3.py @@ -0,0 +1,60 @@ +# 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 msrest.serialization import Model + + +class SpellingFlaggedToken(Model): + """SpellingFlaggedToken. + + 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 Azure. + + :param offset: Required. + :type offset: int + :param token: Required. + :type token: str + :param type: Required. Possible values include: 'UnknownToken', + 'RepeatedToken'. Default value: "UnknownToken" . + :type type: str or + ~azure.cognitiveservices.language.spellcheck.models.ErrorType + :ivar suggestions: + :vartype suggestions: + list[~azure.cognitiveservices.language.spellcheck.models.SpellingTokenSuggestion] + :ivar ping_url_suffix: + :vartype ping_url_suffix: str + """ + + _validation = { + 'offset': {'required': True}, + 'token': {'required': True}, + 'type': {'required': True}, + 'suggestions': {'readonly': True}, + 'ping_url_suffix': {'readonly': True}, + } + + _attribute_map = { + 'offset': {'key': 'offset', 'type': 'int'}, + 'token': {'key': 'token', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'suggestions': {'key': 'suggestions', 'type': '[SpellingTokenSuggestion]'}, + 'ping_url_suffix': {'key': 'pingUrlSuffix', 'type': 'str'}, + } + + def __init__(self, *, offset: int, token: str, type="UnknownToken", **kwargs) -> None: + super(SpellingFlaggedToken, self).__init__(**kwargs) + self.offset = offset + self.token = token + self.type = type + self.suggestions = None + self.ping_url_suffix = None diff --git a/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/spelling_token_suggestion.py b/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/spelling_token_suggestion.py index 7c236fea861f..f0ac6d00c30d 100644 --- a/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/spelling_token_suggestion.py +++ b/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/spelling_token_suggestion.py @@ -18,7 +18,9 @@ class SpellingTokenSuggestion(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param suggestion: + All required parameters must be populated in order to send to Azure. + + :param suggestion: Required. :type suggestion: str :ivar score: :vartype score: float @@ -38,8 +40,8 @@ class SpellingTokenSuggestion(Model): 'ping_url_suffix': {'key': 'pingUrlSuffix', 'type': 'str'}, } - def __init__(self, suggestion): - super(SpellingTokenSuggestion, self).__init__() - self.suggestion = suggestion + def __init__(self, **kwargs): + super(SpellingTokenSuggestion, self).__init__(**kwargs) + self.suggestion = kwargs.get('suggestion', None) self.score = None self.ping_url_suffix = None diff --git a/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/spelling_token_suggestion_py3.py b/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/spelling_token_suggestion_py3.py new file mode 100644 index 000000000000..f27ef9faab31 --- /dev/null +++ b/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/models/spelling_token_suggestion_py3.py @@ -0,0 +1,47 @@ +# 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 msrest.serialization import Model + + +class SpellingTokenSuggestion(Model): + """SpellingTokenSuggestion. + + 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 Azure. + + :param suggestion: Required. + :type suggestion: str + :ivar score: + :vartype score: float + :ivar ping_url_suffix: + :vartype ping_url_suffix: str + """ + + _validation = { + 'suggestion': {'required': True}, + 'score': {'readonly': True}, + 'ping_url_suffix': {'readonly': True}, + } + + _attribute_map = { + 'suggestion': {'key': 'suggestion', 'type': 'str'}, + 'score': {'key': 'score', 'type': 'float'}, + 'ping_url_suffix': {'key': 'pingUrlSuffix', 'type': 'str'}, + } + + def __init__(self, *, suggestion: str, **kwargs) -> None: + super(SpellingTokenSuggestion, self).__init__(**kwargs) + self.suggestion = suggestion + self.score = None + self.ping_url_suffix = None diff --git a/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/spell_check_api.py b/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/spell_check_api.py index 6d565fdadd41..4d59f6dc8f92 100644 --- a/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/spell_check_api.py +++ b/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/spell_check_api.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import ServiceClient +from msrest.service_client import SDKClient from msrest import Configuration, Serializer, Deserializer from .version import VERSION from msrest.pipeline import ClientRawResponse @@ -42,7 +42,7 @@ def __init__( self.credentials = credentials -class SpellCheckAPI(object): +class SpellCheckAPI(SDKClient): """The Spell Check API - V7 lets you check a text string for spelling and grammar errors. :ivar config: Configuration for client. @@ -58,7 +58,7 @@ def __init__( self, credentials, base_url=None): self.config = SpellCheckAPIConfiguration(credentials, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + super(SpellCheckAPI, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self.api_version = '1.0' @@ -265,7 +265,7 @@ def spell_checker( The default is Proof. 1) Proof—Finds most spelling and grammar mistakes. 2) Spell—Finds most spelling mistakes but does not find some of the grammar errors that Proof catches (for example, capitalization - and repeated words). Possible values include: 'Proof', 'Spell' + and repeated words). Possible values include: 'proof', 'spell' :type mode: str :param pre_context_text: A string that gives context to the text string. For example, the text string petal is valid. However, if you @@ -301,7 +301,7 @@ def spell_checker( x_bing_apis_sdk = "true" # Construct URL - url = '/spellcheck' + url = self.spell_checker.metadata['url'] # Construct parameters query_parameters = {} @@ -369,3 +369,4 @@ def spell_checker( return client_raw_response return deserialized + spell_checker.metadata = {'url': '/spellcheck'} diff --git a/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/version.py b/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/version.py index e0ec669828cb..63d89bfb54fa 100644 --- a/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/version.py +++ b/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/spellcheck/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.1.0" +VERSION = "1.0" diff --git a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/__init__.py b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/__init__.py index 1f87b1c998b0..8538101fc5e9 100644 --- a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/__init__.py +++ b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/__init__.py @@ -9,20 +9,36 @@ # regenerated. # -------------------------------------------------------------------------- -from .multi_language_input import MultiLanguageInput -from .multi_language_batch_input import MultiLanguageBatchInput -from .key_phrase_batch_result_item import KeyPhraseBatchResultItem -from .error_record import ErrorRecord -from .key_phrase_batch_result import KeyPhraseBatchResult -from .internal_error import InternalError -from .error_response import ErrorResponse, ErrorResponseException -from .input import Input -from .batch_input import BatchInput -from .detected_language import DetectedLanguage -from .language_batch_result_item import LanguageBatchResultItem -from .language_batch_result import LanguageBatchResult -from .sentiment_batch_result_item import SentimentBatchResultItem -from .sentiment_batch_result import SentimentBatchResult +try: + from .multi_language_input_py3 import MultiLanguageInput + from .multi_language_batch_input_py3 import MultiLanguageBatchInput + from .key_phrase_batch_result_item_py3 import KeyPhraseBatchResultItem + from .error_record_py3 import ErrorRecord + from .key_phrase_batch_result_py3 import KeyPhraseBatchResult + from .internal_error_py3 import InternalError + from .error_response_py3 import ErrorResponse, ErrorResponseException + from .input_py3 import Input + from .batch_input_py3 import BatchInput + from .detected_language_py3 import DetectedLanguage + from .language_batch_result_item_py3 import LanguageBatchResultItem + from .language_batch_result_py3 import LanguageBatchResult + from .sentiment_batch_result_item_py3 import SentimentBatchResultItem + from .sentiment_batch_result_py3 import SentimentBatchResult +except (SyntaxError, ImportError): + from .multi_language_input import MultiLanguageInput + from .multi_language_batch_input import MultiLanguageBatchInput + from .key_phrase_batch_result_item import KeyPhraseBatchResultItem + from .error_record import ErrorRecord + from .key_phrase_batch_result import KeyPhraseBatchResult + from .internal_error import InternalError + from .error_response import ErrorResponse, ErrorResponseException + from .input import Input + from .batch_input import BatchInput + from .detected_language import DetectedLanguage + from .language_batch_result_item import LanguageBatchResultItem + from .language_batch_result import LanguageBatchResult + from .sentiment_batch_result_item import SentimentBatchResultItem + from .sentiment_batch_result import SentimentBatchResult from .text_analytics_api_enums import ( AzureRegions, ) diff --git a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/batch_input.py b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/batch_input.py index d2f205ab8211..90d331921e6a 100644 --- a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/batch_input.py +++ b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/batch_input.py @@ -24,6 +24,6 @@ class BatchInput(Model): 'documents': {'key': 'documents', 'type': '[Input]'}, } - def __init__(self, documents=None): - super(BatchInput, self).__init__() - self.documents = documents + def __init__(self, **kwargs): + super(BatchInput, self).__init__(**kwargs) + self.documents = kwargs.get('documents', None) diff --git a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/batch_input_py3.py b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/batch_input_py3.py new file mode 100644 index 000000000000..77299dff371a --- /dev/null +++ b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/batch_input_py3.py @@ -0,0 +1,29 @@ +# 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 msrest.serialization import Model + + +class BatchInput(Model): + """BatchInput. + + :param documents: + :type documents: + list[~azure.cognitiveservices.language.textanalytics.models.Input] + """ + + _attribute_map = { + 'documents': {'key': 'documents', 'type': '[Input]'}, + } + + def __init__(self, *, documents=None, **kwargs) -> None: + super(BatchInput, self).__init__(**kwargs) + self.documents = documents diff --git a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/detected_language.py b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/detected_language.py index 08aa908b61ed..4741f83e264f 100644 --- a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/detected_language.py +++ b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/detected_language.py @@ -31,8 +31,8 @@ class DetectedLanguage(Model): 'score': {'key': 'score', 'type': 'float'}, } - def __init__(self, name=None, iso6391_name=None, score=None): - super(DetectedLanguage, self).__init__() - self.name = name - self.iso6391_name = iso6391_name - self.score = score + def __init__(self, **kwargs): + super(DetectedLanguage, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.iso6391_name = kwargs.get('iso6391_name', None) + self.score = kwargs.get('score', None) diff --git a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/detected_language_py3.py b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/detected_language_py3.py new file mode 100644 index 000000000000..87824c274b58 --- /dev/null +++ b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/detected_language_py3.py @@ -0,0 +1,38 @@ +# 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 msrest.serialization import Model + + +class DetectedLanguage(Model): + """DetectedLanguage. + + :param name: Long name of a detected language (e.g. English, French). + :type name: str + :param iso6391_name: A two letter representation of the detected language + according to the ISO 639-1 standard (e.g. en, fr). + :type iso6391_name: str + :param score: A confidence score between 0 and 1. Scores close to 1 + indicate 100% certainty that the identified language is true. + :type score: float + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'iso6391_name': {'key': 'iso6391Name', 'type': 'str'}, + 'score': {'key': 'score', 'type': 'float'}, + } + + def __init__(self, *, name: str=None, iso6391_name: str=None, score: float=None, **kwargs) -> None: + super(DetectedLanguage, self).__init__(**kwargs) + self.name = name + self.iso6391_name = iso6391_name + self.score = score diff --git a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/error_record.py b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/error_record.py index 81612548d011..22283996cab7 100644 --- a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/error_record.py +++ b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/error_record.py @@ -26,7 +26,7 @@ class ErrorRecord(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self, id=None, message=None): - super(ErrorRecord, self).__init__() - self.id = id - self.message = message + def __init__(self, **kwargs): + super(ErrorRecord, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.message = kwargs.get('message', None) diff --git a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/error_record_py3.py b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/error_record_py3.py new file mode 100644 index 000000000000..3ddcbca03f2c --- /dev/null +++ b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/error_record_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class ErrorRecord(Model): + """ErrorRecord. + + :param id: Input document unique identifier the error refers to. + :type id: str + :param message: Error message. + :type message: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, message: str=None, **kwargs) -> None: + super(ErrorRecord, self).__init__(**kwargs) + self.id = id + self.message = message diff --git a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/error_response.py b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/error_response.py index 22995c92068b..3a0197f190f3 100644 --- a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/error_response.py +++ b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/error_response.py @@ -34,12 +34,12 @@ class ErrorResponse(Model): 'inner_error': {'key': 'innerError', 'type': 'InternalError'}, } - def __init__(self, code=None, message=None, target=None, inner_error=None): - super(ErrorResponse, self).__init__() - self.code = code - self.message = message - self.target = target - self.inner_error = inner_error + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + self.inner_error = kwargs.get('inner_error', None) class ErrorResponseException(HttpOperationError): diff --git a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/error_response_py3.py b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/error_response_py3.py new file mode 100644 index 000000000000..92d272000249 --- /dev/null +++ b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/error_response_py3.py @@ -0,0 +1,54 @@ +# 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 msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class ErrorResponse(Model): + """ErrorResponse. + + :param code: + :type code: str + :param message: + :type message: str + :param target: + :type target: str + :param inner_error: + :type inner_error: + ~azure.cognitiveservices.language.textanalytics.models.InternalError + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'inner_error': {'key': 'innerError', 'type': 'InternalError'}, + } + + def __init__(self, *, code: str=None, message: str=None, target: str=None, inner_error=None, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.inner_error = inner_error + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/input.py b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/input.py index 95a6ae5e185a..35913eba80f4 100644 --- a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/input.py +++ b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/input.py @@ -26,7 +26,7 @@ class Input(Model): 'text': {'key': 'text', 'type': 'str'}, } - def __init__(self, id=None, text=None): - super(Input, self).__init__() - self.id = id - self.text = text + def __init__(self, **kwargs): + super(Input, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.text = kwargs.get('text', None) diff --git a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/input_py3.py b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/input_py3.py new file mode 100644 index 000000000000..fc8ece42126f --- /dev/null +++ b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/input_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class Input(Model): + """Input. + + :param id: Unique, non-empty document identifier. + :type id: str + :param text: + :type text: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'text': {'key': 'text', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, text: str=None, **kwargs) -> None: + super(Input, self).__init__(**kwargs) + self.id = id + self.text = text diff --git a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/internal_error.py b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/internal_error.py index 2e7e1ba6ea6f..1b40432d6d22 100644 --- a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/internal_error.py +++ b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/internal_error.py @@ -30,8 +30,8 @@ class InternalError(Model): 'inner_error': {'key': 'innerError', 'type': 'InternalError'}, } - def __init__(self, code=None, message=None, inner_error=None): - super(InternalError, self).__init__() - self.code = code - self.message = message - self.inner_error = inner_error + def __init__(self, **kwargs): + super(InternalError, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.inner_error = kwargs.get('inner_error', None) diff --git a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/internal_error_py3.py b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/internal_error_py3.py new file mode 100644 index 000000000000..db1299ef21de --- /dev/null +++ b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/internal_error_py3.py @@ -0,0 +1,37 @@ +# 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 msrest.serialization import Model + + +class InternalError(Model): + """InternalError. + + :param code: + :type code: str + :param message: + :type message: str + :param inner_error: + :type inner_error: + ~azure.cognitiveservices.language.textanalytics.models.InternalError + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'inner_error': {'key': 'innerError', 'type': 'InternalError'}, + } + + def __init__(self, *, code: str=None, message: str=None, inner_error=None, **kwargs) -> None: + super(InternalError, self).__init__(**kwargs) + self.code = code + self.message = message + self.inner_error = inner_error diff --git a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/key_phrase_batch_result.py b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/key_phrase_batch_result.py index 03aa865b11bb..62646ccc2b9a 100644 --- a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/key_phrase_batch_result.py +++ b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/key_phrase_batch_result.py @@ -36,7 +36,7 @@ class KeyPhraseBatchResult(Model): 'errors': {'key': 'errors', 'type': '[ErrorRecord]'}, } - def __init__(self): - super(KeyPhraseBatchResult, self).__init__() + def __init__(self, **kwargs): + super(KeyPhraseBatchResult, self).__init__(**kwargs) self.documents = None self.errors = None diff --git a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/key_phrase_batch_result_item.py b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/key_phrase_batch_result_item.py index f3ba063757ed..3ce0b9122bc9 100644 --- a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/key_phrase_batch_result_item.py +++ b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/key_phrase_batch_result_item.py @@ -36,7 +36,7 @@ class KeyPhraseBatchResultItem(Model): 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self): - super(KeyPhraseBatchResultItem, self).__init__() + def __init__(self, **kwargs): + super(KeyPhraseBatchResultItem, self).__init__(**kwargs) self.key_phrases = None self.id = None diff --git a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/key_phrase_batch_result_item_py3.py b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/key_phrase_batch_result_item_py3.py new file mode 100644 index 000000000000..9030b25619ea --- /dev/null +++ b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/key_phrase_batch_result_item_py3.py @@ -0,0 +1,42 @@ +# 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 msrest.serialization import Model + + +class KeyPhraseBatchResultItem(Model): + """KeyPhraseBatchResultItem. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar key_phrases: A list of representative words or phrases. The number + of key phrases returned is proportional to the number of words in the + input document. + :vartype key_phrases: list[str] + :ivar id: Unique document identifier. + :vartype id: str + """ + + _validation = { + 'key_phrases': {'readonly': True}, + 'id': {'readonly': True}, + } + + _attribute_map = { + 'key_phrases': {'key': 'keyPhrases', 'type': '[str]'}, + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(KeyPhraseBatchResultItem, self).__init__(**kwargs) + self.key_phrases = None + self.id = None diff --git a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/key_phrase_batch_result_py3.py b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/key_phrase_batch_result_py3.py new file mode 100644 index 000000000000..85eb3492774c --- /dev/null +++ b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/key_phrase_batch_result_py3.py @@ -0,0 +1,42 @@ +# 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 msrest.serialization import Model + + +class KeyPhraseBatchResult(Model): + """KeyPhraseBatchResult. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar documents: + :vartype documents: + list[~azure.cognitiveservices.language.textanalytics.models.KeyPhraseBatchResultItem] + :ivar errors: + :vartype errors: + list[~azure.cognitiveservices.language.textanalytics.models.ErrorRecord] + """ + + _validation = { + 'documents': {'readonly': True}, + 'errors': {'readonly': True}, + } + + _attribute_map = { + 'documents': {'key': 'documents', 'type': '[KeyPhraseBatchResultItem]'}, + 'errors': {'key': 'errors', 'type': '[ErrorRecord]'}, + } + + def __init__(self, **kwargs) -> None: + super(KeyPhraseBatchResult, self).__init__(**kwargs) + self.documents = None + self.errors = None diff --git a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_batch_result.py b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_batch_result.py index 6a790c5cee6c..658914dd8fea 100644 --- a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_batch_result.py +++ b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_batch_result.py @@ -36,7 +36,7 @@ class LanguageBatchResult(Model): 'errors': {'key': 'errors', 'type': '[ErrorRecord]'}, } - def __init__(self): - super(LanguageBatchResult, self).__init__() + def __init__(self, **kwargs): + super(LanguageBatchResult, self).__init__(**kwargs) self.documents = None self.errors = None diff --git a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_batch_result_item.py b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_batch_result_item.py index 550b3c0ca74e..0058671146fb 100644 --- a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_batch_result_item.py +++ b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_batch_result_item.py @@ -35,7 +35,7 @@ class LanguageBatchResultItem(Model): 'detected_languages': {'key': 'detectedLanguages', 'type': '[DetectedLanguage]'}, } - def __init__(self): - super(LanguageBatchResultItem, self).__init__() + def __init__(self, **kwargs): + super(LanguageBatchResultItem, self).__init__(**kwargs) self.id = None self.detected_languages = None diff --git a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_batch_result_item_py3.py b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_batch_result_item_py3.py new file mode 100644 index 000000000000..ac34fc67e626 --- /dev/null +++ b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_batch_result_item_py3.py @@ -0,0 +1,41 @@ +# 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 msrest.serialization import Model + + +class LanguageBatchResultItem(Model): + """LanguageBatchResultItem. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Unique document identifier. + :vartype id: str + :ivar detected_languages: A list of extracted languages. + :vartype detected_languages: + list[~azure.cognitiveservices.language.textanalytics.models.DetectedLanguage] + """ + + _validation = { + 'id': {'readonly': True}, + 'detected_languages': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'detected_languages': {'key': 'detectedLanguages', 'type': '[DetectedLanguage]'}, + } + + def __init__(self, **kwargs) -> None: + super(LanguageBatchResultItem, self).__init__(**kwargs) + self.id = None + self.detected_languages = None diff --git a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_batch_result_py3.py b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_batch_result_py3.py new file mode 100644 index 000000000000..1e382a86508c --- /dev/null +++ b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_batch_result_py3.py @@ -0,0 +1,42 @@ +# 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 msrest.serialization import Model + + +class LanguageBatchResult(Model): + """LanguageBatchResult. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar documents: + :vartype documents: + list[~azure.cognitiveservices.language.textanalytics.models.LanguageBatchResultItem] + :ivar errors: + :vartype errors: + list[~azure.cognitiveservices.language.textanalytics.models.ErrorRecord] + """ + + _validation = { + 'documents': {'readonly': True}, + 'errors': {'readonly': True}, + } + + _attribute_map = { + 'documents': {'key': 'documents', 'type': '[LanguageBatchResultItem]'}, + 'errors': {'key': 'errors', 'type': '[ErrorRecord]'}, + } + + def __init__(self, **kwargs) -> None: + super(LanguageBatchResult, self).__init__(**kwargs) + self.documents = None + self.errors = None diff --git a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/multi_language_batch_input.py b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/multi_language_batch_input.py index 3630cf2309d1..8c9c5d313a61 100644 --- a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/multi_language_batch_input.py +++ b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/multi_language_batch_input.py @@ -24,6 +24,6 @@ class MultiLanguageBatchInput(Model): 'documents': {'key': 'documents', 'type': '[MultiLanguageInput]'}, } - def __init__(self, documents=None): - super(MultiLanguageBatchInput, self).__init__() - self.documents = documents + def __init__(self, **kwargs): + super(MultiLanguageBatchInput, self).__init__(**kwargs) + self.documents = kwargs.get('documents', None) diff --git a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/multi_language_batch_input_py3.py b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/multi_language_batch_input_py3.py new file mode 100644 index 000000000000..cbacf2d992f2 --- /dev/null +++ b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/multi_language_batch_input_py3.py @@ -0,0 +1,29 @@ +# 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 msrest.serialization import Model + + +class MultiLanguageBatchInput(Model): + """MultiLanguageBatchInput. + + :param documents: + :type documents: + list[~azure.cognitiveservices.language.textanalytics.models.MultiLanguageInput] + """ + + _attribute_map = { + 'documents': {'key': 'documents', 'type': '[MultiLanguageInput]'}, + } + + def __init__(self, *, documents=None, **kwargs) -> None: + super(MultiLanguageBatchInput, self).__init__(**kwargs) + self.documents = documents diff --git a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/multi_language_input.py b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/multi_language_input.py index 5341de6f4b83..da37a13ce080 100644 --- a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/multi_language_input.py +++ b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/multi_language_input.py @@ -30,8 +30,8 @@ class MultiLanguageInput(Model): 'text': {'key': 'text', 'type': 'str'}, } - def __init__(self, language=None, id=None, text=None): - super(MultiLanguageInput, self).__init__() - self.language = language - self.id = id - self.text = text + def __init__(self, **kwargs): + super(MultiLanguageInput, self).__init__(**kwargs) + self.language = kwargs.get('language', None) + self.id = kwargs.get('id', None) + self.text = kwargs.get('text', None) diff --git a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/multi_language_input_py3.py b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/multi_language_input_py3.py new file mode 100644 index 000000000000..bd81650513d5 --- /dev/null +++ b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/multi_language_input_py3.py @@ -0,0 +1,37 @@ +# 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 msrest.serialization import Model + + +class MultiLanguageInput(Model): + """MultiLanguageInput. + + :param language: This is the 2 letter ISO 639-1 representation of a + language. For example, use "en" for English; "es" for Spanish etc., + :type language: str + :param id: Unique, non-empty document identifier. + :type id: str + :param text: + :type text: str + """ + + _attribute_map = { + 'language': {'key': 'language', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'text': {'key': 'text', 'type': 'str'}, + } + + def __init__(self, *, language: str=None, id: str=None, text: str=None, **kwargs) -> None: + super(MultiLanguageInput, self).__init__(**kwargs) + self.language = language + self.id = id + self.text = text diff --git a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/sentiment_batch_result.py b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/sentiment_batch_result.py index 5758c55ab216..0a9f2f2fa580 100644 --- a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/sentiment_batch_result.py +++ b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/sentiment_batch_result.py @@ -36,7 +36,7 @@ class SentimentBatchResult(Model): 'errors': {'key': 'errors', 'type': '[ErrorRecord]'}, } - def __init__(self): - super(SentimentBatchResult, self).__init__() + def __init__(self, **kwargs): + super(SentimentBatchResult, self).__init__(**kwargs) self.documents = None self.errors = None diff --git a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/sentiment_batch_result_item.py b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/sentiment_batch_result_item.py index d7d0ece09c0a..9af2d15bb953 100644 --- a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/sentiment_batch_result_item.py +++ b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/sentiment_batch_result_item.py @@ -37,7 +37,7 @@ class SentimentBatchResultItem(Model): 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self): - super(SentimentBatchResultItem, self).__init__() + def __init__(self, **kwargs): + super(SentimentBatchResultItem, self).__init__(**kwargs) self.score = None self.id = None diff --git a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/sentiment_batch_result_item_py3.py b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/sentiment_batch_result_item_py3.py new file mode 100644 index 000000000000..97ec77f0646f --- /dev/null +++ b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/sentiment_batch_result_item_py3.py @@ -0,0 +1,43 @@ +# 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 msrest.serialization import Model + + +class SentimentBatchResultItem(Model): + """SentimentBatchResultItem. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar score: A decimal number between 0 and 1 denoting the sentiment of + the document. A score above 0.7 usually refers to a positive document + while a score below 0.3 normally has a negative connotation. Mid values + refer to neutral text. + :vartype score: float + :ivar id: Unique document identifier. + :vartype id: str + """ + + _validation = { + 'score': {'readonly': True}, + 'id': {'readonly': True}, + } + + _attribute_map = { + 'score': {'key': 'score', 'type': 'float'}, + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(SentimentBatchResultItem, self).__init__(**kwargs) + self.score = None + self.id = None diff --git a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/sentiment_batch_result_py3.py b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/sentiment_batch_result_py3.py new file mode 100644 index 000000000000..bf7bad35fc87 --- /dev/null +++ b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/sentiment_batch_result_py3.py @@ -0,0 +1,42 @@ +# 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 msrest.serialization import Model + + +class SentimentBatchResult(Model): + """SentimentBatchResult. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar documents: + :vartype documents: + list[~azure.cognitiveservices.language.textanalytics.models.SentimentBatchResultItem] + :ivar errors: + :vartype errors: + list[~azure.cognitiveservices.language.textanalytics.models.ErrorRecord] + """ + + _validation = { + 'documents': {'readonly': True}, + 'errors': {'readonly': True}, + } + + _attribute_map = { + 'documents': {'key': 'documents', 'type': '[SentimentBatchResultItem]'}, + 'errors': {'key': 'errors', 'type': '[ErrorRecord]'}, + } + + def __init__(self, **kwargs) -> None: + super(SentimentBatchResult, self).__init__(**kwargs) + self.documents = None + self.errors = None diff --git a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/text_analytics_api_enums.py b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/text_analytics_api_enums.py index aa4ac59013d4..8f4166eed385 100644 --- a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/text_analytics_api_enums.py +++ b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/text_analytics_api_enums.py @@ -12,7 +12,7 @@ from enum import Enum -class AzureRegions(Enum): +class AzureRegions(str, Enum): westus = "westus" westeurope = "westeurope" diff --git a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/text_analytics_api.py b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/text_analytics_api.py index 347bbcaa5f44..cc1be1685bfe 100644 --- a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/text_analytics_api.py +++ b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/text_analytics_api.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import ServiceClient +from msrest.service_client import SDKClient from msrest import Configuration, Serializer, Deserializer from .version import VERSION from msrest.pipeline import ClientRawResponse @@ -50,7 +50,7 @@ def __init__( self.credentials = credentials -class TextAnalyticsAPI(object): +class TextAnalyticsAPI(SDKClient): """The Text Analytics API is a suite of text analytics web services built with best-in-class Microsoft machine learning algorithms. The API can be used to analyze unstructured text for tasks such as sentiment analysis, key phrase extraction and language detection. No training data is needed to use this API; just bring your text data. This API uses advanced natural language processing techniques to deliver best in class predictions. Further documentation can be found in https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview :ivar config: Configuration for client. @@ -72,7 +72,7 @@ def __init__( self, azure_region, credentials): self.config = TextAnalyticsAPIConfiguration(azure_region, credentials) - self._client = ServiceClient(self.config.credentials, self.config) + super(TextAnalyticsAPI, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self.api_version = 'v2.0' @@ -109,7 +109,7 @@ def key_phrases( input = models.MultiLanguageBatchInput(documents=documents) # Construct URL - url = '/v2.0/keyPhrases' + url = self.key_phrases.metadata['url'] path_format_arguments = { 'AzureRegion': self._serialize.url("self.config.azure_region", self.config.azure_region, 'AzureRegions', skip_quote=True) } @@ -145,6 +145,7 @@ def key_phrases( return client_raw_response return deserialized + key_phrases.metadata = {'url': '/v2.0/keyPhrases'} def detect_language( self, documents=None, custom_headers=None, raw=False, **operation_config): @@ -172,7 +173,7 @@ def detect_language( input = models.BatchInput(documents=documents) # Construct URL - url = '/v2.0/languages' + url = self.detect_language.metadata['url'] path_format_arguments = { 'AzureRegion': self._serialize.url("self.config.azure_region", self.config.azure_region, 'AzureRegions', skip_quote=True) } @@ -208,6 +209,7 @@ def detect_language( return client_raw_response return deserialized + detect_language.metadata = {'url': '/v2.0/languages'} def sentiment( self, documents=None, custom_headers=None, raw=False, **operation_config): @@ -240,7 +242,7 @@ def sentiment( input = models.MultiLanguageBatchInput(documents=documents) # Construct URL - url = '/v2.0/sentiment' + url = self.sentiment.metadata['url'] path_format_arguments = { 'AzureRegion': self._serialize.url("self.config.azure_region", self.config.azure_region, 'AzureRegions', skip_quote=True) } @@ -276,3 +278,4 @@ def sentiment( return client_raw_response return deserialized + sentiment.metadata = {'url': '/v2.0/sentiment'} diff --git a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/version.py b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/version.py index e0ec669828cb..2480717379b3 100644 --- a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/version.py +++ b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.1.0" +VERSION = "v2.0" diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/entity_search_api.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/entity_search_api.py index 30a281c74353..849d3b3943f1 100644 --- a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/entity_search_api.py +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/entity_search_api.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import ServiceClient +from msrest.service_client import SDKClient from msrest import Configuration, Serializer, Deserializer from .version import VERSION from .operations.entities_operations import EntitiesOperations @@ -42,7 +42,7 @@ def __init__( self.credentials = credentials -class EntitySearchAPI(object): +class EntitySearchAPI(SDKClient): """The Entity Search API lets you send a search query to Bing and get back search results that include entities and places. Place results include restaurants, hotel, or other local businesses. For places, the query can specify the name of the local business or it can ask for a list (for example, restaurants near me). Entity results include persons, places, or things. Place in this context is tourist attractions, states, countries, etc. :ivar config: Configuration for client. @@ -61,7 +61,7 @@ def __init__( self, credentials, base_url=None): self.config = EntitySearchAPIConfiguration(credentials, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + super(EntitySearchAPI, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self.api_version = '1.0' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/__init__.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/__init__.py index 84509118c83d..d6685cc561d8 100644 --- a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/__init__.py +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/__init__.py @@ -9,44 +9,84 @@ # regenerated. # -------------------------------------------------------------------------- -from .query_context import QueryContext -from .image_object import ImageObject -from .entities_entity_presentation_info import EntitiesEntityPresentationInfo -from .thing import Thing -from .entities import Entities -from .places import Places -from .search_response import SearchResponse -from .contractual_rules_contractual_rule import ContractualRulesContractualRule -from .response import Response -from .search_results_answer import SearchResultsAnswer -from .identifiable import Identifiable -from .answer import Answer -from .error import Error -from .error_response import ErrorResponse, ErrorResponseException -from .postal_address import PostalAddress -from .place import Place -from .organization import Organization -from .response_base import ResponseBase -from .creative_work import CreativeWork -from .intangible import Intangible -from .movie_theater import MovieTheater -from .contractual_rules_attribution import ContractualRulesAttribution -from .media_object import MediaObject -from .civic_structure import CivicStructure -from .local_business import LocalBusiness -from .tourist_attraction import TouristAttraction -from .airport import Airport -from .license import License -from .structured_value import StructuredValue -from .entertainment_business import EntertainmentBusiness -from .contractual_rules_license_attribution import ContractualRulesLicenseAttribution -from .contractual_rules_link_attribution import ContractualRulesLinkAttribution -from .contractual_rules_media_attribution import ContractualRulesMediaAttribution -from .contractual_rules_text_attribution import ContractualRulesTextAttribution -from .food_establishment import FoodEstablishment -from .lodging_business import LodgingBusiness -from .restaurant import Restaurant -from .hotel import Hotel +try: + from .query_context_py3 import QueryContext + from .image_object_py3 import ImageObject + from .entities_entity_presentation_info_py3 import EntitiesEntityPresentationInfo + from .thing_py3 import Thing + from .entities_py3 import Entities + from .places_py3 import Places + from .search_response_py3 import SearchResponse + from .contractual_rules_contractual_rule_py3 import ContractualRulesContractualRule + from .response_py3 import Response + from .search_results_answer_py3 import SearchResultsAnswer + from .identifiable_py3 import Identifiable + from .answer_py3 import Answer + from .error_py3 import Error + from .error_response_py3 import ErrorResponse, ErrorResponseException + from .postal_address_py3 import PostalAddress + from .place_py3 import Place + from .organization_py3 import Organization + from .response_base_py3 import ResponseBase + from .creative_work_py3 import CreativeWork + from .intangible_py3 import Intangible + from .movie_theater_py3 import MovieTheater + from .contractual_rules_attribution_py3 import ContractualRulesAttribution + from .media_object_py3 import MediaObject + from .civic_structure_py3 import CivicStructure + from .local_business_py3 import LocalBusiness + from .tourist_attraction_py3 import TouristAttraction + from .airport_py3 import Airport + from .license_py3 import License + from .structured_value_py3 import StructuredValue + from .entertainment_business_py3 import EntertainmentBusiness + from .contractual_rules_license_attribution_py3 import ContractualRulesLicenseAttribution + from .contractual_rules_link_attribution_py3 import ContractualRulesLinkAttribution + from .contractual_rules_media_attribution_py3 import ContractualRulesMediaAttribution + from .contractual_rules_text_attribution_py3 import ContractualRulesTextAttribution + from .food_establishment_py3 import FoodEstablishment + from .lodging_business_py3 import LodgingBusiness + from .restaurant_py3 import Restaurant + from .hotel_py3 import Hotel +except (SyntaxError, ImportError): + from .query_context import QueryContext + from .image_object import ImageObject + from .entities_entity_presentation_info import EntitiesEntityPresentationInfo + from .thing import Thing + from .entities import Entities + from .places import Places + from .search_response import SearchResponse + from .contractual_rules_contractual_rule import ContractualRulesContractualRule + from .response import Response + from .search_results_answer import SearchResultsAnswer + from .identifiable import Identifiable + from .answer import Answer + from .error import Error + from .error_response import ErrorResponse, ErrorResponseException + from .postal_address import PostalAddress + from .place import Place + from .organization import Organization + from .response_base import ResponseBase + from .creative_work import CreativeWork + from .intangible import Intangible + from .movie_theater import MovieTheater + from .contractual_rules_attribution import ContractualRulesAttribution + from .media_object import MediaObject + from .civic_structure import CivicStructure + from .local_business import LocalBusiness + from .tourist_attraction import TouristAttraction + from .airport import Airport + from .license import License + from .structured_value import StructuredValue + from .entertainment_business import EntertainmentBusiness + from .contractual_rules_license_attribution import ContractualRulesLicenseAttribution + from .contractual_rules_link_attribution import ContractualRulesLinkAttribution + from .contractual_rules_media_attribution import ContractualRulesMediaAttribution + from .contractual_rules_text_attribution import ContractualRulesTextAttribution + from .food_establishment import FoodEstablishment + from .lodging_business import LodgingBusiness + from .restaurant import Restaurant + from .hotel import Hotel from .entity_search_api_enums import ( EntityQueryScenario, EntityScenario, diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/airport.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/airport.py index f790ef44e164..9587921573a0 100644 --- a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/airport.py +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/airport.py @@ -18,7 +18,9 @@ class Airport(CivicStructure): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -91,8 +93,8 @@ class Airport(CivicStructure): 'icao_code': {'key': 'icaoCode', 'type': 'str'}, } - def __init__(self): - super(Airport, self).__init__() + def __init__(self, **kwargs): + super(Airport, self).__init__(**kwargs) self.iata_code = None self.icao_code = None self._type = 'Airport' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/airport_py3.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/airport_py3.py new file mode 100644 index 000000000000..a459309cbf1a --- /dev/null +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/airport_py3.py @@ -0,0 +1,100 @@ +# 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 .civic_structure import CivicStructure + + +class Airport(CivicStructure): + """Airport. + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar contractual_rules: A list of rules that you must adhere to if you + display the item. + :vartype contractual_rules: + list[~azure.cognitiveservices.search.entitysearch.models.ContractualRulesContractualRule] + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: + :vartype image: + ~azure.cognitiveservices.search.entitysearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar entity_presentation_info: Additional information about the entity + such as hints that you can use to determine the entity's type. To + determine the entity's type, use the entityScenario and entityTypeHint + fields. + :vartype entity_presentation_info: + ~azure.cognitiveservices.search.entitysearch.models.EntitiesEntityPresentationInfo + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar address: The postal address of where the entity is located + :vartype address: + ~azure.cognitiveservices.search.entitysearch.models.PostalAddress + :ivar telephone: The entity's telephone number + :vartype telephone: str + :ivar iata_code: + :vartype iata_code: str + :ivar icao_code: + :vartype icao_code: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'contractual_rules': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'entity_presentation_info': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'address': {'readonly': True}, + 'telephone': {'readonly': True}, + 'iata_code': {'readonly': True}, + 'icao_code': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'contractual_rules': {'key': 'contractualRules', 'type': '[ContractualRulesContractualRule]'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'entity_presentation_info': {'key': 'entityPresentationInfo', 'type': 'EntitiesEntityPresentationInfo'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'PostalAddress'}, + 'telephone': {'key': 'telephone', 'type': 'str'}, + 'iata_code': {'key': 'iataCode', 'type': 'str'}, + 'icao_code': {'key': 'icaoCode', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Airport, self).__init__(**kwargs) + self.iata_code = None + self.icao_code = None + self._type = 'Airport' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/answer.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/answer.py index 0244f558def2..27c010b6cd6a 100644 --- a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/answer.py +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/answer.py @@ -21,7 +21,9 @@ class Answer(Response): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -40,10 +42,17 @@ class Answer(Response): 'web_search_url': {'readonly': True}, } + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'contractual_rules': {'key': 'contractualRules', 'type': '[ContractualRulesContractualRule]'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + } + _subtype_map = { '_type': {'SearchResultsAnswer': 'SearchResultsAnswer'} } - def __init__(self): - super(Answer, self).__init__() + def __init__(self, **kwargs): + super(Answer, self).__init__(**kwargs) self._type = 'Answer' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/answer_py3.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/answer_py3.py new file mode 100644 index 000000000000..ce87c250adec --- /dev/null +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/answer_py3.py @@ -0,0 +1,58 @@ +# 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 .response import Response + + +class Answer(Response): + """Answer. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: SearchResultsAnswer + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar contractual_rules: A list of rules that you must adhere to if you + display the item. + :vartype contractual_rules: + list[~azure.cognitiveservices.search.entitysearch.models.ContractualRulesContractualRule] + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'contractual_rules': {'readonly': True}, + 'web_search_url': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'contractual_rules': {'key': 'contractualRules', 'type': '[ContractualRulesContractualRule]'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'SearchResultsAnswer': 'SearchResultsAnswer'} + } + + def __init__(self, **kwargs) -> None: + super(Answer, self).__init__(**kwargs) + self._type = 'Answer' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/civic_structure.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/civic_structure.py index a8a6ea2dd675..5bca9a7bc6ef 100644 --- a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/civic_structure.py +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/civic_structure.py @@ -21,7 +21,9 @@ class CivicStructure(Place): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -71,10 +73,25 @@ class CivicStructure(Place): 'telephone': {'readonly': True}, } + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'contractual_rules': {'key': 'contractualRules', 'type': '[ContractualRulesContractualRule]'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'entity_presentation_info': {'key': 'entityPresentationInfo', 'type': 'EntitiesEntityPresentationInfo'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'PostalAddress'}, + 'telephone': {'key': 'telephone', 'type': 'str'}, + } + _subtype_map = { '_type': {'Airport': 'Airport'} } - def __init__(self): - super(CivicStructure, self).__init__() + def __init__(self, **kwargs): + super(CivicStructure, self).__init__(**kwargs) self._type = 'CivicStructure' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/civic_structure_py3.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/civic_structure_py3.py new file mode 100644 index 000000000000..6c1ec3513824 --- /dev/null +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/civic_structure_py3.py @@ -0,0 +1,97 @@ +# 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 .place import Place + + +class CivicStructure(Place): + """CivicStructure. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: Airport + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar contractual_rules: A list of rules that you must adhere to if you + display the item. + :vartype contractual_rules: + list[~azure.cognitiveservices.search.entitysearch.models.ContractualRulesContractualRule] + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: + :vartype image: + ~azure.cognitiveservices.search.entitysearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar entity_presentation_info: Additional information about the entity + such as hints that you can use to determine the entity's type. To + determine the entity's type, use the entityScenario and entityTypeHint + fields. + :vartype entity_presentation_info: + ~azure.cognitiveservices.search.entitysearch.models.EntitiesEntityPresentationInfo + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar address: The postal address of where the entity is located + :vartype address: + ~azure.cognitiveservices.search.entitysearch.models.PostalAddress + :ivar telephone: The entity's telephone number + :vartype telephone: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'contractual_rules': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'entity_presentation_info': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'address': {'readonly': True}, + 'telephone': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'contractual_rules': {'key': 'contractualRules', 'type': '[ContractualRulesContractualRule]'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'entity_presentation_info': {'key': 'entityPresentationInfo', 'type': 'EntitiesEntityPresentationInfo'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'PostalAddress'}, + 'telephone': {'key': 'telephone', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'Airport': 'Airport'} + } + + def __init__(self, **kwargs) -> None: + super(CivicStructure, self).__init__(**kwargs) + self._type = 'CivicStructure' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/contractual_rules_attribution.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/contractual_rules_attribution.py index 414040e65b07..cc7e24ca7692 100644 --- a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/contractual_rules_attribution.py +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/contractual_rules_attribution.py @@ -23,10 +23,12 @@ class ContractualRulesAttribution(ContractualRulesContractualRule): 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 Azure. + :ivar target_property_name: The name of the field that the rule applies to. :vartype target_property_name: str - :param _type: Constant filled by server. + :param _type: Required. Constant filled by server. :type _type: str :ivar must_be_close_to_content: A Boolean value that determines whether the contents of the rule must be placed in close proximity to the field @@ -52,7 +54,7 @@ class ContractualRulesAttribution(ContractualRulesContractualRule): '_type': {'ContractualRules/LicenseAttribution': 'ContractualRulesLicenseAttribution', 'ContractualRules/LinkAttribution': 'ContractualRulesLinkAttribution', 'ContractualRules/MediaAttribution': 'ContractualRulesMediaAttribution', 'ContractualRules/TextAttribution': 'ContractualRulesTextAttribution'} } - def __init__(self): - super(ContractualRulesAttribution, self).__init__() + def __init__(self, **kwargs): + super(ContractualRulesAttribution, self).__init__(**kwargs) self.must_be_close_to_content = None self._type = 'ContractualRules/Attribution' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/contractual_rules_attribution_py3.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/contractual_rules_attribution_py3.py new file mode 100644 index 000000000000..1ce884db74e6 --- /dev/null +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/contractual_rules_attribution_py3.py @@ -0,0 +1,60 @@ +# 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 .contractual_rules_contractual_rule import ContractualRulesContractualRule + + +class ContractualRulesAttribution(ContractualRulesContractualRule): + """ContractualRulesAttribution. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ContractualRulesLicenseAttribution, + ContractualRulesLinkAttribution, ContractualRulesMediaAttribution, + ContractualRulesTextAttribution + + 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 Azure. + + :ivar target_property_name: The name of the field that the rule applies + to. + :vartype target_property_name: str + :param _type: Required. Constant filled by server. + :type _type: str + :ivar must_be_close_to_content: A Boolean value that determines whether + the contents of the rule must be placed in close proximity to the field + that the rule applies to. If true, the contents must be placed in close + proximity. If false, or this field does not exist, the contents may be + placed at the caller's discretion. + :vartype must_be_close_to_content: bool + """ + + _validation = { + 'target_property_name': {'readonly': True}, + '_type': {'required': True}, + 'must_be_close_to_content': {'readonly': True}, + } + + _attribute_map = { + 'target_property_name': {'key': 'targetPropertyName', 'type': 'str'}, + '_type': {'key': '_type', 'type': 'str'}, + 'must_be_close_to_content': {'key': 'mustBeCloseToContent', 'type': 'bool'}, + } + + _subtype_map = { + '_type': {'ContractualRules/LicenseAttribution': 'ContractualRulesLicenseAttribution', 'ContractualRules/LinkAttribution': 'ContractualRulesLinkAttribution', 'ContractualRules/MediaAttribution': 'ContractualRulesMediaAttribution', 'ContractualRules/TextAttribution': 'ContractualRulesTextAttribution'} + } + + def __init__(self, **kwargs) -> None: + super(ContractualRulesAttribution, self).__init__(**kwargs) + self.must_be_close_to_content = None + self._type = 'ContractualRules/Attribution' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/contractual_rules_contractual_rule.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/contractual_rules_contractual_rule.py index 2d58ab2d82a4..ad6b49336083 100644 --- a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/contractual_rules_contractual_rule.py +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/contractual_rules_contractual_rule.py @@ -21,10 +21,12 @@ class ContractualRulesContractualRule(Model): 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 Azure. + :ivar target_property_name: The name of the field that the rule applies to. :vartype target_property_name: str - :param _type: Constant filled by server. + :param _type: Required. Constant filled by server. :type _type: str """ @@ -42,7 +44,7 @@ class ContractualRulesContractualRule(Model): '_type': {'ContractualRules/Attribution': 'ContractualRulesAttribution'} } - def __init__(self): - super(ContractualRulesContractualRule, self).__init__() + def __init__(self, **kwargs): + super(ContractualRulesContractualRule, self).__init__(**kwargs) self.target_property_name = None self._type = None diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/contractual_rules_contractual_rule_py3.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/contractual_rules_contractual_rule_py3.py new file mode 100644 index 000000000000..80fcf9a36838 --- /dev/null +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/contractual_rules_contractual_rule_py3.py @@ -0,0 +1,50 @@ +# 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 msrest.serialization import Model + + +class ContractualRulesContractualRule(Model): + """ContractualRulesContractualRule. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ContractualRulesAttribution + + 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 Azure. + + :ivar target_property_name: The name of the field that the rule applies + to. + :vartype target_property_name: str + :param _type: Required. Constant filled by server. + :type _type: str + """ + + _validation = { + 'target_property_name': {'readonly': True}, + '_type': {'required': True}, + } + + _attribute_map = { + 'target_property_name': {'key': 'targetPropertyName', 'type': 'str'}, + '_type': {'key': '_type', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'ContractualRules/Attribution': 'ContractualRulesAttribution'} + } + + def __init__(self, **kwargs) -> None: + super(ContractualRulesContractualRule, self).__init__(**kwargs) + self.target_property_name = None + self._type = None diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/contractual_rules_license_attribution.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/contractual_rules_license_attribution.py index 17ff23cacefd..20725e6dd064 100644 --- a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/contractual_rules_license_attribution.py +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/contractual_rules_license_attribution.py @@ -18,10 +18,12 @@ class ContractualRulesLicenseAttribution(ContractualRulesAttribution): 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 Azure. + :ivar target_property_name: The name of the field that the rule applies to. :vartype target_property_name: str - :param _type: Constant filled by server. + :param _type: Required. Constant filled by server. :type _type: str :ivar must_be_close_to_content: A Boolean value that determines whether the contents of the rule must be placed in close proximity to the field @@ -52,8 +54,8 @@ class ContractualRulesLicenseAttribution(ContractualRulesAttribution): 'license_notice': {'key': 'licenseNotice', 'type': 'str'}, } - def __init__(self): - super(ContractualRulesLicenseAttribution, self).__init__() + def __init__(self, **kwargs): + super(ContractualRulesLicenseAttribution, self).__init__(**kwargs) self.license = None self.license_notice = None self._type = 'ContractualRules/LicenseAttribution' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/contractual_rules_license_attribution_py3.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/contractual_rules_license_attribution_py3.py new file mode 100644 index 000000000000..dc826c5aa422 --- /dev/null +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/contractual_rules_license_attribution_py3.py @@ -0,0 +1,61 @@ +# 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 .contractual_rules_attribution import ContractualRulesAttribution + + +class ContractualRulesLicenseAttribution(ContractualRulesAttribution): + """Defines a contractual rule for license attribution. + + 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 Azure. + + :ivar target_property_name: The name of the field that the rule applies + to. + :vartype target_property_name: str + :param _type: Required. Constant filled by server. + :type _type: str + :ivar must_be_close_to_content: A Boolean value that determines whether + the contents of the rule must be placed in close proximity to the field + that the rule applies to. If true, the contents must be placed in close + proximity. If false, or this field does not exist, the contents may be + placed at the caller's discretion. + :vartype must_be_close_to_content: bool + :ivar license: The license under which the content may be used. + :vartype license: + ~azure.cognitiveservices.search.entitysearch.models.License + :ivar license_notice: The license to display next to the targeted field. + :vartype license_notice: str + """ + + _validation = { + 'target_property_name': {'readonly': True}, + '_type': {'required': True}, + 'must_be_close_to_content': {'readonly': True}, + 'license': {'readonly': True}, + 'license_notice': {'readonly': True}, + } + + _attribute_map = { + 'target_property_name': {'key': 'targetPropertyName', 'type': 'str'}, + '_type': {'key': '_type', 'type': 'str'}, + 'must_be_close_to_content': {'key': 'mustBeCloseToContent', 'type': 'bool'}, + 'license': {'key': 'license', 'type': 'License'}, + 'license_notice': {'key': 'licenseNotice', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ContractualRulesLicenseAttribution, self).__init__(**kwargs) + self.license = None + self.license_notice = None + self._type = 'ContractualRules/LicenseAttribution' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/contractual_rules_link_attribution.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/contractual_rules_link_attribution.py index 18056ed75a1b..afef11e0ab02 100644 --- a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/contractual_rules_link_attribution.py +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/contractual_rules_link_attribution.py @@ -18,10 +18,12 @@ class ContractualRulesLinkAttribution(ContractualRulesAttribution): 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 Azure. + :ivar target_property_name: The name of the field that the rule applies to. :vartype target_property_name: str - :param _type: Constant filled by server. + :param _type: Required. Constant filled by server. :type _type: str :ivar must_be_close_to_content: A Boolean value that determines whether the contents of the rule must be placed in close proximity to the field @@ -29,10 +31,10 @@ class ContractualRulesLinkAttribution(ContractualRulesAttribution): proximity. If false, or this field does not exist, the contents may be placed at the caller's discretion. :vartype must_be_close_to_content: bool - :param text: The attribution text. + :param text: Required. The attribution text. :type text: str - :param url: The URL to the provider's website. Use text and URL to create - the hyperlink. + :param url: Required. The URL to the provider's website. Use text and URL + to create the hyperlink. :type url: str :ivar optional_for_list_display: Indicates whether this provider's attribution is optional. @@ -57,9 +59,9 @@ class ContractualRulesLinkAttribution(ContractualRulesAttribution): 'optional_for_list_display': {'key': 'optionalForListDisplay', 'type': 'bool'}, } - def __init__(self, text, url): - super(ContractualRulesLinkAttribution, self).__init__() - self.text = text - self.url = url + def __init__(self, **kwargs): + super(ContractualRulesLinkAttribution, self).__init__(**kwargs) + self.text = kwargs.get('text', None) + self.url = kwargs.get('url', None) self.optional_for_list_display = None self._type = 'ContractualRules/LinkAttribution' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/contractual_rules_link_attribution_py3.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/contractual_rules_link_attribution_py3.py new file mode 100644 index 000000000000..ee497c17ec50 --- /dev/null +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/contractual_rules_link_attribution_py3.py @@ -0,0 +1,67 @@ +# 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 .contractual_rules_attribution import ContractualRulesAttribution + + +class ContractualRulesLinkAttribution(ContractualRulesAttribution): + """Defines a contractual rule for link attribution. + + 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 Azure. + + :ivar target_property_name: The name of the field that the rule applies + to. + :vartype target_property_name: str + :param _type: Required. Constant filled by server. + :type _type: str + :ivar must_be_close_to_content: A Boolean value that determines whether + the contents of the rule must be placed in close proximity to the field + that the rule applies to. If true, the contents must be placed in close + proximity. If false, or this field does not exist, the contents may be + placed at the caller's discretion. + :vartype must_be_close_to_content: bool + :param text: Required. The attribution text. + :type text: str + :param url: Required. The URL to the provider's website. Use text and URL + to create the hyperlink. + :type url: str + :ivar optional_for_list_display: Indicates whether this provider's + attribution is optional. + :vartype optional_for_list_display: bool + """ + + _validation = { + 'target_property_name': {'readonly': True}, + '_type': {'required': True}, + 'must_be_close_to_content': {'readonly': True}, + 'text': {'required': True}, + 'url': {'required': True}, + 'optional_for_list_display': {'readonly': True}, + } + + _attribute_map = { + 'target_property_name': {'key': 'targetPropertyName', 'type': 'str'}, + '_type': {'key': '_type', 'type': 'str'}, + 'must_be_close_to_content': {'key': 'mustBeCloseToContent', 'type': 'bool'}, + 'text': {'key': 'text', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'optional_for_list_display': {'key': 'optionalForListDisplay', 'type': 'bool'}, + } + + def __init__(self, *, text: str, url: str, **kwargs) -> None: + super(ContractualRulesLinkAttribution, self).__init__(**kwargs) + self.text = text + self.url = url + self.optional_for_list_display = None + self._type = 'ContractualRules/LinkAttribution' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/contractual_rules_media_attribution.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/contractual_rules_media_attribution.py index a58f045f3875..9c7379ea760a 100644 --- a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/contractual_rules_media_attribution.py +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/contractual_rules_media_attribution.py @@ -18,10 +18,12 @@ class ContractualRulesMediaAttribution(ContractualRulesAttribution): 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 Azure. + :ivar target_property_name: The name of the field that the rule applies to. :vartype target_property_name: str - :param _type: Constant filled by server. + :param _type: Required. Constant filled by server. :type _type: str :ivar must_be_close_to_content: A Boolean value that determines whether the contents of the rule must be placed in close proximity to the field @@ -49,7 +51,7 @@ class ContractualRulesMediaAttribution(ContractualRulesAttribution): 'url': {'key': 'url', 'type': 'str'}, } - def __init__(self): - super(ContractualRulesMediaAttribution, self).__init__() + def __init__(self, **kwargs): + super(ContractualRulesMediaAttribution, self).__init__(**kwargs) self.url = None self._type = 'ContractualRules/MediaAttribution' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/contractual_rules_media_attribution_py3.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/contractual_rules_media_attribution_py3.py new file mode 100644 index 000000000000..d939d36c26e5 --- /dev/null +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/contractual_rules_media_attribution_py3.py @@ -0,0 +1,57 @@ +# 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 .contractual_rules_attribution import ContractualRulesAttribution + + +class ContractualRulesMediaAttribution(ContractualRulesAttribution): + """Defines a contractual rule for media attribution. + + 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 Azure. + + :ivar target_property_name: The name of the field that the rule applies + to. + :vartype target_property_name: str + :param _type: Required. Constant filled by server. + :type _type: str + :ivar must_be_close_to_content: A Boolean value that determines whether + the contents of the rule must be placed in close proximity to the field + that the rule applies to. If true, the contents must be placed in close + proximity. If false, or this field does not exist, the contents may be + placed at the caller's discretion. + :vartype must_be_close_to_content: bool + :ivar url: The URL that you use to create of hyperlink of the media + content. For example, if the target is an image, you would use the URL to + make the image clickable. + :vartype url: str + """ + + _validation = { + 'target_property_name': {'readonly': True}, + '_type': {'required': True}, + 'must_be_close_to_content': {'readonly': True}, + 'url': {'readonly': True}, + } + + _attribute_map = { + 'target_property_name': {'key': 'targetPropertyName', 'type': 'str'}, + '_type': {'key': '_type', 'type': 'str'}, + 'must_be_close_to_content': {'key': 'mustBeCloseToContent', 'type': 'bool'}, + 'url': {'key': 'url', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ContractualRulesMediaAttribution, self).__init__(**kwargs) + self.url = None + self._type = 'ContractualRules/MediaAttribution' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/contractual_rules_text_attribution.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/contractual_rules_text_attribution.py index 04cb40c453de..a8f606f99816 100644 --- a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/contractual_rules_text_attribution.py +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/contractual_rules_text_attribution.py @@ -18,10 +18,12 @@ class ContractualRulesTextAttribution(ContractualRulesAttribution): 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 Azure. + :ivar target_property_name: The name of the field that the rule applies to. :vartype target_property_name: str - :param _type: Constant filled by server. + :param _type: Required. Constant filled by server. :type _type: str :ivar must_be_close_to_content: A Boolean value that determines whether the contents of the rule must be placed in close proximity to the field @@ -29,11 +31,11 @@ class ContractualRulesTextAttribution(ContractualRulesAttribution): proximity. If false, or this field does not exist, the contents may be placed at the caller's discretion. :vartype must_be_close_to_content: bool - :param text: The attribution text. Text attribution applies to the entity - as a whole and should be displayed immediately following the entity - presentation. If there are multiple text or link attribution rules that do - not specify a target, you should concatenate them and display them using a - "Data from:" label. + :param text: Required. The attribution text. Text attribution applies to + the entity as a whole and should be displayed immediately following the + entity presentation. If there are multiple text or link attribution rules + that do not specify a target, you should concatenate them and display them + using a "Data from:" label. :type text: str :ivar optional_for_list_display: Indicates whether this provider's attribution is optional. @@ -56,8 +58,8 @@ class ContractualRulesTextAttribution(ContractualRulesAttribution): 'optional_for_list_display': {'key': 'optionalForListDisplay', 'type': 'bool'}, } - def __init__(self, text): - super(ContractualRulesTextAttribution, self).__init__() - self.text = text + def __init__(self, **kwargs): + super(ContractualRulesTextAttribution, self).__init__(**kwargs) + self.text = kwargs.get('text', None) self.optional_for_list_display = None self._type = 'ContractualRules/TextAttribution' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/contractual_rules_text_attribution_py3.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/contractual_rules_text_attribution_py3.py new file mode 100644 index 000000000000..77af35b739e8 --- /dev/null +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/contractual_rules_text_attribution_py3.py @@ -0,0 +1,65 @@ +# 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 .contractual_rules_attribution import ContractualRulesAttribution + + +class ContractualRulesTextAttribution(ContractualRulesAttribution): + """Defines a contractual rule for text attribution. + + 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 Azure. + + :ivar target_property_name: The name of the field that the rule applies + to. + :vartype target_property_name: str + :param _type: Required. Constant filled by server. + :type _type: str + :ivar must_be_close_to_content: A Boolean value that determines whether + the contents of the rule must be placed in close proximity to the field + that the rule applies to. If true, the contents must be placed in close + proximity. If false, or this field does not exist, the contents may be + placed at the caller's discretion. + :vartype must_be_close_to_content: bool + :param text: Required. The attribution text. Text attribution applies to + the entity as a whole and should be displayed immediately following the + entity presentation. If there are multiple text or link attribution rules + that do not specify a target, you should concatenate them and display them + using a "Data from:" label. + :type text: str + :ivar optional_for_list_display: Indicates whether this provider's + attribution is optional. + :vartype optional_for_list_display: bool + """ + + _validation = { + 'target_property_name': {'readonly': True}, + '_type': {'required': True}, + 'must_be_close_to_content': {'readonly': True}, + 'text': {'required': True}, + 'optional_for_list_display': {'readonly': True}, + } + + _attribute_map = { + 'target_property_name': {'key': 'targetPropertyName', 'type': 'str'}, + '_type': {'key': '_type', 'type': 'str'}, + 'must_be_close_to_content': {'key': 'mustBeCloseToContent', 'type': 'bool'}, + 'text': {'key': 'text', 'type': 'str'}, + 'optional_for_list_display': {'key': 'optionalForListDisplay', 'type': 'bool'}, + } + + def __init__(self, *, text: str, **kwargs) -> None: + super(ContractualRulesTextAttribution, self).__init__(**kwargs) + self.text = text + self.optional_for_list_display = None + self._type = 'ContractualRules/TextAttribution' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/creative_work.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/creative_work.py index d7c13d67a097..b4fd1df21709 100644 --- a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/creative_work.py +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/creative_work.py @@ -21,7 +21,9 @@ class CreativeWork(Thing): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -94,8 +96,8 @@ class CreativeWork(Thing): '_type': {'MediaObject': 'MediaObject', 'License': 'License'} } - def __init__(self): - super(CreativeWork, self).__init__() + def __init__(self, **kwargs): + super(CreativeWork, self).__init__(**kwargs) self.thumbnail_url = None self.provider = None self.text = None diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/creative_work_py3.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/creative_work_py3.py new file mode 100644 index 000000000000..ba6eb84c8bb9 --- /dev/null +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/creative_work_py3.py @@ -0,0 +1,104 @@ +# 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 .thing import Thing + + +class CreativeWork(Thing): + """CreativeWork. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: MediaObject, License + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar contractual_rules: A list of rules that you must adhere to if you + display the item. + :vartype contractual_rules: + list[~azure.cognitiveservices.search.entitysearch.models.ContractualRulesContractualRule] + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: + :vartype image: + ~azure.cognitiveservices.search.entitysearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar entity_presentation_info: Additional information about the entity + such as hints that you can use to determine the entity's type. To + determine the entity's type, use the entityScenario and entityTypeHint + fields. + :vartype entity_presentation_info: + ~azure.cognitiveservices.search.entitysearch.models.EntitiesEntityPresentationInfo + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar thumbnail_url: The URL to a thumbnail of the item. + :vartype thumbnail_url: str + :ivar provider: The source of the creative work. + :vartype provider: + list[~azure.cognitiveservices.search.entitysearch.models.Thing] + :ivar text: + :vartype text: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'contractual_rules': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'entity_presentation_info': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'thumbnail_url': {'readonly': True}, + 'provider': {'readonly': True}, + 'text': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'contractual_rules': {'key': 'contractualRules', 'type': '[ContractualRulesContractualRule]'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'entity_presentation_info': {'key': 'entityPresentationInfo', 'type': 'EntitiesEntityPresentationInfo'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'thumbnail_url': {'key': 'thumbnailUrl', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': '[Thing]'}, + 'text': {'key': 'text', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'MediaObject': 'MediaObject', 'License': 'License'} + } + + def __init__(self, **kwargs) -> None: + super(CreativeWork, self).__init__(**kwargs) + self.thumbnail_url = None + self.provider = None + self.text = None + self._type = 'CreativeWork' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/entertainment_business.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/entertainment_business.py index 51a0b7e21043..5523635175c7 100644 --- a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/entertainment_business.py +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/entertainment_business.py @@ -21,7 +21,9 @@ class EntertainmentBusiness(LocalBusiness): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -84,10 +86,29 @@ class EntertainmentBusiness(LocalBusiness): 'tag_line': {'readonly': True}, } + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'contractual_rules': {'key': 'contractualRules', 'type': '[ContractualRulesContractualRule]'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'entity_presentation_info': {'key': 'entityPresentationInfo', 'type': 'EntitiesEntityPresentationInfo'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'PostalAddress'}, + 'telephone': {'key': 'telephone', 'type': 'str'}, + 'price_range': {'key': 'priceRange', 'type': 'str'}, + 'panoramas': {'key': 'panoramas', 'type': '[ImageObject]'}, + 'is_permanently_closed': {'key': 'isPermanentlyClosed', 'type': 'bool'}, + 'tag_line': {'key': 'tagLine', 'type': 'str'}, + } + _subtype_map = { '_type': {'MovieTheater': 'MovieTheater'} } - def __init__(self): - super(EntertainmentBusiness, self).__init__() + def __init__(self, **kwargs): + super(EntertainmentBusiness, self).__init__(**kwargs) self._type = 'EntertainmentBusiness' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/entertainment_business_py3.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/entertainment_business_py3.py new file mode 100644 index 000000000000..998bba6a616d --- /dev/null +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/entertainment_business_py3.py @@ -0,0 +1,114 @@ +# 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 .local_business import LocalBusiness + + +class EntertainmentBusiness(LocalBusiness): + """EntertainmentBusiness. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: MovieTheater + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar contractual_rules: A list of rules that you must adhere to if you + display the item. + :vartype contractual_rules: + list[~azure.cognitiveservices.search.entitysearch.models.ContractualRulesContractualRule] + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: + :vartype image: + ~azure.cognitiveservices.search.entitysearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar entity_presentation_info: Additional information about the entity + such as hints that you can use to determine the entity's type. To + determine the entity's type, use the entityScenario and entityTypeHint + fields. + :vartype entity_presentation_info: + ~azure.cognitiveservices.search.entitysearch.models.EntitiesEntityPresentationInfo + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar address: The postal address of where the entity is located + :vartype address: + ~azure.cognitiveservices.search.entitysearch.models.PostalAddress + :ivar telephone: The entity's telephone number + :vartype telephone: str + :ivar price_range: $$. + :vartype price_range: str + :ivar panoramas: + :vartype panoramas: + list[~azure.cognitiveservices.search.entitysearch.models.ImageObject] + :ivar is_permanently_closed: + :vartype is_permanently_closed: bool + :ivar tag_line: + :vartype tag_line: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'contractual_rules': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'entity_presentation_info': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'address': {'readonly': True}, + 'telephone': {'readonly': True}, + 'price_range': {'readonly': True}, + 'panoramas': {'readonly': True}, + 'is_permanently_closed': {'readonly': True}, + 'tag_line': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'contractual_rules': {'key': 'contractualRules', 'type': '[ContractualRulesContractualRule]'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'entity_presentation_info': {'key': 'entityPresentationInfo', 'type': 'EntitiesEntityPresentationInfo'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'PostalAddress'}, + 'telephone': {'key': 'telephone', 'type': 'str'}, + 'price_range': {'key': 'priceRange', 'type': 'str'}, + 'panoramas': {'key': 'panoramas', 'type': '[ImageObject]'}, + 'is_permanently_closed': {'key': 'isPermanentlyClosed', 'type': 'bool'}, + 'tag_line': {'key': 'tagLine', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'MovieTheater': 'MovieTheater'} + } + + def __init__(self, **kwargs) -> None: + super(EntertainmentBusiness, self).__init__(**kwargs) + self._type = 'EntertainmentBusiness' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/entities.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/entities.py index 81f14b62ac46..3e2c429fdc6c 100644 --- a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/entities.py +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/entities.py @@ -18,7 +18,9 @@ class Entities(SearchResultsAnswer): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -44,7 +46,7 @@ class Entities(SearchResultsAnswer): 'ListWithPivot'. Default value: "DominantEntity" . :vartype query_scenario: str or ~azure.cognitiveservices.search.entitysearch.models.EntityQueryScenario - :param value: A list of entities. + :param value: Required. A list of entities. :type value: list[~azure.cognitiveservices.search.entitysearch.models.Thing] """ @@ -69,8 +71,8 @@ class Entities(SearchResultsAnswer): 'value': {'key': 'value', 'type': '[Thing]'}, } - def __init__(self, value): - super(Entities, self).__init__() + def __init__(self, **kwargs): + super(Entities, self).__init__(**kwargs) self.query_scenario = None - self.value = value + self.value = kwargs.get('value', None) self._type = 'Entities' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/entities_entity_presentation_info.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/entities_entity_presentation_info.py index 3f1f4ea8cd60..276a419efc67 100644 --- a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/entities_entity_presentation_info.py +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/entities_entity_presentation_info.py @@ -18,9 +18,11 @@ class EntitiesEntityPresentationInfo(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param entity_scenario: The supported scenario. Possible values include: - 'DominantEntity', 'DisambiguationItem', 'ListItem'. Default value: - "DominantEntity" . + All required parameters must be populated in order to send to Azure. + + :param entity_scenario: Required. The supported scenario. Possible values + include: 'DominantEntity', 'DisambiguationItem', 'ListItem'. Default + value: "DominantEntity" . :type entity_scenario: str or ~azure.cognitiveservices.search.entitysearch.models.EntityScenario :ivar entity_type_hints: A list of hints that indicate the entity's type. @@ -47,8 +49,8 @@ class EntitiesEntityPresentationInfo(Model): 'entity_type_display_hint': {'key': 'entityTypeDisplayHint', 'type': 'str'}, } - def __init__(self, entity_scenario="DominantEntity"): - super(EntitiesEntityPresentationInfo, self).__init__() - self.entity_scenario = entity_scenario + def __init__(self, **kwargs): + super(EntitiesEntityPresentationInfo, self).__init__(**kwargs) + self.entity_scenario = kwargs.get('entity_scenario', "DominantEntity") self.entity_type_hints = None self.entity_type_display_hint = None diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/entities_entity_presentation_info_py3.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/entities_entity_presentation_info_py3.py new file mode 100644 index 000000000000..6ad0f9b93bd1 --- /dev/null +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/entities_entity_presentation_info_py3.py @@ -0,0 +1,56 @@ +# 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 msrest.serialization import Model + + +class EntitiesEntityPresentationInfo(Model): + """Defines additional information about an entity such as type hints. + + 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 Azure. + + :param entity_scenario: Required. The supported scenario. Possible values + include: 'DominantEntity', 'DisambiguationItem', 'ListItem'. Default + value: "DominantEntity" . + :type entity_scenario: str or + ~azure.cognitiveservices.search.entitysearch.models.EntityScenario + :ivar entity_type_hints: A list of hints that indicate the entity's type. + The list could contain a single hint such as Movie or a list of hints such + as Place, LocalBusiness, Restaurant. Each successive hint in the array + narrows the entity's type. + :vartype entity_type_hints: list[str or + ~azure.cognitiveservices.search.entitysearch.models.EntityType] + :ivar entity_type_display_hint: A display version of the entity hint. For + example, if entityTypeHints is Artist, this field may be set to American + Singer. + :vartype entity_type_display_hint: str + """ + + _validation = { + 'entity_scenario': {'required': True}, + 'entity_type_hints': {'readonly': True}, + 'entity_type_display_hint': {'readonly': True}, + } + + _attribute_map = { + 'entity_scenario': {'key': 'entityScenario', 'type': 'str'}, + 'entity_type_hints': {'key': 'entityTypeHints', 'type': '[str]'}, + 'entity_type_display_hint': {'key': 'entityTypeDisplayHint', 'type': 'str'}, + } + + def __init__(self, *, entity_scenario="DominantEntity", **kwargs) -> None: + super(EntitiesEntityPresentationInfo, self).__init__(**kwargs) + self.entity_scenario = entity_scenario + self.entity_type_hints = None + self.entity_type_display_hint = None diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/entities_py3.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/entities_py3.py new file mode 100644 index 000000000000..bd5e67425e7c --- /dev/null +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/entities_py3.py @@ -0,0 +1,78 @@ +# 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 .search_results_answer import SearchResultsAnswer + + +class Entities(SearchResultsAnswer): + """Defines an entity answer. + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar contractual_rules: A list of rules that you must adhere to if you + display the item. + :vartype contractual_rules: + list[~azure.cognitiveservices.search.entitysearch.models.ContractualRulesContractualRule] + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar query_context: + :vartype query_context: + ~azure.cognitiveservices.search.entitysearch.models.QueryContext + :ivar query_scenario: The supported query scenario. This field is set to + DominantEntity or DisambiguationItem. The field is set to DominantEntity + if Bing determines that only a single entity satisfies the request. For + example, a book, movie, person, or attraction. If multiple entities could + satisfy the request, the field is set to DisambiguationItem. For example, + if the request uses the generic title of a movie franchise, the entity's + type would likely be DisambiguationItem. But, if the request specifies a + specific title from the franchise, the entity's type would likely be + DominantEntity. Possible values include: 'DominantEntity', + 'DominantEntityWithDisambiguation', 'Disambiguation', 'List', + 'ListWithPivot'. Default value: "DominantEntity" . + :vartype query_scenario: str or + ~azure.cognitiveservices.search.entitysearch.models.EntityQueryScenario + :param value: Required. A list of entities. + :type value: + list[~azure.cognitiveservices.search.entitysearch.models.Thing] + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'contractual_rules': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'query_context': {'readonly': True}, + 'query_scenario': {'readonly': True}, + 'value': {'required': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'contractual_rules': {'key': 'contractualRules', 'type': '[ContractualRulesContractualRule]'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'query_context': {'key': 'queryContext', 'type': 'QueryContext'}, + 'query_scenario': {'key': 'queryScenario', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[Thing]'}, + } + + def __init__(self, *, value, **kwargs) -> None: + super(Entities, self).__init__(**kwargs) + self.query_scenario = None + self.value = value + self._type = 'Entities' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/entity_search_api_enums.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/entity_search_api_enums.py index d1b709879204..bbfd40a96863 100644 --- a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/entity_search_api_enums.py +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/entity_search_api_enums.py @@ -12,7 +12,7 @@ from enum import Enum -class EntityQueryScenario(Enum): +class EntityQueryScenario(str, Enum): dominant_entity = "DominantEntity" dominant_entity_with_disambiguation = "DominantEntityWithDisambiguation" @@ -21,14 +21,14 @@ class EntityQueryScenario(Enum): list_with_pivot = "ListWithPivot" -class EntityScenario(Enum): +class EntityScenario(str, Enum): dominant_entity = "DominantEntity" disambiguation_item = "DisambiguationItem" list_item = "ListItem" -class EntityType(Enum): +class EntityType(str, Enum): generic = "Generic" person = "Person" @@ -81,7 +81,7 @@ class EntityType(Enum): car = "Car" -class ErrorCode(Enum): +class ErrorCode(str, Enum): none = "None" server_error = "ServerError" @@ -91,7 +91,7 @@ class ErrorCode(Enum): insufficient_authorization = "InsufficientAuthorization" -class ErrorSubCode(Enum): +class ErrorSubCode(str, Enum): unexpected_error = "UnexpectedError" resource_error = "ResourceError" @@ -106,19 +106,19 @@ class ErrorSubCode(Enum): authorization_expired = "AuthorizationExpired" -class AnswerType(Enum): +class AnswerType(str, Enum): entities = "Entities" places = "Places" -class ResponseFormat(Enum): +class ResponseFormat(str, Enum): json = "Json" json_ld = "JsonLd" -class SafeSearch(Enum): +class SafeSearch(str, Enum): off = "Off" moderate = "Moderate" diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/error.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/error.py index 7febf008faa4..b02777a297b5 100644 --- a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/error.py +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/error.py @@ -18,8 +18,10 @@ class Error(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param code: The error code that identifies the category of error. - Possible values include: 'None', 'ServerError', 'InvalidRequest', + All required parameters must be populated in order to send to Azure. + + :param code: Required. The error code that identifies the category of + error. Possible values include: 'None', 'ServerError', 'InvalidRequest', 'RateLimitExceeded', 'InvalidAuthorization', 'InsufficientAuthorization'. Default value: "None" . :type code: str or @@ -31,7 +33,7 @@ class Error(Model): 'AuthorizationRedundancy', 'AuthorizationDisabled', 'AuthorizationExpired' :vartype sub_code: str or ~azure.cognitiveservices.search.entitysearch.models.ErrorSubCode - :param message: A description of the error. + :param message: Required. A description of the error. :type message: str :ivar more_details: A description that provides additional information about the error. @@ -60,11 +62,11 @@ class Error(Model): 'value': {'key': 'value', 'type': 'str'}, } - def __init__(self, message, code="None"): - super(Error, self).__init__() - self.code = code + def __init__(self, **kwargs): + super(Error, self).__init__(**kwargs) + self.code = kwargs.get('code', "None") self.sub_code = None - self.message = message + self.message = kwargs.get('message', None) self.more_details = None self.parameter = None self.value = None diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/error_py3.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/error_py3.py new file mode 100644 index 000000000000..44a31449591a --- /dev/null +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/error_py3.py @@ -0,0 +1,72 @@ +# 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 msrest.serialization import Model + + +class Error(Model): + """Defines the error that occurred. + + 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 Azure. + + :param code: Required. The error code that identifies the category of + error. Possible values include: 'None', 'ServerError', 'InvalidRequest', + 'RateLimitExceeded', 'InvalidAuthorization', 'InsufficientAuthorization'. + Default value: "None" . + :type code: str or + ~azure.cognitiveservices.search.entitysearch.models.ErrorCode + :ivar sub_code: The error code that further helps to identify the error. + Possible values include: 'UnexpectedError', 'ResourceError', + 'NotImplemented', 'ParameterMissing', 'ParameterInvalidValue', + 'HttpNotAllowed', 'Blocked', 'AuthorizationMissing', + 'AuthorizationRedundancy', 'AuthorizationDisabled', 'AuthorizationExpired' + :vartype sub_code: str or + ~azure.cognitiveservices.search.entitysearch.models.ErrorSubCode + :param message: Required. A description of the error. + :type message: str + :ivar more_details: A description that provides additional information + about the error. + :vartype more_details: str + :ivar parameter: The parameter in the request that caused the error. + :vartype parameter: str + :ivar value: The parameter's value in the request that was not valid. + :vartype value: str + """ + + _validation = { + 'code': {'required': True}, + 'sub_code': {'readonly': True}, + 'message': {'required': True}, + 'more_details': {'readonly': True}, + 'parameter': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'sub_code': {'key': 'subCode', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'more_details': {'key': 'moreDetails', 'type': 'str'}, + 'parameter': {'key': 'parameter', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, message: str, code="None", **kwargs) -> None: + super(Error, self).__init__(**kwargs) + self.code = code + self.sub_code = None + self.message = message + self.more_details = None + self.parameter = None + self.value = None diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/error_response.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/error_response.py index 3d27e0dd4d49..f55e5a03e19c 100644 --- a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/error_response.py +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/error_response.py @@ -19,7 +19,9 @@ class ErrorResponse(Response): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -29,8 +31,8 @@ class ErrorResponse(Response): list[~azure.cognitiveservices.search.entitysearch.models.ContractualRulesContractualRule] :ivar web_search_url: The URL To Bing's search result for this item. :vartype web_search_url: str - :param errors: A list of errors that describe the reasons why the request - failed. + :param errors: Required. A list of errors that describe the reasons why + the request failed. :type errors: list[~azure.cognitiveservices.search.entitysearch.models.Error] """ @@ -51,9 +53,9 @@ class ErrorResponse(Response): 'errors': {'key': 'errors', 'type': '[Error]'}, } - def __init__(self, errors): - super(ErrorResponse, self).__init__() - self.errors = errors + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.errors = kwargs.get('errors', None) self._type = 'ErrorResponse' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/error_response_py3.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/error_response_py3.py new file mode 100644 index 000000000000..611a6274b16c --- /dev/null +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/error_response_py3.py @@ -0,0 +1,71 @@ +# 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 .response import Response +from msrest.exceptions import HttpOperationError + + +class ErrorResponse(Response): + """The top-level response that represents a failed request. + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar contractual_rules: A list of rules that you must adhere to if you + display the item. + :vartype contractual_rules: + list[~azure.cognitiveservices.search.entitysearch.models.ContractualRulesContractualRule] + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :param errors: Required. A list of errors that describe the reasons why + the request failed. + :type errors: + list[~azure.cognitiveservices.search.entitysearch.models.Error] + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'contractual_rules': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'errors': {'required': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'contractual_rules': {'key': 'contractualRules', 'type': '[ContractualRulesContractualRule]'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'errors': {'key': 'errors', 'type': '[Error]'}, + } + + def __init__(self, *, errors, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.errors = errors + self._type = 'ErrorResponse' + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/food_establishment.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/food_establishment.py index a20f266dccc9..a69a9a4d93b2 100644 --- a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/food_establishment.py +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/food_establishment.py @@ -21,7 +21,9 @@ class FoodEstablishment(LocalBusiness): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -84,10 +86,29 @@ class FoodEstablishment(LocalBusiness): 'tag_line': {'readonly': True}, } + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'contractual_rules': {'key': 'contractualRules', 'type': '[ContractualRulesContractualRule]'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'entity_presentation_info': {'key': 'entityPresentationInfo', 'type': 'EntitiesEntityPresentationInfo'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'PostalAddress'}, + 'telephone': {'key': 'telephone', 'type': 'str'}, + 'price_range': {'key': 'priceRange', 'type': 'str'}, + 'panoramas': {'key': 'panoramas', 'type': '[ImageObject]'}, + 'is_permanently_closed': {'key': 'isPermanentlyClosed', 'type': 'bool'}, + 'tag_line': {'key': 'tagLine', 'type': 'str'}, + } + _subtype_map = { '_type': {'Restaurant': 'Restaurant'} } - def __init__(self): - super(FoodEstablishment, self).__init__() + def __init__(self, **kwargs): + super(FoodEstablishment, self).__init__(**kwargs) self._type = 'FoodEstablishment' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/food_establishment_py3.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/food_establishment_py3.py new file mode 100644 index 000000000000..d95a0b077264 --- /dev/null +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/food_establishment_py3.py @@ -0,0 +1,114 @@ +# 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 .local_business import LocalBusiness + + +class FoodEstablishment(LocalBusiness): + """FoodEstablishment. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: Restaurant + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar contractual_rules: A list of rules that you must adhere to if you + display the item. + :vartype contractual_rules: + list[~azure.cognitiveservices.search.entitysearch.models.ContractualRulesContractualRule] + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: + :vartype image: + ~azure.cognitiveservices.search.entitysearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar entity_presentation_info: Additional information about the entity + such as hints that you can use to determine the entity's type. To + determine the entity's type, use the entityScenario and entityTypeHint + fields. + :vartype entity_presentation_info: + ~azure.cognitiveservices.search.entitysearch.models.EntitiesEntityPresentationInfo + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar address: The postal address of where the entity is located + :vartype address: + ~azure.cognitiveservices.search.entitysearch.models.PostalAddress + :ivar telephone: The entity's telephone number + :vartype telephone: str + :ivar price_range: $$. + :vartype price_range: str + :ivar panoramas: + :vartype panoramas: + list[~azure.cognitiveservices.search.entitysearch.models.ImageObject] + :ivar is_permanently_closed: + :vartype is_permanently_closed: bool + :ivar tag_line: + :vartype tag_line: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'contractual_rules': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'entity_presentation_info': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'address': {'readonly': True}, + 'telephone': {'readonly': True}, + 'price_range': {'readonly': True}, + 'panoramas': {'readonly': True}, + 'is_permanently_closed': {'readonly': True}, + 'tag_line': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'contractual_rules': {'key': 'contractualRules', 'type': '[ContractualRulesContractualRule]'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'entity_presentation_info': {'key': 'entityPresentationInfo', 'type': 'EntitiesEntityPresentationInfo'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'PostalAddress'}, + 'telephone': {'key': 'telephone', 'type': 'str'}, + 'price_range': {'key': 'priceRange', 'type': 'str'}, + 'panoramas': {'key': 'panoramas', 'type': '[ImageObject]'}, + 'is_permanently_closed': {'key': 'isPermanentlyClosed', 'type': 'bool'}, + 'tag_line': {'key': 'tagLine', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'Restaurant': 'Restaurant'} + } + + def __init__(self, **kwargs) -> None: + super(FoodEstablishment, self).__init__(**kwargs) + self._type = 'FoodEstablishment' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/hotel.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/hotel.py index c18b22c40325..ab3e6c3e4804 100644 --- a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/hotel.py +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/hotel.py @@ -18,7 +18,9 @@ class Hotel(LodgingBusiness): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -108,8 +110,8 @@ class Hotel(LodgingBusiness): 'amenities': {'key': 'amenities', 'type': '[str]'}, } - def __init__(self): - super(Hotel, self).__init__() + def __init__(self, **kwargs): + super(Hotel, self).__init__(**kwargs) self.hotel_class = None self.amenities = None self._type = 'Hotel' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/hotel_py3.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/hotel_py3.py new file mode 100644 index 000000000000..d143549ed5f0 --- /dev/null +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/hotel_py3.py @@ -0,0 +1,117 @@ +# 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 .lodging_business import LodgingBusiness + + +class Hotel(LodgingBusiness): + """Hotel. + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar contractual_rules: A list of rules that you must adhere to if you + display the item. + :vartype contractual_rules: + list[~azure.cognitiveservices.search.entitysearch.models.ContractualRulesContractualRule] + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: + :vartype image: + ~azure.cognitiveservices.search.entitysearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar entity_presentation_info: Additional information about the entity + such as hints that you can use to determine the entity's type. To + determine the entity's type, use the entityScenario and entityTypeHint + fields. + :vartype entity_presentation_info: + ~azure.cognitiveservices.search.entitysearch.models.EntitiesEntityPresentationInfo + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar address: The postal address of where the entity is located + :vartype address: + ~azure.cognitiveservices.search.entitysearch.models.PostalAddress + :ivar telephone: The entity's telephone number + :vartype telephone: str + :ivar price_range: $$. + :vartype price_range: str + :ivar panoramas: + :vartype panoramas: + list[~azure.cognitiveservices.search.entitysearch.models.ImageObject] + :ivar is_permanently_closed: + :vartype is_permanently_closed: bool + :ivar tag_line: + :vartype tag_line: str + :ivar hotel_class: + :vartype hotel_class: str + :ivar amenities: + :vartype amenities: list[str] + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'contractual_rules': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'entity_presentation_info': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'address': {'readonly': True}, + 'telephone': {'readonly': True}, + 'price_range': {'readonly': True}, + 'panoramas': {'readonly': True}, + 'is_permanently_closed': {'readonly': True}, + 'tag_line': {'readonly': True}, + 'hotel_class': {'readonly': True}, + 'amenities': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'contractual_rules': {'key': 'contractualRules', 'type': '[ContractualRulesContractualRule]'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'entity_presentation_info': {'key': 'entityPresentationInfo', 'type': 'EntitiesEntityPresentationInfo'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'PostalAddress'}, + 'telephone': {'key': 'telephone', 'type': 'str'}, + 'price_range': {'key': 'priceRange', 'type': 'str'}, + 'panoramas': {'key': 'panoramas', 'type': '[ImageObject]'}, + 'is_permanently_closed': {'key': 'isPermanentlyClosed', 'type': 'bool'}, + 'tag_line': {'key': 'tagLine', 'type': 'str'}, + 'hotel_class': {'key': 'hotelClass', 'type': 'str'}, + 'amenities': {'key': 'amenities', 'type': '[str]'}, + } + + def __init__(self, **kwargs) -> None: + super(Hotel, self).__init__(**kwargs) + self.hotel_class = None + self.amenities = None + self._type = 'Hotel' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/identifiable.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/identifiable.py index 133e93fa8f94..513e53d238bb 100644 --- a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/identifiable.py +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/identifiable.py @@ -21,7 +21,9 @@ class Identifiable(ResponseBase): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -41,7 +43,7 @@ class Identifiable(ResponseBase): '_type': {'Response': 'Response'} } - def __init__(self): - super(Identifiable, self).__init__() + def __init__(self, **kwargs): + super(Identifiable, self).__init__(**kwargs) self.id = None self._type = 'Identifiable' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/identifiable_py3.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/identifiable_py3.py new file mode 100644 index 000000000000..c87dc0347e3d --- /dev/null +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/identifiable_py3.py @@ -0,0 +1,49 @@ +# 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 .response_base import ResponseBase + + +class Identifiable(ResponseBase): + """Defines the identity of a resource. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: Response + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'Response': 'Response'} + } + + def __init__(self, **kwargs) -> None: + super(Identifiable, self).__init__(**kwargs) + self.id = None + self._type = 'Identifiable' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/image_object.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/image_object.py index 6312275a331a..7b7c050094ac 100644 --- a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/image_object.py +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/image_object.py @@ -18,7 +18,9 @@ class ImageObject(MediaObject): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -109,7 +111,7 @@ class ImageObject(MediaObject): 'thumbnail': {'key': 'thumbnail', 'type': 'ImageObject'}, } - def __init__(self): - super(ImageObject, self).__init__() + def __init__(self, **kwargs): + super(ImageObject, self).__init__(**kwargs) self.thumbnail = None self._type = 'ImageObject' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/image_object_py3.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/image_object_py3.py new file mode 100644 index 000000000000..ba0fc2acdd21 --- /dev/null +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/image_object_py3.py @@ -0,0 +1,117 @@ +# 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 .media_object import MediaObject + + +class ImageObject(MediaObject): + """Defines an image. + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar contractual_rules: A list of rules that you must adhere to if you + display the item. + :vartype contractual_rules: + list[~azure.cognitiveservices.search.entitysearch.models.ContractualRulesContractualRule] + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: + :vartype image: + ~azure.cognitiveservices.search.entitysearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar entity_presentation_info: Additional information about the entity + such as hints that you can use to determine the entity's type. To + determine the entity's type, use the entityScenario and entityTypeHint + fields. + :vartype entity_presentation_info: + ~azure.cognitiveservices.search.entitysearch.models.EntitiesEntityPresentationInfo + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar thumbnail_url: The URL to a thumbnail of the item. + :vartype thumbnail_url: str + :ivar provider: The source of the creative work. + :vartype provider: + list[~azure.cognitiveservices.search.entitysearch.models.Thing] + :ivar text: + :vartype text: str + :ivar content_url: Original URL to retrieve the source (file) for the + media object (e.g the source URL for the image). + :vartype content_url: str + :ivar host_page_url: URL of the page that hosts the media object. + :vartype host_page_url: str + :ivar width: The width of the source media object, in pixels. + :vartype width: int + :ivar height: The height of the source media object, in pixels. + :vartype height: int + :ivar thumbnail: The URL to a thumbnail of the image + :vartype thumbnail: + ~azure.cognitiveservices.search.entitysearch.models.ImageObject + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'contractual_rules': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'entity_presentation_info': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'thumbnail_url': {'readonly': True}, + 'provider': {'readonly': True}, + 'text': {'readonly': True}, + 'content_url': {'readonly': True}, + 'host_page_url': {'readonly': True}, + 'width': {'readonly': True}, + 'height': {'readonly': True}, + 'thumbnail': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'contractual_rules': {'key': 'contractualRules', 'type': '[ContractualRulesContractualRule]'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'entity_presentation_info': {'key': 'entityPresentationInfo', 'type': 'EntitiesEntityPresentationInfo'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'thumbnail_url': {'key': 'thumbnailUrl', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': '[Thing]'}, + 'text': {'key': 'text', 'type': 'str'}, + 'content_url': {'key': 'contentUrl', 'type': 'str'}, + 'host_page_url': {'key': 'hostPageUrl', 'type': 'str'}, + 'width': {'key': 'width', 'type': 'int'}, + 'height': {'key': 'height', 'type': 'int'}, + 'thumbnail': {'key': 'thumbnail', 'type': 'ImageObject'}, + } + + def __init__(self, **kwargs) -> None: + super(ImageObject, self).__init__(**kwargs) + self.thumbnail = None + self._type = 'ImageObject' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/intangible.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/intangible.py index dedf341eb615..dff2d85d18ba 100644 --- a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/intangible.py +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/intangible.py @@ -21,7 +21,9 @@ class Intangible(Thing): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -64,10 +66,23 @@ class Intangible(Thing): 'bing_id': {'readonly': True}, } + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'contractual_rules': {'key': 'contractualRules', 'type': '[ContractualRulesContractualRule]'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'entity_presentation_info': {'key': 'entityPresentationInfo', 'type': 'EntitiesEntityPresentationInfo'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + } + _subtype_map = { '_type': {'StructuredValue': 'StructuredValue'} } - def __init__(self): - super(Intangible, self).__init__() + def __init__(self, **kwargs): + super(Intangible, self).__init__(**kwargs) self._type = 'Intangible' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/intangible_py3.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/intangible_py3.py new file mode 100644 index 000000000000..5655a035ee76 --- /dev/null +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/intangible_py3.py @@ -0,0 +1,88 @@ +# 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 .thing import Thing + + +class Intangible(Thing): + """Intangible. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: StructuredValue + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar contractual_rules: A list of rules that you must adhere to if you + display the item. + :vartype contractual_rules: + list[~azure.cognitiveservices.search.entitysearch.models.ContractualRulesContractualRule] + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: + :vartype image: + ~azure.cognitiveservices.search.entitysearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar entity_presentation_info: Additional information about the entity + such as hints that you can use to determine the entity's type. To + determine the entity's type, use the entityScenario and entityTypeHint + fields. + :vartype entity_presentation_info: + ~azure.cognitiveservices.search.entitysearch.models.EntitiesEntityPresentationInfo + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'contractual_rules': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'entity_presentation_info': {'readonly': True}, + 'bing_id': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'contractual_rules': {'key': 'contractualRules', 'type': '[ContractualRulesContractualRule]'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'entity_presentation_info': {'key': 'entityPresentationInfo', 'type': 'EntitiesEntityPresentationInfo'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'StructuredValue': 'StructuredValue'} + } + + def __init__(self, **kwargs) -> None: + super(Intangible, self).__init__(**kwargs) + self._type = 'Intangible' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/license.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/license.py index 5e0d0b59c9e5..ed6177a2d737 100644 --- a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/license.py +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/license.py @@ -18,7 +18,9 @@ class License(CreativeWork): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -71,6 +73,22 @@ class License(CreativeWork): 'text': {'readonly': True}, } - def __init__(self): - super(License, self).__init__() + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'contractual_rules': {'key': 'contractualRules', 'type': '[ContractualRulesContractualRule]'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'entity_presentation_info': {'key': 'entityPresentationInfo', 'type': 'EntitiesEntityPresentationInfo'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'thumbnail_url': {'key': 'thumbnailUrl', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': '[Thing]'}, + 'text': {'key': 'text', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(License, self).__init__(**kwargs) self._type = 'License' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/license_py3.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/license_py3.py new file mode 100644 index 000000000000..db5aa7a1ff21 --- /dev/null +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/license_py3.py @@ -0,0 +1,94 @@ +# 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 .creative_work import CreativeWork + + +class License(CreativeWork): + """Defines the license under which the text or photo may be used. + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar contractual_rules: A list of rules that you must adhere to if you + display the item. + :vartype contractual_rules: + list[~azure.cognitiveservices.search.entitysearch.models.ContractualRulesContractualRule] + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: + :vartype image: + ~azure.cognitiveservices.search.entitysearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar entity_presentation_info: Additional information about the entity + such as hints that you can use to determine the entity's type. To + determine the entity's type, use the entityScenario and entityTypeHint + fields. + :vartype entity_presentation_info: + ~azure.cognitiveservices.search.entitysearch.models.EntitiesEntityPresentationInfo + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar thumbnail_url: The URL to a thumbnail of the item. + :vartype thumbnail_url: str + :ivar provider: The source of the creative work. + :vartype provider: + list[~azure.cognitiveservices.search.entitysearch.models.Thing] + :ivar text: + :vartype text: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'contractual_rules': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'entity_presentation_info': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'thumbnail_url': {'readonly': True}, + 'provider': {'readonly': True}, + 'text': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'contractual_rules': {'key': 'contractualRules', 'type': '[ContractualRulesContractualRule]'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'entity_presentation_info': {'key': 'entityPresentationInfo', 'type': 'EntitiesEntityPresentationInfo'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'thumbnail_url': {'key': 'thumbnailUrl', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': '[Thing]'}, + 'text': {'key': 'text', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(License, self).__init__(**kwargs) + self._type = 'License' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/local_business.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/local_business.py index 32a6a5df6f38..bfeea3b8362d 100644 --- a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/local_business.py +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/local_business.py @@ -21,7 +21,9 @@ class LocalBusiness(Place): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -107,8 +109,8 @@ class LocalBusiness(Place): '_type': {'EntertainmentBusiness': 'EntertainmentBusiness', 'FoodEstablishment': 'FoodEstablishment', 'LodgingBusiness': 'LodgingBusiness'} } - def __init__(self): - super(LocalBusiness, self).__init__() + def __init__(self, **kwargs): + super(LocalBusiness, self).__init__(**kwargs) self.price_range = None self.panoramas = None self.is_permanently_closed = None diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/local_business_py3.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/local_business_py3.py new file mode 100644 index 000000000000..d5b98a18d424 --- /dev/null +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/local_business_py3.py @@ -0,0 +1,118 @@ +# 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 .place import Place + + +class LocalBusiness(Place): + """LocalBusiness. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: EntertainmentBusiness, FoodEstablishment, LodgingBusiness + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar contractual_rules: A list of rules that you must adhere to if you + display the item. + :vartype contractual_rules: + list[~azure.cognitiveservices.search.entitysearch.models.ContractualRulesContractualRule] + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: + :vartype image: + ~azure.cognitiveservices.search.entitysearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar entity_presentation_info: Additional information about the entity + such as hints that you can use to determine the entity's type. To + determine the entity's type, use the entityScenario and entityTypeHint + fields. + :vartype entity_presentation_info: + ~azure.cognitiveservices.search.entitysearch.models.EntitiesEntityPresentationInfo + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar address: The postal address of where the entity is located + :vartype address: + ~azure.cognitiveservices.search.entitysearch.models.PostalAddress + :ivar telephone: The entity's telephone number + :vartype telephone: str + :ivar price_range: $$. + :vartype price_range: str + :ivar panoramas: + :vartype panoramas: + list[~azure.cognitiveservices.search.entitysearch.models.ImageObject] + :ivar is_permanently_closed: + :vartype is_permanently_closed: bool + :ivar tag_line: + :vartype tag_line: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'contractual_rules': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'entity_presentation_info': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'address': {'readonly': True}, + 'telephone': {'readonly': True}, + 'price_range': {'readonly': True}, + 'panoramas': {'readonly': True}, + 'is_permanently_closed': {'readonly': True}, + 'tag_line': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'contractual_rules': {'key': 'contractualRules', 'type': '[ContractualRulesContractualRule]'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'entity_presentation_info': {'key': 'entityPresentationInfo', 'type': 'EntitiesEntityPresentationInfo'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'PostalAddress'}, + 'telephone': {'key': 'telephone', 'type': 'str'}, + 'price_range': {'key': 'priceRange', 'type': 'str'}, + 'panoramas': {'key': 'panoramas', 'type': '[ImageObject]'}, + 'is_permanently_closed': {'key': 'isPermanentlyClosed', 'type': 'bool'}, + 'tag_line': {'key': 'tagLine', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'EntertainmentBusiness': 'EntertainmentBusiness', 'FoodEstablishment': 'FoodEstablishment', 'LodgingBusiness': 'LodgingBusiness'} + } + + def __init__(self, **kwargs) -> None: + super(LocalBusiness, self).__init__(**kwargs) + self.price_range = None + self.panoramas = None + self.is_permanently_closed = None + self.tag_line = None + self._type = 'LocalBusiness' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/lodging_business.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/lodging_business.py index b4880748d5b3..f6ed22006144 100644 --- a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/lodging_business.py +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/lodging_business.py @@ -21,7 +21,9 @@ class LodgingBusiness(LocalBusiness): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -84,10 +86,29 @@ class LodgingBusiness(LocalBusiness): 'tag_line': {'readonly': True}, } + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'contractual_rules': {'key': 'contractualRules', 'type': '[ContractualRulesContractualRule]'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'entity_presentation_info': {'key': 'entityPresentationInfo', 'type': 'EntitiesEntityPresentationInfo'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'PostalAddress'}, + 'telephone': {'key': 'telephone', 'type': 'str'}, + 'price_range': {'key': 'priceRange', 'type': 'str'}, + 'panoramas': {'key': 'panoramas', 'type': '[ImageObject]'}, + 'is_permanently_closed': {'key': 'isPermanentlyClosed', 'type': 'bool'}, + 'tag_line': {'key': 'tagLine', 'type': 'str'}, + } + _subtype_map = { '_type': {'Hotel': 'Hotel'} } - def __init__(self): - super(LodgingBusiness, self).__init__() + def __init__(self, **kwargs): + super(LodgingBusiness, self).__init__(**kwargs) self._type = 'LodgingBusiness' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/lodging_business_py3.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/lodging_business_py3.py new file mode 100644 index 000000000000..9caf104a1b52 --- /dev/null +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/lodging_business_py3.py @@ -0,0 +1,114 @@ +# 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 .local_business import LocalBusiness + + +class LodgingBusiness(LocalBusiness): + """LodgingBusiness. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: Hotel + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar contractual_rules: A list of rules that you must adhere to if you + display the item. + :vartype contractual_rules: + list[~azure.cognitiveservices.search.entitysearch.models.ContractualRulesContractualRule] + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: + :vartype image: + ~azure.cognitiveservices.search.entitysearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar entity_presentation_info: Additional information about the entity + such as hints that you can use to determine the entity's type. To + determine the entity's type, use the entityScenario and entityTypeHint + fields. + :vartype entity_presentation_info: + ~azure.cognitiveservices.search.entitysearch.models.EntitiesEntityPresentationInfo + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar address: The postal address of where the entity is located + :vartype address: + ~azure.cognitiveservices.search.entitysearch.models.PostalAddress + :ivar telephone: The entity's telephone number + :vartype telephone: str + :ivar price_range: $$. + :vartype price_range: str + :ivar panoramas: + :vartype panoramas: + list[~azure.cognitiveservices.search.entitysearch.models.ImageObject] + :ivar is_permanently_closed: + :vartype is_permanently_closed: bool + :ivar tag_line: + :vartype tag_line: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'contractual_rules': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'entity_presentation_info': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'address': {'readonly': True}, + 'telephone': {'readonly': True}, + 'price_range': {'readonly': True}, + 'panoramas': {'readonly': True}, + 'is_permanently_closed': {'readonly': True}, + 'tag_line': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'contractual_rules': {'key': 'contractualRules', 'type': '[ContractualRulesContractualRule]'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'entity_presentation_info': {'key': 'entityPresentationInfo', 'type': 'EntitiesEntityPresentationInfo'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'PostalAddress'}, + 'telephone': {'key': 'telephone', 'type': 'str'}, + 'price_range': {'key': 'priceRange', 'type': 'str'}, + 'panoramas': {'key': 'panoramas', 'type': '[ImageObject]'}, + 'is_permanently_closed': {'key': 'isPermanentlyClosed', 'type': 'bool'}, + 'tag_line': {'key': 'tagLine', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'Hotel': 'Hotel'} + } + + def __init__(self, **kwargs) -> None: + super(LodgingBusiness, self).__init__(**kwargs) + self._type = 'LodgingBusiness' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/media_object.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/media_object.py index 12ad5cb5246d..9f4b271270ae 100644 --- a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/media_object.py +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/media_object.py @@ -21,7 +21,9 @@ class MediaObject(CreativeWork): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -111,8 +113,8 @@ class MediaObject(CreativeWork): '_type': {'ImageObject': 'ImageObject'} } - def __init__(self): - super(MediaObject, self).__init__() + def __init__(self, **kwargs): + super(MediaObject, self).__init__(**kwargs) self.content_url = None self.host_page_url = None self.width = None diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/media_object_py3.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/media_object_py3.py new file mode 100644 index 000000000000..a8c789ea2c3e --- /dev/null +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/media_object_py3.py @@ -0,0 +1,122 @@ +# 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 .creative_work import CreativeWork + + +class MediaObject(CreativeWork): + """MediaObject. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ImageObject + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar contractual_rules: A list of rules that you must adhere to if you + display the item. + :vartype contractual_rules: + list[~azure.cognitiveservices.search.entitysearch.models.ContractualRulesContractualRule] + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: + :vartype image: + ~azure.cognitiveservices.search.entitysearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar entity_presentation_info: Additional information about the entity + such as hints that you can use to determine the entity's type. To + determine the entity's type, use the entityScenario and entityTypeHint + fields. + :vartype entity_presentation_info: + ~azure.cognitiveservices.search.entitysearch.models.EntitiesEntityPresentationInfo + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar thumbnail_url: The URL to a thumbnail of the item. + :vartype thumbnail_url: str + :ivar provider: The source of the creative work. + :vartype provider: + list[~azure.cognitiveservices.search.entitysearch.models.Thing] + :ivar text: + :vartype text: str + :ivar content_url: Original URL to retrieve the source (file) for the + media object (e.g the source URL for the image). + :vartype content_url: str + :ivar host_page_url: URL of the page that hosts the media object. + :vartype host_page_url: str + :ivar width: The width of the source media object, in pixels. + :vartype width: int + :ivar height: The height of the source media object, in pixels. + :vartype height: int + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'contractual_rules': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'entity_presentation_info': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'thumbnail_url': {'readonly': True}, + 'provider': {'readonly': True}, + 'text': {'readonly': True}, + 'content_url': {'readonly': True}, + 'host_page_url': {'readonly': True}, + 'width': {'readonly': True}, + 'height': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'contractual_rules': {'key': 'contractualRules', 'type': '[ContractualRulesContractualRule]'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'entity_presentation_info': {'key': 'entityPresentationInfo', 'type': 'EntitiesEntityPresentationInfo'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'thumbnail_url': {'key': 'thumbnailUrl', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': '[Thing]'}, + 'text': {'key': 'text', 'type': 'str'}, + 'content_url': {'key': 'contentUrl', 'type': 'str'}, + 'host_page_url': {'key': 'hostPageUrl', 'type': 'str'}, + 'width': {'key': 'width', 'type': 'int'}, + 'height': {'key': 'height', 'type': 'int'}, + } + + _subtype_map = { + '_type': {'ImageObject': 'ImageObject'} + } + + def __init__(self, **kwargs) -> None: + super(MediaObject, self).__init__(**kwargs) + self.content_url = None + self.host_page_url = None + self.width = None + self.height = None + self._type = 'MediaObject' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/movie_theater.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/movie_theater.py index ee0254eedd29..b98faf00795d 100644 --- a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/movie_theater.py +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/movie_theater.py @@ -18,7 +18,9 @@ class MovieTheater(EntertainmentBusiness): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -104,7 +106,7 @@ class MovieTheater(EntertainmentBusiness): 'screen_count': {'key': 'screenCount', 'type': 'int'}, } - def __init__(self): - super(MovieTheater, self).__init__() + def __init__(self, **kwargs): + super(MovieTheater, self).__init__(**kwargs) self.screen_count = None self._type = 'MovieTheater' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/movie_theater_py3.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/movie_theater_py3.py new file mode 100644 index 000000000000..0e4da1631afe --- /dev/null +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/movie_theater_py3.py @@ -0,0 +1,112 @@ +# 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 .entertainment_business import EntertainmentBusiness + + +class MovieTheater(EntertainmentBusiness): + """MovieTheater. + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar contractual_rules: A list of rules that you must adhere to if you + display the item. + :vartype contractual_rules: + list[~azure.cognitiveservices.search.entitysearch.models.ContractualRulesContractualRule] + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: + :vartype image: + ~azure.cognitiveservices.search.entitysearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar entity_presentation_info: Additional information about the entity + such as hints that you can use to determine the entity's type. To + determine the entity's type, use the entityScenario and entityTypeHint + fields. + :vartype entity_presentation_info: + ~azure.cognitiveservices.search.entitysearch.models.EntitiesEntityPresentationInfo + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar address: The postal address of where the entity is located + :vartype address: + ~azure.cognitiveservices.search.entitysearch.models.PostalAddress + :ivar telephone: The entity's telephone number + :vartype telephone: str + :ivar price_range: $$. + :vartype price_range: str + :ivar panoramas: + :vartype panoramas: + list[~azure.cognitiveservices.search.entitysearch.models.ImageObject] + :ivar is_permanently_closed: + :vartype is_permanently_closed: bool + :ivar tag_line: + :vartype tag_line: str + :ivar screen_count: + :vartype screen_count: int + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'contractual_rules': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'entity_presentation_info': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'address': {'readonly': True}, + 'telephone': {'readonly': True}, + 'price_range': {'readonly': True}, + 'panoramas': {'readonly': True}, + 'is_permanently_closed': {'readonly': True}, + 'tag_line': {'readonly': True}, + 'screen_count': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'contractual_rules': {'key': 'contractualRules', 'type': '[ContractualRulesContractualRule]'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'entity_presentation_info': {'key': 'entityPresentationInfo', 'type': 'EntitiesEntityPresentationInfo'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'PostalAddress'}, + 'telephone': {'key': 'telephone', 'type': 'str'}, + 'price_range': {'key': 'priceRange', 'type': 'str'}, + 'panoramas': {'key': 'panoramas', 'type': '[ImageObject]'}, + 'is_permanently_closed': {'key': 'isPermanentlyClosed', 'type': 'bool'}, + 'tag_line': {'key': 'tagLine', 'type': 'str'}, + 'screen_count': {'key': 'screenCount', 'type': 'int'}, + } + + def __init__(self, **kwargs) -> None: + super(MovieTheater, self).__init__(**kwargs) + self.screen_count = None + self._type = 'MovieTheater' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/organization.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/organization.py index 9f6bc184a464..1f8d02f8cd7b 100644 --- a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/organization.py +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/organization.py @@ -18,7 +18,9 @@ class Organization(Thing): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -61,6 +63,19 @@ class Organization(Thing): 'bing_id': {'readonly': True}, } - def __init__(self): - super(Organization, self).__init__() + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'contractual_rules': {'key': 'contractualRules', 'type': '[ContractualRulesContractualRule]'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'entity_presentation_info': {'key': 'entityPresentationInfo', 'type': 'EntitiesEntityPresentationInfo'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Organization, self).__init__(**kwargs) self._type = 'Organization' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/organization_py3.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/organization_py3.py new file mode 100644 index 000000000000..8b12a4c212ce --- /dev/null +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/organization_py3.py @@ -0,0 +1,81 @@ +# 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 .thing import Thing + + +class Organization(Thing): + """Defines an organization. + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar contractual_rules: A list of rules that you must adhere to if you + display the item. + :vartype contractual_rules: + list[~azure.cognitiveservices.search.entitysearch.models.ContractualRulesContractualRule] + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: + :vartype image: + ~azure.cognitiveservices.search.entitysearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar entity_presentation_info: Additional information about the entity + such as hints that you can use to determine the entity's type. To + determine the entity's type, use the entityScenario and entityTypeHint + fields. + :vartype entity_presentation_info: + ~azure.cognitiveservices.search.entitysearch.models.EntitiesEntityPresentationInfo + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'contractual_rules': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'entity_presentation_info': {'readonly': True}, + 'bing_id': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'contractual_rules': {'key': 'contractualRules', 'type': '[ContractualRulesContractualRule]'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'entity_presentation_info': {'key': 'entityPresentationInfo', 'type': 'EntitiesEntityPresentationInfo'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Organization, self).__init__(**kwargs) + self._type = 'Organization' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/place.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/place.py index 484f5c8bc3c6..80b785e18f72 100644 --- a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/place.py +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/place.py @@ -21,7 +21,9 @@ class Place(Thing): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -90,8 +92,8 @@ class Place(Thing): '_type': {'CivicStructure': 'CivicStructure', 'LocalBusiness': 'LocalBusiness', 'TouristAttraction': 'TouristAttraction'} } - def __init__(self): - super(Place, self).__init__() + def __init__(self, **kwargs): + super(Place, self).__init__(**kwargs) self.address = None self.telephone = None self._type = 'Place' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/place_py3.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/place_py3.py new file mode 100644 index 000000000000..1aa3b357f72d --- /dev/null +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/place_py3.py @@ -0,0 +1,99 @@ +# 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 .thing import Thing + + +class Place(Thing): + """Defines information about a local entity, such as a restaurant or hotel. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: CivicStructure, LocalBusiness, TouristAttraction + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar contractual_rules: A list of rules that you must adhere to if you + display the item. + :vartype contractual_rules: + list[~azure.cognitiveservices.search.entitysearch.models.ContractualRulesContractualRule] + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: + :vartype image: + ~azure.cognitiveservices.search.entitysearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar entity_presentation_info: Additional information about the entity + such as hints that you can use to determine the entity's type. To + determine the entity's type, use the entityScenario and entityTypeHint + fields. + :vartype entity_presentation_info: + ~azure.cognitiveservices.search.entitysearch.models.EntitiesEntityPresentationInfo + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar address: The postal address of where the entity is located + :vartype address: + ~azure.cognitiveservices.search.entitysearch.models.PostalAddress + :ivar telephone: The entity's telephone number + :vartype telephone: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'contractual_rules': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'entity_presentation_info': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'address': {'readonly': True}, + 'telephone': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'contractual_rules': {'key': 'contractualRules', 'type': '[ContractualRulesContractualRule]'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'entity_presentation_info': {'key': 'entityPresentationInfo', 'type': 'EntitiesEntityPresentationInfo'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'PostalAddress'}, + 'telephone': {'key': 'telephone', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'CivicStructure': 'CivicStructure', 'LocalBusiness': 'LocalBusiness', 'TouristAttraction': 'TouristAttraction'} + } + + def __init__(self, **kwargs) -> None: + super(Place, self).__init__(**kwargs) + self.address = None + self.telephone = None + self._type = 'Place' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/places.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/places.py index 0533d3cdd40b..698c08ce6434 100644 --- a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/places.py +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/places.py @@ -18,7 +18,9 @@ class Places(SearchResultsAnswer): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -31,7 +33,8 @@ class Places(SearchResultsAnswer): :ivar query_context: :vartype query_context: ~azure.cognitiveservices.search.entitysearch.models.QueryContext - :param value: A list of local entities, such as restaurants or hotels. + :param value: Required. A list of local entities, such as restaurants or + hotels. :type value: list[~azure.cognitiveservices.search.entitysearch.models.Thing] """ @@ -54,7 +57,7 @@ class Places(SearchResultsAnswer): 'value': {'key': 'value', 'type': '[Thing]'}, } - def __init__(self, value): - super(Places, self).__init__() - self.value = value + def __init__(self, **kwargs): + super(Places, self).__init__(**kwargs) + self.value = kwargs.get('value', None) self._type = 'Places' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/places_py3.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/places_py3.py new file mode 100644 index 000000000000..d37c5584d19e --- /dev/null +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/places_py3.py @@ -0,0 +1,63 @@ +# 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 .search_results_answer import SearchResultsAnswer + + +class Places(SearchResultsAnswer): + """Defines a local entity answer. + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar contractual_rules: A list of rules that you must adhere to if you + display the item. + :vartype contractual_rules: + list[~azure.cognitiveservices.search.entitysearch.models.ContractualRulesContractualRule] + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar query_context: + :vartype query_context: + ~azure.cognitiveservices.search.entitysearch.models.QueryContext + :param value: Required. A list of local entities, such as restaurants or + hotels. + :type value: + list[~azure.cognitiveservices.search.entitysearch.models.Thing] + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'contractual_rules': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'query_context': {'readonly': True}, + 'value': {'required': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'contractual_rules': {'key': 'contractualRules', 'type': '[ContractualRulesContractualRule]'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'query_context': {'key': 'queryContext', 'type': 'QueryContext'}, + 'value': {'key': 'value', 'type': '[Thing]'}, + } + + def __init__(self, *, value, **kwargs) -> None: + super(Places, self).__init__(**kwargs) + self.value = value + self._type = 'Places' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/postal_address.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/postal_address.py index 79cde4044995..7b89ceb1e429 100644 --- a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/postal_address.py +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/postal_address.py @@ -18,7 +18,9 @@ class PostalAddress(StructuredValue): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -127,8 +129,8 @@ class PostalAddress(StructuredValue): 'text': {'key': 'text', 'type': 'str'}, } - def __init__(self): - super(PostalAddress, self).__init__() + def __init__(self, **kwargs): + super(PostalAddress, self).__init__(**kwargs) self.street_address = None self.address_locality = None self.address_subregion = None diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/postal_address_py3.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/postal_address_py3.py new file mode 100644 index 000000000000..93878b9c98e0 --- /dev/null +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/postal_address_py3.py @@ -0,0 +1,145 @@ +# 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 .structured_value import StructuredValue + + +class PostalAddress(StructuredValue): + """Defines a postal address. + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar contractual_rules: A list of rules that you must adhere to if you + display the item. + :vartype contractual_rules: + list[~azure.cognitiveservices.search.entitysearch.models.ContractualRulesContractualRule] + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: + :vartype image: + ~azure.cognitiveservices.search.entitysearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar entity_presentation_info: Additional information about the entity + such as hints that you can use to determine the entity's type. To + determine the entity's type, use the entityScenario and entityTypeHint + fields. + :vartype entity_presentation_info: + ~azure.cognitiveservices.search.entitysearch.models.EntitiesEntityPresentationInfo + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar street_address: + :vartype street_address: str + :ivar address_locality: The city where the street address is located. For + example, Seattle. + :vartype address_locality: str + :ivar address_subregion: + :vartype address_subregion: str + :ivar address_region: The state or province code where the street address + is located. This could be the two-letter code. For example, WA, or the + full name , Washington. + :vartype address_region: str + :ivar postal_code: The zip code or postal code where the street address is + located. For example, 98052. + :vartype postal_code: str + :ivar post_office_box_number: + :vartype post_office_box_number: str + :ivar address_country: The country/region where the street address is + located. This could be the two-letter ISO code. For example, US, or the + full name, United States. + :vartype address_country: str + :ivar country_iso: The two letter ISO code of this countr. For example, + US. + :vartype country_iso: str + :ivar neighborhood: The neighborhood where the street address is located. + For example, Westlake. + :vartype neighborhood: str + :ivar address_region_abbreviation: Region Abbreviation. For example, WA. + :vartype address_region_abbreviation: str + :ivar text: The complete address. For example, 2100 Westlake Ave N, + Bellevue, WA 98052. + :vartype text: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'contractual_rules': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'entity_presentation_info': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'street_address': {'readonly': True}, + 'address_locality': {'readonly': True}, + 'address_subregion': {'readonly': True}, + 'address_region': {'readonly': True}, + 'postal_code': {'readonly': True}, + 'post_office_box_number': {'readonly': True}, + 'address_country': {'readonly': True}, + 'country_iso': {'readonly': True}, + 'neighborhood': {'readonly': True}, + 'address_region_abbreviation': {'readonly': True}, + 'text': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'contractual_rules': {'key': 'contractualRules', 'type': '[ContractualRulesContractualRule]'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'entity_presentation_info': {'key': 'entityPresentationInfo', 'type': 'EntitiesEntityPresentationInfo'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'street_address': {'key': 'streetAddress', 'type': 'str'}, + 'address_locality': {'key': 'addressLocality', 'type': 'str'}, + 'address_subregion': {'key': 'addressSubregion', 'type': 'str'}, + 'address_region': {'key': 'addressRegion', 'type': 'str'}, + 'postal_code': {'key': 'postalCode', 'type': 'str'}, + 'post_office_box_number': {'key': 'postOfficeBoxNumber', 'type': 'str'}, + 'address_country': {'key': 'addressCountry', 'type': 'str'}, + 'country_iso': {'key': 'countryIso', 'type': 'str'}, + 'neighborhood': {'key': 'neighborhood', 'type': 'str'}, + 'address_region_abbreviation': {'key': 'addressRegionAbbreviation', 'type': 'str'}, + 'text': {'key': 'text', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(PostalAddress, self).__init__(**kwargs) + self.street_address = None + self.address_locality = None + self.address_subregion = None + self.address_region = None + self.postal_code = None + self.post_office_box_number = None + self.address_country = None + self.country_iso = None + self.neighborhood = None + self.address_region_abbreviation = None + self.text = None + self._type = 'PostalAddress' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/query_context.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/query_context.py index 9b710ad7e62e..c26b471f261b 100644 --- a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/query_context.py +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/query_context.py @@ -18,7 +18,10 @@ class QueryContext(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param original_query: The query string as specified in the request. + All required parameters must be populated in order to send to Azure. + + :param original_query: Required. The query string as specified in the + request. :type original_query: str :ivar altered_query: The query string used by Bing to perform the query. Bing uses the altered query string if the original query string contained @@ -65,9 +68,9 @@ class QueryContext(Model): 'ask_user_for_location': {'key': 'askUserForLocation', 'type': 'bool'}, } - def __init__(self, original_query): - super(QueryContext, self).__init__() - self.original_query = original_query + def __init__(self, **kwargs): + super(QueryContext, self).__init__(**kwargs) + self.original_query = kwargs.get('original_query', None) self.altered_query = None self.alteration_override_query = None self.adult_intent = None diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/query_context_py3.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/query_context_py3.py new file mode 100644 index 000000000000..53616eda6f30 --- /dev/null +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/query_context_py3.py @@ -0,0 +1,77 @@ +# 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 msrest.serialization import Model + + +class QueryContext(Model): + """Defines the query context that Bing used for the request. + + 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 Azure. + + :param original_query: Required. The query string as specified in the + request. + :type original_query: str + :ivar altered_query: The query string used by Bing to perform the query. + Bing uses the altered query string if the original query string contained + spelling mistakes. For example, if the query string is "saling downwind", + the altered query string will be "sailing downwind". This field is + included only if the original query string contains a spelling mistake. + :vartype altered_query: str + :ivar alteration_override_query: The query string to use to force Bing to + use the original string. For example, if the query string is "saling + downwind", the override query string will be "+saling downwind". Remember + to encode the query string which results in "%2Bsaling+downwind". This + field is included only if the original query string contains a spelling + mistake. + :vartype alteration_override_query: str + :ivar adult_intent: A Boolean value that indicates whether the specified + query has adult intent. The value is true if the query has adult intent; + otherwise, false. + :vartype adult_intent: bool + :ivar ask_user_for_location: A Boolean value that indicates whether Bing + requires the user's location to provide accurate results. If you specified + the user's location by using the X-MSEdge-ClientIP and X-Search-Location + headers, you can ignore this field. For location aware queries, such as + "today's weather" or "restaurants near me" that need the user's location + to provide accurate results, this field is set to true. For location aware + queries that include the location (for example, "Seattle weather"), this + field is set to false. This field is also set to false for queries that + are not location aware, such as "best sellers". + :vartype ask_user_for_location: bool + """ + + _validation = { + 'original_query': {'required': True}, + 'altered_query': {'readonly': True}, + 'alteration_override_query': {'readonly': True}, + 'adult_intent': {'readonly': True}, + 'ask_user_for_location': {'readonly': True}, + } + + _attribute_map = { + 'original_query': {'key': 'originalQuery', 'type': 'str'}, + 'altered_query': {'key': 'alteredQuery', 'type': 'str'}, + 'alteration_override_query': {'key': 'alterationOverrideQuery', 'type': 'str'}, + 'adult_intent': {'key': 'adultIntent', 'type': 'bool'}, + 'ask_user_for_location': {'key': 'askUserForLocation', 'type': 'bool'}, + } + + def __init__(self, *, original_query: str, **kwargs) -> None: + super(QueryContext, self).__init__(**kwargs) + self.original_query = original_query + self.altered_query = None + self.alteration_override_query = None + self.adult_intent = None + self.ask_user_for_location = None diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/response.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/response.py index 3e44ba6a1b84..4c1684dbe185 100644 --- a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/response.py +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/response.py @@ -22,7 +22,9 @@ class Response(Identifiable): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -52,8 +54,8 @@ class Response(Identifiable): '_type': {'Thing': 'Thing', 'SearchResponse': 'SearchResponse', 'Answer': 'Answer', 'ErrorResponse': 'ErrorResponse'} } - def __init__(self): - super(Response, self).__init__() + def __init__(self, **kwargs): + super(Response, self).__init__(**kwargs) self.contractual_rules = None self.web_search_url = None self._type = 'Response' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/response_base.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/response_base.py index 0b5b11b43039..5a09ce0f95d6 100644 --- a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/response_base.py +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/response_base.py @@ -18,7 +18,9 @@ class ResponseBase(Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: Identifiable - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str """ @@ -34,6 +36,6 @@ class ResponseBase(Model): '_type': {'Identifiable': 'Identifiable'} } - def __init__(self): - super(ResponseBase, self).__init__() + def __init__(self, **kwargs): + super(ResponseBase, self).__init__(**kwargs) self._type = None diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/response_base_py3.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/response_base_py3.py new file mode 100644 index 000000000000..0ac9762f5cd7 --- /dev/null +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/response_base_py3.py @@ -0,0 +1,41 @@ +# 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 msrest.serialization import Model + + +class ResponseBase(Model): + """ResponseBase. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: Identifiable + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + """ + + _validation = { + '_type': {'required': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'Identifiable': 'Identifiable'} + } + + def __init__(self, **kwargs) -> None: + super(ResponseBase, self).__init__(**kwargs) + self._type = None diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/response_py3.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/response_py3.py new file mode 100644 index 000000000000..1a9742695e5b --- /dev/null +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/response_py3.py @@ -0,0 +1,61 @@ +# 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 .identifiable import Identifiable + + +class Response(Identifiable): + """Defines a response. All schemas that could be returned at the root of a + response should inherit from this. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: Thing, SearchResponse, Answer, ErrorResponse + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar contractual_rules: A list of rules that you must adhere to if you + display the item. + :vartype contractual_rules: + list[~azure.cognitiveservices.search.entitysearch.models.ContractualRulesContractualRule] + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'contractual_rules': {'readonly': True}, + 'web_search_url': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'contractual_rules': {'key': 'contractualRules', 'type': '[ContractualRulesContractualRule]'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'Thing': 'Thing', 'SearchResponse': 'SearchResponse', 'Answer': 'Answer', 'ErrorResponse': 'ErrorResponse'} + } + + def __init__(self, **kwargs) -> None: + super(Response, self).__init__(**kwargs) + self.contractual_rules = None + self.web_search_url = None + self._type = 'Response' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/restaurant.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/restaurant.py index 2f610b4a9eb0..57995f726550 100644 --- a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/restaurant.py +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/restaurant.py @@ -18,7 +18,9 @@ class Restaurant(FoodEstablishment): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -116,8 +118,8 @@ class Restaurant(FoodEstablishment): 'menu_url': {'key': 'menuUrl', 'type': 'str'}, } - def __init__(self): - super(Restaurant, self).__init__() + def __init__(self, **kwargs): + super(Restaurant, self).__init__(**kwargs) self.accepts_reservations = None self.reservation_url = None self.serves_cuisine = None diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/restaurant_py3.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/restaurant_py3.py new file mode 100644 index 000000000000..4e8f8333572f --- /dev/null +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/restaurant_py3.py @@ -0,0 +1,127 @@ +# 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 .food_establishment import FoodEstablishment + + +class Restaurant(FoodEstablishment): + """Restaurant. + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar contractual_rules: A list of rules that you must adhere to if you + display the item. + :vartype contractual_rules: + list[~azure.cognitiveservices.search.entitysearch.models.ContractualRulesContractualRule] + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: + :vartype image: + ~azure.cognitiveservices.search.entitysearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar entity_presentation_info: Additional information about the entity + such as hints that you can use to determine the entity's type. To + determine the entity's type, use the entityScenario and entityTypeHint + fields. + :vartype entity_presentation_info: + ~azure.cognitiveservices.search.entitysearch.models.EntitiesEntityPresentationInfo + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar address: The postal address of where the entity is located + :vartype address: + ~azure.cognitiveservices.search.entitysearch.models.PostalAddress + :ivar telephone: The entity's telephone number + :vartype telephone: str + :ivar price_range: $$. + :vartype price_range: str + :ivar panoramas: + :vartype panoramas: + list[~azure.cognitiveservices.search.entitysearch.models.ImageObject] + :ivar is_permanently_closed: + :vartype is_permanently_closed: bool + :ivar tag_line: + :vartype tag_line: str + :ivar accepts_reservations: + :vartype accepts_reservations: bool + :ivar reservation_url: + :vartype reservation_url: str + :ivar serves_cuisine: + :vartype serves_cuisine: list[str] + :ivar menu_url: + :vartype menu_url: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'contractual_rules': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'entity_presentation_info': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'address': {'readonly': True}, + 'telephone': {'readonly': True}, + 'price_range': {'readonly': True}, + 'panoramas': {'readonly': True}, + 'is_permanently_closed': {'readonly': True}, + 'tag_line': {'readonly': True}, + 'accepts_reservations': {'readonly': True}, + 'reservation_url': {'readonly': True}, + 'serves_cuisine': {'readonly': True}, + 'menu_url': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'contractual_rules': {'key': 'contractualRules', 'type': '[ContractualRulesContractualRule]'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'entity_presentation_info': {'key': 'entityPresentationInfo', 'type': 'EntitiesEntityPresentationInfo'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'PostalAddress'}, + 'telephone': {'key': 'telephone', 'type': 'str'}, + 'price_range': {'key': 'priceRange', 'type': 'str'}, + 'panoramas': {'key': 'panoramas', 'type': '[ImageObject]'}, + 'is_permanently_closed': {'key': 'isPermanentlyClosed', 'type': 'bool'}, + 'tag_line': {'key': 'tagLine', 'type': 'str'}, + 'accepts_reservations': {'key': 'acceptsReservations', 'type': 'bool'}, + 'reservation_url': {'key': 'reservationUrl', 'type': 'str'}, + 'serves_cuisine': {'key': 'servesCuisine', 'type': '[str]'}, + 'menu_url': {'key': 'menuUrl', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Restaurant, self).__init__(**kwargs) + self.accepts_reservations = None + self.reservation_url = None + self.serves_cuisine = None + self.menu_url = None + self._type = 'Restaurant' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/search_response.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/search_response.py index 9284d8ac4a89..d593432f49ee 100644 --- a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/search_response.py +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/search_response.py @@ -19,7 +19,9 @@ class SearchResponse(Response): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -64,8 +66,8 @@ class SearchResponse(Response): 'places': {'key': 'places', 'type': 'Places'}, } - def __init__(self): - super(SearchResponse, self).__init__() + def __init__(self, **kwargs): + super(SearchResponse, self).__init__(**kwargs) self.query_context = None self.entities = None self.places = None diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/search_response_py3.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/search_response_py3.py new file mode 100644 index 000000000000..f2f3d33ce6e5 --- /dev/null +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/search_response_py3.py @@ -0,0 +1,74 @@ +# 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 .response import Response + + +class SearchResponse(Response): + """Defines the top-level object that the response includes when the request + succeeds. + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar contractual_rules: A list of rules that you must adhere to if you + display the item. + :vartype contractual_rules: + list[~azure.cognitiveservices.search.entitysearch.models.ContractualRulesContractualRule] + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar query_context: An object that contains the query string that Bing + used for the request. This object contains the query string as entered by + the user. It may also contain an altered query string that Bing used for + the query if the query string contained a spelling mistake. + :vartype query_context: + ~azure.cognitiveservices.search.entitysearch.models.QueryContext + :ivar entities: A list of entities that are relevant to the search query. + :vartype entities: + ~azure.cognitiveservices.search.entitysearch.models.Entities + :ivar places: A list of local entities such as restaurants or hotels that + are relevant to the query. + :vartype places: + ~azure.cognitiveservices.search.entitysearch.models.Places + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'contractual_rules': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'query_context': {'readonly': True}, + 'entities': {'readonly': True}, + 'places': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'contractual_rules': {'key': 'contractualRules', 'type': '[ContractualRulesContractualRule]'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'query_context': {'key': 'queryContext', 'type': 'QueryContext'}, + 'entities': {'key': 'entities', 'type': 'Entities'}, + 'places': {'key': 'places', 'type': 'Places'}, + } + + def __init__(self, **kwargs) -> None: + super(SearchResponse, self).__init__(**kwargs) + self.query_context = None + self.entities = None + self.places = None + self._type = 'SearchResponse' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/search_results_answer.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/search_results_answer.py index fc7e5c3473cc..9605c7659384 100644 --- a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/search_results_answer.py +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/search_results_answer.py @@ -21,7 +21,9 @@ class SearchResultsAnswer(Answer): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -56,7 +58,7 @@ class SearchResultsAnswer(Answer): '_type': {'Entities': 'Entities', 'Places': 'Places'} } - def __init__(self): - super(SearchResultsAnswer, self).__init__() + def __init__(self, **kwargs): + super(SearchResultsAnswer, self).__init__(**kwargs) self.query_context = None self._type = 'SearchResultsAnswer' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/search_results_answer_py3.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/search_results_answer_py3.py new file mode 100644 index 000000000000..ba96bdafff5b --- /dev/null +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/search_results_answer_py3.py @@ -0,0 +1,64 @@ +# 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 .answer import Answer + + +class SearchResultsAnswer(Answer): + """SearchResultsAnswer. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: Entities, Places + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar contractual_rules: A list of rules that you must adhere to if you + display the item. + :vartype contractual_rules: + list[~azure.cognitiveservices.search.entitysearch.models.ContractualRulesContractualRule] + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar query_context: + :vartype query_context: + ~azure.cognitiveservices.search.entitysearch.models.QueryContext + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'contractual_rules': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'query_context': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'contractual_rules': {'key': 'contractualRules', 'type': '[ContractualRulesContractualRule]'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'query_context': {'key': 'queryContext', 'type': 'QueryContext'}, + } + + _subtype_map = { + '_type': {'Entities': 'Entities', 'Places': 'Places'} + } + + def __init__(self, **kwargs) -> None: + super(SearchResultsAnswer, self).__init__(**kwargs) + self.query_context = None + self._type = 'SearchResultsAnswer' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/structured_value.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/structured_value.py index 54afb2e5e7a9..c76251bf1a59 100644 --- a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/structured_value.py +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/structured_value.py @@ -21,7 +21,9 @@ class StructuredValue(Intangible): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -64,10 +66,23 @@ class StructuredValue(Intangible): 'bing_id': {'readonly': True}, } + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'contractual_rules': {'key': 'contractualRules', 'type': '[ContractualRulesContractualRule]'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'entity_presentation_info': {'key': 'entityPresentationInfo', 'type': 'EntitiesEntityPresentationInfo'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + } + _subtype_map = { '_type': {'PostalAddress': 'PostalAddress'} } - def __init__(self): - super(StructuredValue, self).__init__() + def __init__(self, **kwargs): + super(StructuredValue, self).__init__(**kwargs) self._type = 'StructuredValue' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/structured_value_py3.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/structured_value_py3.py new file mode 100644 index 000000000000..889fa719399d --- /dev/null +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/structured_value_py3.py @@ -0,0 +1,88 @@ +# 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 .intangible import Intangible + + +class StructuredValue(Intangible): + """StructuredValue. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: PostalAddress + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar contractual_rules: A list of rules that you must adhere to if you + display the item. + :vartype contractual_rules: + list[~azure.cognitiveservices.search.entitysearch.models.ContractualRulesContractualRule] + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: + :vartype image: + ~azure.cognitiveservices.search.entitysearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar entity_presentation_info: Additional information about the entity + such as hints that you can use to determine the entity's type. To + determine the entity's type, use the entityScenario and entityTypeHint + fields. + :vartype entity_presentation_info: + ~azure.cognitiveservices.search.entitysearch.models.EntitiesEntityPresentationInfo + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'contractual_rules': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'entity_presentation_info': {'readonly': True}, + 'bing_id': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'contractual_rules': {'key': 'contractualRules', 'type': '[ContractualRulesContractualRule]'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'entity_presentation_info': {'key': 'entityPresentationInfo', 'type': 'EntitiesEntityPresentationInfo'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'PostalAddress': 'PostalAddress'} + } + + def __init__(self, **kwargs) -> None: + super(StructuredValue, self).__init__(**kwargs) + self._type = 'StructuredValue' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/thing.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/thing.py index 19b013332047..3a5729a60f2b 100644 --- a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/thing.py +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/thing.py @@ -21,7 +21,9 @@ class Thing(Response): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -81,8 +83,8 @@ class Thing(Response): '_type': {'Place': 'Place', 'Organization': 'Organization', 'CreativeWork': 'CreativeWork', 'Intangible': 'Intangible'} } - def __init__(self): - super(Thing, self).__init__() + def __init__(self, **kwargs): + super(Thing, self).__init__(**kwargs) self.name = None self.url = None self.image = None diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/thing_py3.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/thing_py3.py new file mode 100644 index 000000000000..9faea48431a3 --- /dev/null +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/thing_py3.py @@ -0,0 +1,94 @@ +# 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 .response import Response + + +class Thing(Response): + """Thing. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: Place, Organization, CreativeWork, Intangible + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar contractual_rules: A list of rules that you must adhere to if you + display the item. + :vartype contractual_rules: + list[~azure.cognitiveservices.search.entitysearch.models.ContractualRulesContractualRule] + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: + :vartype image: + ~azure.cognitiveservices.search.entitysearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar entity_presentation_info: Additional information about the entity + such as hints that you can use to determine the entity's type. To + determine the entity's type, use the entityScenario and entityTypeHint + fields. + :vartype entity_presentation_info: + ~azure.cognitiveservices.search.entitysearch.models.EntitiesEntityPresentationInfo + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'contractual_rules': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'entity_presentation_info': {'readonly': True}, + 'bing_id': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'contractual_rules': {'key': 'contractualRules', 'type': '[ContractualRulesContractualRule]'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'entity_presentation_info': {'key': 'entityPresentationInfo', 'type': 'EntitiesEntityPresentationInfo'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'Place': 'Place', 'Organization': 'Organization', 'CreativeWork': 'CreativeWork', 'Intangible': 'Intangible'} + } + + def __init__(self, **kwargs) -> None: + super(Thing, self).__init__(**kwargs) + self.name = None + self.url = None + self.image = None + self.description = None + self.entity_presentation_info = None + self.bing_id = None + self._type = 'Thing' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/tourist_attraction.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/tourist_attraction.py index 9f6b508dd9f2..1b7e52743cea 100644 --- a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/tourist_attraction.py +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/tourist_attraction.py @@ -18,7 +18,9 @@ class TouristAttraction(Place): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -68,6 +70,21 @@ class TouristAttraction(Place): 'telephone': {'readonly': True}, } - def __init__(self): - super(TouristAttraction, self).__init__() + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'contractual_rules': {'key': 'contractualRules', 'type': '[ContractualRulesContractualRule]'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'entity_presentation_info': {'key': 'entityPresentationInfo', 'type': 'EntitiesEntityPresentationInfo'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'PostalAddress'}, + 'telephone': {'key': 'telephone', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TouristAttraction, self).__init__(**kwargs) self._type = 'TouristAttraction' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/tourist_attraction_py3.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/tourist_attraction_py3.py new file mode 100644 index 000000000000..1217039bdce8 --- /dev/null +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/models/tourist_attraction_py3.py @@ -0,0 +1,90 @@ +# 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 .place import Place + + +class TouristAttraction(Place): + """TouristAttraction. + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar contractual_rules: A list of rules that you must adhere to if you + display the item. + :vartype contractual_rules: + list[~azure.cognitiveservices.search.entitysearch.models.ContractualRulesContractualRule] + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: + :vartype image: + ~azure.cognitiveservices.search.entitysearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar entity_presentation_info: Additional information about the entity + such as hints that you can use to determine the entity's type. To + determine the entity's type, use the entityScenario and entityTypeHint + fields. + :vartype entity_presentation_info: + ~azure.cognitiveservices.search.entitysearch.models.EntitiesEntityPresentationInfo + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar address: The postal address of where the entity is located + :vartype address: + ~azure.cognitiveservices.search.entitysearch.models.PostalAddress + :ivar telephone: The entity's telephone number + :vartype telephone: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'contractual_rules': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'entity_presentation_info': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'address': {'readonly': True}, + 'telephone': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'contractual_rules': {'key': 'contractualRules', 'type': '[ContractualRulesContractualRule]'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'entity_presentation_info': {'key': 'entityPresentationInfo', 'type': 'EntitiesEntityPresentationInfo'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'PostalAddress'}, + 'telephone': {'key': 'telephone', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(TouristAttraction, self).__init__(**kwargs) + self._type = 'TouristAttraction' diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/operations/entities_operations.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/operations/entities_operations.py index 80c651bdb2bb..685d86b8ff1b 100644 --- a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/operations/entities_operations.py +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/operations/entities_operations.py @@ -230,7 +230,7 @@ def search( :class:`ErrorResponseException` """ # Construct URL - url = '/entities' + url = self.search.metadata['url'] # Construct parameters query_parameters = {} @@ -284,3 +284,4 @@ def search( return client_raw_response return deserialized + search.metadata = {'url': '/entities'} diff --git a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/version.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/version.py index e0ec669828cb..63d89bfb54fa 100644 --- a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/version.py +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/entitysearch/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.1.0" +VERSION = "1.0" diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/image_search_api.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/image_search_api.py index 999b8b51091d..8ff1ef3ca8ff 100644 --- a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/image_search_api.py +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/image_search_api.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import ServiceClient +from msrest.service_client import SDKClient from msrest import Configuration, Serializer, Deserializer from .version import VERSION from .operations.images_operations import ImagesOperations @@ -42,7 +42,7 @@ def __init__( self.credentials = credentials -class ImageSearchAPI(object): +class ImageSearchAPI(SDKClient): """The Image Search API lets you send a search query to Bing and get back a list of relevant images. This section provides technical details about the query parameters and headers that you use to request images and the JSON response objects that contain them. For examples that show how to make requests, see [Searching the Web for Images](https://docs.microsoft.com/azure/cognitive-services/bing-image-search/search-the-web). :ivar config: Configuration for client. @@ -61,7 +61,7 @@ def __init__( self, credentials, base_url=None): self.config = ImageSearchAPIConfiguration(credentials, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + super(ImageSearchAPI, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self.api_version = '1.0' diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/__init__.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/__init__.py index 76ba92c518e1..8abe388f0610 100644 --- a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/__init__.py +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/__init__.py @@ -9,50 +9,96 @@ # regenerated. # -------------------------------------------------------------------------- -from .organization import Organization -from .aggregate_rating import AggregateRating -from .offer import Offer -from .aggregate_offer import AggregateOffer -from .images_image_metadata import ImagesImageMetadata -from .image_object import ImageObject -from .query import Query -from .pivot_suggestions import PivotSuggestions -from .images import Images -from .search_results_answer import SearchResultsAnswer -from .answer import Answer -from .media_object import MediaObject -from .response import Response -from .thing import Thing -from .creative_work import CreativeWork -from .identifiable import Identifiable -from .error import Error -from .error_response import ErrorResponse, ErrorResponseException -from .image_insights_image_caption import ImageInsightsImageCaption -from .image_gallery import ImageGallery -from .related_collections_module import RelatedCollectionsModule -from .images_module import ImagesModule -from .related_searches_module import RelatedSearchesModule -from .recipe import Recipe -from .recipes_module import RecipesModule -from .normalized_rectangle import NormalizedRectangle -from .recognized_entity import RecognizedEntity -from .recognized_entity_region import RecognizedEntityRegion -from .recognized_entity_group import RecognizedEntityGroup -from .recognized_entities_module import RecognizedEntitiesModule -from .insights_tag import InsightsTag -from .image_tags_module import ImageTagsModule -from .image_insights import ImageInsights -from .trending_images_tile import TrendingImagesTile -from .trending_images_category import TrendingImagesCategory -from .trending_images import TrendingImages -from .properties_item import PropertiesItem -from .web_page import WebPage -from .response_base import ResponseBase -from .person import Person -from .intangible import Intangible -from .rating import Rating -from .collection_page import CollectionPage -from .structured_value import StructuredValue +try: + from .organization_py3 import Organization + from .aggregate_rating_py3 import AggregateRating + from .offer_py3 import Offer + from .aggregate_offer_py3 import AggregateOffer + from .images_image_metadata_py3 import ImagesImageMetadata + from .image_object_py3 import ImageObject + from .query_py3 import Query + from .pivot_suggestions_py3 import PivotSuggestions + from .images_py3 import Images + from .search_results_answer_py3 import SearchResultsAnswer + from .answer_py3 import Answer + from .media_object_py3 import MediaObject + from .response_py3 import Response + from .thing_py3 import Thing + from .creative_work_py3 import CreativeWork + from .identifiable_py3 import Identifiable + from .error_py3 import Error + from .error_response_py3 import ErrorResponse, ErrorResponseException + from .image_insights_image_caption_py3 import ImageInsightsImageCaption + from .image_gallery_py3 import ImageGallery + from .related_collections_module_py3 import RelatedCollectionsModule + from .images_module_py3 import ImagesModule + from .related_searches_module_py3 import RelatedSearchesModule + from .recipe_py3 import Recipe + from .recipes_module_py3 import RecipesModule + from .normalized_rectangle_py3 import NormalizedRectangle + from .recognized_entity_py3 import RecognizedEntity + from .recognized_entity_region_py3 import RecognizedEntityRegion + from .recognized_entity_group_py3 import RecognizedEntityGroup + from .recognized_entities_module_py3 import RecognizedEntitiesModule + from .insights_tag_py3 import InsightsTag + from .image_tags_module_py3 import ImageTagsModule + from .image_insights_py3 import ImageInsights + from .trending_images_tile_py3 import TrendingImagesTile + from .trending_images_category_py3 import TrendingImagesCategory + from .trending_images_py3 import TrendingImages + from .properties_item_py3 import PropertiesItem + from .web_page_py3 import WebPage + from .response_base_py3 import ResponseBase + from .person_py3 import Person + from .intangible_py3 import Intangible + from .rating_py3 import Rating + from .collection_page_py3 import CollectionPage + from .structured_value_py3 import StructuredValue +except (SyntaxError, ImportError): + from .organization import Organization + from .aggregate_rating import AggregateRating + from .offer import Offer + from .aggregate_offer import AggregateOffer + from .images_image_metadata import ImagesImageMetadata + from .image_object import ImageObject + from .query import Query + from .pivot_suggestions import PivotSuggestions + from .images import Images + from .search_results_answer import SearchResultsAnswer + from .answer import Answer + from .media_object import MediaObject + from .response import Response + from .thing import Thing + from .creative_work import CreativeWork + from .identifiable import Identifiable + from .error import Error + from .error_response import ErrorResponse, ErrorResponseException + from .image_insights_image_caption import ImageInsightsImageCaption + from .image_gallery import ImageGallery + from .related_collections_module import RelatedCollectionsModule + from .images_module import ImagesModule + from .related_searches_module import RelatedSearchesModule + from .recipe import Recipe + from .recipes_module import RecipesModule + from .normalized_rectangle import NormalizedRectangle + from .recognized_entity import RecognizedEntity + from .recognized_entity_region import RecognizedEntityRegion + from .recognized_entity_group import RecognizedEntityGroup + from .recognized_entities_module import RecognizedEntitiesModule + from .insights_tag import InsightsTag + from .image_tags_module import ImageTagsModule + from .image_insights import ImageInsights + from .trending_images_tile import TrendingImagesTile + from .trending_images_category import TrendingImagesCategory + from .trending_images import TrendingImages + from .properties_item import PropertiesItem + from .web_page import WebPage + from .response_base import ResponseBase + from .person import Person + from .intangible import Intangible + from .rating import Rating + from .collection_page import CollectionPage + from .structured_value import StructuredValue from .image_search_api_enums import ( Currency, ItemAvailability, diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/aggregate_offer.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/aggregate_offer.py index 7d84fd7c4174..ec7a2c53d066 100644 --- a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/aggregate_offer.py +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/aggregate_offer.py @@ -18,7 +18,9 @@ class AggregateOffer(Offer): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -125,7 +127,7 @@ class AggregateOffer(Offer): 'offers': {'key': 'offers', 'type': '[Offer]'}, } - def __init__(self): - super(AggregateOffer, self).__init__() + def __init__(self, **kwargs): + super(AggregateOffer, self).__init__(**kwargs) self.offers = None self._type = 'AggregateOffer' diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/aggregate_offer_py3.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/aggregate_offer_py3.py new file mode 100644 index 000000000000..c47117c42873 --- /dev/null +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/aggregate_offer_py3.py @@ -0,0 +1,133 @@ +# 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 .offer import Offer + + +class AggregateOffer(Offer): + """Defines a list of offers from merchants that are related to the image. + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. + :vartype read_link: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.imagesearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar seller: Seller for this offer + :vartype seller: + ~azure.cognitiveservices.search.imagesearch.models.Organization + :ivar price: The item's price. + :vartype price: float + :ivar price_currency: The monetary currency. For example, USD. Possible + values include: 'USD', 'CAD', 'GBP', 'EUR', 'COP', 'JPY', 'CNY', 'AUD', + 'INR', 'AED', 'AFN', 'ALL', 'AMD', 'ANG', 'AOA', 'ARS', 'AWG', 'AZN', + 'BAM', 'BBD', 'BDT', 'BGN', 'BHD', 'BIF', 'BMD', 'BND', 'BOB', 'BOV', + 'BRL', 'BSD', 'BTN', 'BWP', 'BYR', 'BZD', 'CDF', 'CHE', 'CHF', 'CHW', + 'CLF', 'CLP', 'COU', 'CRC', 'CUC', 'CUP', 'CVE', 'CZK', 'DJF', 'DKK', + 'DOP', 'DZD', 'EGP', 'ERN', 'ETB', 'FJD', 'FKP', 'GEL', 'GHS', 'GIP', + 'GMD', 'GNF', 'GTQ', 'GYD', 'HKD', 'HNL', 'HRK', 'HTG', 'HUF', 'IDR', + 'ILS', 'IQD', 'IRR', 'ISK', 'JMD', 'JOD', 'KES', 'KGS', 'KHR', 'KMF', + 'KPW', 'KRW', 'KWD', 'KYD', 'KZT', 'LAK', 'LBP', 'LKR', 'LRD', 'LSL', + 'LYD', 'MAD', 'MDL', 'MGA', 'MKD', 'MMK', 'MNT', 'MOP', 'MRO', 'MUR', + 'MVR', 'MWK', 'MXN', 'MXV', 'MYR', 'MZN', 'NAD', 'NGN', 'NIO', 'NOK', + 'NPR', 'NZD', 'OMR', 'PAB', 'PEN', 'PGK', 'PHP', 'PKR', 'PLN', 'PYG', + 'QAR', 'RON', 'RSD', 'RUB', 'RWF', 'SAR', 'SBD', 'SCR', 'SDG', 'SEK', + 'SGD', 'SHP', 'SLL', 'SOS', 'SRD', 'SSP', 'STD', 'SYP', 'SZL', 'THB', + 'TJS', 'TMT', 'TND', 'TOP', 'TRY', 'TTD', 'TWD', 'TZS', 'UAH', 'UGX', + 'UYU', 'UZS', 'VEF', 'VND', 'VUV', 'WST', 'XAF', 'XCD', 'XOF', 'XPF', + 'YER', 'ZAR', 'ZMW'. Default value: "USD" . + :vartype price_currency: str or + ~azure.cognitiveservices.search.imagesearch.models.Currency + :ivar availability: The item's availability. The following are the + possible values: Discontinued, InStock, InStoreOnly, LimitedAvailability, + OnlineOnly, OutOfStock, PreOrder, SoldOut. Possible values include: + 'Discontinued', 'InStock', 'InStoreOnly', 'LimitedAvailability', + 'OnlineOnly', 'OutOfStock', 'PreOrder', 'SoldOut' + :vartype availability: str or + ~azure.cognitiveservices.search.imagesearch.models.ItemAvailability + :ivar aggregate_rating: An aggregated rating that indicates how well the + product has been rated by others. + :vartype aggregate_rating: + ~azure.cognitiveservices.search.imagesearch.models.AggregateRating + :ivar last_updated: The last date that the offer was updated. The date is + in the form YYYY-MM-DD. + :vartype last_updated: str + :ivar offers: A list of offers from merchants that have offerings related + to the image. + :vartype offers: + list[~azure.cognitiveservices.search.imagesearch.models.Offer] + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'seller': {'readonly': True}, + 'price': {'readonly': True}, + 'price_currency': {'readonly': True}, + 'availability': {'readonly': True}, + 'aggregate_rating': {'readonly': True}, + 'last_updated': {'readonly': True}, + 'offers': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'seller': {'key': 'seller', 'type': 'Organization'}, + 'price': {'key': 'price', 'type': 'float'}, + 'price_currency': {'key': 'priceCurrency', 'type': 'str'}, + 'availability': {'key': 'availability', 'type': 'str'}, + 'aggregate_rating': {'key': 'aggregateRating', 'type': 'AggregateRating'}, + 'last_updated': {'key': 'lastUpdated', 'type': 'str'}, + 'offers': {'key': 'offers', 'type': '[Offer]'}, + } + + def __init__(self, **kwargs) -> None: + super(AggregateOffer, self).__init__(**kwargs) + self.offers = None + self._type = 'AggregateOffer' diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/aggregate_rating.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/aggregate_rating.py index 15ad6dec51e3..288a2a2d0ea4 100644 --- a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/aggregate_rating.py +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/aggregate_rating.py @@ -18,12 +18,14 @@ class AggregateRating(Rating): 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 Azure. + :ivar text: Text representation of an item. :vartype text: str - :param _type: Constant filled by server. + :param _type: Required. Constant filled by server. :type _type: str - :param rating_value: The mean (average) rating. The possible values are - 1.0 through 5.0. + :param rating_value: Required. The mean (average) rating. The possible + values are 1.0 through 5.0. :type rating_value: float :ivar best_rating: The highest rated review. The possible values are 1.0 through 5.0. @@ -49,7 +51,7 @@ class AggregateRating(Rating): 'review_count': {'key': 'reviewCount', 'type': 'int'}, } - def __init__(self, rating_value): - super(AggregateRating, self).__init__(rating_value=rating_value) + def __init__(self, **kwargs): + super(AggregateRating, self).__init__(**kwargs) self.review_count = None self._type = 'AggregateRating' diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/aggregate_rating_py3.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/aggregate_rating_py3.py new file mode 100644 index 000000000000..ec4fe8aec9f7 --- /dev/null +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/aggregate_rating_py3.py @@ -0,0 +1,57 @@ +# 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 .rating import Rating + + +class AggregateRating(Rating): + """Defines the metrics that indicate how well an item was rated by others. + + 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 Azure. + + :ivar text: Text representation of an item. + :vartype text: str + :param _type: Required. Constant filled by server. + :type _type: str + :param rating_value: Required. The mean (average) rating. The possible + values are 1.0 through 5.0. + :type rating_value: float + :ivar best_rating: The highest rated review. The possible values are 1.0 + through 5.0. + :vartype best_rating: float + :ivar review_count: The number of times the recipe has been rated or + reviewed. + :vartype review_count: int + """ + + _validation = { + 'text': {'readonly': True}, + '_type': {'required': True}, + 'rating_value': {'required': True}, + 'best_rating': {'readonly': True}, + 'review_count': {'readonly': True}, + } + + _attribute_map = { + 'text': {'key': 'text', 'type': 'str'}, + '_type': {'key': '_type', 'type': 'str'}, + 'rating_value': {'key': 'ratingValue', 'type': 'float'}, + 'best_rating': {'key': 'bestRating', 'type': 'float'}, + 'review_count': {'key': 'reviewCount', 'type': 'int'}, + } + + def __init__(self, *, rating_value: float, **kwargs) -> None: + super(AggregateRating, self).__init__(rating_value=rating_value, **kwargs) + self.review_count = None + self._type = 'AggregateRating' diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/answer.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/answer.py index a8efff8f0d6b..d3c464d0ffc7 100644 --- a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/answer.py +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/answer.py @@ -21,7 +21,9 @@ class Answer(Response): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -38,10 +40,17 @@ class Answer(Response): 'web_search_url': {'readonly': True}, } + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + } + _subtype_map = { '_type': {'SearchResultsAnswer': 'SearchResultsAnswer'} } - def __init__(self): - super(Answer, self).__init__() + def __init__(self, **kwargs): + super(Answer, self).__init__(**kwargs) self._type = 'Answer' diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/answer_py3.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/answer_py3.py new file mode 100644 index 000000000000..d7d5df488ee5 --- /dev/null +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/answer_py3.py @@ -0,0 +1,56 @@ +# 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 .response import Response + + +class Answer(Response): + """Defines an answer. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: SearchResultsAnswer + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. + :vartype read_link: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'SearchResultsAnswer': 'SearchResultsAnswer'} + } + + def __init__(self, **kwargs) -> None: + super(Answer, self).__init__(**kwargs) + self._type = 'Answer' diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/collection_page.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/collection_page.py index 4a95d2708866..a94de2ed640d 100644 --- a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/collection_page.py +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/collection_page.py @@ -21,7 +21,9 @@ class CollectionPage(WebPage): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -71,10 +73,27 @@ class CollectionPage(WebPage): 'text': {'readonly': True}, } + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'thumbnail_url': {'key': 'thumbnailUrl', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': '[Thing]'}, + 'date_published': {'key': 'datePublished', 'type': 'str'}, + 'text': {'key': 'text', 'type': 'str'}, + } + _subtype_map = { '_type': {'ImageGallery': 'ImageGallery'} } - def __init__(self): - super(CollectionPage, self).__init__() + def __init__(self, **kwargs): + super(CollectionPage, self).__init__(**kwargs) self._type = 'CollectionPage' diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/collection_page_py3.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/collection_page_py3.py new file mode 100644 index 000000000000..94b42baa7a74 --- /dev/null +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/collection_page_py3.py @@ -0,0 +1,99 @@ +# 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 .web_page import WebPage + + +class CollectionPage(WebPage): + """Defines a link to a webpage that contains a collection. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ImageGallery + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. + :vartype read_link: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.imagesearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar thumbnail_url: The URL to a thumbnail of the item. + :vartype thumbnail_url: str + :ivar provider: The source of the creative work. + :vartype provider: + list[~azure.cognitiveservices.search.imagesearch.models.Thing] + :ivar date_published: The date on which the CreativeWork was published. + :vartype date_published: str + :ivar text: Text content of this creative work + :vartype text: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'thumbnail_url': {'readonly': True}, + 'provider': {'readonly': True}, + 'date_published': {'readonly': True}, + 'text': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'thumbnail_url': {'key': 'thumbnailUrl', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': '[Thing]'}, + 'date_published': {'key': 'datePublished', 'type': 'str'}, + 'text': {'key': 'text', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'ImageGallery': 'ImageGallery'} + } + + def __init__(self, **kwargs) -> None: + super(CollectionPage, self).__init__(**kwargs) + self._type = 'CollectionPage' diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/creative_work.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/creative_work.py index 44831fdf5b7a..d9f42656bdde 100644 --- a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/creative_work.py +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/creative_work.py @@ -22,7 +22,9 @@ class CreativeWork(Thing): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -93,8 +95,8 @@ class CreativeWork(Thing): '_type': {'MediaObject': 'MediaObject', 'Recipe': 'Recipe', 'WebPage': 'WebPage'} } - def __init__(self): - super(CreativeWork, self).__init__() + def __init__(self, **kwargs): + super(CreativeWork, self).__init__(**kwargs) self.thumbnail_url = None self.provider = None self.date_published = None diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/creative_work_py3.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/creative_work_py3.py new file mode 100644 index 000000000000..cc4b45c27e1d --- /dev/null +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/creative_work_py3.py @@ -0,0 +1,104 @@ +# 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 .thing import Thing + + +class CreativeWork(Thing): + """The most generic kind of creative work, including books, movies, + photographs, software programs, etc. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: MediaObject, Recipe, WebPage + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. + :vartype read_link: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.imagesearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar thumbnail_url: The URL to a thumbnail of the item. + :vartype thumbnail_url: str + :ivar provider: The source of the creative work. + :vartype provider: + list[~azure.cognitiveservices.search.imagesearch.models.Thing] + :ivar date_published: The date on which the CreativeWork was published. + :vartype date_published: str + :ivar text: Text content of this creative work + :vartype text: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'thumbnail_url': {'readonly': True}, + 'provider': {'readonly': True}, + 'date_published': {'readonly': True}, + 'text': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'thumbnail_url': {'key': 'thumbnailUrl', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': '[Thing]'}, + 'date_published': {'key': 'datePublished', 'type': 'str'}, + 'text': {'key': 'text', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'MediaObject': 'MediaObject', 'Recipe': 'Recipe', 'WebPage': 'WebPage'} + } + + def __init__(self, **kwargs) -> None: + super(CreativeWork, self).__init__(**kwargs) + self.thumbnail_url = None + self.provider = None + self.date_published = None + self.text = None + self._type = 'CreativeWork' diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/error.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/error.py index f8bdfee4bf2c..9b7b2cb42b2f 100644 --- a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/error.py +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/error.py @@ -18,8 +18,10 @@ class Error(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param code: The error code that identifies the category of error. - Possible values include: 'None', 'ServerError', 'InvalidRequest', + All required parameters must be populated in order to send to Azure. + + :param code: Required. The error code that identifies the category of + error. Possible values include: 'None', 'ServerError', 'InvalidRequest', 'RateLimitExceeded', 'InvalidAuthorization', 'InsufficientAuthorization'. Default value: "None" . :type code: str or @@ -31,7 +33,7 @@ class Error(Model): 'AuthorizationRedundancy', 'AuthorizationDisabled', 'AuthorizationExpired' :vartype sub_code: str or ~azure.cognitiveservices.search.imagesearch.models.ErrorSubCode - :param message: A description of the error. + :param message: Required. A description of the error. :type message: str :ivar more_details: A description that provides additional information about the error. @@ -60,11 +62,11 @@ class Error(Model): 'value': {'key': 'value', 'type': 'str'}, } - def __init__(self, message, code="None"): - super(Error, self).__init__() - self.code = code + def __init__(self, **kwargs): + super(Error, self).__init__(**kwargs) + self.code = kwargs.get('code', "None") self.sub_code = None - self.message = message + self.message = kwargs.get('message', None) self.more_details = None self.parameter = None self.value = None diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/error_py3.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/error_py3.py new file mode 100644 index 000000000000..30270cc26758 --- /dev/null +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/error_py3.py @@ -0,0 +1,72 @@ +# 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 msrest.serialization import Model + + +class Error(Model): + """Defines the error that occurred. + + 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 Azure. + + :param code: Required. The error code that identifies the category of + error. Possible values include: 'None', 'ServerError', 'InvalidRequest', + 'RateLimitExceeded', 'InvalidAuthorization', 'InsufficientAuthorization'. + Default value: "None" . + :type code: str or + ~azure.cognitiveservices.search.imagesearch.models.ErrorCode + :ivar sub_code: The error code that further helps to identify the error. + Possible values include: 'UnexpectedError', 'ResourceError', + 'NotImplemented', 'ParameterMissing', 'ParameterInvalidValue', + 'HttpNotAllowed', 'Blocked', 'AuthorizationMissing', + 'AuthorizationRedundancy', 'AuthorizationDisabled', 'AuthorizationExpired' + :vartype sub_code: str or + ~azure.cognitiveservices.search.imagesearch.models.ErrorSubCode + :param message: Required. A description of the error. + :type message: str + :ivar more_details: A description that provides additional information + about the error. + :vartype more_details: str + :ivar parameter: The parameter in the request that caused the error. + :vartype parameter: str + :ivar value: The parameter's value in the request that was not valid. + :vartype value: str + """ + + _validation = { + 'code': {'required': True}, + 'sub_code': {'readonly': True}, + 'message': {'required': True}, + 'more_details': {'readonly': True}, + 'parameter': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'sub_code': {'key': 'subCode', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'more_details': {'key': 'moreDetails', 'type': 'str'}, + 'parameter': {'key': 'parameter', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, message: str, code="None", **kwargs) -> None: + super(Error, self).__init__(**kwargs) + self.code = code + self.sub_code = None + self.message = message + self.more_details = None + self.parameter = None + self.value = None diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/error_response.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/error_response.py index 022bfebb328f..afd3e0c64eb0 100644 --- a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/error_response.py +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/error_response.py @@ -19,7 +19,9 @@ class ErrorResponse(Response): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -27,8 +29,8 @@ class ErrorResponse(Response): :vartype read_link: str :ivar web_search_url: The URL To Bing's search result for this item. :vartype web_search_url: str - :param errors: A list of errors that describe the reasons why the request - failed. + :param errors: Required. A list of errors that describe the reasons why + the request failed. :type errors: list[~azure.cognitiveservices.search.imagesearch.models.Error] """ @@ -49,9 +51,9 @@ class ErrorResponse(Response): 'errors': {'key': 'errors', 'type': '[Error]'}, } - def __init__(self, errors): - super(ErrorResponse, self).__init__() - self.errors = errors + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.errors = kwargs.get('errors', None) self._type = 'ErrorResponse' diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/error_response_py3.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/error_response_py3.py new file mode 100644 index 000000000000..f3e9d9de27fe --- /dev/null +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/error_response_py3.py @@ -0,0 +1,69 @@ +# 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 .response import Response +from msrest.exceptions import HttpOperationError + + +class ErrorResponse(Response): + """The top-level response that represents a failed request. + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. + :vartype read_link: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :param errors: Required. A list of errors that describe the reasons why + the request failed. + :type errors: + list[~azure.cognitiveservices.search.imagesearch.models.Error] + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'errors': {'required': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'errors': {'key': 'errors', 'type': '[Error]'}, + } + + def __init__(self, *, errors, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.errors = errors + self._type = 'ErrorResponse' + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/identifiable.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/identifiable.py index 133e93fa8f94..513e53d238bb 100644 --- a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/identifiable.py +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/identifiable.py @@ -21,7 +21,9 @@ class Identifiable(ResponseBase): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -41,7 +43,7 @@ class Identifiable(ResponseBase): '_type': {'Response': 'Response'} } - def __init__(self): - super(Identifiable, self).__init__() + def __init__(self, **kwargs): + super(Identifiable, self).__init__(**kwargs) self.id = None self._type = 'Identifiable' diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/identifiable_py3.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/identifiable_py3.py new file mode 100644 index 000000000000..c87dc0347e3d --- /dev/null +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/identifiable_py3.py @@ -0,0 +1,49 @@ +# 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 .response_base import ResponseBase + + +class Identifiable(ResponseBase): + """Defines the identity of a resource. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: Response + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'Response': 'Response'} + } + + def __init__(self, **kwargs) -> None: + super(Identifiable, self).__init__(**kwargs) + self.id = None + self._type = 'Identifiable' diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/image_gallery.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/image_gallery.py index 9ffbb7142411..54573b4d0a5a 100644 --- a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/image_gallery.py +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/image_gallery.py @@ -18,7 +18,9 @@ class ImageGallery(CollectionPage): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -100,8 +102,8 @@ class ImageGallery(CollectionPage): 'followers_count': {'key': 'followersCount', 'type': 'long'}, } - def __init__(self): - super(ImageGallery, self).__init__() + def __init__(self, **kwargs): + super(ImageGallery, self).__init__(**kwargs) self.source = None self.images_count = None self.followers_count = None diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/image_gallery_py3.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/image_gallery_py3.py new file mode 100644 index 000000000000..c000f3a264f7 --- /dev/null +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/image_gallery_py3.py @@ -0,0 +1,110 @@ +# 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 .collection_page import CollectionPage + + +class ImageGallery(CollectionPage): + """Defines a link to a webpage that contains a collection of related images. + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. + :vartype read_link: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.imagesearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar thumbnail_url: The URL to a thumbnail of the item. + :vartype thumbnail_url: str + :ivar provider: The source of the creative work. + :vartype provider: + list[~azure.cognitiveservices.search.imagesearch.models.Thing] + :ivar date_published: The date on which the CreativeWork was published. + :vartype date_published: str + :ivar text: Text content of this creative work + :vartype text: str + :ivar source: The publisher or social network where the images were found. + You must attribute the publisher as the source where the collection was + found. + :vartype source: str + :ivar images_count: The number of related images found in the collection. + :vartype images_count: long + :ivar followers_count: The number of users on the social network that + follow the creator. + :vartype followers_count: long + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'thumbnail_url': {'readonly': True}, + 'provider': {'readonly': True}, + 'date_published': {'readonly': True}, + 'text': {'readonly': True}, + 'source': {'readonly': True}, + 'images_count': {'readonly': True}, + 'followers_count': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'thumbnail_url': {'key': 'thumbnailUrl', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': '[Thing]'}, + 'date_published': {'key': 'datePublished', 'type': 'str'}, + 'text': {'key': 'text', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'str'}, + 'images_count': {'key': 'imagesCount', 'type': 'long'}, + 'followers_count': {'key': 'followersCount', 'type': 'long'}, + } + + def __init__(self, **kwargs) -> None: + super(ImageGallery, self).__init__(**kwargs) + self.source = None + self.images_count = None + self.followers_count = None + self._type = 'ImageGallery' diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/image_insights.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/image_insights.py index f2d9ffcdc379..7965e97519b7 100644 --- a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/image_insights.py +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/image_insights.py @@ -24,7 +24,9 @@ class ImageInsights(Response): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -132,8 +134,8 @@ class ImageInsights(Response): 'image_tags': {'key': 'imageTags', 'type': 'ImageTagsModule'}, } - def __init__(self): - super(ImageInsights, self).__init__() + def __init__(self, **kwargs): + super(ImageInsights, self).__init__(**kwargs) self.image_insights_token = None self.best_representative_query = None self.image_caption = None diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/image_insights_image_caption.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/image_insights_image_caption.py index 7287bd87457d..dc28e5ea5db5 100644 --- a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/image_insights_image_caption.py +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/image_insights_image_caption.py @@ -15,16 +15,19 @@ class ImageInsightsImageCaption(Model): """Defines an image's caption. - :param caption: A caption about the image. + All required parameters must be populated in order to send to Azure. + + :param caption: Required. A caption about the image. :type caption: str - :param data_source_url: The URL to the website where the caption was - found. You must attribute the caption to the source. For example, by + :param data_source_url: Required. The URL to the website where the caption + was found. You must attribute the caption to the source. For example, by displaying the domain name from the URL next to the caption and using the URL to link to the source website. :type data_source_url: str - :param related_searches: A list of entities found in the caption. Use the - contents of the Query object to find the entity in the caption and create - a link. The link takes the user to images of the entity. + :param related_searches: Required. A list of entities found in the + caption. Use the contents of the Query object to find the entity in the + caption and create a link. The link takes the user to images of the + entity. :type related_searches: list[~azure.cognitiveservices.search.imagesearch.models.Query] """ @@ -41,8 +44,8 @@ class ImageInsightsImageCaption(Model): 'related_searches': {'key': 'relatedSearches', 'type': '[Query]'}, } - def __init__(self, caption, data_source_url, related_searches): - super(ImageInsightsImageCaption, self).__init__() - self.caption = caption - self.data_source_url = data_source_url - self.related_searches = related_searches + def __init__(self, **kwargs): + super(ImageInsightsImageCaption, self).__init__(**kwargs) + self.caption = kwargs.get('caption', None) + self.data_source_url = kwargs.get('data_source_url', None) + self.related_searches = kwargs.get('related_searches', None) diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/image_insights_image_caption_py3.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/image_insights_image_caption_py3.py new file mode 100644 index 000000000000..a116df059251 --- /dev/null +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/image_insights_image_caption_py3.py @@ -0,0 +1,51 @@ +# 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 msrest.serialization import Model + + +class ImageInsightsImageCaption(Model): + """Defines an image's caption. + + All required parameters must be populated in order to send to Azure. + + :param caption: Required. A caption about the image. + :type caption: str + :param data_source_url: Required. The URL to the website where the caption + was found. You must attribute the caption to the source. For example, by + displaying the domain name from the URL next to the caption and using the + URL to link to the source website. + :type data_source_url: str + :param related_searches: Required. A list of entities found in the + caption. Use the contents of the Query object to find the entity in the + caption and create a link. The link takes the user to images of the + entity. + :type related_searches: + list[~azure.cognitiveservices.search.imagesearch.models.Query] + """ + + _validation = { + 'caption': {'required': True}, + 'data_source_url': {'required': True}, + 'related_searches': {'required': True}, + } + + _attribute_map = { + 'caption': {'key': 'caption', 'type': 'str'}, + 'data_source_url': {'key': 'dataSourceUrl', 'type': 'str'}, + 'related_searches': {'key': 'relatedSearches', 'type': '[Query]'}, + } + + def __init__(self, *, caption: str, data_source_url: str, related_searches, **kwargs) -> None: + super(ImageInsightsImageCaption, self).__init__(**kwargs) + self.caption = caption + self.data_source_url = data_source_url + self.related_searches = related_searches diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/image_insights_py3.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/image_insights_py3.py new file mode 100644 index 000000000000..d65240f36067 --- /dev/null +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/image_insights_py3.py @@ -0,0 +1,151 @@ +# 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 .response import Response + + +class ImageInsights(Response): + """The top-level object that the response includes when an image insights + request succeeds. For information about requesting image insights, see the + [insightsToken](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#insightstoken) + query parameter. The modules query parameter affects the fields that Bing + includes in the response. If you set + [modules](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#modulesrequested) + to only Caption, then this object includes only the imageCaption field. + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. + :vartype read_link: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar image_insights_token: A token that you use in a subsequent call to + the Image Search API to get more information about the image. For + information about using this token, see the insightsToken query parameter. + This token has the same usage as the token in the Image object. + :vartype image_insights_token: str + :ivar best_representative_query: The query term that best represents the + image. Clicking the link in the Query object, takes the user to a webpage + with more pictures of the image. + :vartype best_representative_query: + ~azure.cognitiveservices.search.imagesearch.models.Query + :ivar image_caption: The caption to use for the image. + :vartype image_caption: + ~azure.cognitiveservices.search.imagesearch.models.ImageInsightsImageCaption + :ivar related_collections: A list of links to webpages that contain + related images. + :vartype related_collections: + ~azure.cognitiveservices.search.imagesearch.models.RelatedCollectionsModule + :ivar pages_including: A list of webpages that contain the image. To + access the webpage, use the URL in the image's hostPageUrl field. + :vartype pages_including: + ~azure.cognitiveservices.search.imagesearch.models.ImagesModule + :ivar shopping_sources: A list of merchants that offer items related to + the image. For example, if the image is of an apple pie, the list contains + merchants that are selling apple pies. + :vartype shopping_sources: + ~azure.cognitiveservices.search.imagesearch.models.AggregateOffer + :ivar related_searches: A list of related queries made by others. + :vartype related_searches: + ~azure.cognitiveservices.search.imagesearch.models.RelatedSearchesModule + :ivar recipes: A list of recipes related to the image. For example, if the + image is of an apple pie, the list contains recipes for making an apple + pie. + :vartype recipes: + ~azure.cognitiveservices.search.imagesearch.models.RecipesModule + :ivar visually_similar_images: A list of images that are visually similar + to the original image. For example, if the specified image is of a sunset + over a body of water, the list of similar images are of a sunset over a + body of water. If the specified image is of a person, similar images might + be of the same person or they might be of persons dressed similarly or in + a similar setting. The criteria for similarity continues to evolve. + :vartype visually_similar_images: + ~azure.cognitiveservices.search.imagesearch.models.ImagesModule + :ivar visually_similar_products: A list of images that contain products + that are visually similar to products found in the original image. For + example, if the specified image contains a dress, the list of similar + images contain a dress. The image provides summary information about + offers that Bing found online for the product. + :vartype visually_similar_products: + ~azure.cognitiveservices.search.imagesearch.models.ImagesModule + :ivar recognized_entity_groups: A list of groups that contain images of + entities that match the entity found in the specified image. For example, + the response might include images from the general celebrity group if the + entity was recognized in that group. + :vartype recognized_entity_groups: + ~azure.cognitiveservices.search.imagesearch.models.RecognizedEntitiesModule + :ivar image_tags: A list of characteristics of the content found in the + image. For example, if the image is of a person, the tags might indicate + the person's gender and the type of clothes they're wearing. + :vartype image_tags: + ~azure.cognitiveservices.search.imagesearch.models.ImageTagsModule + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'image_insights_token': {'readonly': True}, + 'best_representative_query': {'readonly': True}, + 'image_caption': {'readonly': True}, + 'related_collections': {'readonly': True}, + 'pages_including': {'readonly': True}, + 'shopping_sources': {'readonly': True}, + 'related_searches': {'readonly': True}, + 'recipes': {'readonly': True}, + 'visually_similar_images': {'readonly': True}, + 'visually_similar_products': {'readonly': True}, + 'recognized_entity_groups': {'readonly': True}, + 'image_tags': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'image_insights_token': {'key': 'imageInsightsToken', 'type': 'str'}, + 'best_representative_query': {'key': 'bestRepresentativeQuery', 'type': 'Query'}, + 'image_caption': {'key': 'imageCaption', 'type': 'ImageInsightsImageCaption'}, + 'related_collections': {'key': 'relatedCollections', 'type': 'RelatedCollectionsModule'}, + 'pages_including': {'key': 'pagesIncluding', 'type': 'ImagesModule'}, + 'shopping_sources': {'key': 'shoppingSources', 'type': 'AggregateOffer'}, + 'related_searches': {'key': 'relatedSearches', 'type': 'RelatedSearchesModule'}, + 'recipes': {'key': 'recipes', 'type': 'RecipesModule'}, + 'visually_similar_images': {'key': 'visuallySimilarImages', 'type': 'ImagesModule'}, + 'visually_similar_products': {'key': 'visuallySimilarProducts', 'type': 'ImagesModule'}, + 'recognized_entity_groups': {'key': 'recognizedEntityGroups', 'type': 'RecognizedEntitiesModule'}, + 'image_tags': {'key': 'imageTags', 'type': 'ImageTagsModule'}, + } + + def __init__(self, **kwargs) -> None: + super(ImageInsights, self).__init__(**kwargs) + self.image_insights_token = None + self.best_representative_query = None + self.image_caption = None + self.related_collections = None + self.pages_including = None + self.shopping_sources = None + self.related_searches = None + self.recipes = None + self.visually_similar_images = None + self.visually_similar_products = None + self.recognized_entity_groups = None + self.image_tags = None + self._type = 'ImageInsights' diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/image_object.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/image_object.py index c48d69d31f31..21d511be51cd 100644 --- a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/image_object.py +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/image_object.py @@ -18,7 +18,9 @@ class ImageObject(MediaObject): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -153,8 +155,8 @@ class ImageObject(MediaObject): 'visual_words': {'key': 'visualWords', 'type': 'str'}, } - def __init__(self): - super(ImageObject, self).__init__() + def __init__(self, **kwargs): + super(ImageObject, self).__init__(**kwargs) self.thumbnail = None self.image_insights_token = None self.insights_metadata = None diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/image_object_py3.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/image_object_py3.py new file mode 100644 index 000000000000..ebda17aa57ba --- /dev/null +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/image_object_py3.py @@ -0,0 +1,166 @@ +# 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 .media_object import MediaObject + + +class ImageObject(MediaObject): + """Defines an image. + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. + :vartype read_link: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.imagesearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar thumbnail_url: The URL to a thumbnail of the item. + :vartype thumbnail_url: str + :ivar provider: The source of the creative work. + :vartype provider: + list[~azure.cognitiveservices.search.imagesearch.models.Thing] + :ivar date_published: The date on which the CreativeWork was published. + :vartype date_published: str + :ivar text: Text content of this creative work + :vartype text: str + :ivar content_url: Original URL to retrieve the source (file) for the + media object (e.g the source URL for the image). + :vartype content_url: str + :ivar host_page_url: URL of the page that hosts the media object. + :vartype host_page_url: str + :ivar content_size: Size of the media object content (use format "value + unit" e.g "1024 B"). + :vartype content_size: str + :ivar encoding_format: Encoding format (e.g mp3, mp4, jpeg, etc). + :vartype encoding_format: str + :ivar host_page_display_url: Display URL of the page that hosts the media + object. + :vartype host_page_display_url: str + :ivar width: The width of the source media object, in pixels. + :vartype width: int + :ivar height: The height of the source media object, in pixels. + :vartype height: int + :ivar thumbnail: The URL to a thumbnail of the image + :vartype thumbnail: + ~azure.cognitiveservices.search.imagesearch.models.ImageObject + :ivar image_insights_token: The token that you use in a subsequent call to + the Image Search API to get additional information about the image. For + information about using this token, see the insightsToken query parameter. + :vartype image_insights_token: str + :ivar insights_metadata: A count of the number of websites where you can + shop or perform other actions related to the image. For example, if the + image is of an apple pie, this object includes a count of the number of + websites where you can buy an apple pie. To indicate the number of offers + in your UX, include badging such as a shopping cart icon that contains the + count. When the user clicks on the icon, use imageInisghtsToken to get the + list of websites. + :vartype insights_metadata: + ~azure.cognitiveservices.search.imagesearch.models.ImagesImageMetadata + :ivar image_id: Unique Id for the image + :vartype image_id: str + :ivar accent_color: A three-byte hexadecimal number that represents the + color that dominates the image. Use the color as the temporary background + in your client until the image is loaded. + :vartype accent_color: str + :ivar visual_words: Visual representation of the image. Used for getting + more sizes + :vartype visual_words: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'thumbnail_url': {'readonly': True}, + 'provider': {'readonly': True}, + 'date_published': {'readonly': True}, + 'text': {'readonly': True}, + 'content_url': {'readonly': True}, + 'host_page_url': {'readonly': True}, + 'content_size': {'readonly': True}, + 'encoding_format': {'readonly': True}, + 'host_page_display_url': {'readonly': True}, + 'width': {'readonly': True}, + 'height': {'readonly': True}, + 'thumbnail': {'readonly': True}, + 'image_insights_token': {'readonly': True}, + 'insights_metadata': {'readonly': True}, + 'image_id': {'readonly': True}, + 'accent_color': {'readonly': True}, + 'visual_words': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'thumbnail_url': {'key': 'thumbnailUrl', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': '[Thing]'}, + 'date_published': {'key': 'datePublished', 'type': 'str'}, + 'text': {'key': 'text', 'type': 'str'}, + 'content_url': {'key': 'contentUrl', 'type': 'str'}, + 'host_page_url': {'key': 'hostPageUrl', 'type': 'str'}, + 'content_size': {'key': 'contentSize', 'type': 'str'}, + 'encoding_format': {'key': 'encodingFormat', 'type': 'str'}, + 'host_page_display_url': {'key': 'hostPageDisplayUrl', 'type': 'str'}, + 'width': {'key': 'width', 'type': 'int'}, + 'height': {'key': 'height', 'type': 'int'}, + 'thumbnail': {'key': 'thumbnail', 'type': 'ImageObject'}, + 'image_insights_token': {'key': 'imageInsightsToken', 'type': 'str'}, + 'insights_metadata': {'key': 'insightsMetadata', 'type': 'ImagesImageMetadata'}, + 'image_id': {'key': 'imageId', 'type': 'str'}, + 'accent_color': {'key': 'accentColor', 'type': 'str'}, + 'visual_words': {'key': 'visualWords', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ImageObject, self).__init__(**kwargs) + self.thumbnail = None + self.image_insights_token = None + self.insights_metadata = None + self.image_id = None + self.accent_color = None + self.visual_words = None + self._type = 'ImageObject' diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/image_search_api_enums.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/image_search_api_enums.py index 38d360f7f6db..752fa084fc29 100644 --- a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/image_search_api_enums.py +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/image_search_api_enums.py @@ -12,7 +12,7 @@ from enum import Enum -class Currency(Enum): +class Currency(str, Enum): usd = "USD" cad = "CAD" @@ -177,7 +177,7 @@ class Currency(Enum): zmw = "ZMW" -class ItemAvailability(Enum): +class ItemAvailability(str, Enum): discontinued = "Discontinued" in_stock = "InStock" @@ -189,7 +189,7 @@ class ItemAvailability(Enum): sold_out = "SoldOut" -class ErrorCode(Enum): +class ErrorCode(str, Enum): none = "None" server_error = "ServerError" @@ -199,7 +199,7 @@ class ErrorCode(Enum): insufficient_authorization = "InsufficientAuthorization" -class ErrorSubCode(Enum): +class ErrorSubCode(str, Enum): unexpected_error = "UnexpectedError" resource_error = "ResourceError" @@ -214,7 +214,7 @@ class ErrorSubCode(Enum): authorization_expired = "AuthorizationExpired" -class ImageAspect(Enum): +class ImageAspect(str, Enum): all = "All" square = "Square" @@ -222,7 +222,7 @@ class ImageAspect(Enum): tall = "Tall" -class ImageColor(Enum): +class ImageColor(str, Enum): color_only = "ColorOnly" monochrome = "Monochrome" @@ -240,20 +240,20 @@ class ImageColor(Enum): yellow = "Yellow" -class Freshness(Enum): +class Freshness(str, Enum): day = "Day" week = "Week" month = "Month" -class ImageContent(Enum): +class ImageContent(str, Enum): face = "Face" portrait = "Portrait" -class ImageType(Enum): +class ImageType(str, Enum): animated_gif = "AnimatedGif" clipart = "Clipart" @@ -263,7 +263,7 @@ class ImageType(Enum): transparent = "Transparent" -class ImageLicense(Enum): +class ImageLicense(str, Enum): all = "All" any = "Any" @@ -274,14 +274,14 @@ class ImageLicense(Enum): modify_commercially = "ModifyCommercially" -class SafeSearch(Enum): +class SafeSearch(str, Enum): off = "Off" moderate = "Moderate" strict = "Strict" -class ImageSize(Enum): +class ImageSize(str, Enum): all = "All" small = "Small" @@ -290,12 +290,12 @@ class ImageSize(Enum): wallpaper = "Wallpaper" -class ImageCropType(Enum): +class ImageCropType(str, Enum): rectangular = "Rectangular" -class ImageInsightModule(Enum): +class ImageInsightModule(str, Enum): all = "All" brq = "BRQ" diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/image_tags_module.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/image_tags_module.py index b49c4e828a07..8af440f299b6 100644 --- a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/image_tags_module.py +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/image_tags_module.py @@ -15,10 +15,12 @@ class ImageTagsModule(Model): """Defines the characteristics of content found in an image. - :param value: A list of tags that describe the characteristics of the - content found in the image. For example, if the image is of a musical - artist, the list might include Female, Dress, and Music to indicate the - person is female music artist that's wearing a dress. + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of tags that describe the characteristics + of the content found in the image. For example, if the image is of a + musical artist, the list might include Female, Dress, and Music to + indicate the person is female music artist that's wearing a dress. :type value: list[~azure.cognitiveservices.search.imagesearch.models.InsightsTag] """ @@ -31,6 +33,6 @@ class ImageTagsModule(Model): 'value': {'key': 'value', 'type': '[InsightsTag]'}, } - def __init__(self, value): - super(ImageTagsModule, self).__init__() - self.value = value + def __init__(self, **kwargs): + super(ImageTagsModule, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/image_tags_module_py3.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/image_tags_module_py3.py new file mode 100644 index 000000000000..75b6ac825707 --- /dev/null +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/image_tags_module_py3.py @@ -0,0 +1,38 @@ +# 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 msrest.serialization import Model + + +class ImageTagsModule(Model): + """Defines the characteristics of content found in an image. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of tags that describe the characteristics + of the content found in the image. For example, if the image is of a + musical artist, the list might include Female, Dress, and Music to + indicate the person is female music artist that's wearing a dress. + :type value: + list[~azure.cognitiveservices.search.imagesearch.models.InsightsTag] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[InsightsTag]'}, + } + + def __init__(self, *, value, **kwargs) -> None: + super(ImageTagsModule, self).__init__(**kwargs) + self.value = value diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/images.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/images.py index 3e1d13fe0118..d0f27f917fb0 100644 --- a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/images.py +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/images.py @@ -18,7 +18,9 @@ class Images(SearchResultsAnswer): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -33,8 +35,8 @@ class Images(SearchResultsAnswer): :ivar next_offset: Used as part of deduping. Tells client the next offset that client should use in the next pagination request :vartype next_offset: int - :param value: A list of image objects that are relevant to the query. If - there are no results, the List is empty. + :param value: Required. A list of image objects that are relevant to the + query. If there are no results, the List is empty. :type value: list[~azure.cognitiveservices.search.imagesearch.models.ImageObject] :ivar query_expansions: A list of expanded queries that narrows the @@ -82,10 +84,10 @@ class Images(SearchResultsAnswer): 'similar_terms': {'key': 'similarTerms', 'type': '[Query]'}, } - def __init__(self, value): - super(Images, self).__init__() + def __init__(self, **kwargs): + super(Images, self).__init__(**kwargs) self.next_offset = None - self.value = value + self.value = kwargs.get('value', None) self.query_expansions = None self.pivot_suggestions = None self.similar_terms = None diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/images_image_metadata.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/images_image_metadata.py index c57fd3b8e36e..b23fd9dab663 100644 --- a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/images_image_metadata.py +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/images_image_metadata.py @@ -46,8 +46,8 @@ class ImagesImageMetadata(Model): 'aggregate_offer': {'key': 'aggregateOffer', 'type': 'AggregateOffer'}, } - def __init__(self): - super(ImagesImageMetadata, self).__init__() + def __init__(self, **kwargs): + super(ImagesImageMetadata, self).__init__(**kwargs) self.shopping_sources_count = None self.recipe_sources_count = None self.aggregate_offer = None diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/images_image_metadata_py3.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/images_image_metadata_py3.py new file mode 100644 index 000000000000..3eb2f4ef07fa --- /dev/null +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/images_image_metadata_py3.py @@ -0,0 +1,53 @@ +# 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 msrest.serialization import Model + + +class ImagesImageMetadata(Model): + """Defines a count of the number of websites where you can shop or perform + other actions related to the image. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar shopping_sources_count: The number of websites that offer goods of + the products seen in the image. + :vartype shopping_sources_count: int + :ivar recipe_sources_count: The number of websites that offer recipes of + the food seen in the image. + :vartype recipe_sources_count: int + :ivar aggregate_offer: A summary of the online offers of products found in + the image. For example, if the image is of a dress, the offer might + identify the lowest price and the number of offers found. Only visually + similar products insights include this field. The offer includes the + following fields: Name, AggregateRating, OfferCount, and LowPrice. + :vartype aggregate_offer: + ~azure.cognitiveservices.search.imagesearch.models.AggregateOffer + """ + + _validation = { + 'shopping_sources_count': {'readonly': True}, + 'recipe_sources_count': {'readonly': True}, + 'aggregate_offer': {'readonly': True}, + } + + _attribute_map = { + 'shopping_sources_count': {'key': 'shoppingSourcesCount', 'type': 'int'}, + 'recipe_sources_count': {'key': 'recipeSourcesCount', 'type': 'int'}, + 'aggregate_offer': {'key': 'aggregateOffer', 'type': 'AggregateOffer'}, + } + + def __init__(self, **kwargs) -> None: + super(ImagesImageMetadata, self).__init__(**kwargs) + self.shopping_sources_count = None + self.recipe_sources_count = None + self.aggregate_offer = None diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/images_module.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/images_module.py index 3866efe8dad2..e449916802e7 100644 --- a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/images_module.py +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/images_module.py @@ -31,6 +31,6 @@ class ImagesModule(Model): 'value': {'key': 'value', 'type': '[ImageObject]'}, } - def __init__(self): - super(ImagesModule, self).__init__() + def __init__(self, **kwargs): + super(ImagesModule, self).__init__(**kwargs) self.value = None diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/images_module_py3.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/images_module_py3.py new file mode 100644 index 000000000000..2fffb352a69b --- /dev/null +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/images_module_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class ImagesModule(Model): + """Defines a list of images. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: A list of images. + :vartype value: + list[~azure.cognitiveservices.search.imagesearch.models.ImageObject] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ImageObject]'}, + } + + def __init__(self, **kwargs) -> None: + super(ImagesModule, self).__init__(**kwargs) + self.value = None diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/images_py3.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/images_py3.py new file mode 100644 index 000000000000..1b762f7c02e0 --- /dev/null +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/images_py3.py @@ -0,0 +1,94 @@ +# 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 .search_results_answer import SearchResultsAnswer + + +class Images(SearchResultsAnswer): + """Defines an image answer. + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. + :vartype read_link: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar total_estimated_matches: The estimated number of webpages that are + relevant to the query. Use this number along with the count and offset + query parameters to page the results. + :vartype total_estimated_matches: long + :ivar next_offset: Used as part of deduping. Tells client the next offset + that client should use in the next pagination request + :vartype next_offset: int + :param value: Required. A list of image objects that are relevant to the + query. If there are no results, the List is empty. + :type value: + list[~azure.cognitiveservices.search.imagesearch.models.ImageObject] + :ivar query_expansions: A list of expanded queries that narrows the + original query. For example, if the query was Microsoft Surface, the + expanded queries might be: Microsoft Surface Pro 3, Microsoft Surface RT, + Microsoft Surface Phone, and Microsoft Surface Hub. + :vartype query_expansions: + list[~azure.cognitiveservices.search.imagesearch.models.Query] + :ivar pivot_suggestions: A list of segments in the original query. For + example, if the query was Red Flowers, Bing might segment the query into + Red and Flowers. The Flowers pivot may contain query suggestions such as + Red Peonies and Red Daisies, and the Red pivot may contain query + suggestions such as Green Flowers and Yellow Flowers. + :vartype pivot_suggestions: + list[~azure.cognitiveservices.search.imagesearch.models.PivotSuggestions] + :ivar similar_terms: A list of terms that are similar in meaning to the + user's query term. + :vartype similar_terms: + list[~azure.cognitiveservices.search.imagesearch.models.Query] + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'total_estimated_matches': {'readonly': True}, + 'next_offset': {'readonly': True}, + 'value': {'required': True}, + 'query_expansions': {'readonly': True}, + 'pivot_suggestions': {'readonly': True}, + 'similar_terms': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'total_estimated_matches': {'key': 'totalEstimatedMatches', 'type': 'long'}, + 'next_offset': {'key': 'nextOffset', 'type': 'int'}, + 'value': {'key': 'value', 'type': '[ImageObject]'}, + 'query_expansions': {'key': 'queryExpansions', 'type': '[Query]'}, + 'pivot_suggestions': {'key': 'pivotSuggestions', 'type': '[PivotSuggestions]'}, + 'similar_terms': {'key': 'similarTerms', 'type': '[Query]'}, + } + + def __init__(self, *, value, **kwargs) -> None: + super(Images, self).__init__(**kwargs) + self.next_offset = None + self.value = value + self.query_expansions = None + self.pivot_suggestions = None + self.similar_terms = None + self._type = 'Images' diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/insights_tag.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/insights_tag.py index 14c2af108a8c..30589115f262 100644 --- a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/insights_tag.py +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/insights_tag.py @@ -31,6 +31,6 @@ class InsightsTag(Model): 'name': {'key': 'name', 'type': 'str'}, } - def __init__(self): - super(InsightsTag, self).__init__() + def __init__(self, **kwargs): + super(InsightsTag, self).__init__(**kwargs) self.name = None diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/insights_tag_py3.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/insights_tag_py3.py new file mode 100644 index 000000000000..aa453e7ec93e --- /dev/null +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/insights_tag_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class InsightsTag(Model): + """Defines a characteristic of the content found in the image. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of the characteristic. For example, cat, kitty, + calico cat. + :vartype name: str + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(InsightsTag, self).__init__(**kwargs) + self.name = None diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/intangible.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/intangible.py index 432678bbd8ac..209769de612a 100644 --- a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/intangible.py +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/intangible.py @@ -22,7 +22,9 @@ class Intangible(Thing): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -59,10 +61,23 @@ class Intangible(Thing): 'bing_id': {'readonly': True}, } + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + } + _subtype_map = { '_type': {'StructuredValue': 'StructuredValue'} } - def __init__(self): - super(Intangible, self).__init__() + def __init__(self, **kwargs): + super(Intangible, self).__init__(**kwargs) self._type = 'Intangible' diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/intangible_py3.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/intangible_py3.py new file mode 100644 index 000000000000..60ba0360f40f --- /dev/null +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/intangible_py3.py @@ -0,0 +1,83 @@ +# 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 .thing import Thing + + +class Intangible(Thing): + """A utility class that serves as the umbrella for a number of 'intangible' + things such as quantities, structured values, etc. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: StructuredValue + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. + :vartype read_link: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.imagesearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'StructuredValue': 'StructuredValue'} + } + + def __init__(self, **kwargs) -> None: + super(Intangible, self).__init__(**kwargs) + self._type = 'Intangible' diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/media_object.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/media_object.py index 995698ac5296..1698f032b9a3 100644 --- a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/media_object.py +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/media_object.py @@ -21,7 +21,9 @@ class MediaObject(CreativeWork): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -123,8 +125,8 @@ class MediaObject(CreativeWork): '_type': {'ImageObject': 'ImageObject'} } - def __init__(self): - super(MediaObject, self).__init__() + def __init__(self, **kwargs): + super(MediaObject, self).__init__(**kwargs) self.content_url = None self.host_page_url = None self.content_size = None diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/media_object_py3.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/media_object_py3.py new file mode 100644 index 000000000000..ef1a6ad24dca --- /dev/null +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/media_object_py3.py @@ -0,0 +1,137 @@ +# 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 .creative_work import CreativeWork + + +class MediaObject(CreativeWork): + """Defines a media object. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ImageObject + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. + :vartype read_link: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.imagesearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar thumbnail_url: The URL to a thumbnail of the item. + :vartype thumbnail_url: str + :ivar provider: The source of the creative work. + :vartype provider: + list[~azure.cognitiveservices.search.imagesearch.models.Thing] + :ivar date_published: The date on which the CreativeWork was published. + :vartype date_published: str + :ivar text: Text content of this creative work + :vartype text: str + :ivar content_url: Original URL to retrieve the source (file) for the + media object (e.g the source URL for the image). + :vartype content_url: str + :ivar host_page_url: URL of the page that hosts the media object. + :vartype host_page_url: str + :ivar content_size: Size of the media object content (use format "value + unit" e.g "1024 B"). + :vartype content_size: str + :ivar encoding_format: Encoding format (e.g mp3, mp4, jpeg, etc). + :vartype encoding_format: str + :ivar host_page_display_url: Display URL of the page that hosts the media + object. + :vartype host_page_display_url: str + :ivar width: The width of the source media object, in pixels. + :vartype width: int + :ivar height: The height of the source media object, in pixels. + :vartype height: int + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'thumbnail_url': {'readonly': True}, + 'provider': {'readonly': True}, + 'date_published': {'readonly': True}, + 'text': {'readonly': True}, + 'content_url': {'readonly': True}, + 'host_page_url': {'readonly': True}, + 'content_size': {'readonly': True}, + 'encoding_format': {'readonly': True}, + 'host_page_display_url': {'readonly': True}, + 'width': {'readonly': True}, + 'height': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'thumbnail_url': {'key': 'thumbnailUrl', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': '[Thing]'}, + 'date_published': {'key': 'datePublished', 'type': 'str'}, + 'text': {'key': 'text', 'type': 'str'}, + 'content_url': {'key': 'contentUrl', 'type': 'str'}, + 'host_page_url': {'key': 'hostPageUrl', 'type': 'str'}, + 'content_size': {'key': 'contentSize', 'type': 'str'}, + 'encoding_format': {'key': 'encodingFormat', 'type': 'str'}, + 'host_page_display_url': {'key': 'hostPageDisplayUrl', 'type': 'str'}, + 'width': {'key': 'width', 'type': 'int'}, + 'height': {'key': 'height', 'type': 'int'}, + } + + _subtype_map = { + '_type': {'ImageObject': 'ImageObject'} + } + + def __init__(self, **kwargs) -> None: + super(MediaObject, self).__init__(**kwargs) + self.content_url = None + self.host_page_url = None + self.content_size = None + self.encoding_format = None + self.host_page_display_url = None + self.width = None + self.height = None + self._type = 'MediaObject' diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/normalized_rectangle.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/normalized_rectangle.py index 76d6308d8a13..379d5d426036 100644 --- a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/normalized_rectangle.py +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/normalized_rectangle.py @@ -21,7 +21,9 @@ class NormalizedRectangle(StructuredValue): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -43,13 +45,13 @@ class NormalizedRectangle(StructuredValue): :vartype alternate_name: str :ivar bing_id: An ID that uniquely identifies this item. :vartype bing_id: str - :param left: The left coordinate. + :param left: Required. The left coordinate. :type left: float - :param top: The top coordinate + :param top: Required. The top coordinate :type top: float - :param right: The right coordinate + :param right: Required. The right coordinate :type right: float - :param bottom: The bottom coordinate + :param bottom: Required. The bottom coordinate :type bottom: float """ @@ -87,10 +89,10 @@ class NormalizedRectangle(StructuredValue): 'bottom': {'key': 'bottom', 'type': 'float'}, } - def __init__(self, left, top, right, bottom): - super(NormalizedRectangle, self).__init__() - self.left = left - self.top = top - self.right = right - self.bottom = bottom + def __init__(self, **kwargs): + super(NormalizedRectangle, self).__init__(**kwargs) + self.left = kwargs.get('left', None) + self.top = kwargs.get('top', None) + self.right = kwargs.get('right', None) + self.bottom = kwargs.get('bottom', None) self._type = 'NormalizedRectangle' diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/normalized_rectangle_py3.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/normalized_rectangle_py3.py new file mode 100644 index 000000000000..fc8d22faf57d --- /dev/null +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/normalized_rectangle_py3.py @@ -0,0 +1,98 @@ +# 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 .structured_value import StructuredValue + + +class NormalizedRectangle(StructuredValue): + """Defines a region of an image. The region is defined by the coordinates of + the top, left corner and bottom, right corner of the region. The + coordinates are fractional values of the original image's width and height + in the range 0.0 through 1.0. + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. + :vartype read_link: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.imagesearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :param left: Required. The left coordinate. + :type left: float + :param top: Required. The top coordinate + :type top: float + :param right: Required. The right coordinate + :type right: float + :param bottom: Required. The bottom coordinate + :type bottom: float + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'left': {'required': True}, + 'top': {'required': True}, + 'right': {'required': True}, + 'bottom': {'required': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'left': {'key': 'left', 'type': 'float'}, + 'top': {'key': 'top', 'type': 'float'}, + 'right': {'key': 'right', 'type': 'float'}, + 'bottom': {'key': 'bottom', 'type': 'float'}, + } + + def __init__(self, *, left: float, top: float, right: float, bottom: float, **kwargs) -> None: + super(NormalizedRectangle, self).__init__(**kwargs) + self.left = left + self.top = top + self.right = right + self.bottom = bottom + self._type = 'NormalizedRectangle' diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/offer.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/offer.py index 098ff48d6926..9a3749017f01 100644 --- a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/offer.py +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/offer.py @@ -21,7 +21,9 @@ class Offer(Thing): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -126,8 +128,8 @@ class Offer(Thing): '_type': {'AggregateOffer': 'AggregateOffer'} } - def __init__(self): - super(Offer, self).__init__() + def __init__(self, **kwargs): + super(Offer, self).__init__(**kwargs) self.seller = None self.price = None self.price_currency = None diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/offer_py3.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/offer_py3.py new file mode 100644 index 000000000000..5a893296dae6 --- /dev/null +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/offer_py3.py @@ -0,0 +1,139 @@ +# 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 .thing import Thing + + +class Offer(Thing): + """Defines a merchant's offer. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AggregateOffer + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. + :vartype read_link: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.imagesearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar seller: Seller for this offer + :vartype seller: + ~azure.cognitiveservices.search.imagesearch.models.Organization + :ivar price: The item's price. + :vartype price: float + :ivar price_currency: The monetary currency. For example, USD. Possible + values include: 'USD', 'CAD', 'GBP', 'EUR', 'COP', 'JPY', 'CNY', 'AUD', + 'INR', 'AED', 'AFN', 'ALL', 'AMD', 'ANG', 'AOA', 'ARS', 'AWG', 'AZN', + 'BAM', 'BBD', 'BDT', 'BGN', 'BHD', 'BIF', 'BMD', 'BND', 'BOB', 'BOV', + 'BRL', 'BSD', 'BTN', 'BWP', 'BYR', 'BZD', 'CDF', 'CHE', 'CHF', 'CHW', + 'CLF', 'CLP', 'COU', 'CRC', 'CUC', 'CUP', 'CVE', 'CZK', 'DJF', 'DKK', + 'DOP', 'DZD', 'EGP', 'ERN', 'ETB', 'FJD', 'FKP', 'GEL', 'GHS', 'GIP', + 'GMD', 'GNF', 'GTQ', 'GYD', 'HKD', 'HNL', 'HRK', 'HTG', 'HUF', 'IDR', + 'ILS', 'IQD', 'IRR', 'ISK', 'JMD', 'JOD', 'KES', 'KGS', 'KHR', 'KMF', + 'KPW', 'KRW', 'KWD', 'KYD', 'KZT', 'LAK', 'LBP', 'LKR', 'LRD', 'LSL', + 'LYD', 'MAD', 'MDL', 'MGA', 'MKD', 'MMK', 'MNT', 'MOP', 'MRO', 'MUR', + 'MVR', 'MWK', 'MXN', 'MXV', 'MYR', 'MZN', 'NAD', 'NGN', 'NIO', 'NOK', + 'NPR', 'NZD', 'OMR', 'PAB', 'PEN', 'PGK', 'PHP', 'PKR', 'PLN', 'PYG', + 'QAR', 'RON', 'RSD', 'RUB', 'RWF', 'SAR', 'SBD', 'SCR', 'SDG', 'SEK', + 'SGD', 'SHP', 'SLL', 'SOS', 'SRD', 'SSP', 'STD', 'SYP', 'SZL', 'THB', + 'TJS', 'TMT', 'TND', 'TOP', 'TRY', 'TTD', 'TWD', 'TZS', 'UAH', 'UGX', + 'UYU', 'UZS', 'VEF', 'VND', 'VUV', 'WST', 'XAF', 'XCD', 'XOF', 'XPF', + 'YER', 'ZAR', 'ZMW'. Default value: "USD" . + :vartype price_currency: str or + ~azure.cognitiveservices.search.imagesearch.models.Currency + :ivar availability: The item's availability. The following are the + possible values: Discontinued, InStock, InStoreOnly, LimitedAvailability, + OnlineOnly, OutOfStock, PreOrder, SoldOut. Possible values include: + 'Discontinued', 'InStock', 'InStoreOnly', 'LimitedAvailability', + 'OnlineOnly', 'OutOfStock', 'PreOrder', 'SoldOut' + :vartype availability: str or + ~azure.cognitiveservices.search.imagesearch.models.ItemAvailability + :ivar aggregate_rating: An aggregated rating that indicates how well the + product has been rated by others. + :vartype aggregate_rating: + ~azure.cognitiveservices.search.imagesearch.models.AggregateRating + :ivar last_updated: The last date that the offer was updated. The date is + in the form YYYY-MM-DD. + :vartype last_updated: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'seller': {'readonly': True}, + 'price': {'readonly': True}, + 'price_currency': {'readonly': True}, + 'availability': {'readonly': True}, + 'aggregate_rating': {'readonly': True}, + 'last_updated': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'seller': {'key': 'seller', 'type': 'Organization'}, + 'price': {'key': 'price', 'type': 'float'}, + 'price_currency': {'key': 'priceCurrency', 'type': 'str'}, + 'availability': {'key': 'availability', 'type': 'str'}, + 'aggregate_rating': {'key': 'aggregateRating', 'type': 'AggregateRating'}, + 'last_updated': {'key': 'lastUpdated', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'AggregateOffer': 'AggregateOffer'} + } + + def __init__(self, **kwargs) -> None: + super(Offer, self).__init__(**kwargs) + self.seller = None + self.price = None + self.price_currency = None + self.availability = None + self.aggregate_rating = None + self.last_updated = None + self._type = 'Offer' diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/organization.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/organization.py index a424e891ab45..71d030580c20 100644 --- a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/organization.py +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/organization.py @@ -18,7 +18,9 @@ class Organization(Thing): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -55,6 +57,19 @@ class Organization(Thing): 'bing_id': {'readonly': True}, } - def __init__(self): - super(Organization, self).__init__() + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Organization, self).__init__(**kwargs) self._type = 'Organization' diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/organization_py3.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/organization_py3.py new file mode 100644 index 000000000000..a23cd3694118 --- /dev/null +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/organization_py3.py @@ -0,0 +1,75 @@ +# 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 .thing import Thing + + +class Organization(Thing): + """Defines an organization. + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. + :vartype read_link: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.imagesearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Organization, self).__init__(**kwargs) + self._type = 'Organization' diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/person.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/person.py index eecc70ba1e50..2f9d097a9a7a 100644 --- a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/person.py +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/person.py @@ -18,7 +18,9 @@ class Person(Thing): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -76,8 +78,8 @@ class Person(Thing): 'twitter_profile': {'key': 'twitterProfile', 'type': 'str'}, } - def __init__(self): - super(Person, self).__init__() + def __init__(self, **kwargs): + super(Person, self).__init__(**kwargs) self.job_title = None self.twitter_profile = None self._type = 'Person' diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/person_py3.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/person_py3.py new file mode 100644 index 000000000000..5db418a3db8c --- /dev/null +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/person_py3.py @@ -0,0 +1,85 @@ +# 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 .thing import Thing + + +class Person(Thing): + """Defines a person. + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. + :vartype read_link: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.imagesearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar job_title: The person's job title. + :vartype job_title: str + :ivar twitter_profile: The URL of the person's twitter profile. + :vartype twitter_profile: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'job_title': {'readonly': True}, + 'twitter_profile': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'job_title': {'key': 'jobTitle', 'type': 'str'}, + 'twitter_profile': {'key': 'twitterProfile', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Person, self).__init__(**kwargs) + self.job_title = None + self.twitter_profile = None + self._type = 'Person' diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/pivot_suggestions.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/pivot_suggestions.py index 4bda2d8b5959..43727638599c 100644 --- a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/pivot_suggestions.py +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/pivot_suggestions.py @@ -15,9 +15,11 @@ class PivotSuggestions(Model): """Defines the pivot segment. - :param pivot: The segment from the original query to pivot on. + All required parameters must be populated in order to send to Azure. + + :param pivot: Required. The segment from the original query to pivot on. :type pivot: str - :param suggestions: A list of suggested queries for the pivot. + :param suggestions: Required. A list of suggested queries for the pivot. :type suggestions: list[~azure.cognitiveservices.search.imagesearch.models.Query] """ @@ -32,7 +34,7 @@ class PivotSuggestions(Model): 'suggestions': {'key': 'suggestions', 'type': '[Query]'}, } - def __init__(self, pivot, suggestions): - super(PivotSuggestions, self).__init__() - self.pivot = pivot - self.suggestions = suggestions + def __init__(self, **kwargs): + super(PivotSuggestions, self).__init__(**kwargs) + self.pivot = kwargs.get('pivot', None) + self.suggestions = kwargs.get('suggestions', None) diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/pivot_suggestions_py3.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/pivot_suggestions_py3.py new file mode 100644 index 000000000000..83db74fb8b91 --- /dev/null +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/pivot_suggestions_py3.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class PivotSuggestions(Model): + """Defines the pivot segment. + + All required parameters must be populated in order to send to Azure. + + :param pivot: Required. The segment from the original query to pivot on. + :type pivot: str + :param suggestions: Required. A list of suggested queries for the pivot. + :type suggestions: + list[~azure.cognitiveservices.search.imagesearch.models.Query] + """ + + _validation = { + 'pivot': {'required': True}, + 'suggestions': {'required': True}, + } + + _attribute_map = { + 'pivot': {'key': 'pivot', 'type': 'str'}, + 'suggestions': {'key': 'suggestions', 'type': '[Query]'}, + } + + def __init__(self, *, pivot: str, suggestions, **kwargs) -> None: + super(PivotSuggestions, self).__init__(**kwargs) + self.pivot = pivot + self.suggestions = suggestions diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/properties_item.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/properties_item.py index 0c1bdedfb9ee..0826a1c9d662 100644 --- a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/properties_item.py +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/properties_item.py @@ -21,9 +21,11 @@ class PropertiesItem(Model): 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 Azure. + :ivar text: Text representation of an item. :vartype text: str - :param _type: Constant filled by server. + :param _type: Required. Constant filled by server. :type _type: str """ @@ -41,7 +43,7 @@ class PropertiesItem(Model): '_type': {'Rating': 'Rating'} } - def __init__(self): - super(PropertiesItem, self).__init__() + def __init__(self, **kwargs): + super(PropertiesItem, self).__init__(**kwargs) self.text = None self._type = None diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/properties_item_py3.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/properties_item_py3.py new file mode 100644 index 000000000000..17ca93eba774 --- /dev/null +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/properties_item_py3.py @@ -0,0 +1,49 @@ +# 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 msrest.serialization import Model + + +class PropertiesItem(Model): + """Defines an item. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: Rating + + 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 Azure. + + :ivar text: Text representation of an item. + :vartype text: str + :param _type: Required. Constant filled by server. + :type _type: str + """ + + _validation = { + 'text': {'readonly': True}, + '_type': {'required': True}, + } + + _attribute_map = { + 'text': {'key': 'text', 'type': 'str'}, + '_type': {'key': '_type', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'Rating': 'Rating'} + } + + def __init__(self, **kwargs) -> None: + super(PropertiesItem, self).__init__(**kwargs) + self.text = None + self._type = None diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/query.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/query.py index 0539e1f05707..e66f7ca9f493 100644 --- a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/query.py +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/query.py @@ -18,8 +18,10 @@ class Query(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param text: The query string. Use this string as the query term in a new - search request. + All required parameters must be populated in order to send to Azure. + + :param text: Required. The query string. Use this string as the query term + in a new search request. :type text: str :ivar display_text: The display version of the query term. This version of the query term may contain special characters that highlight the search @@ -56,9 +58,9 @@ class Query(Model): 'thumbnail': {'key': 'thumbnail', 'type': 'ImageObject'}, } - def __init__(self, text): - super(Query, self).__init__() - self.text = text + def __init__(self, **kwargs): + super(Query, self).__init__(**kwargs) + self.text = kwargs.get('text', None) self.display_text = None self.web_search_url = None self.search_link = None diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/query_py3.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/query_py3.py new file mode 100644 index 000000000000..0ceba96a2bd5 --- /dev/null +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/query_py3.py @@ -0,0 +1,67 @@ +# 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 msrest.serialization import Model + + +class Query(Model): + """Defines a search query. + + 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 Azure. + + :param text: Required. The query string. Use this string as the query term + in a new search request. + :type text: str + :ivar display_text: The display version of the query term. This version of + the query term may contain special characters that highlight the search + term found in the query string. The string contains the highlighting + characters only if the query enabled hit highlighting + :vartype display_text: str + :ivar web_search_url: The URL that takes the user to the Bing search + results page for the query.Only related search results include this field. + :vartype web_search_url: str + :ivar search_link: The URL that you use to get the results of the related + search. Before using the URL, you must append query parameters as + appropriate and include the Ocp-Apim-Subscription-Key header. Use this URL + if you're displaying the results in your own user interface. Otherwise, + use the webSearchUrl URL. + :vartype search_link: str + :ivar thumbnail: The URL to a thumbnail of a related image. + :vartype thumbnail: + ~azure.cognitiveservices.search.imagesearch.models.ImageObject + """ + + _validation = { + 'text': {'required': True}, + 'display_text': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'search_link': {'readonly': True}, + 'thumbnail': {'readonly': True}, + } + + _attribute_map = { + 'text': {'key': 'text', 'type': 'str'}, + 'display_text': {'key': 'displayText', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'search_link': {'key': 'searchLink', 'type': 'str'}, + 'thumbnail': {'key': 'thumbnail', 'type': 'ImageObject'}, + } + + def __init__(self, *, text: str, **kwargs) -> None: + super(Query, self).__init__(**kwargs) + self.text = text + self.display_text = None + self.web_search_url = None + self.search_link = None + self.thumbnail = None diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/rating.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/rating.py index b9d4a410db34..a749cf2f7c0b 100644 --- a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/rating.py +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/rating.py @@ -21,12 +21,14 @@ class Rating(PropertiesItem): 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 Azure. + :ivar text: Text representation of an item. :vartype text: str - :param _type: Constant filled by server. + :param _type: Required. Constant filled by server. :type _type: str - :param rating_value: The mean (average) rating. The possible values are - 1.0 through 5.0. + :param rating_value: Required. The mean (average) rating. The possible + values are 1.0 through 5.0. :type rating_value: float :ivar best_rating: The highest rated review. The possible values are 1.0 through 5.0. @@ -51,8 +53,8 @@ class Rating(PropertiesItem): '_type': {'AggregateRating': 'AggregateRating'} } - def __init__(self, rating_value): - super(Rating, self).__init__() - self.rating_value = rating_value + def __init__(self, **kwargs): + super(Rating, self).__init__(**kwargs) + self.rating_value = kwargs.get('rating_value', None) self.best_rating = None self._type = 'Rating' diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/rating_py3.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/rating_py3.py new file mode 100644 index 000000000000..cf4b1a32eec8 --- /dev/null +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/rating_py3.py @@ -0,0 +1,60 @@ +# 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 .properties_item import PropertiesItem + + +class Rating(PropertiesItem): + """Defines a rating. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AggregateRating + + 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 Azure. + + :ivar text: Text representation of an item. + :vartype text: str + :param _type: Required. Constant filled by server. + :type _type: str + :param rating_value: Required. The mean (average) rating. The possible + values are 1.0 through 5.0. + :type rating_value: float + :ivar best_rating: The highest rated review. The possible values are 1.0 + through 5.0. + :vartype best_rating: float + """ + + _validation = { + 'text': {'readonly': True}, + '_type': {'required': True}, + 'rating_value': {'required': True}, + 'best_rating': {'readonly': True}, + } + + _attribute_map = { + 'text': {'key': 'text', 'type': 'str'}, + '_type': {'key': '_type', 'type': 'str'}, + 'rating_value': {'key': 'ratingValue', 'type': 'float'}, + 'best_rating': {'key': 'bestRating', 'type': 'float'}, + } + + _subtype_map = { + '_type': {'AggregateRating': 'AggregateRating'} + } + + def __init__(self, *, rating_value: float, **kwargs) -> None: + super(Rating, self).__init__(**kwargs) + self.rating_value = rating_value + self.best_rating = None + self._type = 'Rating' diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/recipe.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/recipe.py index 842d959109b9..a094b46d360c 100644 --- a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/recipe.py +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/recipe.py @@ -18,7 +18,9 @@ class Recipe(CreativeWork): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -103,8 +105,8 @@ class Recipe(CreativeWork): 'total_time': {'key': 'totalTime', 'type': 'str'}, } - def __init__(self): - super(Recipe, self).__init__() + def __init__(self, **kwargs): + super(Recipe, self).__init__(**kwargs) self.cook_time = None self.prep_time = None self.total_time = None diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/recipe_py3.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/recipe_py3.py new file mode 100644 index 000000000000..f3e29acf8e61 --- /dev/null +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/recipe_py3.py @@ -0,0 +1,113 @@ +# 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 .creative_work import CreativeWork + + +class Recipe(CreativeWork): + """Defines a cooking recipe. + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. + :vartype read_link: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.imagesearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar thumbnail_url: The URL to a thumbnail of the item. + :vartype thumbnail_url: str + :ivar provider: The source of the creative work. + :vartype provider: + list[~azure.cognitiveservices.search.imagesearch.models.Thing] + :ivar date_published: The date on which the CreativeWork was published. + :vartype date_published: str + :ivar text: Text content of this creative work + :vartype text: str + :ivar cook_time: The amount of time the food takes to cook. For example, + PT25M. For information about the time format, see + http://en.wikipedia.org/wiki/ISO_8601#Durations. + :vartype cook_time: str + :ivar prep_time: The amount of time required to prepare the ingredients. + For example, PT15M. For information about the time format, see + http://en.wikipedia.org/wiki/ISO_8601#Durations. + :vartype prep_time: str + :ivar total_time: The total amount of time it takes to prepare and cook + the recipe. For example, PT45M. For information about the time format, see + http://en.wikipedia.org/wiki/ISO_8601#Durations. + :vartype total_time: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'thumbnail_url': {'readonly': True}, + 'provider': {'readonly': True}, + 'date_published': {'readonly': True}, + 'text': {'readonly': True}, + 'cook_time': {'readonly': True}, + 'prep_time': {'readonly': True}, + 'total_time': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'thumbnail_url': {'key': 'thumbnailUrl', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': '[Thing]'}, + 'date_published': {'key': 'datePublished', 'type': 'str'}, + 'text': {'key': 'text', 'type': 'str'}, + 'cook_time': {'key': 'cookTime', 'type': 'str'}, + 'prep_time': {'key': 'prepTime', 'type': 'str'}, + 'total_time': {'key': 'totalTime', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Recipe, self).__init__(**kwargs) + self.cook_time = None + self.prep_time = None + self.total_time = None + self._type = 'Recipe' diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/recipes_module.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/recipes_module.py index e283d0a3ad8c..988d9ab561c2 100644 --- a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/recipes_module.py +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/recipes_module.py @@ -31,6 +31,6 @@ class RecipesModule(Model): 'value': {'key': 'value', 'type': '[Recipe]'}, } - def __init__(self): - super(RecipesModule, self).__init__() + def __init__(self, **kwargs): + super(RecipesModule, self).__init__(**kwargs) self.value = None diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/recipes_module_py3.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/recipes_module_py3.py new file mode 100644 index 000000000000..0764002ab9c6 --- /dev/null +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/recipes_module_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class RecipesModule(Model): + """Defines a list of recipes. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: A list of recipes. + :vartype value: + list[~azure.cognitiveservices.search.imagesearch.models.Recipe] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Recipe]'}, + } + + def __init__(self, **kwargs) -> None: + super(RecipesModule, self).__init__(**kwargs) + self.value = None diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/recognized_entities_module.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/recognized_entities_module.py index 7e4935646f31..8c8719f50415 100644 --- a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/recognized_entities_module.py +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/recognized_entities_module.py @@ -31,6 +31,6 @@ class RecognizedEntitiesModule(Model): 'value': {'key': 'value', 'type': '[RecognizedEntityGroup]'}, } - def __init__(self): - super(RecognizedEntitiesModule, self).__init__() + def __init__(self, **kwargs): + super(RecognizedEntitiesModule, self).__init__(**kwargs) self.value = None diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/recognized_entities_module_py3.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/recognized_entities_module_py3.py new file mode 100644 index 000000000000..db80149bb933 --- /dev/null +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/recognized_entities_module_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class RecognizedEntitiesModule(Model): + """Defines a list of previously recognized entities. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: A list of recognized entities. + :vartype value: + list[~azure.cognitiveservices.search.imagesearch.models.RecognizedEntityGroup] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[RecognizedEntityGroup]'}, + } + + def __init__(self, **kwargs) -> None: + super(RecognizedEntitiesModule, self).__init__(**kwargs) + self.value = None diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/recognized_entity.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/recognized_entity.py index 24111f6deebc..10972d8b6b5e 100644 --- a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/recognized_entity.py +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/recognized_entity.py @@ -18,7 +18,9 @@ class RecognizedEntity(Response): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -53,8 +55,8 @@ class RecognizedEntity(Response): 'match_confidence': {'key': 'matchConfidence', 'type': 'float'}, } - def __init__(self): - super(RecognizedEntity, self).__init__() + def __init__(self, **kwargs): + super(RecognizedEntity, self).__init__(**kwargs) self.entity = None self.match_confidence = None self._type = 'RecognizedEntity' diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/recognized_entity_group.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/recognized_entity_group.py index 81f72a530962..3f839d01148b 100644 --- a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/recognized_entity_group.py +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/recognized_entity_group.py @@ -15,15 +15,17 @@ class RecognizedEntityGroup(Model): """Defines a group of previously recognized entities. - :param recognized_entity_regions: The regions of the image that contain - entities. + All required parameters must be populated in order to send to Azure. + + :param recognized_entity_regions: Required. The regions of the image that + contain entities. :type recognized_entity_regions: list[~azure.cognitiveservices.search.imagesearch.models.RecognizedEntityRegion] - :param name: The name of the group where images of the entity were also - found. The following are possible groups. CelebRecognitionAnnotations: - Similar to CelebrityAnnotations but provides a higher probability of an - accurate match. CelebrityAnnotations: Contains celebrities such as actors, - politicians, athletes, and historical figures. + :param name: Required. The name of the group where images of the entity + were also found. The following are possible groups. + CelebRecognitionAnnotations: Similar to CelebrityAnnotations but provides + a higher probability of an accurate match. CelebrityAnnotations: Contains + celebrities such as actors, politicians, athletes, and historical figures. :type name: str """ @@ -37,7 +39,7 @@ class RecognizedEntityGroup(Model): 'name': {'key': 'name', 'type': 'str'}, } - def __init__(self, recognized_entity_regions, name): - super(RecognizedEntityGroup, self).__init__() - self.recognized_entity_regions = recognized_entity_regions - self.name = name + def __init__(self, **kwargs): + super(RecognizedEntityGroup, self).__init__(**kwargs) + self.recognized_entity_regions = kwargs.get('recognized_entity_regions', None) + self.name = kwargs.get('name', None) diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/recognized_entity_group_py3.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/recognized_entity_group_py3.py new file mode 100644 index 000000000000..259b586f6526 --- /dev/null +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/recognized_entity_group_py3.py @@ -0,0 +1,45 @@ +# 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 msrest.serialization import Model + + +class RecognizedEntityGroup(Model): + """Defines a group of previously recognized entities. + + All required parameters must be populated in order to send to Azure. + + :param recognized_entity_regions: Required. The regions of the image that + contain entities. + :type recognized_entity_regions: + list[~azure.cognitiveservices.search.imagesearch.models.RecognizedEntityRegion] + :param name: Required. The name of the group where images of the entity + were also found. The following are possible groups. + CelebRecognitionAnnotations: Similar to CelebrityAnnotations but provides + a higher probability of an accurate match. CelebrityAnnotations: Contains + celebrities such as actors, politicians, athletes, and historical figures. + :type name: str + """ + + _validation = { + 'recognized_entity_regions': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'recognized_entity_regions': {'key': 'recognizedEntityRegions', 'type': '[RecognizedEntityRegion]'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, recognized_entity_regions, name: str, **kwargs) -> None: + super(RecognizedEntityGroup, self).__init__(**kwargs) + self.recognized_entity_regions = recognized_entity_regions + self.name = name diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/recognized_entity_py3.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/recognized_entity_py3.py new file mode 100644 index 000000000000..cdaa8c0cd3c3 --- /dev/null +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/recognized_entity_py3.py @@ -0,0 +1,62 @@ +# 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 .response import Response + + +class RecognizedEntity(Response): + """Defines a recognized entity. + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. + :vartype read_link: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar entity: The entity that was recognized. The following are the + possible entity objects: Person + :vartype entity: ~azure.cognitiveservices.search.imagesearch.models.Thing + :ivar match_confidence: The confidence that Bing has that the entity in + the image matches this entity. The confidence ranges from 0.0 through 1.0 + with 1.0 being very confident. + :vartype match_confidence: float + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'entity': {'readonly': True}, + 'match_confidence': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'entity': {'key': 'entity', 'type': 'Thing'}, + 'match_confidence': {'key': 'matchConfidence', 'type': 'float'}, + } + + def __init__(self, **kwargs) -> None: + super(RecognizedEntity, self).__init__(**kwargs) + self.entity = None + self.match_confidence = None + self._type = 'RecognizedEntity' diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/recognized_entity_region.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/recognized_entity_region.py index 6657d44616d0..552c42221acd 100644 --- a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/recognized_entity_region.py +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/recognized_entity_region.py @@ -19,7 +19,9 @@ class RecognizedEntityRegion(Response): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -61,8 +63,8 @@ class RecognizedEntityRegion(Response): 'matching_entities': {'key': 'matchingEntities', 'type': '[RecognizedEntity]'}, } - def __init__(self): - super(RecognizedEntityRegion, self).__init__() + def __init__(self, **kwargs): + super(RecognizedEntityRegion, self).__init__(**kwargs) self.region = None self.matching_entities = None self._type = 'RecognizedEntityRegion' diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/recognized_entity_region_py3.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/recognized_entity_region_py3.py new file mode 100644 index 000000000000..70626031a667 --- /dev/null +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/recognized_entity_region_py3.py @@ -0,0 +1,70 @@ +# 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 .response import Response + + +class RecognizedEntityRegion(Response): + """Defines a region of the image where an entity was found and a list of + entities that might match it. + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. + :vartype read_link: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar region: A region of the image that contains an entity. The values of + the rectangle are relative to the width and height of the original image + and are in the range 0.0 through 1.0. For example, if the image is 300x200 + and the region's top, left corner is at point (10, 20) and the bottom, + right corner is at point (290, 150), then the normalized rectangle is: + Left = 0.0333333333333333, Top = 0.1, Right = 0.9666666666666667, Bottom = + 0.75. For people, the region represents the person's face. + :vartype region: + ~azure.cognitiveservices.search.imagesearch.models.NormalizedRectangle + :ivar matching_entities: A list of entities that Bing believes match the + entity found in the region. The entities are in descending order of + confidence (see the matchConfidence field of RecognizedEntity). + :vartype matching_entities: + list[~azure.cognitiveservices.search.imagesearch.models.RecognizedEntity] + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'region': {'readonly': True}, + 'matching_entities': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'region': {'key': 'region', 'type': 'NormalizedRectangle'}, + 'matching_entities': {'key': 'matchingEntities', 'type': '[RecognizedEntity]'}, + } + + def __init__(self, **kwargs) -> None: + super(RecognizedEntityRegion, self).__init__(**kwargs) + self.region = None + self.matching_entities = None + self._type = 'RecognizedEntityRegion' diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/related_collections_module.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/related_collections_module.py index 5e490bc4430d..db3497133cd9 100644 --- a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/related_collections_module.py +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/related_collections_module.py @@ -31,6 +31,6 @@ class RelatedCollectionsModule(Model): 'value': {'key': 'value', 'type': '[ImageGallery]'}, } - def __init__(self): - super(RelatedCollectionsModule, self).__init__() + def __init__(self, **kwargs): + super(RelatedCollectionsModule, self).__init__(**kwargs) self.value = None diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/related_collections_module_py3.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/related_collections_module_py3.py new file mode 100644 index 000000000000..f2a24c14199e --- /dev/null +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/related_collections_module_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class RelatedCollectionsModule(Model): + """Defines a list of webpages that contain related images. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: A list of webpages that contain related images. + :vartype value: + list[~azure.cognitiveservices.search.imagesearch.models.ImageGallery] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ImageGallery]'}, + } + + def __init__(self, **kwargs) -> None: + super(RelatedCollectionsModule, self).__init__(**kwargs) + self.value = None diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/related_searches_module.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/related_searches_module.py index f06b8fc6f2d2..40f72d04f7eb 100644 --- a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/related_searches_module.py +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/related_searches_module.py @@ -31,6 +31,6 @@ class RelatedSearchesModule(Model): 'value': {'key': 'value', 'type': '[Query]'}, } - def __init__(self): - super(RelatedSearchesModule, self).__init__() + def __init__(self, **kwargs): + super(RelatedSearchesModule, self).__init__(**kwargs) self.value = None diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/related_searches_module_py3.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/related_searches_module_py3.py new file mode 100644 index 000000000000..ce3f1bdad0f7 --- /dev/null +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/related_searches_module_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class RelatedSearchesModule(Model): + """Defines a list of related searches. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: A list of related searches. + :vartype value: + list[~azure.cognitiveservices.search.imagesearch.models.Query] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Query]'}, + } + + def __init__(self, **kwargs) -> None: + super(RelatedSearchesModule, self).__init__(**kwargs) + self.value = None diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/response.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/response.py index 5299190365c1..bfe83453f37f 100644 --- a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/response.py +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/response.py @@ -23,7 +23,9 @@ class Response(Identifiable): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -51,8 +53,8 @@ class Response(Identifiable): '_type': {'Answer': 'Answer', 'Thing': 'Thing', 'ErrorResponse': 'ErrorResponse', 'RecognizedEntity': 'RecognizedEntity', 'RecognizedEntityRegion': 'RecognizedEntityRegion', 'ImageInsights': 'ImageInsights', 'TrendingImages': 'TrendingImages'} } - def __init__(self): - super(Response, self).__init__() + def __init__(self, **kwargs): + super(Response, self).__init__(**kwargs) self.read_link = None self.web_search_url = None self._type = 'Response' diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/response_base.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/response_base.py index a0aa392f833b..fd44632cfc0a 100644 --- a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/response_base.py +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/response_base.py @@ -18,7 +18,9 @@ class ResponseBase(Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: Identifiable - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str """ @@ -34,6 +36,6 @@ class ResponseBase(Model): '_type': {'Identifiable': 'Identifiable'} } - def __init__(self): - super(ResponseBase, self).__init__() + def __init__(self, **kwargs): + super(ResponseBase, self).__init__(**kwargs) self._type = None diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/response_base_py3.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/response_base_py3.py new file mode 100644 index 000000000000..680e0fe98ab4 --- /dev/null +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/response_base_py3.py @@ -0,0 +1,41 @@ +# 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 msrest.serialization import Model + + +class ResponseBase(Model): + """Response base. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: Identifiable + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + """ + + _validation = { + '_type': {'required': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'Identifiable': 'Identifiable'} + } + + def __init__(self, **kwargs) -> None: + super(ResponseBase, self).__init__(**kwargs) + self._type = None diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/response_py3.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/response_py3.py new file mode 100644 index 000000000000..85528bfc91e5 --- /dev/null +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/response_py3.py @@ -0,0 +1,60 @@ +# 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 .identifiable import Identifiable + + +class Response(Identifiable): + """Defines a response. All schemas that could be returned at the root of a + response should inherit from this. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: Answer, Thing, ErrorResponse, RecognizedEntity, + RecognizedEntityRegion, ImageInsights, TrendingImages + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. + :vartype read_link: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'Answer': 'Answer', 'Thing': 'Thing', 'ErrorResponse': 'ErrorResponse', 'RecognizedEntity': 'RecognizedEntity', 'RecognizedEntityRegion': 'RecognizedEntityRegion', 'ImageInsights': 'ImageInsights', 'TrendingImages': 'TrendingImages'} + } + + def __init__(self, **kwargs) -> None: + super(Response, self).__init__(**kwargs) + self.read_link = None + self.web_search_url = None + self._type = 'Response' diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/search_results_answer.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/search_results_answer.py index 4fc3b181e797..3ce089b82a6c 100644 --- a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/search_results_answer.py +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/search_results_answer.py @@ -21,7 +21,9 @@ class SearchResultsAnswer(Answer): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -55,7 +57,7 @@ class SearchResultsAnswer(Answer): '_type': {'Images': 'Images'} } - def __init__(self): - super(SearchResultsAnswer, self).__init__() + def __init__(self, **kwargs): + super(SearchResultsAnswer, self).__init__(**kwargs) self.total_estimated_matches = None self._type = 'SearchResultsAnswer' diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/search_results_answer_py3.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/search_results_answer_py3.py new file mode 100644 index 000000000000..f0bb1b5cf65b --- /dev/null +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/search_results_answer_py3.py @@ -0,0 +1,63 @@ +# 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 .answer import Answer + + +class SearchResultsAnswer(Answer): + """Defines a search result answer. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: Images + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. + :vartype read_link: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar total_estimated_matches: The estimated number of webpages that are + relevant to the query. Use this number along with the count and offset + query parameters to page the results. + :vartype total_estimated_matches: long + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'total_estimated_matches': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'total_estimated_matches': {'key': 'totalEstimatedMatches', 'type': 'long'}, + } + + _subtype_map = { + '_type': {'Images': 'Images'} + } + + def __init__(self, **kwargs) -> None: + super(SearchResultsAnswer, self).__init__(**kwargs) + self.total_estimated_matches = None + self._type = 'SearchResultsAnswer' diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/structured_value.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/structured_value.py index 82c80d2d42e9..9dd8c5101f8a 100644 --- a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/structured_value.py +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/structured_value.py @@ -21,7 +21,9 @@ class StructuredValue(Intangible): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -58,10 +60,23 @@ class StructuredValue(Intangible): 'bing_id': {'readonly': True}, } + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + } + _subtype_map = { '_type': {'NormalizedRectangle': 'NormalizedRectangle'} } - def __init__(self): - super(StructuredValue, self).__init__() + def __init__(self, **kwargs): + super(StructuredValue, self).__init__(**kwargs) self._type = 'StructuredValue' diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/structured_value_py3.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/structured_value_py3.py new file mode 100644 index 000000000000..9d8b26aad49f --- /dev/null +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/structured_value_py3.py @@ -0,0 +1,82 @@ +# 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 .intangible import Intangible + + +class StructuredValue(Intangible): + """StructuredValue. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: NormalizedRectangle + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. + :vartype read_link: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.imagesearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'NormalizedRectangle': 'NormalizedRectangle'} + } + + def __init__(self, **kwargs) -> None: + super(StructuredValue, self).__init__(**kwargs) + self._type = 'StructuredValue' diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/thing.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/thing.py index 1594adbe9c49..bac48c5e64e1 100644 --- a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/thing.py +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/thing.py @@ -21,7 +21,9 @@ class Thing(Response): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -75,8 +77,8 @@ class Thing(Response): '_type': {'Organization': 'Organization', 'Offer': 'Offer', 'CreativeWork': 'CreativeWork', 'Person': 'Person', 'Intangible': 'Intangible'} } - def __init__(self): - super(Thing, self).__init__() + def __init__(self, **kwargs): + super(Thing, self).__init__(**kwargs) self.name = None self.url = None self.image = None diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/thing_py3.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/thing_py3.py new file mode 100644 index 000000000000..2a6cc114063c --- /dev/null +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/thing_py3.py @@ -0,0 +1,88 @@ +# 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 .response import Response + + +class Thing(Response): + """Defines a thing. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: Organization, Offer, CreativeWork, Person, Intangible + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. + :vartype read_link: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.imagesearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'Organization': 'Organization', 'Offer': 'Offer', 'CreativeWork': 'CreativeWork', 'Person': 'Person', 'Intangible': 'Intangible'} + } + + def __init__(self, **kwargs) -> None: + super(Thing, self).__init__(**kwargs) + self.name = None + self.url = None + self.image = None + self.description = None + self.alternate_name = None + self.bing_id = None + self._type = 'Thing' diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/trending_images.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/trending_images.py index 58f51deacbfa..6ea1b01e76aa 100644 --- a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/trending_images.py +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/trending_images.py @@ -19,7 +19,9 @@ class TrendingImages(Response): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -27,8 +29,8 @@ class TrendingImages(Response): :vartype read_link: str :ivar web_search_url: The URL To Bing's search result for this item. :vartype web_search_url: str - :param categories: A list that identifies categories of images and a list - of trending images in that category. + :param categories: Required. A list that identifies categories of images + and a list of trending images in that category. :type categories: list[~azure.cognitiveservices.search.imagesearch.models.TrendingImagesCategory] """ @@ -49,7 +51,7 @@ class TrendingImages(Response): 'categories': {'key': 'categories', 'type': '[TrendingImagesCategory]'}, } - def __init__(self, categories): - super(TrendingImages, self).__init__() - self.categories = categories + def __init__(self, **kwargs): + super(TrendingImages, self).__init__(**kwargs) + self.categories = kwargs.get('categories', None) self._type = 'TrendingImages' diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/trending_images_category.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/trending_images_category.py index 5e6561b6c926..85b7318cc537 100644 --- a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/trending_images_category.py +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/trending_images_category.py @@ -15,13 +15,16 @@ class TrendingImagesCategory(Model): """Defines the category of trending images. - :param title: The name of the image category. For example, Popular People - Searches. + All required parameters must be populated in order to send to Azure. + + :param title: Required. The name of the image category. For example, + Popular People Searches. :type title: str - :param tiles: A list of images that are trending in the category. Each - tile contains an image and a URL that returns more images of the subject. - For example, if the category is Popular People Searches, the image is of a - popular person and the URL would return more images of that person. + :param tiles: Required. A list of images that are trending in the + category. Each tile contains an image and a URL that returns more images + of the subject. For example, if the category is Popular People Searches, + the image is of a popular person and the URL would return more images of + that person. :type tiles: list[~azure.cognitiveservices.search.imagesearch.models.TrendingImagesTile] """ @@ -36,7 +39,7 @@ class TrendingImagesCategory(Model): 'tiles': {'key': 'tiles', 'type': '[TrendingImagesTile]'}, } - def __init__(self, title, tiles): - super(TrendingImagesCategory, self).__init__() - self.title = title - self.tiles = tiles + def __init__(self, **kwargs): + super(TrendingImagesCategory, self).__init__(**kwargs) + self.title = kwargs.get('title', None) + self.tiles = kwargs.get('tiles', None) diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/trending_images_category_py3.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/trending_images_category_py3.py new file mode 100644 index 000000000000..c76479d9f687 --- /dev/null +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/trending_images_category_py3.py @@ -0,0 +1,45 @@ +# 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 msrest.serialization import Model + + +class TrendingImagesCategory(Model): + """Defines the category of trending images. + + All required parameters must be populated in order to send to Azure. + + :param title: Required. The name of the image category. For example, + Popular People Searches. + :type title: str + :param tiles: Required. A list of images that are trending in the + category. Each tile contains an image and a URL that returns more images + of the subject. For example, if the category is Popular People Searches, + the image is of a popular person and the URL would return more images of + that person. + :type tiles: + list[~azure.cognitiveservices.search.imagesearch.models.TrendingImagesTile] + """ + + _validation = { + 'title': {'required': True}, + 'tiles': {'required': True}, + } + + _attribute_map = { + 'title': {'key': 'title', 'type': 'str'}, + 'tiles': {'key': 'tiles', 'type': '[TrendingImagesTile]'}, + } + + def __init__(self, *, title: str, tiles, **kwargs) -> None: + super(TrendingImagesCategory, self).__init__(**kwargs) + self.title = title + self.tiles = tiles diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/trending_images_py3.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/trending_images_py3.py new file mode 100644 index 000000000000..9831a7d14339 --- /dev/null +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/trending_images_py3.py @@ -0,0 +1,57 @@ +# 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 .response import Response + + +class TrendingImages(Response): + """The top-level object that the response includes when a trending images + request succeeds. + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. + :vartype read_link: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :param categories: Required. A list that identifies categories of images + and a list of trending images in that category. + :type categories: + list[~azure.cognitiveservices.search.imagesearch.models.TrendingImagesCategory] + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'categories': {'required': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'categories': {'key': 'categories', 'type': '[TrendingImagesCategory]'}, + } + + def __init__(self, *, categories, **kwargs) -> None: + super(TrendingImages, self).__init__(**kwargs) + self.categories = categories + self._type = 'TrendingImages' diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/trending_images_tile.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/trending_images_tile.py index ecba3466fc39..ea1b93bead19 100644 --- a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/trending_images_tile.py +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/trending_images_tile.py @@ -15,12 +15,14 @@ class TrendingImagesTile(Model): """Defines an image tile. - :param query: A query that returns a Bing search results page with more - images of the subject. For example, if the category is Popular People - Searches, then the thumbnail is of a popular person. The query would - return a Bing search results page with more images of that person. + All required parameters must be populated in order to send to Azure. + + :param query: Required. A query that returns a Bing search results page + with more images of the subject. For example, if the category is Popular + People Searches, then the thumbnail is of a popular person. The query + would return a Bing search results page with more images of that person. :type query: ~azure.cognitiveservices.search.imagesearch.models.Query - :param image: The image's thumbnail. + :param image: Required. The image's thumbnail. :type image: ~azure.cognitiveservices.search.imagesearch.models.ImageObject """ @@ -35,7 +37,7 @@ class TrendingImagesTile(Model): 'image': {'key': 'image', 'type': 'ImageObject'}, } - def __init__(self, query, image): - super(TrendingImagesTile, self).__init__() - self.query = query - self.image = image + def __init__(self, **kwargs): + super(TrendingImagesTile, self).__init__(**kwargs) + self.query = kwargs.get('query', None) + self.image = kwargs.get('image', None) diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/trending_images_tile_py3.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/trending_images_tile_py3.py new file mode 100644 index 000000000000..f2d12242a643 --- /dev/null +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/trending_images_tile_py3.py @@ -0,0 +1,43 @@ +# 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 msrest.serialization import Model + + +class TrendingImagesTile(Model): + """Defines an image tile. + + All required parameters must be populated in order to send to Azure. + + :param query: Required. A query that returns a Bing search results page + with more images of the subject. For example, if the category is Popular + People Searches, then the thumbnail is of a popular person. The query + would return a Bing search results page with more images of that person. + :type query: ~azure.cognitiveservices.search.imagesearch.models.Query + :param image: Required. The image's thumbnail. + :type image: + ~azure.cognitiveservices.search.imagesearch.models.ImageObject + """ + + _validation = { + 'query': {'required': True}, + 'image': {'required': True}, + } + + _attribute_map = { + 'query': {'key': 'query', 'type': 'Query'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + } + + def __init__(self, *, query, image, **kwargs) -> None: + super(TrendingImagesTile, self).__init__(**kwargs) + self.query = query + self.image = image diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/web_page.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/web_page.py index 22d3fd2ea7f5..9e5cb0c25202 100644 --- a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/web_page.py +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/web_page.py @@ -21,7 +21,9 @@ class WebPage(CreativeWork): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -71,10 +73,27 @@ class WebPage(CreativeWork): 'text': {'readonly': True}, } + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'thumbnail_url': {'key': 'thumbnailUrl', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': '[Thing]'}, + 'date_published': {'key': 'datePublished', 'type': 'str'}, + 'text': {'key': 'text', 'type': 'str'}, + } + _subtype_map = { '_type': {'CollectionPage': 'CollectionPage'} } - def __init__(self): - super(WebPage, self).__init__() + def __init__(self, **kwargs): + super(WebPage, self).__init__(**kwargs) self._type = 'WebPage' diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/web_page_py3.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/web_page_py3.py new file mode 100644 index 000000000000..50c8d7b02f23 --- /dev/null +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/models/web_page_py3.py @@ -0,0 +1,99 @@ +# 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 .creative_work import CreativeWork + + +class WebPage(CreativeWork): + """Defines a webpage that is relevant to the query. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: CollectionPage + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. + :vartype read_link: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.imagesearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar thumbnail_url: The URL to a thumbnail of the item. + :vartype thumbnail_url: str + :ivar provider: The source of the creative work. + :vartype provider: + list[~azure.cognitiveservices.search.imagesearch.models.Thing] + :ivar date_published: The date on which the CreativeWork was published. + :vartype date_published: str + :ivar text: Text content of this creative work + :vartype text: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'thumbnail_url': {'readonly': True}, + 'provider': {'readonly': True}, + 'date_published': {'readonly': True}, + 'text': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'thumbnail_url': {'key': 'thumbnailUrl', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': '[Thing]'}, + 'date_published': {'key': 'datePublished', 'type': 'str'}, + 'text': {'key': 'text', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'CollectionPage': 'CollectionPage'} + } + + def __init__(self, **kwargs) -> None: + super(WebPage, self).__init__(**kwargs) + self._type = 'WebPage' diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/operations/images_operations.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/operations/images_operations.py index 2ce696709a72..b23a2db51cb1 100644 --- a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/operations/images_operations.py +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/operations/images_operations.py @@ -410,7 +410,7 @@ def search( :class:`ErrorResponseException` """ # Construct URL - url = '/images/search' + url = self.search.metadata['url'] # Construct parameters query_parameters = {} @@ -494,6 +494,7 @@ def search( return client_raw_response return deserialized + search.metadata = {'url': '/images/search'} def details( self, query, accept_language=None, content_type=None, user_agent=None, client_id=None, client_ip=None, location=None, crop_bottom=None, crop_left=None, crop_right=None, crop_top=None, crop_type=None, country_code=None, id=None, image_url=None, insights_token=None, modules=None, market=None, safe_search=None, set_lang=None, custom_headers=None, raw=False, **operation_config): @@ -826,7 +827,7 @@ def details( :class:`ErrorResponseException` """ # Construct URL - url = '/images/details' + url = self.details.metadata['url'] # Construct parameters query_parameters = {} @@ -894,6 +895,7 @@ def details( return client_raw_response return deserialized + details.metadata = {'url': '/images/details'} def trending( self, accept_language=None, user_agent=None, client_id=None, client_ip=None, location=None, country_code=None, market=None, safe_search=None, set_lang=None, custom_headers=None, raw=False, **operation_config): @@ -1108,7 +1110,7 @@ def trending( :class:`ErrorResponseException` """ # Construct URL - url = '/images/trending' + url = self.trending.metadata['url'] # Construct parameters query_parameters = {} @@ -1155,3 +1157,4 @@ def trending( return client_raw_response return deserialized + trending.metadata = {'url': '/images/trending'} diff --git a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/version.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/version.py index e0ec669828cb..63d89bfb54fa 100644 --- a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/version.py +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/imagesearch/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.1.0" +VERSION = "1.0" diff --git a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/__init__.py b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/__init__.py index 0853e618edd6..28bee5c05abd 100644 --- a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/__init__.py +++ b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/__init__.py @@ -9,25 +9,46 @@ # regenerated. # -------------------------------------------------------------------------- -from .news_article import NewsArticle -from .news import News -from .search_results_answer import SearchResultsAnswer -from .image_object import ImageObject -from .query import Query -from .news_topic import NewsTopic -from .answer import Answer -from .article import Article -from .thing import Thing -from .response import Response -from .trending_topics import TrendingTopics -from .video_object import VideoObject -from .creative_work import CreativeWork -from .organization import Organization -from .identifiable import Identifiable -from .error import Error -from .error_response import ErrorResponse, ErrorResponseException -from .media_object import MediaObject -from .response_base import ResponseBase +try: + from .news_article_py3 import NewsArticle + from .news_py3 import News + from .search_results_answer_py3 import SearchResultsAnswer + from .image_object_py3 import ImageObject + from .query_py3 import Query + from .news_topic_py3 import NewsTopic + from .answer_py3 import Answer + from .article_py3 import Article + from .thing_py3 import Thing + from .response_py3 import Response + from .trending_topics_py3 import TrendingTopics + from .video_object_py3 import VideoObject + from .creative_work_py3 import CreativeWork + from .organization_py3 import Organization + from .identifiable_py3 import Identifiable + from .error_py3 import Error + from .error_response_py3 import ErrorResponse, ErrorResponseException + from .media_object_py3 import MediaObject + from .response_base_py3 import ResponseBase +except (SyntaxError, ImportError): + from .news_article import NewsArticle + from .news import News + from .search_results_answer import SearchResultsAnswer + from .image_object import ImageObject + from .query import Query + from .news_topic import NewsTopic + from .answer import Answer + from .article import Article + from .thing import Thing + from .response import Response + from .trending_topics import TrendingTopics + from .video_object import VideoObject + from .creative_work import CreativeWork + from .organization import Organization + from .identifiable import Identifiable + from .error import Error + from .error_response import ErrorResponse, ErrorResponseException + from .media_object import MediaObject + from .response_base import ResponseBase from .news_search_api_enums import ( ErrorCode, ErrorSubCode, diff --git a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/answer.py b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/answer.py index 51c3ebf331cd..feb8f2b55c3f 100644 --- a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/answer.py +++ b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/answer.py @@ -21,7 +21,9 @@ class Answer(Response): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -50,7 +52,7 @@ class Answer(Response): '_type': {'SearchResultsAnswer': 'SearchResultsAnswer', 'TrendingTopics': 'TrendingTopics'} } - def __init__(self): - super(Answer, self).__init__() + def __init__(self, **kwargs): + super(Answer, self).__init__(**kwargs) self.follow_up_queries = None self._type = 'Answer' diff --git a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/answer_py3.py b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/answer_py3.py new file mode 100644 index 000000000000..86296d6e4675 --- /dev/null +++ b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/answer_py3.py @@ -0,0 +1,58 @@ +# 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 .response import Response + + +class Answer(Response): + """Defines an answer. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: SearchResultsAnswer, TrendingTopics + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar follow_up_queries: + :vartype follow_up_queries: + list[~azure.cognitiveservices.search.newssearch.models.Query] + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'follow_up_queries': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'follow_up_queries': {'key': 'followUpQueries', 'type': '[Query]'}, + } + + _subtype_map = { + '_type': {'SearchResultsAnswer': 'SearchResultsAnswer', 'TrendingTopics': 'TrendingTopics'} + } + + def __init__(self, **kwargs) -> None: + super(Answer, self).__init__(**kwargs) + self.follow_up_queries = None + self._type = 'Answer' diff --git a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/article.py b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/article.py index 6cbc9151e97a..a3eebcc6c8c9 100644 --- a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/article.py +++ b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/article.py @@ -21,7 +21,9 @@ class Article(CreativeWork): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -93,7 +95,7 @@ class Article(CreativeWork): '_type': {'NewsArticle': 'NewsArticle'} } - def __init__(self): - super(Article, self).__init__() + def __init__(self, **kwargs): + super(Article, self).__init__(**kwargs) self.word_count = None self._type = 'Article' diff --git a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/article_py3.py b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/article_py3.py new file mode 100644 index 000000000000..888b20524d44 --- /dev/null +++ b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/article_py3.py @@ -0,0 +1,101 @@ +# 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 .creative_work import CreativeWork + + +class Article(CreativeWork): + """Article. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: NewsArticle + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.newssearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar thumbnail_url: The URL to a thumbnail of the item. + :vartype thumbnail_url: str + :ivar provider: The source of the creative work. + :vartype provider: + list[~azure.cognitiveservices.search.newssearch.models.Thing] + :ivar date_published: The date on which the CreativeWork was published. + :vartype date_published: str + :ivar video: A video of the item. + :vartype video: + ~azure.cognitiveservices.search.newssearch.models.VideoObject + :ivar word_count: The number of words in the text of the Article. + :vartype word_count: int + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'thumbnail_url': {'readonly': True}, + 'provider': {'readonly': True}, + 'date_published': {'readonly': True}, + 'video': {'readonly': True}, + 'word_count': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'thumbnail_url': {'key': 'thumbnailUrl', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': '[Thing]'}, + 'date_published': {'key': 'datePublished', 'type': 'str'}, + 'video': {'key': 'video', 'type': 'VideoObject'}, + 'word_count': {'key': 'wordCount', 'type': 'int'}, + } + + _subtype_map = { + '_type': {'NewsArticle': 'NewsArticle'} + } + + def __init__(self, **kwargs) -> None: + super(Article, self).__init__(**kwargs) + self.word_count = None + self._type = 'Article' diff --git a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/creative_work.py b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/creative_work.py index 11d0869f1580..8132e75a8276 100644 --- a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/creative_work.py +++ b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/creative_work.py @@ -22,7 +22,9 @@ class CreativeWork(Thing): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -90,8 +92,8 @@ class CreativeWork(Thing): '_type': {'Article': 'Article', 'MediaObject': 'MediaObject'} } - def __init__(self): - super(CreativeWork, self).__init__() + def __init__(self, **kwargs): + super(CreativeWork, self).__init__(**kwargs) self.thumbnail_url = None self.provider = None self.date_published = None diff --git a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/creative_work_py3.py b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/creative_work_py3.py new file mode 100644 index 000000000000..5159410f9d2e --- /dev/null +++ b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/creative_work_py3.py @@ -0,0 +1,101 @@ +# 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 .thing import Thing + + +class CreativeWork(Thing): + """The most generic kind of creative work, including books, movies, + photographs, software programs, etc. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: Article, MediaObject + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.newssearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar thumbnail_url: The URL to a thumbnail of the item. + :vartype thumbnail_url: str + :ivar provider: The source of the creative work. + :vartype provider: + list[~azure.cognitiveservices.search.newssearch.models.Thing] + :ivar date_published: The date on which the CreativeWork was published. + :vartype date_published: str + :ivar video: A video of the item. + :vartype video: + ~azure.cognitiveservices.search.newssearch.models.VideoObject + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'thumbnail_url': {'readonly': True}, + 'provider': {'readonly': True}, + 'date_published': {'readonly': True}, + 'video': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'thumbnail_url': {'key': 'thumbnailUrl', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': '[Thing]'}, + 'date_published': {'key': 'datePublished', 'type': 'str'}, + 'video': {'key': 'video', 'type': 'VideoObject'}, + } + + _subtype_map = { + '_type': {'Article': 'Article', 'MediaObject': 'MediaObject'} + } + + def __init__(self, **kwargs) -> None: + super(CreativeWork, self).__init__(**kwargs) + self.thumbnail_url = None + self.provider = None + self.date_published = None + self.video = None + self._type = 'CreativeWork' diff --git a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/error.py b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/error.py index 622d958d61d9..4507e044e955 100644 --- a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/error.py +++ b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/error.py @@ -18,8 +18,10 @@ class Error(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param code: The error code that identifies the category of error. - Possible values include: 'None', 'ServerError', 'InvalidRequest', + All required parameters must be populated in order to send to Azure. + + :param code: Required. The error code that identifies the category of + error. Possible values include: 'None', 'ServerError', 'InvalidRequest', 'RateLimitExceeded', 'InvalidAuthorization', 'InsufficientAuthorization'. Default value: "None" . :type code: str or @@ -31,7 +33,7 @@ class Error(Model): 'AuthorizationRedundancy', 'AuthorizationDisabled', 'AuthorizationExpired' :vartype sub_code: str or ~azure.cognitiveservices.search.newssearch.models.ErrorSubCode - :param message: A description of the error. + :param message: Required. A description of the error. :type message: str :ivar more_details: A description that provides additional information about the error. @@ -60,11 +62,11 @@ class Error(Model): 'value': {'key': 'value', 'type': 'str'}, } - def __init__(self, message, code="None"): - super(Error, self).__init__() - self.code = code + def __init__(self, **kwargs): + super(Error, self).__init__(**kwargs) + self.code = kwargs.get('code', "None") self.sub_code = None - self.message = message + self.message = kwargs.get('message', None) self.more_details = None self.parameter = None self.value = None diff --git a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/error_py3.py b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/error_py3.py new file mode 100644 index 000000000000..57d746bf9ff8 --- /dev/null +++ b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/error_py3.py @@ -0,0 +1,72 @@ +# 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 msrest.serialization import Model + + +class Error(Model): + """Defines the error that occurred. + + 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 Azure. + + :param code: Required. The error code that identifies the category of + error. Possible values include: 'None', 'ServerError', 'InvalidRequest', + 'RateLimitExceeded', 'InvalidAuthorization', 'InsufficientAuthorization'. + Default value: "None" . + :type code: str or + ~azure.cognitiveservices.search.newssearch.models.ErrorCode + :ivar sub_code: The error code that further helps to identify the error. + Possible values include: 'UnexpectedError', 'ResourceError', + 'NotImplemented', 'ParameterMissing', 'ParameterInvalidValue', + 'HttpNotAllowed', 'Blocked', 'AuthorizationMissing', + 'AuthorizationRedundancy', 'AuthorizationDisabled', 'AuthorizationExpired' + :vartype sub_code: str or + ~azure.cognitiveservices.search.newssearch.models.ErrorSubCode + :param message: Required. A description of the error. + :type message: str + :ivar more_details: A description that provides additional information + about the error. + :vartype more_details: str + :ivar parameter: The parameter in the request that caused the error. + :vartype parameter: str + :ivar value: The parameter's value in the request that was not valid. + :vartype value: str + """ + + _validation = { + 'code': {'required': True}, + 'sub_code': {'readonly': True}, + 'message': {'required': True}, + 'more_details': {'readonly': True}, + 'parameter': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'sub_code': {'key': 'subCode', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'more_details': {'key': 'moreDetails', 'type': 'str'}, + 'parameter': {'key': 'parameter', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, message: str, code="None", **kwargs) -> None: + super(Error, self).__init__(**kwargs) + self.code = code + self.sub_code = None + self.message = message + self.more_details = None + self.parameter = None + self.value = None diff --git a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/error_response.py b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/error_response.py index e80e96206f90..cc270e71007f 100644 --- a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/error_response.py +++ b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/error_response.py @@ -19,14 +19,16 @@ class ErrorResponse(Response): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str :ivar web_search_url: The URL To Bing's search result for this item. :vartype web_search_url: str - :param errors: A list of errors that describe the reasons why the request - failed. + :param errors: Required. A list of errors that describe the reasons why + the request failed. :type errors: list[~azure.cognitiveservices.search.newssearch.models.Error] """ @@ -45,9 +47,9 @@ class ErrorResponse(Response): 'errors': {'key': 'errors', 'type': '[Error]'}, } - def __init__(self, errors): - super(ErrorResponse, self).__init__() - self.errors = errors + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.errors = kwargs.get('errors', None) self._type = 'ErrorResponse' diff --git a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/error_response_py3.py b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/error_response_py3.py new file mode 100644 index 000000000000..431704fe9213 --- /dev/null +++ b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/error_response_py3.py @@ -0,0 +1,65 @@ +# 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 .response import Response +from msrest.exceptions import HttpOperationError + + +class ErrorResponse(Response): + """The top-level response that represents a failed request. + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :param errors: Required. A list of errors that describe the reasons why + the request failed. + :type errors: + list[~azure.cognitiveservices.search.newssearch.models.Error] + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'errors': {'required': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'errors': {'key': 'errors', 'type': '[Error]'}, + } + + def __init__(self, *, errors, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.errors = errors + self._type = 'ErrorResponse' + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/identifiable.py b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/identifiable.py index 133e93fa8f94..513e53d238bb 100644 --- a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/identifiable.py +++ b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/identifiable.py @@ -21,7 +21,9 @@ class Identifiable(ResponseBase): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -41,7 +43,7 @@ class Identifiable(ResponseBase): '_type': {'Response': 'Response'} } - def __init__(self): - super(Identifiable, self).__init__() + def __init__(self, **kwargs): + super(Identifiable, self).__init__(**kwargs) self.id = None self._type = 'Identifiable' diff --git a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/identifiable_py3.py b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/identifiable_py3.py new file mode 100644 index 000000000000..c87dc0347e3d --- /dev/null +++ b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/identifiable_py3.py @@ -0,0 +1,49 @@ +# 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 .response_base import ResponseBase + + +class Identifiable(ResponseBase): + """Defines the identity of a resource. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: Response + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'Response': 'Response'} + } + + def __init__(self, **kwargs) -> None: + super(Identifiable, self).__init__(**kwargs) + self.id = None + self._type = 'Identifiable' diff --git a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/image_object.py b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/image_object.py index be0b16f0ab33..5f0f6e6b1f62 100644 --- a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/image_object.py +++ b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/image_object.py @@ -18,7 +18,9 @@ class ImageObject(MediaObject): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -100,7 +102,7 @@ class ImageObject(MediaObject): 'thumbnail': {'key': 'thumbnail', 'type': 'ImageObject'}, } - def __init__(self): - super(ImageObject, self).__init__() + def __init__(self, **kwargs): + super(ImageObject, self).__init__(**kwargs) self.thumbnail = None self._type = 'ImageObject' diff --git a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/image_object_py3.py b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/image_object_py3.py new file mode 100644 index 000000000000..0c02175a6f79 --- /dev/null +++ b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/image_object_py3.py @@ -0,0 +1,108 @@ +# 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 .media_object import MediaObject + + +class ImageObject(MediaObject): + """Defines an image. + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.newssearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar thumbnail_url: The URL to a thumbnail of the item. + :vartype thumbnail_url: str + :ivar provider: The source of the creative work. + :vartype provider: + list[~azure.cognitiveservices.search.newssearch.models.Thing] + :ivar date_published: The date on which the CreativeWork was published. + :vartype date_published: str + :ivar video: A video of the item. + :vartype video: + ~azure.cognitiveservices.search.newssearch.models.VideoObject + :ivar content_url: Original URL to retrieve the source (file) for the + media object (e.g the source URL for the image). + :vartype content_url: str + :ivar width: The width of the source media object, in pixels. + :vartype width: int + :ivar height: The height of the source media object, in pixels. + :vartype height: int + :ivar thumbnail: The URL to a thumbnail of the image + :vartype thumbnail: + ~azure.cognitiveservices.search.newssearch.models.ImageObject + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'thumbnail_url': {'readonly': True}, + 'provider': {'readonly': True}, + 'date_published': {'readonly': True}, + 'video': {'readonly': True}, + 'content_url': {'readonly': True}, + 'width': {'readonly': True}, + 'height': {'readonly': True}, + 'thumbnail': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'thumbnail_url': {'key': 'thumbnailUrl', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': '[Thing]'}, + 'date_published': {'key': 'datePublished', 'type': 'str'}, + 'video': {'key': 'video', 'type': 'VideoObject'}, + 'content_url': {'key': 'contentUrl', 'type': 'str'}, + 'width': {'key': 'width', 'type': 'int'}, + 'height': {'key': 'height', 'type': 'int'}, + 'thumbnail': {'key': 'thumbnail', 'type': 'ImageObject'}, + } + + def __init__(self, **kwargs) -> None: + super(ImageObject, self).__init__(**kwargs) + self.thumbnail = None + self._type = 'ImageObject' diff --git a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/media_object.py b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/media_object.py index 833271a55dad..272e6f9f8a2e 100644 --- a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/media_object.py +++ b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/media_object.py @@ -21,7 +21,9 @@ class MediaObject(CreativeWork): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -102,8 +104,8 @@ class MediaObject(CreativeWork): '_type': {'ImageObject': 'ImageObject', 'VideoObject': 'VideoObject'} } - def __init__(self): - super(MediaObject, self).__init__() + def __init__(self, **kwargs): + super(MediaObject, self).__init__(**kwargs) self.content_url = None self.width = None self.height = None diff --git a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/media_object_py3.py b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/media_object_py3.py new file mode 100644 index 000000000000..e4e1600ea45d --- /dev/null +++ b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/media_object_py3.py @@ -0,0 +1,112 @@ +# 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 .creative_work import CreativeWork + + +class MediaObject(CreativeWork): + """Defines a media object. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ImageObject, VideoObject + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.newssearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar thumbnail_url: The URL to a thumbnail of the item. + :vartype thumbnail_url: str + :ivar provider: The source of the creative work. + :vartype provider: + list[~azure.cognitiveservices.search.newssearch.models.Thing] + :ivar date_published: The date on which the CreativeWork was published. + :vartype date_published: str + :ivar video: A video of the item. + :vartype video: + ~azure.cognitiveservices.search.newssearch.models.VideoObject + :ivar content_url: Original URL to retrieve the source (file) for the + media object (e.g the source URL for the image). + :vartype content_url: str + :ivar width: The width of the source media object, in pixels. + :vartype width: int + :ivar height: The height of the source media object, in pixels. + :vartype height: int + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'thumbnail_url': {'readonly': True}, + 'provider': {'readonly': True}, + 'date_published': {'readonly': True}, + 'video': {'readonly': True}, + 'content_url': {'readonly': True}, + 'width': {'readonly': True}, + 'height': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'thumbnail_url': {'key': 'thumbnailUrl', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': '[Thing]'}, + 'date_published': {'key': 'datePublished', 'type': 'str'}, + 'video': {'key': 'video', 'type': 'VideoObject'}, + 'content_url': {'key': 'contentUrl', 'type': 'str'}, + 'width': {'key': 'width', 'type': 'int'}, + 'height': {'key': 'height', 'type': 'int'}, + } + + _subtype_map = { + '_type': {'ImageObject': 'ImageObject', 'VideoObject': 'VideoObject'} + } + + def __init__(self, **kwargs) -> None: + super(MediaObject, self).__init__(**kwargs) + self.content_url = None + self.width = None + self.height = None + self._type = 'MediaObject' diff --git a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/news.py b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/news.py index 6b2945fc461d..c2fd484f8ed5 100644 --- a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/news.py +++ b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/news.py @@ -18,7 +18,9 @@ class News(SearchResultsAnswer): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -31,9 +33,9 @@ class News(SearchResultsAnswer): relevant to the query. Use this number along with the count and offset query parameters to page the results. :vartype total_estimated_matches: long - :param value: An array of NewsArticle objects that contain information - about news articles that are relevant to the query. If there are no - results to return for the request, the array is empty. + :param value: Required. An array of NewsArticle objects that contain + information about news articles that are relevant to the query. If there + are no results to return for the request, the array is empty. :type value: list[~azure.cognitiveservices.search.newssearch.models.NewsArticle] :ivar location: Location of local news @@ -60,8 +62,8 @@ class News(SearchResultsAnswer): 'location': {'key': 'location', 'type': 'str'}, } - def __init__(self, value): - super(News, self).__init__() - self.value = value + def __init__(self, **kwargs): + super(News, self).__init__(**kwargs) + self.value = kwargs.get('value', None) self.location = None self._type = 'News' diff --git a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/news_article.py b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/news_article.py index d4727fd9c268..e9a68959f117 100644 --- a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/news_article.py +++ b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/news_article.py @@ -18,7 +18,9 @@ class NewsArticle(Article): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -104,8 +106,8 @@ class NewsArticle(Article): 'clustered_articles': {'key': 'clusteredArticles', 'type': '[NewsArticle]'}, } - def __init__(self): - super(NewsArticle, self).__init__() + def __init__(self, **kwargs): + super(NewsArticle, self).__init__(**kwargs) self.category = None self.headline = None self.clustered_articles = None diff --git a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/news_article_py3.py b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/news_article_py3.py new file mode 100644 index 000000000000..bd2b563bd7d9 --- /dev/null +++ b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/news_article_py3.py @@ -0,0 +1,114 @@ +# 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 .article import Article + + +class NewsArticle(Article): + """Defines a news article. + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.newssearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar thumbnail_url: The URL to a thumbnail of the item. + :vartype thumbnail_url: str + :ivar provider: The source of the creative work. + :vartype provider: + list[~azure.cognitiveservices.search.newssearch.models.Thing] + :ivar date_published: The date on which the CreativeWork was published. + :vartype date_published: str + :ivar video: A video of the item. + :vartype video: + ~azure.cognitiveservices.search.newssearch.models.VideoObject + :ivar word_count: The number of words in the text of the Article. + :vartype word_count: int + :ivar category: The news category that the article belongs to. For + example, Sports. If the news category cannot be determined, the article + does not include this field. + :vartype category: str + :ivar headline: A Boolean value that indicates whether the news article is + a headline. If true, the article is a headline. The article includes this + field only for news categories requests that do not specify the category + query parameter. + :vartype headline: bool + :ivar clustered_articles: A list of related news articles. + :vartype clustered_articles: + list[~azure.cognitiveservices.search.newssearch.models.NewsArticle] + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'thumbnail_url': {'readonly': True}, + 'provider': {'readonly': True}, + 'date_published': {'readonly': True}, + 'video': {'readonly': True}, + 'word_count': {'readonly': True}, + 'category': {'readonly': True}, + 'headline': {'readonly': True}, + 'clustered_articles': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'thumbnail_url': {'key': 'thumbnailUrl', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': '[Thing]'}, + 'date_published': {'key': 'datePublished', 'type': 'str'}, + 'video': {'key': 'video', 'type': 'VideoObject'}, + 'word_count': {'key': 'wordCount', 'type': 'int'}, + 'category': {'key': 'category', 'type': 'str'}, + 'headline': {'key': 'headline', 'type': 'bool'}, + 'clustered_articles': {'key': 'clusteredArticles', 'type': '[NewsArticle]'}, + } + + def __init__(self, **kwargs) -> None: + super(NewsArticle, self).__init__(**kwargs) + self.category = None + self.headline = None + self.clustered_articles = None + self._type = 'NewsArticle' diff --git a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/news_py3.py b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/news_py3.py new file mode 100644 index 000000000000..92c414ebb22a --- /dev/null +++ b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/news_py3.py @@ -0,0 +1,69 @@ +# 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 .search_results_answer import SearchResultsAnswer + + +class News(SearchResultsAnswer): + """Defines a news answer. + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar follow_up_queries: + :vartype follow_up_queries: + list[~azure.cognitiveservices.search.newssearch.models.Query] + :ivar total_estimated_matches: The estimated number of webpages that are + relevant to the query. Use this number along with the count and offset + query parameters to page the results. + :vartype total_estimated_matches: long + :param value: Required. An array of NewsArticle objects that contain + information about news articles that are relevant to the query. If there + are no results to return for the request, the array is empty. + :type value: + list[~azure.cognitiveservices.search.newssearch.models.NewsArticle] + :ivar location: Location of local news + :vartype location: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'follow_up_queries': {'readonly': True}, + 'total_estimated_matches': {'readonly': True}, + 'value': {'required': True}, + 'location': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'follow_up_queries': {'key': 'followUpQueries', 'type': '[Query]'}, + 'total_estimated_matches': {'key': 'totalEstimatedMatches', 'type': 'long'}, + 'value': {'key': 'value', 'type': '[NewsArticle]'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, *, value, **kwargs) -> None: + super(News, self).__init__(**kwargs) + self.value = value + self.location = None + self._type = 'News' diff --git a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/news_search_api_enums.py b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/news_search_api_enums.py index 0a73b849775c..0787199ed23c 100644 --- a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/news_search_api_enums.py +++ b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/news_search_api_enums.py @@ -12,7 +12,7 @@ from enum import Enum -class ErrorCode(Enum): +class ErrorCode(str, Enum): none = "None" server_error = "ServerError" @@ -22,7 +22,7 @@ class ErrorCode(Enum): insufficient_authorization = "InsufficientAuthorization" -class ErrorSubCode(Enum): +class ErrorSubCode(str, Enum): unexpected_error = "UnexpectedError" resource_error = "ResourceError" @@ -37,21 +37,21 @@ class ErrorSubCode(Enum): authorization_expired = "AuthorizationExpired" -class Freshness(Enum): +class Freshness(str, Enum): day = "Day" week = "Week" month = "Month" -class SafeSearch(Enum): +class SafeSearch(str, Enum): off = "Off" moderate = "Moderate" strict = "Strict" -class TextFormat(Enum): +class TextFormat(str, Enum): raw = "Raw" html = "Html" diff --git a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/news_topic.py b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/news_topic.py index 492c1065ba1f..dc073ce4ec99 100644 --- a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/news_topic.py +++ b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/news_topic.py @@ -18,7 +18,9 @@ class NewsTopic(Thing): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -79,8 +81,8 @@ class NewsTopic(Thing): 'news_search_url': {'key': 'newsSearchUrl', 'type': 'str'}, } - def __init__(self): - super(NewsTopic, self).__init__() + def __init__(self, **kwargs): + super(NewsTopic, self).__init__(**kwargs) self.is_breaking_news = None self.query = None self.news_search_url = None diff --git a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/news_topic_py3.py b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/news_topic_py3.py new file mode 100644 index 000000000000..b61ad0fdc80b --- /dev/null +++ b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/news_topic_py3.py @@ -0,0 +1,89 @@ +# 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 .thing import Thing + + +class NewsTopic(Thing): + """NewsTopic. + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.newssearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar is_breaking_news: A Boolean value that indicates whether the topic + is considered breaking news. If the topic is considered breaking news, the + value is true. + :vartype is_breaking_news: bool + :ivar query: A search query term that returns this trending topic. + :vartype query: ~azure.cognitiveservices.search.newssearch.models.Query + :ivar news_search_url: The URL to the Bing News search results for the + search query term + :vartype news_search_url: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'is_breaking_news': {'readonly': True}, + 'query': {'readonly': True}, + 'news_search_url': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'is_breaking_news': {'key': 'isBreakingNews', 'type': 'bool'}, + 'query': {'key': 'query', 'type': 'Query'}, + 'news_search_url': {'key': 'newsSearchUrl', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(NewsTopic, self).__init__(**kwargs) + self.is_breaking_news = None + self.query = None + self.news_search_url = None + self._type = 'News/Topic' diff --git a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/organization.py b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/organization.py index a04f571ed8c0..3d6aafa2c4d6 100644 --- a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/organization.py +++ b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/organization.py @@ -18,7 +18,9 @@ class Organization(Thing): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -52,6 +54,18 @@ class Organization(Thing): 'bing_id': {'readonly': True}, } - def __init__(self): - super(Organization, self).__init__() + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Organization, self).__init__(**kwargs) self._type = 'Organization' diff --git a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/organization_py3.py b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/organization_py3.py new file mode 100644 index 000000000000..3669f433266b --- /dev/null +++ b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/organization_py3.py @@ -0,0 +1,71 @@ +# 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 .thing import Thing + + +class Organization(Thing): + """Defines an organization. + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.newssearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Organization, self).__init__(**kwargs) + self._type = 'Organization' diff --git a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/query.py b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/query.py index 5fadce8bde62..7d8e95a283a2 100644 --- a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/query.py +++ b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/query.py @@ -18,8 +18,10 @@ class Query(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param text: The query string. Use this string as the query term in a new - search request. + All required parameters must be populated in order to send to Azure. + + :param text: Required. The query string. Use this string as the query term + in a new search request. :type text: str :ivar display_text: The display version of the query term. This version of the query term may contain special characters that highlight the search @@ -56,9 +58,9 @@ class Query(Model): 'thumbnail': {'key': 'thumbnail', 'type': 'ImageObject'}, } - def __init__(self, text): - super(Query, self).__init__() - self.text = text + def __init__(self, **kwargs): + super(Query, self).__init__(**kwargs) + self.text = kwargs.get('text', None) self.display_text = None self.web_search_url = None self.search_link = None diff --git a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/query_py3.py b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/query_py3.py new file mode 100644 index 000000000000..23a849e31558 --- /dev/null +++ b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/query_py3.py @@ -0,0 +1,67 @@ +# 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 msrest.serialization import Model + + +class Query(Model): + """Defines a search query. + + 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 Azure. + + :param text: Required. The query string. Use this string as the query term + in a new search request. + :type text: str + :ivar display_text: The display version of the query term. This version of + the query term may contain special characters that highlight the search + term found in the query string. The string contains the highlighting + characters only if the query enabled hit highlighting + :vartype display_text: str + :ivar web_search_url: The URL that takes the user to the Bing search + results page for the query.Only related search results include this field. + :vartype web_search_url: str + :ivar search_link: The URL that you use to get the results of the related + search. Before using the URL, you must append query parameters as + appropriate and include the Ocp-Apim-Subscription-Key header. Use this URL + if you're displaying the results in your own user interface. Otherwise, + use the webSearchUrl URL. + :vartype search_link: str + :ivar thumbnail: The URL to a thumbnail of a related image. + :vartype thumbnail: + ~azure.cognitiveservices.search.newssearch.models.ImageObject + """ + + _validation = { + 'text': {'required': True}, + 'display_text': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'search_link': {'readonly': True}, + 'thumbnail': {'readonly': True}, + } + + _attribute_map = { + 'text': {'key': 'text', 'type': 'str'}, + 'display_text': {'key': 'displayText', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'search_link': {'key': 'searchLink', 'type': 'str'}, + 'thumbnail': {'key': 'thumbnail', 'type': 'ImageObject'}, + } + + def __init__(self, *, text: str, **kwargs) -> None: + super(Query, self).__init__(**kwargs) + self.text = text + self.display_text = None + self.web_search_url = None + self.search_link = None + self.thumbnail = None diff --git a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/response.py b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/response.py index 067f3686ba81..81d1703aa891 100644 --- a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/response.py +++ b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/response.py @@ -22,7 +22,9 @@ class Response(Identifiable): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -46,7 +48,7 @@ class Response(Identifiable): '_type': {'Answer': 'Answer', 'Thing': 'Thing', 'ErrorResponse': 'ErrorResponse'} } - def __init__(self): - super(Response, self).__init__() + def __init__(self, **kwargs): + super(Response, self).__init__(**kwargs) self.web_search_url = None self._type = 'Response' diff --git a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/response_base.py b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/response_base.py index a0aa392f833b..fd44632cfc0a 100644 --- a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/response_base.py +++ b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/response_base.py @@ -18,7 +18,9 @@ class ResponseBase(Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: Identifiable - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str """ @@ -34,6 +36,6 @@ class ResponseBase(Model): '_type': {'Identifiable': 'Identifiable'} } - def __init__(self): - super(ResponseBase, self).__init__() + def __init__(self, **kwargs): + super(ResponseBase, self).__init__(**kwargs) self._type = None diff --git a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/response_base_py3.py b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/response_base_py3.py new file mode 100644 index 000000000000..680e0fe98ab4 --- /dev/null +++ b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/response_base_py3.py @@ -0,0 +1,41 @@ +# 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 msrest.serialization import Model + + +class ResponseBase(Model): + """Response base. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: Identifiable + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + """ + + _validation = { + '_type': {'required': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'Identifiable': 'Identifiable'} + } + + def __init__(self, **kwargs) -> None: + super(ResponseBase, self).__init__(**kwargs) + self._type = None diff --git a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/response_py3.py b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/response_py3.py new file mode 100644 index 000000000000..483a96700a73 --- /dev/null +++ b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/response_py3.py @@ -0,0 +1,54 @@ +# 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 .identifiable import Identifiable + + +class Response(Identifiable): + """Defines a response. All schemas that could be returned at the root of a + response should inherit from this. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: Answer, Thing, ErrorResponse + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'web_search_url': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'Answer': 'Answer', 'Thing': 'Thing', 'ErrorResponse': 'ErrorResponse'} + } + + def __init__(self, **kwargs) -> None: + super(Response, self).__init__(**kwargs) + self.web_search_url = None + self._type = 'Response' diff --git a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/search_results_answer.py b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/search_results_answer.py index 050d965dd692..582f713380ec 100644 --- a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/search_results_answer.py +++ b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/search_results_answer.py @@ -21,7 +21,9 @@ class SearchResultsAnswer(Answer): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -56,7 +58,7 @@ class SearchResultsAnswer(Answer): '_type': {'News': 'News'} } - def __init__(self): - super(SearchResultsAnswer, self).__init__() + def __init__(self, **kwargs): + super(SearchResultsAnswer, self).__init__(**kwargs) self.total_estimated_matches = None self._type = 'SearchResultsAnswer' diff --git a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/search_results_answer_py3.py b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/search_results_answer_py3.py new file mode 100644 index 000000000000..adf75174e8ff --- /dev/null +++ b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/search_results_answer_py3.py @@ -0,0 +1,64 @@ +# 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 .answer import Answer + + +class SearchResultsAnswer(Answer): + """Defines a search result answer. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: News + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar follow_up_queries: + :vartype follow_up_queries: + list[~azure.cognitiveservices.search.newssearch.models.Query] + :ivar total_estimated_matches: The estimated number of webpages that are + relevant to the query. Use this number along with the count and offset + query parameters to page the results. + :vartype total_estimated_matches: long + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'follow_up_queries': {'readonly': True}, + 'total_estimated_matches': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'follow_up_queries': {'key': 'followUpQueries', 'type': '[Query]'}, + 'total_estimated_matches': {'key': 'totalEstimatedMatches', 'type': 'long'}, + } + + _subtype_map = { + '_type': {'News': 'News'} + } + + def __init__(self, **kwargs) -> None: + super(SearchResultsAnswer, self).__init__(**kwargs) + self.total_estimated_matches = None + self._type = 'SearchResultsAnswer' diff --git a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/thing.py b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/thing.py index c71483745bed..2c30d1651138 100644 --- a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/thing.py +++ b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/thing.py @@ -21,7 +21,9 @@ class Thing(Response): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -71,8 +73,8 @@ class Thing(Response): '_type': {'News/Topic': 'NewsTopic', 'CreativeWork': 'CreativeWork', 'Organization': 'Organization'} } - def __init__(self): - super(Thing, self).__init__() + def __init__(self, **kwargs): + super(Thing, self).__init__(**kwargs) self.name = None self.url = None self.image = None diff --git a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/thing_py3.py b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/thing_py3.py new file mode 100644 index 000000000000..ad750c53b212 --- /dev/null +++ b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/thing_py3.py @@ -0,0 +1,84 @@ +# 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 .response import Response + + +class Thing(Response): + """Defines a thing. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: NewsTopic, CreativeWork, Organization + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.newssearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'News/Topic': 'NewsTopic', 'CreativeWork': 'CreativeWork', 'Organization': 'Organization'} + } + + def __init__(self, **kwargs) -> None: + super(Thing, self).__init__(**kwargs) + self.name = None + self.url = None + self.image = None + self.description = None + self.alternate_name = None + self.bing_id = None + self._type = 'Thing' diff --git a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/trending_topics.py b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/trending_topics.py index 2d6982e45cab..33cbfddd39f1 100644 --- a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/trending_topics.py +++ b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/trending_topics.py @@ -18,7 +18,9 @@ class TrendingTopics(Answer): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -27,7 +29,7 @@ class TrendingTopics(Answer): :ivar follow_up_queries: :vartype follow_up_queries: list[~azure.cognitiveservices.search.newssearch.models.Query] - :param value: A list of trending news topics on Bing + :param value: Required. A list of trending news topics on Bing :type value: list[~azure.cognitiveservices.search.newssearch.models.NewsTopic] """ @@ -48,7 +50,7 @@ class TrendingTopics(Answer): 'value': {'key': 'value', 'type': '[NewsTopic]'}, } - def __init__(self, value): - super(TrendingTopics, self).__init__() - self.value = value + def __init__(self, **kwargs): + super(TrendingTopics, self).__init__(**kwargs) + self.value = kwargs.get('value', None) self._type = 'TrendingTopics' diff --git a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/trending_topics_py3.py b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/trending_topics_py3.py new file mode 100644 index 000000000000..9a5419e150f6 --- /dev/null +++ b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/trending_topics_py3.py @@ -0,0 +1,56 @@ +# 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 .answer import Answer + + +class TrendingTopics(Answer): + """TrendingTopics. + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar follow_up_queries: + :vartype follow_up_queries: + list[~azure.cognitiveservices.search.newssearch.models.Query] + :param value: Required. A list of trending news topics on Bing + :type value: + list[~azure.cognitiveservices.search.newssearch.models.NewsTopic] + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'follow_up_queries': {'readonly': True}, + 'value': {'required': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'follow_up_queries': {'key': 'followUpQueries', 'type': '[Query]'}, + 'value': {'key': 'value', 'type': '[NewsTopic]'}, + } + + def __init__(self, *, value, **kwargs) -> None: + super(TrendingTopics, self).__init__(**kwargs) + self.value = value + self._type = 'TrendingTopics' diff --git a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/video_object.py b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/video_object.py index 17b29f18a915..d499914afb38 100644 --- a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/video_object.py +++ b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/video_object.py @@ -18,7 +18,9 @@ class VideoObject(MediaObject): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -132,8 +134,8 @@ class VideoObject(MediaObject): 'is_superfresh': {'key': 'isSuperfresh', 'type': 'bool'}, } - def __init__(self): - super(VideoObject, self).__init__() + def __init__(self, **kwargs): + super(VideoObject, self).__init__(**kwargs) self.motion_thumbnail_url = None self.motion_thumbnail_id = None self.embed_html = None diff --git a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/video_object_py3.py b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/video_object_py3.py new file mode 100644 index 000000000000..a1b02740da1b --- /dev/null +++ b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/video_object_py3.py @@ -0,0 +1,148 @@ +# 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 .media_object import MediaObject + + +class VideoObject(MediaObject): + """Defines a video object that is relevant to the query. + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.newssearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar thumbnail_url: The URL to a thumbnail of the item. + :vartype thumbnail_url: str + :ivar provider: The source of the creative work. + :vartype provider: + list[~azure.cognitiveservices.search.newssearch.models.Thing] + :ivar date_published: The date on which the CreativeWork was published. + :vartype date_published: str + :ivar video: A video of the item. + :vartype video: + ~azure.cognitiveservices.search.newssearch.models.VideoObject + :ivar content_url: Original URL to retrieve the source (file) for the + media object (e.g the source URL for the image). + :vartype content_url: str + :ivar width: The width of the source media object, in pixels. + :vartype width: int + :ivar height: The height of the source media object, in pixels. + :vartype height: int + :ivar motion_thumbnail_url: + :vartype motion_thumbnail_url: str + :ivar motion_thumbnail_id: + :vartype motion_thumbnail_id: str + :ivar embed_html: + :vartype embed_html: str + :ivar allow_https_embed: + :vartype allow_https_embed: bool + :ivar view_count: + :vartype view_count: int + :ivar thumbnail: + :vartype thumbnail: + ~azure.cognitiveservices.search.newssearch.models.ImageObject + :ivar video_id: + :vartype video_id: str + :ivar allow_mobile_embed: + :vartype allow_mobile_embed: bool + :ivar is_superfresh: + :vartype is_superfresh: bool + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'thumbnail_url': {'readonly': True}, + 'provider': {'readonly': True}, + 'date_published': {'readonly': True}, + 'video': {'readonly': True}, + 'content_url': {'readonly': True}, + 'width': {'readonly': True}, + 'height': {'readonly': True}, + 'motion_thumbnail_url': {'readonly': True}, + 'motion_thumbnail_id': {'readonly': True}, + 'embed_html': {'readonly': True}, + 'allow_https_embed': {'readonly': True}, + 'view_count': {'readonly': True}, + 'thumbnail': {'readonly': True}, + 'video_id': {'readonly': True}, + 'allow_mobile_embed': {'readonly': True}, + 'is_superfresh': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'thumbnail_url': {'key': 'thumbnailUrl', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': '[Thing]'}, + 'date_published': {'key': 'datePublished', 'type': 'str'}, + 'video': {'key': 'video', 'type': 'VideoObject'}, + 'content_url': {'key': 'contentUrl', 'type': 'str'}, + 'width': {'key': 'width', 'type': 'int'}, + 'height': {'key': 'height', 'type': 'int'}, + 'motion_thumbnail_url': {'key': 'motionThumbnailUrl', 'type': 'str'}, + 'motion_thumbnail_id': {'key': 'motionThumbnailId', 'type': 'str'}, + 'embed_html': {'key': 'embedHtml', 'type': 'str'}, + 'allow_https_embed': {'key': 'allowHttpsEmbed', 'type': 'bool'}, + 'view_count': {'key': 'viewCount', 'type': 'int'}, + 'thumbnail': {'key': 'thumbnail', 'type': 'ImageObject'}, + 'video_id': {'key': 'videoId', 'type': 'str'}, + 'allow_mobile_embed': {'key': 'allowMobileEmbed', 'type': 'bool'}, + 'is_superfresh': {'key': 'isSuperfresh', 'type': 'bool'}, + } + + def __init__(self, **kwargs) -> None: + super(VideoObject, self).__init__(**kwargs) + self.motion_thumbnail_url = None + self.motion_thumbnail_id = None + self.embed_html = None + self.allow_https_embed = None + self.view_count = None + self.thumbnail = None + self.video_id = None + self.allow_mobile_embed = None + self.is_superfresh = None + self._type = 'VideoObject' diff --git a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/news_search_api.py b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/news_search_api.py index 6314f3a2aa5c..91fd1659ff4e 100644 --- a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/news_search_api.py +++ b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/news_search_api.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import ServiceClient +from msrest.service_client import SDKClient from msrest import Configuration, Serializer, Deserializer from .version import VERSION from .operations.news_operations import NewsOperations @@ -42,7 +42,7 @@ def __init__( self.credentials = credentials -class NewsSearchAPI(object): +class NewsSearchAPI(SDKClient): """The News Search API lets you send a search query to Bing and get back a list of news that are relevant to the search query. This section provides technical details about the query parameters and headers that you use to request news and the JSON response objects that contain them. For examples that show how to make requests, see [Searching the web for news](https://docs.microsoft.com/en-us/azure/cognitive-services/bing-news-search/search-the-web). :ivar config: Configuration for client. @@ -61,7 +61,7 @@ def __init__( self, credentials, base_url=None): self.config = NewsSearchAPIConfiguration(credentials, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + super(NewsSearchAPI, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self.api_version = '1.0' diff --git a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/operations/news_operations.py b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/operations/news_operations.py index 7e3386fafe61..984cfb09ffa7 100644 --- a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/operations/news_operations.py +++ b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/operations/news_operations.py @@ -320,7 +320,7 @@ def search( :class:`ErrorResponseException` """ # Construct URL - url = '/news/search' + url = self.search.metadata['url'] # Construct parameters query_parameters = {} @@ -382,6 +382,7 @@ def search( return client_raw_response return deserialized + search.metadata = {'url': '/news/search'} def category( self, accept_language=None, user_agent=None, client_id=None, client_ip=None, location=None, country_code=None, category=None, count=None, headline_count=None, market=None, offset=None, original_image=None, safe_search=None, set_lang=None, text_decorations=None, text_format=None, custom_headers=None, raw=False, **operation_config): @@ -555,7 +556,7 @@ def category( by 20 (for example, 0, 20, 40). It is possible for multiple pages to include some overlap in results. If you do not specify the [category](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-news-api-v7-reference#category) - parameter, Bing ignores this paramter. + parameter, Bing ignores this parameter. :type count: int :param headline_count: The number of headline articles to return in the response. The default is 12. Specify this parameter only if you do @@ -591,7 +592,7 @@ def category( example, 0, 20, 40). It is possible for multiple pages to include some overlap in results. If you do not specify the [category](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-news-api-v7-reference#category) - parameter, Bing ignores this paramter. + parameter, Bing ignores this parameter. :type offset: int :param original_image: A Boolean value that determines whether the image's contentUrl contains a URL that points to a thumbnail of the @@ -665,7 +666,7 @@ def category( :class:`ErrorResponseException` """ # Construct URL - url = '/news' + url = self.category.metadata['url'] # Construct parameters query_parameters = {} @@ -726,6 +727,7 @@ def category( return client_raw_response return deserialized + category.metadata = {'url': '/news'} def trending( self, accept_language=None, user_agent=None, client_id=None, client_ip=None, location=None, country_code=None, count=None, market=None, offset=None, safe_search=None, set_lang=None, since=None, sort_by=None, text_decorations=None, text_format=None, custom_headers=None, raw=False, **operation_config): @@ -992,7 +994,7 @@ def trending( :class:`ErrorResponseException` """ # Construct URL - url = '/news/trendingtopics' + url = self.trending.metadata['url'] # Construct parameters query_parameters = {} @@ -1051,3 +1053,4 @@ def trending( return client_raw_response return deserialized + trending.metadata = {'url': '/news/trendingtopics'} diff --git a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/version.py b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/version.py index e0ec669828cb..63d89bfb54fa 100644 --- a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/version.py +++ b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.1.0" +VERSION = "1.0" diff --git a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/__init__.py b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/__init__.py index 2df4a0994579..b8ec88b67cc4 100644 --- a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/__init__.py +++ b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/__init__.py @@ -9,28 +9,52 @@ # regenerated. # -------------------------------------------------------------------------- -from .image_object import ImageObject -from .video_object import VideoObject -from .query import Query -from .pivot_suggestions import PivotSuggestions -from .videos import Videos -from .search_results_answer import SearchResultsAnswer -from .answer import Answer -from .query_context import QueryContext -from .media_object import MediaObject -from .response import Response -from .thing import Thing -from .creative_work import CreativeWork -from .identifiable import Identifiable -from .error import Error -from .error_response import ErrorResponse, ErrorResponseException -from .trending_videos_tile import TrendingVideosTile -from .trending_videos_subcategory import TrendingVideosSubcategory -from .trending_videos_category import TrendingVideosCategory -from .trending_videos import TrendingVideos -from .videos_module import VideosModule -from .video_details import VideoDetails -from .response_base import ResponseBase +try: + from .image_object_py3 import ImageObject + from .video_object_py3 import VideoObject + from .query_py3 import Query + from .pivot_suggestions_py3 import PivotSuggestions + from .videos_py3 import Videos + from .search_results_answer_py3 import SearchResultsAnswer + from .answer_py3 import Answer + from .query_context_py3 import QueryContext + from .media_object_py3 import MediaObject + from .response_py3 import Response + from .thing_py3 import Thing + from .creative_work_py3 import CreativeWork + from .identifiable_py3 import Identifiable + from .error_py3 import Error + from .error_response_py3 import ErrorResponse, ErrorResponseException + from .trending_videos_tile_py3 import TrendingVideosTile + from .trending_videos_subcategory_py3 import TrendingVideosSubcategory + from .trending_videos_category_py3 import TrendingVideosCategory + from .trending_videos_py3 import TrendingVideos + from .videos_module_py3 import VideosModule + from .video_details_py3 import VideoDetails + from .response_base_py3 import ResponseBase +except (SyntaxError, ImportError): + from .image_object import ImageObject + from .video_object import VideoObject + from .query import Query + from .pivot_suggestions import PivotSuggestions + from .videos import Videos + from .search_results_answer import SearchResultsAnswer + from .answer import Answer + from .query_context import QueryContext + from .media_object import MediaObject + from .response import Response + from .thing import Thing + from .creative_work import CreativeWork + from .identifiable import Identifiable + from .error import Error + from .error_response import ErrorResponse, ErrorResponseException + from .trending_videos_tile import TrendingVideosTile + from .trending_videos_subcategory import TrendingVideosSubcategory + from .trending_videos_category import TrendingVideosCategory + from .trending_videos import TrendingVideos + from .videos_module import VideosModule + from .video_details import VideoDetails + from .response_base import ResponseBase from .video_search_api_enums import ( VideoQueryScenario, ErrorCode, diff --git a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/answer.py b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/answer.py index ea0eac78cec7..73044962c5cd 100644 --- a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/answer.py +++ b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/answer.py @@ -21,7 +21,9 @@ class Answer(Response): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -50,7 +52,7 @@ class Answer(Response): '_type': {'SearchResultsAnswer': 'SearchResultsAnswer'} } - def __init__(self): - super(Answer, self).__init__() + def __init__(self, **kwargs): + super(Answer, self).__init__(**kwargs) self.follow_up_queries = None self._type = 'Answer' diff --git a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/answer_py3.py b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/answer_py3.py new file mode 100644 index 000000000000..ffef129bd72c --- /dev/null +++ b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/answer_py3.py @@ -0,0 +1,58 @@ +# 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 .response import Response + + +class Answer(Response): + """Answer. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: SearchResultsAnswer + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar follow_up_queries: + :vartype follow_up_queries: + list[~azure.cognitiveservices.search.videosearch.models.Query] + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'follow_up_queries': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'follow_up_queries': {'key': 'followUpQueries', 'type': '[Query]'}, + } + + _subtype_map = { + '_type': {'SearchResultsAnswer': 'SearchResultsAnswer'} + } + + def __init__(self, **kwargs) -> None: + super(Answer, self).__init__(**kwargs) + self.follow_up_queries = None + self._type = 'Answer' diff --git a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/creative_work.py b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/creative_work.py index 2609c0cfffdb..9ba0cbdb94e8 100644 --- a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/creative_work.py +++ b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/creative_work.py @@ -21,7 +21,9 @@ class CreativeWork(Thing): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -84,8 +86,8 @@ class CreativeWork(Thing): '_type': {'MediaObject': 'MediaObject'} } - def __init__(self): - super(CreativeWork, self).__init__() + def __init__(self, **kwargs): + super(CreativeWork, self).__init__(**kwargs) self.thumbnail_url = None self.provider = None self.text = None diff --git a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/creative_work_py3.py b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/creative_work_py3.py new file mode 100644 index 000000000000..103d95d07c7c --- /dev/null +++ b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/creative_work_py3.py @@ -0,0 +1,94 @@ +# 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 .thing import Thing + + +class CreativeWork(Thing): + """CreativeWork. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: MediaObject + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: + :vartype image: + ~azure.cognitiveservices.search.videosearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar thumbnail_url: The URL to a thumbnail of the item. + :vartype thumbnail_url: str + :ivar provider: The source of the creative work. + :vartype provider: + list[~azure.cognitiveservices.search.videosearch.models.Thing] + :ivar text: + :vartype text: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'thumbnail_url': {'readonly': True}, + 'provider': {'readonly': True}, + 'text': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'thumbnail_url': {'key': 'thumbnailUrl', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': '[Thing]'}, + 'text': {'key': 'text', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'MediaObject': 'MediaObject'} + } + + def __init__(self, **kwargs) -> None: + super(CreativeWork, self).__init__(**kwargs) + self.thumbnail_url = None + self.provider = None + self.text = None + self._type = 'CreativeWork' diff --git a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/error.py b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/error.py index 16ddd26d1e53..c56d8acc60dc 100644 --- a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/error.py +++ b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/error.py @@ -18,8 +18,10 @@ class Error(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param code: The error code that identifies the category of error. - Possible values include: 'None', 'ServerError', 'InvalidRequest', + All required parameters must be populated in order to send to Azure. + + :param code: Required. The error code that identifies the category of + error. Possible values include: 'None', 'ServerError', 'InvalidRequest', 'RateLimitExceeded', 'InvalidAuthorization', 'InsufficientAuthorization'. Default value: "None" . :type code: str or @@ -31,7 +33,7 @@ class Error(Model): 'AuthorizationRedundancy', 'AuthorizationDisabled', 'AuthorizationExpired' :vartype sub_code: str or ~azure.cognitiveservices.search.videosearch.models.ErrorSubCode - :param message: A description of the error. + :param message: Required. A description of the error. :type message: str :ivar more_details: A description that provides additional information about the error. @@ -60,11 +62,11 @@ class Error(Model): 'value': {'key': 'value', 'type': 'str'}, } - def __init__(self, message, code="None"): - super(Error, self).__init__() - self.code = code + def __init__(self, **kwargs): + super(Error, self).__init__(**kwargs) + self.code = kwargs.get('code', "None") self.sub_code = None - self.message = message + self.message = kwargs.get('message', None) self.more_details = None self.parameter = None self.value = None diff --git a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/error_py3.py b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/error_py3.py new file mode 100644 index 000000000000..ca37ac713c5d --- /dev/null +++ b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/error_py3.py @@ -0,0 +1,72 @@ +# 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 msrest.serialization import Model + + +class Error(Model): + """Defines the error that occurred. + + 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 Azure. + + :param code: Required. The error code that identifies the category of + error. Possible values include: 'None', 'ServerError', 'InvalidRequest', + 'RateLimitExceeded', 'InvalidAuthorization', 'InsufficientAuthorization'. + Default value: "None" . + :type code: str or + ~azure.cognitiveservices.search.videosearch.models.ErrorCode + :ivar sub_code: The error code that further helps to identify the error. + Possible values include: 'UnexpectedError', 'ResourceError', + 'NotImplemented', 'ParameterMissing', 'ParameterInvalidValue', + 'HttpNotAllowed', 'Blocked', 'AuthorizationMissing', + 'AuthorizationRedundancy', 'AuthorizationDisabled', 'AuthorizationExpired' + :vartype sub_code: str or + ~azure.cognitiveservices.search.videosearch.models.ErrorSubCode + :param message: Required. A description of the error. + :type message: str + :ivar more_details: A description that provides additional information + about the error. + :vartype more_details: str + :ivar parameter: The parameter in the request that caused the error. + :vartype parameter: str + :ivar value: The parameter's value in the request that was not valid. + :vartype value: str + """ + + _validation = { + 'code': {'required': True}, + 'sub_code': {'readonly': True}, + 'message': {'required': True}, + 'more_details': {'readonly': True}, + 'parameter': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'ErrorCode'}, + 'sub_code': {'key': 'subCode', 'type': 'ErrorSubCode'}, + 'message': {'key': 'message', 'type': 'str'}, + 'more_details': {'key': 'moreDetails', 'type': 'str'}, + 'parameter': {'key': 'parameter', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, message: str, code="None", **kwargs) -> None: + super(Error, self).__init__(**kwargs) + self.code = code + self.sub_code = None + self.message = message + self.more_details = None + self.parameter = None + self.value = None diff --git a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/error_response.py b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/error_response.py index 9784030fe36c..be07fe5afa93 100644 --- a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/error_response.py +++ b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/error_response.py @@ -19,14 +19,16 @@ class ErrorResponse(Response): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str :ivar web_search_url: The URL To Bing's search result for this item. :vartype web_search_url: str - :param errors: A list of errors that describe the reasons why the request - failed. + :param errors: Required. A list of errors that describe the reasons why + the request failed. :type errors: list[~azure.cognitiveservices.search.videosearch.models.Error] """ @@ -45,9 +47,9 @@ class ErrorResponse(Response): 'errors': {'key': 'errors', 'type': '[Error]'}, } - def __init__(self, errors): - super(ErrorResponse, self).__init__() - self.errors = errors + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.errors = kwargs.get('errors', None) self._type = 'ErrorResponse' diff --git a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/error_response_py3.py b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/error_response_py3.py new file mode 100644 index 000000000000..656e8eea6939 --- /dev/null +++ b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/error_response_py3.py @@ -0,0 +1,65 @@ +# 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 .response import Response +from msrest.exceptions import HttpOperationError + + +class ErrorResponse(Response): + """The top-level response that represents a failed request. + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :param errors: Required. A list of errors that describe the reasons why + the request failed. + :type errors: + list[~azure.cognitiveservices.search.videosearch.models.Error] + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'errors': {'required': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'errors': {'key': 'errors', 'type': '[Error]'}, + } + + def __init__(self, *, errors, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.errors = errors + self._type = 'ErrorResponse' + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/identifiable.py b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/identifiable.py index 133e93fa8f94..513e53d238bb 100644 --- a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/identifiable.py +++ b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/identifiable.py @@ -21,7 +21,9 @@ class Identifiable(ResponseBase): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -41,7 +43,7 @@ class Identifiable(ResponseBase): '_type': {'Response': 'Response'} } - def __init__(self): - super(Identifiable, self).__init__() + def __init__(self, **kwargs): + super(Identifiable, self).__init__(**kwargs) self.id = None self._type = 'Identifiable' diff --git a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/identifiable_py3.py b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/identifiable_py3.py new file mode 100644 index 000000000000..c87dc0347e3d --- /dev/null +++ b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/identifiable_py3.py @@ -0,0 +1,49 @@ +# 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 .response_base import ResponseBase + + +class Identifiable(ResponseBase): + """Defines the identity of a resource. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: Response + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'Response': 'Response'} + } + + def __init__(self, **kwargs) -> None: + super(Identifiable, self).__init__(**kwargs) + self.id = None + self._type = 'Identifiable' diff --git a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/image_object.py b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/image_object.py index 3cb3a380911f..cc2e7809848f 100644 --- a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/image_object.py +++ b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/image_object.py @@ -18,7 +18,9 @@ class ImageObject(MediaObject): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -99,7 +101,7 @@ class ImageObject(MediaObject): 'thumbnail': {'key': 'thumbnail', 'type': 'ImageObject'}, } - def __init__(self): - super(ImageObject, self).__init__() + def __init__(self, **kwargs): + super(ImageObject, self).__init__(**kwargs) self.thumbnail = None self._type = 'ImageObject' diff --git a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/image_object_py3.py b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/image_object_py3.py new file mode 100644 index 000000000000..ebe0d1896ba0 --- /dev/null +++ b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/image_object_py3.py @@ -0,0 +1,107 @@ +# 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 .media_object import MediaObject + + +class ImageObject(MediaObject): + """Defines an image. + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: + :vartype image: + ~azure.cognitiveservices.search.videosearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar thumbnail_url: The URL to a thumbnail of the item. + :vartype thumbnail_url: str + :ivar provider: The source of the creative work. + :vartype provider: + list[~azure.cognitiveservices.search.videosearch.models.Thing] + :ivar text: + :vartype text: str + :ivar content_url: Original URL to retrieve the source (file) for the + media object (e.g the source URL for the image). + :vartype content_url: str + :ivar host_page_url: URL of the page that hosts the media object. + :vartype host_page_url: str + :ivar width: The width of the source media object, in pixels. + :vartype width: int + :ivar height: The height of the source media object, in pixels. + :vartype height: int + :ivar thumbnail: The URL to a thumbnail of the image + :vartype thumbnail: + ~azure.cognitiveservices.search.videosearch.models.ImageObject + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'thumbnail_url': {'readonly': True}, + 'provider': {'readonly': True}, + 'text': {'readonly': True}, + 'content_url': {'readonly': True}, + 'host_page_url': {'readonly': True}, + 'width': {'readonly': True}, + 'height': {'readonly': True}, + 'thumbnail': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'thumbnail_url': {'key': 'thumbnailUrl', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': '[Thing]'}, + 'text': {'key': 'text', 'type': 'str'}, + 'content_url': {'key': 'contentUrl', 'type': 'str'}, + 'host_page_url': {'key': 'hostPageUrl', 'type': 'str'}, + 'width': {'key': 'width', 'type': 'int'}, + 'height': {'key': 'height', 'type': 'int'}, + 'thumbnail': {'key': 'thumbnail', 'type': 'ImageObject'}, + } + + def __init__(self, **kwargs) -> None: + super(ImageObject, self).__init__(**kwargs) + self.thumbnail = None + self._type = 'ImageObject' diff --git a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/media_object.py b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/media_object.py index f21eb29ebad1..2a58e90c545b 100644 --- a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/media_object.py +++ b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/media_object.py @@ -21,7 +21,9 @@ class MediaObject(CreativeWork): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -101,8 +103,8 @@ class MediaObject(CreativeWork): '_type': {'ImageObject': 'ImageObject', 'VideoObject': 'VideoObject'} } - def __init__(self): - super(MediaObject, self).__init__() + def __init__(self, **kwargs): + super(MediaObject, self).__init__(**kwargs) self.content_url = None self.host_page_url = None self.width = None diff --git a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/media_object_py3.py b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/media_object_py3.py new file mode 100644 index 000000000000..275e85d158d9 --- /dev/null +++ b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/media_object_py3.py @@ -0,0 +1,112 @@ +# 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 .creative_work import CreativeWork + + +class MediaObject(CreativeWork): + """MediaObject. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ImageObject, VideoObject + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: + :vartype image: + ~azure.cognitiveservices.search.videosearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar thumbnail_url: The URL to a thumbnail of the item. + :vartype thumbnail_url: str + :ivar provider: The source of the creative work. + :vartype provider: + list[~azure.cognitiveservices.search.videosearch.models.Thing] + :ivar text: + :vartype text: str + :ivar content_url: Original URL to retrieve the source (file) for the + media object (e.g the source URL for the image). + :vartype content_url: str + :ivar host_page_url: URL of the page that hosts the media object. + :vartype host_page_url: str + :ivar width: The width of the source media object, in pixels. + :vartype width: int + :ivar height: The height of the source media object, in pixels. + :vartype height: int + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'thumbnail_url': {'readonly': True}, + 'provider': {'readonly': True}, + 'text': {'readonly': True}, + 'content_url': {'readonly': True}, + 'host_page_url': {'readonly': True}, + 'width': {'readonly': True}, + 'height': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'thumbnail_url': {'key': 'thumbnailUrl', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': '[Thing]'}, + 'text': {'key': 'text', 'type': 'str'}, + 'content_url': {'key': 'contentUrl', 'type': 'str'}, + 'host_page_url': {'key': 'hostPageUrl', 'type': 'str'}, + 'width': {'key': 'width', 'type': 'int'}, + 'height': {'key': 'height', 'type': 'int'}, + } + + _subtype_map = { + '_type': {'ImageObject': 'ImageObject', 'VideoObject': 'VideoObject'} + } + + def __init__(self, **kwargs) -> None: + super(MediaObject, self).__init__(**kwargs) + self.content_url = None + self.host_page_url = None + self.width = None + self.height = None + self._type = 'MediaObject' diff --git a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/pivot_suggestions.py b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/pivot_suggestions.py index 9c44c891ee18..6d99fad74def 100644 --- a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/pivot_suggestions.py +++ b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/pivot_suggestions.py @@ -15,9 +15,11 @@ class PivotSuggestions(Model): """PivotSuggestions. - :param pivot: + All required parameters must be populated in order to send to Azure. + + :param pivot: Required. :type pivot: str - :param suggestions: + :param suggestions: Required. :type suggestions: list[~azure.cognitiveservices.search.videosearch.models.Query] """ @@ -32,7 +34,7 @@ class PivotSuggestions(Model): 'suggestions': {'key': 'suggestions', 'type': '[Query]'}, } - def __init__(self, pivot, suggestions): - super(PivotSuggestions, self).__init__() - self.pivot = pivot - self.suggestions = suggestions + def __init__(self, **kwargs): + super(PivotSuggestions, self).__init__(**kwargs) + self.pivot = kwargs.get('pivot', None) + self.suggestions = kwargs.get('suggestions', None) diff --git a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/pivot_suggestions_py3.py b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/pivot_suggestions_py3.py new file mode 100644 index 000000000000..67fbfae0eadf --- /dev/null +++ b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/pivot_suggestions_py3.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class PivotSuggestions(Model): + """PivotSuggestions. + + All required parameters must be populated in order to send to Azure. + + :param pivot: Required. + :type pivot: str + :param suggestions: Required. + :type suggestions: + list[~azure.cognitiveservices.search.videosearch.models.Query] + """ + + _validation = { + 'pivot': {'required': True}, + 'suggestions': {'required': True}, + } + + _attribute_map = { + 'pivot': {'key': 'pivot', 'type': 'str'}, + 'suggestions': {'key': 'suggestions', 'type': '[Query]'}, + } + + def __init__(self, *, pivot: str, suggestions, **kwargs) -> None: + super(PivotSuggestions, self).__init__(**kwargs) + self.pivot = pivot + self.suggestions = suggestions diff --git a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/query.py b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/query.py index 5cc62783638e..e4acdc454ef1 100644 --- a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/query.py +++ b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/query.py @@ -18,8 +18,10 @@ class Query(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param text: The query string. Use this string as the query term in a new - search request. + All required parameters must be populated in order to send to Azure. + + :param text: Required. The query string. Use this string as the query term + in a new search request. :type text: str :ivar display_text: The display version of the query term. This version of the query term may contain special characters that highlight the search @@ -52,9 +54,9 @@ class Query(Model): 'thumbnail': {'key': 'thumbnail', 'type': 'ImageObject'}, } - def __init__(self, text): - super(Query, self).__init__() - self.text = text + def __init__(self, **kwargs): + super(Query, self).__init__(**kwargs) + self.text = kwargs.get('text', None) self.display_text = None self.web_search_url = None self.search_link = None diff --git a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/query_context.py b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/query_context.py index d400056406f2..e15748517245 100644 --- a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/query_context.py +++ b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/query_context.py @@ -18,7 +18,10 @@ class QueryContext(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param original_query: The query string as specified in the request. + All required parameters must be populated in order to send to Azure. + + :param original_query: Required. The query string as specified in the + request. :type original_query: str :ivar altered_query: The query string used by Bing to perform the query. Bing uses the altered query string if the original query string contained @@ -69,9 +72,9 @@ class QueryContext(Model): 'is_transactional': {'key': 'isTransactional', 'type': 'bool'}, } - def __init__(self, original_query): - super(QueryContext, self).__init__() - self.original_query = original_query + def __init__(self, **kwargs): + super(QueryContext, self).__init__(**kwargs) + self.original_query = kwargs.get('original_query', None) self.altered_query = None self.alteration_override_query = None self.adult_intent = None diff --git a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/query_context_py3.py b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/query_context_py3.py new file mode 100644 index 000000000000..631e199f0b66 --- /dev/null +++ b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/query_context_py3.py @@ -0,0 +1,82 @@ +# 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 msrest.serialization import Model + + +class QueryContext(Model): + """Defines the query context that Bing used for the request. + + 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 Azure. + + :param original_query: Required. The query string as specified in the + request. + :type original_query: str + :ivar altered_query: The query string used by Bing to perform the query. + Bing uses the altered query string if the original query string contained + spelling mistakes. For example, if the query string is "saling downwind", + the altered query string will be "sailing downwind". This field is + included only if the original query string contains a spelling mistake. + :vartype altered_query: str + :ivar alteration_override_query: The query string to use to force Bing to + use the original string. For example, if the query string is "saling + downwind", the override query string will be "+saling downwind". Remember + to encode the query string which results in "%2Bsaling+downwind". This + field is included only if the original query string contains a spelling + mistake. + :vartype alteration_override_query: str + :ivar adult_intent: A Boolean value that indicates whether the specified + query has adult intent. The value is true if the query has adult intent; + otherwise, false. + :vartype adult_intent: bool + :ivar ask_user_for_location: A Boolean value that indicates whether Bing + requires the user's location to provide accurate results. If you specified + the user's location by using the X-MSEdge-ClientIP and X-Search-Location + headers, you can ignore this field. For location aware queries, such as + "today's weather" or "restaurants near me" that need the user's location + to provide accurate results, this field is set to true. For location aware + queries that include the location (for example, "Seattle weather"), this + field is set to false. This field is also set to false for queries that + are not location aware, such as "best sellers". + :vartype ask_user_for_location: bool + :ivar is_transactional: + :vartype is_transactional: bool + """ + + _validation = { + 'original_query': {'required': True}, + 'altered_query': {'readonly': True}, + 'alteration_override_query': {'readonly': True}, + 'adult_intent': {'readonly': True}, + 'ask_user_for_location': {'readonly': True}, + 'is_transactional': {'readonly': True}, + } + + _attribute_map = { + 'original_query': {'key': 'originalQuery', 'type': 'str'}, + 'altered_query': {'key': 'alteredQuery', 'type': 'str'}, + 'alteration_override_query': {'key': 'alterationOverrideQuery', 'type': 'str'}, + 'adult_intent': {'key': 'adultIntent', 'type': 'bool'}, + 'ask_user_for_location': {'key': 'askUserForLocation', 'type': 'bool'}, + 'is_transactional': {'key': 'isTransactional', 'type': 'bool'}, + } + + def __init__(self, *, original_query: str, **kwargs) -> None: + super(QueryContext, self).__init__(**kwargs) + self.original_query = original_query + self.altered_query = None + self.alteration_override_query = None + self.adult_intent = None + self.ask_user_for_location = None + self.is_transactional = None diff --git a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/query_py3.py b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/query_py3.py new file mode 100644 index 000000000000..c574d6f8eb69 --- /dev/null +++ b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/query_py3.py @@ -0,0 +1,63 @@ +# 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 msrest.serialization import Model + + +class Query(Model): + """Defines a search query. + + 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 Azure. + + :param text: Required. The query string. Use this string as the query term + in a new search request. + :type text: str + :ivar display_text: The display version of the query term. This version of + the query term may contain special characters that highlight the search + term found in the query string. The string contains the highlighting + characters only if the query enabled hit highlighting + :vartype display_text: str + :ivar web_search_url: The URL that takes the user to the Bing search + results page for the query.Only related search results include this field. + :vartype web_search_url: str + :ivar search_link: + :vartype search_link: str + :ivar thumbnail: + :vartype thumbnail: + ~azure.cognitiveservices.search.videosearch.models.ImageObject + """ + + _validation = { + 'text': {'required': True}, + 'display_text': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'search_link': {'readonly': True}, + 'thumbnail': {'readonly': True}, + } + + _attribute_map = { + 'text': {'key': 'text', 'type': 'str'}, + 'display_text': {'key': 'displayText', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'search_link': {'key': 'searchLink', 'type': 'str'}, + 'thumbnail': {'key': 'thumbnail', 'type': 'ImageObject'}, + } + + def __init__(self, *, text: str, **kwargs) -> None: + super(Query, self).__init__(**kwargs) + self.text = text + self.display_text = None + self.web_search_url = None + self.search_link = None + self.thumbnail = None diff --git a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/response.py b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/response.py index 7c793cbb746a..7acea15cdece 100644 --- a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/response.py +++ b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/response.py @@ -22,7 +22,9 @@ class Response(Identifiable): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -46,7 +48,7 @@ class Response(Identifiable): '_type': {'Answer': 'Answer', 'Thing': 'Thing', 'ErrorResponse': 'ErrorResponse', 'TrendingVideos': 'TrendingVideos', 'VideoDetails': 'VideoDetails'} } - def __init__(self): - super(Response, self).__init__() + def __init__(self, **kwargs): + super(Response, self).__init__(**kwargs) self.web_search_url = None self._type = 'Response' diff --git a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/response_base.py b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/response_base.py index 0b5b11b43039..5a09ce0f95d6 100644 --- a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/response_base.py +++ b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/response_base.py @@ -18,7 +18,9 @@ class ResponseBase(Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: Identifiable - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str """ @@ -34,6 +36,6 @@ class ResponseBase(Model): '_type': {'Identifiable': 'Identifiable'} } - def __init__(self): - super(ResponseBase, self).__init__() + def __init__(self, **kwargs): + super(ResponseBase, self).__init__(**kwargs) self._type = None diff --git a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/response_base_py3.py b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/response_base_py3.py new file mode 100644 index 000000000000..0ac9762f5cd7 --- /dev/null +++ b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/response_base_py3.py @@ -0,0 +1,41 @@ +# 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 msrest.serialization import Model + + +class ResponseBase(Model): + """ResponseBase. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: Identifiable + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + """ + + _validation = { + '_type': {'required': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'Identifiable': 'Identifiable'} + } + + def __init__(self, **kwargs) -> None: + super(ResponseBase, self).__init__(**kwargs) + self._type = None diff --git a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/response_py3.py b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/response_py3.py new file mode 100644 index 000000000000..1ffe2ecddc38 --- /dev/null +++ b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/response_py3.py @@ -0,0 +1,54 @@ +# 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 .identifiable import Identifiable + + +class Response(Identifiable): + """Defines a response. All schemas that could be returned at the root of a + response should inherit from this. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: Answer, Thing, ErrorResponse, TrendingVideos, VideoDetails + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'web_search_url': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'Answer': 'Answer', 'Thing': 'Thing', 'ErrorResponse': 'ErrorResponse', 'TrendingVideos': 'TrendingVideos', 'VideoDetails': 'VideoDetails'} + } + + def __init__(self, **kwargs) -> None: + super(Response, self).__init__(**kwargs) + self.web_search_url = None + self._type = 'Response' diff --git a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/search_results_answer.py b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/search_results_answer.py index ca6c47a4361c..b6f648f3a78b 100644 --- a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/search_results_answer.py +++ b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/search_results_answer.py @@ -21,7 +21,9 @@ class SearchResultsAnswer(Answer): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -60,8 +62,8 @@ class SearchResultsAnswer(Answer): '_type': {'Videos': 'Videos'} } - def __init__(self): - super(SearchResultsAnswer, self).__init__() + def __init__(self, **kwargs): + super(SearchResultsAnswer, self).__init__(**kwargs) self.total_estimated_matches = None self.is_family_friendly = None self._type = 'SearchResultsAnswer' diff --git a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/search_results_answer_py3.py b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/search_results_answer_py3.py new file mode 100644 index 000000000000..97ea3ebe04e6 --- /dev/null +++ b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/search_results_answer_py3.py @@ -0,0 +1,69 @@ +# 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 .answer import Answer + + +class SearchResultsAnswer(Answer): + """SearchResultsAnswer. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: Videos + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar follow_up_queries: + :vartype follow_up_queries: + list[~azure.cognitiveservices.search.videosearch.models.Query] + :ivar total_estimated_matches: The estimated number of webpages that are + relevant to the query. Use this number along with the count and offset + query parameters to page the results. + :vartype total_estimated_matches: long + :ivar is_family_friendly: + :vartype is_family_friendly: bool + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'follow_up_queries': {'readonly': True}, + 'total_estimated_matches': {'readonly': True}, + 'is_family_friendly': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'follow_up_queries': {'key': 'followUpQueries', 'type': '[Query]'}, + 'total_estimated_matches': {'key': 'totalEstimatedMatches', 'type': 'long'}, + 'is_family_friendly': {'key': 'isFamilyFriendly', 'type': 'bool'}, + } + + _subtype_map = { + '_type': {'Videos': 'Videos'} + } + + def __init__(self, **kwargs) -> None: + super(SearchResultsAnswer, self).__init__(**kwargs) + self.total_estimated_matches = None + self.is_family_friendly = None + self._type = 'SearchResultsAnswer' diff --git a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/thing.py b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/thing.py index 6b0a1554d274..45182f144784 100644 --- a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/thing.py +++ b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/thing.py @@ -21,7 +21,9 @@ class Thing(Response): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -71,8 +73,8 @@ class Thing(Response): '_type': {'CreativeWork': 'CreativeWork'} } - def __init__(self): - super(Thing, self).__init__() + def __init__(self, **kwargs): + super(Thing, self).__init__(**kwargs) self.name = None self.url = None self.image = None diff --git a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/thing_py3.py b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/thing_py3.py new file mode 100644 index 000000000000..45983ae82c33 --- /dev/null +++ b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/thing_py3.py @@ -0,0 +1,84 @@ +# 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 .response import Response + + +class Thing(Response): + """Thing. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: CreativeWork + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: + :vartype image: + ~azure.cognitiveservices.search.videosearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'CreativeWork': 'CreativeWork'} + } + + def __init__(self, **kwargs) -> None: + super(Thing, self).__init__(**kwargs) + self.name = None + self.url = None + self.image = None + self.description = None + self.alternate_name = None + self.bing_id = None + self._type = 'Thing' diff --git a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/trending_videos.py b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/trending_videos.py index 3cc8bbbe3754..6aa195f46545 100644 --- a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/trending_videos.py +++ b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/trending_videos.py @@ -18,16 +18,18 @@ class TrendingVideos(Response): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str :ivar web_search_url: The URL To Bing's search result for this item. :vartype web_search_url: str - :param banner_tiles: + :param banner_tiles: Required. :type banner_tiles: list[~azure.cognitiveservices.search.videosearch.models.TrendingVideosTile] - :param categories: + :param categories: Required. :type categories: list[~azure.cognitiveservices.search.videosearch.models.TrendingVideosCategory] """ @@ -48,8 +50,8 @@ class TrendingVideos(Response): 'categories': {'key': 'categories', 'type': '[TrendingVideosCategory]'}, } - def __init__(self, banner_tiles, categories): - super(TrendingVideos, self).__init__() - self.banner_tiles = banner_tiles - self.categories = categories + def __init__(self, **kwargs): + super(TrendingVideos, self).__init__(**kwargs) + self.banner_tiles = kwargs.get('banner_tiles', None) + self.categories = kwargs.get('categories', None) self._type = 'TrendingVideos' diff --git a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/trending_videos_category.py b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/trending_videos_category.py index cd0b026de8fa..ad8ef54e0cee 100644 --- a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/trending_videos_category.py +++ b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/trending_videos_category.py @@ -15,9 +15,11 @@ class TrendingVideosCategory(Model): """TrendingVideosCategory. - :param title: + All required parameters must be populated in order to send to Azure. + + :param title: Required. :type title: str - :param subcategories: + :param subcategories: Required. :type subcategories: list[~azure.cognitiveservices.search.videosearch.models.TrendingVideosSubcategory] """ @@ -32,7 +34,7 @@ class TrendingVideosCategory(Model): 'subcategories': {'key': 'subcategories', 'type': '[TrendingVideosSubcategory]'}, } - def __init__(self, title, subcategories): - super(TrendingVideosCategory, self).__init__() - self.title = title - self.subcategories = subcategories + def __init__(self, **kwargs): + super(TrendingVideosCategory, self).__init__(**kwargs) + self.title = kwargs.get('title', None) + self.subcategories = kwargs.get('subcategories', None) diff --git a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/trending_videos_category_py3.py b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/trending_videos_category_py3.py new file mode 100644 index 000000000000..d18cdb9a7145 --- /dev/null +++ b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/trending_videos_category_py3.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class TrendingVideosCategory(Model): + """TrendingVideosCategory. + + All required parameters must be populated in order to send to Azure. + + :param title: Required. + :type title: str + :param subcategories: Required. + :type subcategories: + list[~azure.cognitiveservices.search.videosearch.models.TrendingVideosSubcategory] + """ + + _validation = { + 'title': {'required': True}, + 'subcategories': {'required': True}, + } + + _attribute_map = { + 'title': {'key': 'title', 'type': 'str'}, + 'subcategories': {'key': 'subcategories', 'type': '[TrendingVideosSubcategory]'}, + } + + def __init__(self, *, title: str, subcategories, **kwargs) -> None: + super(TrendingVideosCategory, self).__init__(**kwargs) + self.title = title + self.subcategories = subcategories diff --git a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/trending_videos_py3.py b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/trending_videos_py3.py new file mode 100644 index 000000000000..8494562939ad --- /dev/null +++ b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/trending_videos_py3.py @@ -0,0 +1,57 @@ +# 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 .response import Response + + +class TrendingVideos(Response): + """TrendingVideos. + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :param banner_tiles: Required. + :type banner_tiles: + list[~azure.cognitiveservices.search.videosearch.models.TrendingVideosTile] + :param categories: Required. + :type categories: + list[~azure.cognitiveservices.search.videosearch.models.TrendingVideosCategory] + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'banner_tiles': {'required': True}, + 'categories': {'required': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'banner_tiles': {'key': 'bannerTiles', 'type': '[TrendingVideosTile]'}, + 'categories': {'key': 'categories', 'type': '[TrendingVideosCategory]'}, + } + + def __init__(self, *, banner_tiles, categories, **kwargs) -> None: + super(TrendingVideos, self).__init__(**kwargs) + self.banner_tiles = banner_tiles + self.categories = categories + self._type = 'TrendingVideos' diff --git a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/trending_videos_subcategory.py b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/trending_videos_subcategory.py index 233550fa23d1..137358acf1c6 100644 --- a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/trending_videos_subcategory.py +++ b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/trending_videos_subcategory.py @@ -15,9 +15,11 @@ class TrendingVideosSubcategory(Model): """TrendingVideosSubcategory. - :param title: + All required parameters must be populated in order to send to Azure. + + :param title: Required. :type title: str - :param tiles: + :param tiles: Required. :type tiles: list[~azure.cognitiveservices.search.videosearch.models.TrendingVideosTile] """ @@ -32,7 +34,7 @@ class TrendingVideosSubcategory(Model): 'tiles': {'key': 'tiles', 'type': '[TrendingVideosTile]'}, } - def __init__(self, title, tiles): - super(TrendingVideosSubcategory, self).__init__() - self.title = title - self.tiles = tiles + def __init__(self, **kwargs): + super(TrendingVideosSubcategory, self).__init__(**kwargs) + self.title = kwargs.get('title', None) + self.tiles = kwargs.get('tiles', None) diff --git a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/trending_videos_subcategory_py3.py b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/trending_videos_subcategory_py3.py new file mode 100644 index 000000000000..399db7d4025c --- /dev/null +++ b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/trending_videos_subcategory_py3.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class TrendingVideosSubcategory(Model): + """TrendingVideosSubcategory. + + All required parameters must be populated in order to send to Azure. + + :param title: Required. + :type title: str + :param tiles: Required. + :type tiles: + list[~azure.cognitiveservices.search.videosearch.models.TrendingVideosTile] + """ + + _validation = { + 'title': {'required': True}, + 'tiles': {'required': True}, + } + + _attribute_map = { + 'title': {'key': 'title', 'type': 'str'}, + 'tiles': {'key': 'tiles', 'type': '[TrendingVideosTile]'}, + } + + def __init__(self, *, title: str, tiles, **kwargs) -> None: + super(TrendingVideosSubcategory, self).__init__(**kwargs) + self.title = title + self.tiles = tiles diff --git a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/trending_videos_tile.py b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/trending_videos_tile.py index 68a913fdd016..a62b6af3b23f 100644 --- a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/trending_videos_tile.py +++ b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/trending_videos_tile.py @@ -15,9 +15,11 @@ class TrendingVideosTile(Model): """TrendingVideosTile. - :param query: + All required parameters must be populated in order to send to Azure. + + :param query: Required. :type query: ~azure.cognitiveservices.search.videosearch.models.Query - :param image: + :param image: Required. :type image: ~azure.cognitiveservices.search.videosearch.models.ImageObject """ @@ -32,7 +34,7 @@ class TrendingVideosTile(Model): 'image': {'key': 'image', 'type': 'ImageObject'}, } - def __init__(self, query, image): - super(TrendingVideosTile, self).__init__() - self.query = query - self.image = image + def __init__(self, **kwargs): + super(TrendingVideosTile, self).__init__(**kwargs) + self.query = kwargs.get('query', None) + self.image = kwargs.get('image', None) diff --git a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/trending_videos_tile_py3.py b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/trending_videos_tile_py3.py new file mode 100644 index 000000000000..9da17c9c86af --- /dev/null +++ b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/trending_videos_tile_py3.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class TrendingVideosTile(Model): + """TrendingVideosTile. + + All required parameters must be populated in order to send to Azure. + + :param query: Required. + :type query: ~azure.cognitiveservices.search.videosearch.models.Query + :param image: Required. + :type image: + ~azure.cognitiveservices.search.videosearch.models.ImageObject + """ + + _validation = { + 'query': {'required': True}, + 'image': {'required': True}, + } + + _attribute_map = { + 'query': {'key': 'query', 'type': 'Query'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + } + + def __init__(self, *, query, image, **kwargs) -> None: + super(TrendingVideosTile, self).__init__(**kwargs) + self.query = query + self.image = image diff --git a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/video_details.py b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/video_details.py index 23f7577ba267..7bc62b453999 100644 --- a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/video_details.py +++ b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/video_details.py @@ -18,7 +18,9 @@ class VideoDetails(Response): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -48,8 +50,8 @@ class VideoDetails(Response): 'video_result': {'key': 'videoResult', 'type': 'VideoObject'}, } - def __init__(self): - super(VideoDetails, self).__init__() + def __init__(self, **kwargs): + super(VideoDetails, self).__init__(**kwargs) self.related_videos = None self.video_result = None self._type = 'VideoDetails' diff --git a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/video_details_py3.py b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/video_details_py3.py new file mode 100644 index 000000000000..240150d12003 --- /dev/null +++ b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/video_details_py3.py @@ -0,0 +1,57 @@ +# 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 .response import Response + + +class VideoDetails(Response): + """VideoDetails. + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar related_videos: + :vartype related_videos: + ~azure.cognitiveservices.search.videosearch.models.VideosModule + :ivar video_result: + :vartype video_result: + ~azure.cognitiveservices.search.videosearch.models.VideoObject + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'related_videos': {'readonly': True}, + 'video_result': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'related_videos': {'key': 'relatedVideos', 'type': 'VideosModule'}, + 'video_result': {'key': 'videoResult', 'type': 'VideoObject'}, + } + + def __init__(self, **kwargs) -> None: + super(VideoDetails, self).__init__(**kwargs) + self.related_videos = None + self.video_result = None + self._type = 'VideoDetails' diff --git a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/video_object.py b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/video_object.py index d1fa384509ad..e58d3855f759 100644 --- a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/video_object.py +++ b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/video_object.py @@ -18,7 +18,9 @@ class VideoObject(MediaObject): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -131,8 +133,8 @@ class VideoObject(MediaObject): 'is_superfresh': {'key': 'isSuperfresh', 'type': 'bool'}, } - def __init__(self): - super(VideoObject, self).__init__() + def __init__(self, **kwargs): + super(VideoObject, self).__init__(**kwargs) self.motion_thumbnail_url = None self.motion_thumbnail_id = None self.embed_html = None diff --git a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/video_object_py3.py b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/video_object_py3.py new file mode 100644 index 000000000000..75f6febe82b0 --- /dev/null +++ b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/video_object_py3.py @@ -0,0 +1,147 @@ +# 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 .media_object import MediaObject + + +class VideoObject(MediaObject): + """Defines a video object that is relevant to the query. + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: + :vartype image: + ~azure.cognitiveservices.search.videosearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar thumbnail_url: The URL to a thumbnail of the item. + :vartype thumbnail_url: str + :ivar provider: The source of the creative work. + :vartype provider: + list[~azure.cognitiveservices.search.videosearch.models.Thing] + :ivar text: + :vartype text: str + :ivar content_url: Original URL to retrieve the source (file) for the + media object (e.g the source URL for the image). + :vartype content_url: str + :ivar host_page_url: URL of the page that hosts the media object. + :vartype host_page_url: str + :ivar width: The width of the source media object, in pixels. + :vartype width: int + :ivar height: The height of the source media object, in pixels. + :vartype height: int + :ivar motion_thumbnail_url: + :vartype motion_thumbnail_url: str + :ivar motion_thumbnail_id: + :vartype motion_thumbnail_id: str + :ivar embed_html: + :vartype embed_html: str + :ivar allow_https_embed: + :vartype allow_https_embed: bool + :ivar view_count: + :vartype view_count: int + :ivar thumbnail: + :vartype thumbnail: + ~azure.cognitiveservices.search.videosearch.models.ImageObject + :ivar video_id: + :vartype video_id: str + :ivar allow_mobile_embed: + :vartype allow_mobile_embed: bool + :ivar is_superfresh: + :vartype is_superfresh: bool + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'thumbnail_url': {'readonly': True}, + 'provider': {'readonly': True}, + 'text': {'readonly': True}, + 'content_url': {'readonly': True}, + 'host_page_url': {'readonly': True}, + 'width': {'readonly': True}, + 'height': {'readonly': True}, + 'motion_thumbnail_url': {'readonly': True}, + 'motion_thumbnail_id': {'readonly': True}, + 'embed_html': {'readonly': True}, + 'allow_https_embed': {'readonly': True}, + 'view_count': {'readonly': True}, + 'thumbnail': {'readonly': True}, + 'video_id': {'readonly': True}, + 'allow_mobile_embed': {'readonly': True}, + 'is_superfresh': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'thumbnail_url': {'key': 'thumbnailUrl', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': '[Thing]'}, + 'text': {'key': 'text', 'type': 'str'}, + 'content_url': {'key': 'contentUrl', 'type': 'str'}, + 'host_page_url': {'key': 'hostPageUrl', 'type': 'str'}, + 'width': {'key': 'width', 'type': 'int'}, + 'height': {'key': 'height', 'type': 'int'}, + 'motion_thumbnail_url': {'key': 'motionThumbnailUrl', 'type': 'str'}, + 'motion_thumbnail_id': {'key': 'motionThumbnailId', 'type': 'str'}, + 'embed_html': {'key': 'embedHtml', 'type': 'str'}, + 'allow_https_embed': {'key': 'allowHttpsEmbed', 'type': 'bool'}, + 'view_count': {'key': 'viewCount', 'type': 'int'}, + 'thumbnail': {'key': 'thumbnail', 'type': 'ImageObject'}, + 'video_id': {'key': 'videoId', 'type': 'str'}, + 'allow_mobile_embed': {'key': 'allowMobileEmbed', 'type': 'bool'}, + 'is_superfresh': {'key': 'isSuperfresh', 'type': 'bool'}, + } + + def __init__(self, **kwargs) -> None: + super(VideoObject, self).__init__(**kwargs) + self.motion_thumbnail_url = None + self.motion_thumbnail_id = None + self.embed_html = None + self.allow_https_embed = None + self.view_count = None + self.thumbnail = None + self.video_id = None + self.allow_mobile_embed = None + self.is_superfresh = None + self._type = 'VideoObject' diff --git a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/video_search_api_enums.py b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/video_search_api_enums.py index b27345710726..805594ff92d0 100644 --- a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/video_search_api_enums.py +++ b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/video_search_api_enums.py @@ -12,13 +12,13 @@ from enum import Enum -class VideoQueryScenario(Enum): +class VideoQueryScenario(str, Enum): list = "List" single_dominant_video = "SingleDominantVideo" -class ErrorCode(Enum): +class ErrorCode(str, Enum): none = "None" server_error = "ServerError" @@ -28,7 +28,7 @@ class ErrorCode(Enum): insufficient_authorization = "InsufficientAuthorization" -class ErrorSubCode(Enum): +class ErrorSubCode(str, Enum): unexpected_error = "UnexpectedError" resource_error = "ResourceError" @@ -43,14 +43,14 @@ class ErrorSubCode(Enum): authorization_expired = "AuthorizationExpired" -class Freshness(Enum): +class Freshness(str, Enum): day = "Day" week = "Week" month = "Month" -class VideoLength(Enum): +class VideoLength(str, Enum): all = "All" short = "Short" @@ -58,14 +58,14 @@ class VideoLength(Enum): long_enum = "Long" -class VideoPricing(Enum): +class VideoPricing(str, Enum): all = "All" free = "Free" paid = "Paid" -class VideoResolution(Enum): +class VideoResolution(str, Enum): all = "All" sd480p = "SD480p" @@ -73,20 +73,20 @@ class VideoResolution(Enum): hd1080p = "HD1080p" -class SafeSearch(Enum): +class SafeSearch(str, Enum): off = "Off" moderate = "Moderate" strict = "Strict" -class TextFormat(Enum): +class TextFormat(str, Enum): raw = "Raw" html = "Html" -class VideoInsightModule(Enum): +class VideoInsightModule(str, Enum): all = "All" related_videos = "RelatedVideos" diff --git a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/videos.py b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/videos.py index 87e7c0e6b9c1..36e2763e61c8 100644 --- a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/videos.py +++ b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/videos.py @@ -18,7 +18,9 @@ class Videos(SearchResultsAnswer): Variables are only populated by the server, and will be ignored when sending a request. - :param _type: Constant filled by server. + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. :type _type: str :ivar id: A String identifier. :vartype id: str @@ -33,7 +35,8 @@ class Videos(SearchResultsAnswer): :vartype total_estimated_matches: long :ivar is_family_friendly: :vartype is_family_friendly: bool - :param value: A list of video objects that are relevant to the query. + :param value: Required. A list of video objects that are relevant to the + query. :type value: list[~azure.cognitiveservices.search.videosearch.models.VideoObject] :ivar next_offset: @@ -77,9 +80,9 @@ class Videos(SearchResultsAnswer): 'pivot_suggestions': {'key': 'pivotSuggestions', 'type': '[PivotSuggestions]'}, } - def __init__(self, value): - super(Videos, self).__init__() - self.value = value + def __init__(self, **kwargs): + super(Videos, self).__init__(**kwargs) + self.value = kwargs.get('value', None) self.next_offset = None self.scenario = None self.query_expansions = None diff --git a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/videos_module.py b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/videos_module.py index 7ccfea02737f..9314decdd87c 100644 --- a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/videos_module.py +++ b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/videos_module.py @@ -31,6 +31,6 @@ class VideosModule(Model): 'value': {'key': 'value', 'type': '[VideoObject]'}, } - def __init__(self): - super(VideosModule, self).__init__() + def __init__(self, **kwargs): + super(VideosModule, self).__init__(**kwargs) self.value = None diff --git a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/videos_module_py3.py b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/videos_module_py3.py new file mode 100644 index 000000000000..e891bcd424aa --- /dev/null +++ b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/videos_module_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class VideosModule(Model): + """VideosModule. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: + :vartype value: + list[~azure.cognitiveservices.search.videosearch.models.VideoObject] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VideoObject]'}, + } + + def __init__(self, **kwargs) -> None: + super(VideosModule, self).__init__(**kwargs) + self.value = None diff --git a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/videos_py3.py b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/videos_py3.py new file mode 100644 index 000000000000..51b4b7b5b5fa --- /dev/null +++ b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/videos_py3.py @@ -0,0 +1,90 @@ +# 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 .search_results_answer import SearchResultsAnswer + + +class Videos(SearchResultsAnswer): + """Defines a video answer. + + 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 Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar follow_up_queries: + :vartype follow_up_queries: + list[~azure.cognitiveservices.search.videosearch.models.Query] + :ivar total_estimated_matches: The estimated number of webpages that are + relevant to the query. Use this number along with the count and offset + query parameters to page the results. + :vartype total_estimated_matches: long + :ivar is_family_friendly: + :vartype is_family_friendly: bool + :param value: Required. A list of video objects that are relevant to the + query. + :type value: + list[~azure.cognitiveservices.search.videosearch.models.VideoObject] + :ivar next_offset: + :vartype next_offset: int + :ivar scenario: Possible values include: 'List', 'SingleDominantVideo' + :vartype scenario: str or + ~azure.cognitiveservices.search.videosearch.models.VideoQueryScenario + :ivar query_expansions: + :vartype query_expansions: + list[~azure.cognitiveservices.search.videosearch.models.Query] + :ivar pivot_suggestions: + :vartype pivot_suggestions: + list[~azure.cognitiveservices.search.videosearch.models.PivotSuggestions] + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'follow_up_queries': {'readonly': True}, + 'total_estimated_matches': {'readonly': True}, + 'is_family_friendly': {'readonly': True}, + 'value': {'required': True}, + 'next_offset': {'readonly': True}, + 'scenario': {'readonly': True}, + 'query_expansions': {'readonly': True}, + 'pivot_suggestions': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'follow_up_queries': {'key': 'followUpQueries', 'type': '[Query]'}, + 'total_estimated_matches': {'key': 'totalEstimatedMatches', 'type': 'long'}, + 'is_family_friendly': {'key': 'isFamilyFriendly', 'type': 'bool'}, + 'value': {'key': 'value', 'type': '[VideoObject]'}, + 'next_offset': {'key': 'nextOffset', 'type': 'int'}, + 'scenario': {'key': 'scenario', 'type': 'VideoQueryScenario'}, + 'query_expansions': {'key': 'queryExpansions', 'type': '[Query]'}, + 'pivot_suggestions': {'key': 'pivotSuggestions', 'type': '[PivotSuggestions]'}, + } + + def __init__(self, *, value, **kwargs) -> None: + super(Videos, self).__init__(**kwargs) + self.value = value + self.next_offset = None + self.scenario = None + self.query_expansions = None + self.pivot_suggestions = None + self._type = 'Videos' diff --git a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/operations/videos_operations.py b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/operations/videos_operations.py index 6dcc119d34c4..35e69f0559d5 100644 --- a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/operations/videos_operations.py +++ b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/operations/videos_operations.py @@ -337,7 +337,7 @@ def search( :class:`ErrorResponseException` """ # Construct URL - url = '/videos/search' + url = self.search.metadata['url'] # Construct parameters query_parameters = {} @@ -403,6 +403,7 @@ def search( return client_raw_response return deserialized + search.metadata = {'url': '/videos/search'} def details( self, query, accept_language=None, user_agent=None, client_id=None, client_ip=None, location=None, country_code=None, id=None, modules=None, market=None, resolution=None, safe_search=None, set_lang=None, text_decorations=None, text_format=None, custom_headers=None, raw=False, **operation_config): @@ -674,7 +675,7 @@ def details( :class:`ErrorResponseException` """ # Construct URL - url = '/videos/details' + url = self.details.metadata['url'] # Construct parameters query_parameters = {} @@ -732,6 +733,7 @@ def details( return client_raw_response return deserialized + details.metadata = {'url': '/videos/details'} def trending( self, accept_language=None, user_agent=None, client_id=None, client_ip=None, location=None, country_code=None, market=None, safe_search=None, set_lang=None, text_decorations=None, text_format=None, custom_headers=None, raw=False, **operation_config): @@ -967,7 +969,7 @@ def trending( :class:`ErrorResponseException` """ # Construct URL - url = '/videos/trending' + url = self.trending.metadata['url'] # Construct parameters query_parameters = {} @@ -1018,3 +1020,4 @@ def trending( return client_raw_response return deserialized + trending.metadata = {'url': '/videos/trending'} diff --git a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/version.py b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/version.py index e0ec669828cb..63d89bfb54fa 100644 --- a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/version.py +++ b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.1.0" +VERSION = "1.0" diff --git a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/video_search_api.py b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/video_search_api.py index 0654a7712f41..f25b4e20d6b0 100644 --- a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/video_search_api.py +++ b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/video_search_api.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import ServiceClient +from msrest.service_client import SDKClient from msrest import Configuration, Serializer, Deserializer from .version import VERSION from .operations.videos_operations import VideosOperations @@ -42,7 +42,7 @@ def __init__( self.credentials = credentials -class VideoSearchAPI(object): +class VideoSearchAPI(SDKClient): """The Video Search API lets you search on Bing for video that are relevant to the user's search query, for insights about a video or for videos that are trending based on search requests made by others. This section provides technical details about the query parameters and headers that you use to request videos and the JSON response objects that contain them. For examples that show how to make requests, see [Searching the Web for Videos](https://docs.microsoft.com/azure/cognitive-services/bing-video-search/search-the-web). :ivar config: Configuration for client. @@ -61,7 +61,7 @@ def __init__( self, credentials, base_url=None): self.config = VideoSearchAPIConfiguration(credentials, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + super(VideoSearchAPI, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self.api_version = '1.0' diff --git a/azure-eventgrid/azure/eventgrid/event_grid_client.py b/azure-eventgrid/azure/eventgrid/event_grid_client.py index f9fde043174b..224b1e7be6e6 100644 --- a/azure-eventgrid/azure/eventgrid/event_grid_client.py +++ b/azure-eventgrid/azure/eventgrid/event_grid_client.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import ServiceClient +from msrest.service_client import SDKClient from msrest import Configuration, Serializer, Deserializer from .version import VERSION from msrest.pipeline import ClientRawResponse @@ -41,7 +41,7 @@ def __init__( self.credentials = credentials -class EventGridClient(object): +class EventGridClient(SDKClient): """EventGrid Client :ivar config: Configuration for client. @@ -56,7 +56,7 @@ def __init__( self, credentials): self.config = EventGridClientConfiguration(credentials) - self._client = ServiceClient(self.config.credentials, self.config) + super(EventGridClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self.api_version = '2018-01-01' @@ -84,7 +84,7 @@ def publish_events( :class:`HttpOperationError` """ # Construct URL - url = '/api/events' + url = self.publish_events.metadata['url'] path_format_arguments = { 'topicHostname': self._serialize.url("topic_hostname", topic_hostname, 'str', skip_quote=True) } @@ -114,3 +114,4 @@ def publish_events( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response + publish_events.metadata = {'url': '/api/events'} diff --git a/azure-eventgrid/azure/eventgrid/models/__init__.py b/azure-eventgrid/azure/eventgrid/models/__init__.py index 88cd87310f4b..ddea8d9d1677 100644 --- a/azure-eventgrid/azure/eventgrid/models/__init__.py +++ b/azure-eventgrid/azure/eventgrid/models/__init__.py @@ -9,16 +9,58 @@ # regenerated. # -------------------------------------------------------------------------- -from .storage_blob_created_event_data import StorageBlobCreatedEventData -from .storage_blob_deleted_event_data import StorageBlobDeletedEventData -from .event_hub_capture_file_created_event_data import EventHubCaptureFileCreatedEventData -from .resource_write_success_data import ResourceWriteSuccessData -from .resource_write_failure_data import ResourceWriteFailureData -from .resource_write_cancel_data import ResourceWriteCancelData -from .resource_delete_success_data import ResourceDeleteSuccessData -from .resource_delete_failure_data import ResourceDeleteFailureData -from .resource_delete_cancel_data import ResourceDeleteCancelData -from .event_grid_event import EventGridEvent +try: + from .storage_blob_created_event_data_py3 import StorageBlobCreatedEventData + from .storage_blob_deleted_event_data_py3 import StorageBlobDeletedEventData + from .event_hub_capture_file_created_event_data_py3 import EventHubCaptureFileCreatedEventData + from .resource_write_success_data_py3 import ResourceWriteSuccessData + from .resource_write_failure_data_py3 import ResourceWriteFailureData + from .resource_write_cancel_data_py3 import ResourceWriteCancelData + from .resource_delete_success_data_py3 import ResourceDeleteSuccessData + from .resource_delete_failure_data_py3 import ResourceDeleteFailureData + from .resource_delete_cancel_data_py3 import ResourceDeleteCancelData + from .event_grid_event_py3 import EventGridEvent + from .iot_hub_device_created_event_data_py3 import IotHubDeviceCreatedEventData + from .iot_hub_device_deleted_event_data_py3 import IotHubDeviceDeletedEventData + from .device_twin_metadata_py3 import DeviceTwinMetadata + from .device_twin_properties_py3 import DeviceTwinProperties + from .device_twin_info_properties_py3 import DeviceTwinInfoProperties + from .device_twin_info_x509_thumbprint_py3 import DeviceTwinInfoX509Thumbprint + from .device_twin_info_py3 import DeviceTwinInfo + from .device_life_cycle_event_properties_py3 import DeviceLifeCycleEventProperties + from .container_registry_image_pushed_event_data_py3 import ContainerRegistryImagePushedEventData + from .container_registry_image_deleted_event_data_py3 import ContainerRegistryImageDeletedEventData + from .container_registry_event_target_py3 import ContainerRegistryEventTarget + from .container_registry_event_request_py3 import ContainerRegistryEventRequest + from .container_registry_event_actor_py3 import ContainerRegistryEventActor + from .container_registry_event_source_py3 import ContainerRegistryEventSource + from .container_registry_event_data_py3 import ContainerRegistryEventData +except (SyntaxError, ImportError): + from .storage_blob_created_event_data import StorageBlobCreatedEventData + from .storage_blob_deleted_event_data import StorageBlobDeletedEventData + from .event_hub_capture_file_created_event_data import EventHubCaptureFileCreatedEventData + from .resource_write_success_data import ResourceWriteSuccessData + from .resource_write_failure_data import ResourceWriteFailureData + from .resource_write_cancel_data import ResourceWriteCancelData + from .resource_delete_success_data import ResourceDeleteSuccessData + from .resource_delete_failure_data import ResourceDeleteFailureData + from .resource_delete_cancel_data import ResourceDeleteCancelData + from .event_grid_event import EventGridEvent + from .iot_hub_device_created_event_data import IotHubDeviceCreatedEventData + from .iot_hub_device_deleted_event_data import IotHubDeviceDeletedEventData + from .device_twin_metadata import DeviceTwinMetadata + from .device_twin_properties import DeviceTwinProperties + from .device_twin_info_properties import DeviceTwinInfoProperties + from .device_twin_info_x509_thumbprint import DeviceTwinInfoX509Thumbprint + from .device_twin_info import DeviceTwinInfo + from .device_life_cycle_event_properties import DeviceLifeCycleEventProperties + from .container_registry_image_pushed_event_data import ContainerRegistryImagePushedEventData + from .container_registry_image_deleted_event_data import ContainerRegistryImageDeletedEventData + from .container_registry_event_target import ContainerRegistryEventTarget + from .container_registry_event_request import ContainerRegistryEventRequest + from .container_registry_event_actor import ContainerRegistryEventActor + from .container_registry_event_source import ContainerRegistryEventSource + from .container_registry_event_data import ContainerRegistryEventData __all__ = [ 'StorageBlobCreatedEventData', @@ -31,4 +73,19 @@ 'ResourceDeleteFailureData', 'ResourceDeleteCancelData', 'EventGridEvent', + 'IotHubDeviceCreatedEventData', + 'IotHubDeviceDeletedEventData', + 'DeviceTwinMetadata', + 'DeviceTwinProperties', + 'DeviceTwinInfoProperties', + 'DeviceTwinInfoX509Thumbprint', + 'DeviceTwinInfo', + 'DeviceLifeCycleEventProperties', + 'ContainerRegistryImagePushedEventData', + 'ContainerRegistryImageDeletedEventData', + 'ContainerRegistryEventTarget', + 'ContainerRegistryEventRequest', + 'ContainerRegistryEventActor', + 'ContainerRegistryEventSource', + 'ContainerRegistryEventData', ] diff --git a/azure-eventgrid/azure/eventgrid/models/container_registry_event_actor.py b/azure-eventgrid/azure/eventgrid/models/container_registry_event_actor.py new file mode 100644 index 000000000000..4fcf82f6a7fc --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/container_registry_event_actor.py @@ -0,0 +1,30 @@ +# 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 msrest.serialization import Model + + +class ContainerRegistryEventActor(Model): + """The agent that initiated the event. For most situations, this could be from + the authorization context of the request. + + :param name: The subject or username associated with the request context + that generated the event. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ContainerRegistryEventActor, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-eventgrid/azure/eventgrid/models/container_registry_event_actor_py3.py b/azure-eventgrid/azure/eventgrid/models/container_registry_event_actor_py3.py new file mode 100644 index 000000000000..419b4e917e60 --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/container_registry_event_actor_py3.py @@ -0,0 +1,30 @@ +# 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 msrest.serialization import Model + + +class ContainerRegistryEventActor(Model): + """The agent that initiated the event. For most situations, this could be from + the authorization context of the request. + + :param name: The subject or username associated with the request context + that generated the event. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, **kwargs) -> None: + super(ContainerRegistryEventActor, self).__init__(**kwargs) + self.name = name diff --git a/azure-eventgrid/azure/eventgrid/models/container_registry_event_data.py b/azure-eventgrid/azure/eventgrid/models/container_registry_event_data.py new file mode 100644 index 000000000000..f2b7d10a3f3f --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/container_registry_event_data.py @@ -0,0 +1,54 @@ +# 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 msrest.serialization import Model + + +class ContainerRegistryEventData(Model): + """The content of the event request message. + + :param id: The event ID. + :type id: str + :param timestamp: The time at which the event occurred. + :type timestamp: datetime + :param action: The action that encompasses the provided event. + :type action: str + :param target: The target of the event. + :type target: ~azure.eventgrid.models.ContainerRegistryEventTarget + :param request: The request that generated the event. + :type request: ~azure.eventgrid.models.ContainerRegistryEventRequest + :param actor: The agent that initiated the event. For most situations, + this could be from the authorization context of the request. + :type actor: ~azure.eventgrid.models.ContainerRegistryEventActor + :param source: The registry node that generated the event. Put + differently, while the actor initiates the event, the source generates it. + :type source: ~azure.eventgrid.models.ContainerRegistryEventSource + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'action': {'key': 'action', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'ContainerRegistryEventTarget'}, + 'request': {'key': 'request', 'type': 'ContainerRegistryEventRequest'}, + 'actor': {'key': 'actor', 'type': 'ContainerRegistryEventActor'}, + 'source': {'key': 'source', 'type': 'ContainerRegistryEventSource'}, + } + + def __init__(self, **kwargs): + super(ContainerRegistryEventData, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.timestamp = kwargs.get('timestamp', None) + self.action = kwargs.get('action', None) + self.target = kwargs.get('target', None) + self.request = kwargs.get('request', None) + self.actor = kwargs.get('actor', None) + self.source = kwargs.get('source', None) diff --git a/azure-eventgrid/azure/eventgrid/models/container_registry_event_data_py3.py b/azure-eventgrid/azure/eventgrid/models/container_registry_event_data_py3.py new file mode 100644 index 000000000000..1729ad8c9cba --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/container_registry_event_data_py3.py @@ -0,0 +1,54 @@ +# 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 msrest.serialization import Model + + +class ContainerRegistryEventData(Model): + """The content of the event request message. + + :param id: The event ID. + :type id: str + :param timestamp: The time at which the event occurred. + :type timestamp: datetime + :param action: The action that encompasses the provided event. + :type action: str + :param target: The target of the event. + :type target: ~azure.eventgrid.models.ContainerRegistryEventTarget + :param request: The request that generated the event. + :type request: ~azure.eventgrid.models.ContainerRegistryEventRequest + :param actor: The agent that initiated the event. For most situations, + this could be from the authorization context of the request. + :type actor: ~azure.eventgrid.models.ContainerRegistryEventActor + :param source: The registry node that generated the event. Put + differently, while the actor initiates the event, the source generates it. + :type source: ~azure.eventgrid.models.ContainerRegistryEventSource + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'action': {'key': 'action', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'ContainerRegistryEventTarget'}, + 'request': {'key': 'request', 'type': 'ContainerRegistryEventRequest'}, + 'actor': {'key': 'actor', 'type': 'ContainerRegistryEventActor'}, + 'source': {'key': 'source', 'type': 'ContainerRegistryEventSource'}, + } + + def __init__(self, *, id: str=None, timestamp=None, action: str=None, target=None, request=None, actor=None, source=None, **kwargs) -> None: + super(ContainerRegistryEventData, self).__init__(**kwargs) + self.id = id + self.timestamp = timestamp + self.action = action + self.target = target + self.request = request + self.actor = actor + self.source = source diff --git a/azure-eventgrid/azure/eventgrid/models/container_registry_event_request.py b/azure-eventgrid/azure/eventgrid/models/container_registry_event_request.py new file mode 100644 index 000000000000..51d0917c1eb5 --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/container_registry_event_request.py @@ -0,0 +1,47 @@ +# 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 msrest.serialization import Model + + +class ContainerRegistryEventRequest(Model): + """The request that generated the event. + + :param id: The ID of the request that initiated the event. + :type id: str + :param addr: The IP or hostname and possibly port of the client connection + that initiated the event. This is the RemoteAddr from the standard http + request. + :type addr: str + :param host: The externally accessible hostname of the registry instance, + as specified by the http host header on incoming requests. + :type host: str + :param method: The request method that generated the event. + :type method: str + :param useragent: The user agent header of the request. + :type useragent: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'addr': {'key': 'addr', 'type': 'str'}, + 'host': {'key': 'host', 'type': 'str'}, + 'method': {'key': 'method', 'type': 'str'}, + 'useragent': {'key': 'useragent', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ContainerRegistryEventRequest, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.addr = kwargs.get('addr', None) + self.host = kwargs.get('host', None) + self.method = kwargs.get('method', None) + self.useragent = kwargs.get('useragent', None) diff --git a/azure-eventgrid/azure/eventgrid/models/container_registry_event_request_py3.py b/azure-eventgrid/azure/eventgrid/models/container_registry_event_request_py3.py new file mode 100644 index 000000000000..4f14fff4ad67 --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/container_registry_event_request_py3.py @@ -0,0 +1,47 @@ +# 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 msrest.serialization import Model + + +class ContainerRegistryEventRequest(Model): + """The request that generated the event. + + :param id: The ID of the request that initiated the event. + :type id: str + :param addr: The IP or hostname and possibly port of the client connection + that initiated the event. This is the RemoteAddr from the standard http + request. + :type addr: str + :param host: The externally accessible hostname of the registry instance, + as specified by the http host header on incoming requests. + :type host: str + :param method: The request method that generated the event. + :type method: str + :param useragent: The user agent header of the request. + :type useragent: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'addr': {'key': 'addr', 'type': 'str'}, + 'host': {'key': 'host', 'type': 'str'}, + 'method': {'key': 'method', 'type': 'str'}, + 'useragent': {'key': 'useragent', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, addr: str=None, host: str=None, method: str=None, useragent: str=None, **kwargs) -> None: + super(ContainerRegistryEventRequest, self).__init__(**kwargs) + self.id = id + self.addr = addr + self.host = host + self.method = method + self.useragent = useragent diff --git a/azure-eventgrid/azure/eventgrid/models/container_registry_event_source.py b/azure-eventgrid/azure/eventgrid/models/container_registry_event_source.py new file mode 100644 index 000000000000..4cd58ec01101 --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/container_registry_event_source.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class ContainerRegistryEventSource(Model): + """The registry node that generated the event. Put differently, while the + actor initiates the event, the source generates it. + + :param addr: The IP or hostname and the port of the registry node that + generated the event. Generally, this will be resolved by os.Hostname() + along with the running port. + :type addr: str + :param instance_id: The running instance of an application. Changes after + each restart. + :type instance_id: str + """ + + _attribute_map = { + 'addr': {'key': 'addr', 'type': 'str'}, + 'instance_id': {'key': 'instanceID', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ContainerRegistryEventSource, self).__init__(**kwargs) + self.addr = kwargs.get('addr', None) + self.instance_id = kwargs.get('instance_id', None) diff --git a/azure-eventgrid/azure/eventgrid/models/container_registry_event_source_py3.py b/azure-eventgrid/azure/eventgrid/models/container_registry_event_source_py3.py new file mode 100644 index 000000000000..b12c6c354a61 --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/container_registry_event_source_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class ContainerRegistryEventSource(Model): + """The registry node that generated the event. Put differently, while the + actor initiates the event, the source generates it. + + :param addr: The IP or hostname and the port of the registry node that + generated the event. Generally, this will be resolved by os.Hostname() + along with the running port. + :type addr: str + :param instance_id: The running instance of an application. Changes after + each restart. + :type instance_id: str + """ + + _attribute_map = { + 'addr': {'key': 'addr', 'type': 'str'}, + 'instance_id': {'key': 'instanceID', 'type': 'str'}, + } + + def __init__(self, *, addr: str=None, instance_id: str=None, **kwargs) -> None: + super(ContainerRegistryEventSource, self).__init__(**kwargs) + self.addr = addr + self.instance_id = instance_id diff --git a/azure-eventgrid/azure/eventgrid/models/container_registry_event_target.py b/azure-eventgrid/azure/eventgrid/models/container_registry_event_target.py new file mode 100644 index 000000000000..fd8c0448169c --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/container_registry_event_target.py @@ -0,0 +1,53 @@ +# 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 msrest.serialization import Model + + +class ContainerRegistryEventTarget(Model): + """The target of the event. + + :param media_type: The MIME type of the referenced object. + :type media_type: str + :param size: The number of bytes of the content. Same as Length field. + :type size: long + :param digest: The digest of the content, as defined by the Registry V2 + HTTP API Specification. + :type digest: str + :param length: The number of bytes of the content. Same as Size field. + :type length: long + :param repository: The repository name. + :type repository: str + :param url: The direct URL to the content. + :type url: str + :param tag: The tag name. + :type tag: str + """ + + _attribute_map = { + 'media_type': {'key': 'mediaType', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'long'}, + 'digest': {'key': 'digest', 'type': 'str'}, + 'length': {'key': 'length', 'type': 'long'}, + 'repository': {'key': 'repository', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'tag': {'key': 'tag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ContainerRegistryEventTarget, self).__init__(**kwargs) + self.media_type = kwargs.get('media_type', None) + self.size = kwargs.get('size', None) + self.digest = kwargs.get('digest', None) + self.length = kwargs.get('length', None) + self.repository = kwargs.get('repository', None) + self.url = kwargs.get('url', None) + self.tag = kwargs.get('tag', None) diff --git a/azure-eventgrid/azure/eventgrid/models/container_registry_event_target_py3.py b/azure-eventgrid/azure/eventgrid/models/container_registry_event_target_py3.py new file mode 100644 index 000000000000..accbe49f9615 --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/container_registry_event_target_py3.py @@ -0,0 +1,53 @@ +# 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 msrest.serialization import Model + + +class ContainerRegistryEventTarget(Model): + """The target of the event. + + :param media_type: The MIME type of the referenced object. + :type media_type: str + :param size: The number of bytes of the content. Same as Length field. + :type size: long + :param digest: The digest of the content, as defined by the Registry V2 + HTTP API Specification. + :type digest: str + :param length: The number of bytes of the content. Same as Size field. + :type length: long + :param repository: The repository name. + :type repository: str + :param url: The direct URL to the content. + :type url: str + :param tag: The tag name. + :type tag: str + """ + + _attribute_map = { + 'media_type': {'key': 'mediaType', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'long'}, + 'digest': {'key': 'digest', 'type': 'str'}, + 'length': {'key': 'length', 'type': 'long'}, + 'repository': {'key': 'repository', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'tag': {'key': 'tag', 'type': 'str'}, + } + + def __init__(self, *, media_type: str=None, size: int=None, digest: str=None, length: int=None, repository: str=None, url: str=None, tag: str=None, **kwargs) -> None: + super(ContainerRegistryEventTarget, self).__init__(**kwargs) + self.media_type = media_type + self.size = size + self.digest = digest + self.length = length + self.repository = repository + self.url = url + self.tag = tag diff --git a/azure-eventgrid/azure/eventgrid/models/container_registry_image_deleted_event_data.py b/azure-eventgrid/azure/eventgrid/models/container_registry_image_deleted_event_data.py new file mode 100644 index 000000000000..5db3644bb11f --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/container_registry_image_deleted_event_data.py @@ -0,0 +1,48 @@ +# 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 .container_registry_event_data import ContainerRegistryEventData + + +class ContainerRegistryImageDeletedEventData(ContainerRegistryEventData): + """Schema of the Data property of an EventGridEvent for a + Microsoft.ContainerRegistry.ImageDeleted event. + + :param id: The event ID. + :type id: str + :param timestamp: The time at which the event occurred. + :type timestamp: datetime + :param action: The action that encompasses the provided event. + :type action: str + :param target: The target of the event. + :type target: ~azure.eventgrid.models.ContainerRegistryEventTarget + :param request: The request that generated the event. + :type request: ~azure.eventgrid.models.ContainerRegistryEventRequest + :param actor: The agent that initiated the event. For most situations, + this could be from the authorization context of the request. + :type actor: ~azure.eventgrid.models.ContainerRegistryEventActor + :param source: The registry node that generated the event. Put + differently, while the actor initiates the event, the source generates it. + :type source: ~azure.eventgrid.models.ContainerRegistryEventSource + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'action': {'key': 'action', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'ContainerRegistryEventTarget'}, + 'request': {'key': 'request', 'type': 'ContainerRegistryEventRequest'}, + 'actor': {'key': 'actor', 'type': 'ContainerRegistryEventActor'}, + 'source': {'key': 'source', 'type': 'ContainerRegistryEventSource'}, + } + + def __init__(self, **kwargs): + super(ContainerRegistryImageDeletedEventData, self).__init__(**kwargs) diff --git a/azure-eventgrid/azure/eventgrid/models/container_registry_image_deleted_event_data_py3.py b/azure-eventgrid/azure/eventgrid/models/container_registry_image_deleted_event_data_py3.py new file mode 100644 index 000000000000..dc8924583b50 --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/container_registry_image_deleted_event_data_py3.py @@ -0,0 +1,48 @@ +# 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 .container_registry_event_data import ContainerRegistryEventData + + +class ContainerRegistryImageDeletedEventData(ContainerRegistryEventData): + """Schema of the Data property of an EventGridEvent for a + Microsoft.ContainerRegistry.ImageDeleted event. + + :param id: The event ID. + :type id: str + :param timestamp: The time at which the event occurred. + :type timestamp: datetime + :param action: The action that encompasses the provided event. + :type action: str + :param target: The target of the event. + :type target: ~azure.eventgrid.models.ContainerRegistryEventTarget + :param request: The request that generated the event. + :type request: ~azure.eventgrid.models.ContainerRegistryEventRequest + :param actor: The agent that initiated the event. For most situations, + this could be from the authorization context of the request. + :type actor: ~azure.eventgrid.models.ContainerRegistryEventActor + :param source: The registry node that generated the event. Put + differently, while the actor initiates the event, the source generates it. + :type source: ~azure.eventgrid.models.ContainerRegistryEventSource + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'action': {'key': 'action', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'ContainerRegistryEventTarget'}, + 'request': {'key': 'request', 'type': 'ContainerRegistryEventRequest'}, + 'actor': {'key': 'actor', 'type': 'ContainerRegistryEventActor'}, + 'source': {'key': 'source', 'type': 'ContainerRegistryEventSource'}, + } + + def __init__(self, *, id: str=None, timestamp=None, action: str=None, target=None, request=None, actor=None, source=None, **kwargs) -> None: + super(ContainerRegistryImageDeletedEventData, self).__init__(id=id, timestamp=timestamp, action=action, target=target, request=request, actor=actor, source=source, **kwargs) diff --git a/azure-eventgrid/azure/eventgrid/models/container_registry_image_pushed_event_data.py b/azure-eventgrid/azure/eventgrid/models/container_registry_image_pushed_event_data.py new file mode 100644 index 000000000000..6ddc5985f4dc --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/container_registry_image_pushed_event_data.py @@ -0,0 +1,48 @@ +# 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 .container_registry_event_data import ContainerRegistryEventData + + +class ContainerRegistryImagePushedEventData(ContainerRegistryEventData): + """Schema of the Data property of an EventGridEvent for a + Microsoft.ContainerRegistry.ImagePushed event. + + :param id: The event ID. + :type id: str + :param timestamp: The time at which the event occurred. + :type timestamp: datetime + :param action: The action that encompasses the provided event. + :type action: str + :param target: The target of the event. + :type target: ~azure.eventgrid.models.ContainerRegistryEventTarget + :param request: The request that generated the event. + :type request: ~azure.eventgrid.models.ContainerRegistryEventRequest + :param actor: The agent that initiated the event. For most situations, + this could be from the authorization context of the request. + :type actor: ~azure.eventgrid.models.ContainerRegistryEventActor + :param source: The registry node that generated the event. Put + differently, while the actor initiates the event, the source generates it. + :type source: ~azure.eventgrid.models.ContainerRegistryEventSource + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'action': {'key': 'action', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'ContainerRegistryEventTarget'}, + 'request': {'key': 'request', 'type': 'ContainerRegistryEventRequest'}, + 'actor': {'key': 'actor', 'type': 'ContainerRegistryEventActor'}, + 'source': {'key': 'source', 'type': 'ContainerRegistryEventSource'}, + } + + def __init__(self, **kwargs): + super(ContainerRegistryImagePushedEventData, self).__init__(**kwargs) diff --git a/azure-eventgrid/azure/eventgrid/models/container_registry_image_pushed_event_data_py3.py b/azure-eventgrid/azure/eventgrid/models/container_registry_image_pushed_event_data_py3.py new file mode 100644 index 000000000000..0eb8a68e9462 --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/container_registry_image_pushed_event_data_py3.py @@ -0,0 +1,48 @@ +# 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 .container_registry_event_data import ContainerRegistryEventData + + +class ContainerRegistryImagePushedEventData(ContainerRegistryEventData): + """Schema of the Data property of an EventGridEvent for a + Microsoft.ContainerRegistry.ImagePushed event. + + :param id: The event ID. + :type id: str + :param timestamp: The time at which the event occurred. + :type timestamp: datetime + :param action: The action that encompasses the provided event. + :type action: str + :param target: The target of the event. + :type target: ~azure.eventgrid.models.ContainerRegistryEventTarget + :param request: The request that generated the event. + :type request: ~azure.eventgrid.models.ContainerRegistryEventRequest + :param actor: The agent that initiated the event. For most situations, + this could be from the authorization context of the request. + :type actor: ~azure.eventgrid.models.ContainerRegistryEventActor + :param source: The registry node that generated the event. Put + differently, while the actor initiates the event, the source generates it. + :type source: ~azure.eventgrid.models.ContainerRegistryEventSource + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'action': {'key': 'action', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'ContainerRegistryEventTarget'}, + 'request': {'key': 'request', 'type': 'ContainerRegistryEventRequest'}, + 'actor': {'key': 'actor', 'type': 'ContainerRegistryEventActor'}, + 'source': {'key': 'source', 'type': 'ContainerRegistryEventSource'}, + } + + def __init__(self, *, id: str=None, timestamp=None, action: str=None, target=None, request=None, actor=None, source=None, **kwargs) -> None: + super(ContainerRegistryImagePushedEventData, self).__init__(id=id, timestamp=timestamp, action=action, target=target, request=request, actor=actor, source=source, **kwargs) diff --git a/azure-eventgrid/azure/eventgrid/models/device_life_cycle_event_properties.py b/azure-eventgrid/azure/eventgrid/models/device_life_cycle_event_properties.py new file mode 100644 index 000000000000..2384e13e5528 --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/device_life_cycle_event_properties.py @@ -0,0 +1,51 @@ +# 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 msrest.serialization import Model + + +class DeviceLifeCycleEventProperties(Model): + """Schema of the Data property of an EventGridEvent for a device life cycle + event (DeviceCreated, DeviceDeleted). + + :param device_id: The unique identifier of the device. This case-sensitive + string can be up to 128 characters long, and supports ASCII 7-bit + alphanumeric characters plus the following special characters: - : . + % _ + # * ? ! ( ) , = @ ; $ '. + :type device_id: str + :param hub_name: Name of the IoT Hub where the device was created or + deleted. + :type hub_name: str + :param op_type: The event type specified for this operation by the IoT + Hub. + :type op_type: str + :param operation_timestamp: The ISO8601 timestamp of the operation. + :type operation_timestamp: str + :param twin: Information about the device twin, which is the cloud + represenation of application device metadata. + :type twin: ~azure.eventgrid.models.DeviceTwinInfo + """ + + _attribute_map = { + 'device_id': {'key': 'deviceId', 'type': 'str'}, + 'hub_name': {'key': 'hubName', 'type': 'str'}, + 'op_type': {'key': 'opType', 'type': 'str'}, + 'operation_timestamp': {'key': 'operationTimestamp', 'type': 'str'}, + 'twin': {'key': 'twin', 'type': 'DeviceTwinInfo'}, + } + + def __init__(self, **kwargs): + super(DeviceLifeCycleEventProperties, self).__init__(**kwargs) + self.device_id = kwargs.get('device_id', None) + self.hub_name = kwargs.get('hub_name', None) + self.op_type = kwargs.get('op_type', None) + self.operation_timestamp = kwargs.get('operation_timestamp', None) + self.twin = kwargs.get('twin', None) diff --git a/azure-eventgrid/azure/eventgrid/models/device_life_cycle_event_properties_py3.py b/azure-eventgrid/azure/eventgrid/models/device_life_cycle_event_properties_py3.py new file mode 100644 index 000000000000..1502830091f0 --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/device_life_cycle_event_properties_py3.py @@ -0,0 +1,51 @@ +# 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 msrest.serialization import Model + + +class DeviceLifeCycleEventProperties(Model): + """Schema of the Data property of an EventGridEvent for a device life cycle + event (DeviceCreated, DeviceDeleted). + + :param device_id: The unique identifier of the device. This case-sensitive + string can be up to 128 characters long, and supports ASCII 7-bit + alphanumeric characters plus the following special characters: - : . + % _ + # * ? ! ( ) , = @ ; $ '. + :type device_id: str + :param hub_name: Name of the IoT Hub where the device was created or + deleted. + :type hub_name: str + :param op_type: The event type specified for this operation by the IoT + Hub. + :type op_type: str + :param operation_timestamp: The ISO8601 timestamp of the operation. + :type operation_timestamp: str + :param twin: Information about the device twin, which is the cloud + represenation of application device metadata. + :type twin: ~azure.eventgrid.models.DeviceTwinInfo + """ + + _attribute_map = { + 'device_id': {'key': 'deviceId', 'type': 'str'}, + 'hub_name': {'key': 'hubName', 'type': 'str'}, + 'op_type': {'key': 'opType', 'type': 'str'}, + 'operation_timestamp': {'key': 'operationTimestamp', 'type': 'str'}, + 'twin': {'key': 'twin', 'type': 'DeviceTwinInfo'}, + } + + def __init__(self, *, device_id: str=None, hub_name: str=None, op_type: str=None, operation_timestamp: str=None, twin=None, **kwargs) -> None: + super(DeviceLifeCycleEventProperties, self).__init__(**kwargs) + self.device_id = device_id + self.hub_name = hub_name + self.op_type = op_type + self.operation_timestamp = operation_timestamp + self.twin = twin diff --git a/azure-eventgrid/azure/eventgrid/models/device_twin_info.py b/azure-eventgrid/azure/eventgrid/models/device_twin_info.py new file mode 100644 index 000000000000..4f7782f31aa2 --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/device_twin_info.py @@ -0,0 +1,78 @@ +# 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 msrest.serialization import Model + + +class DeviceTwinInfo(Model): + """Information about the device twin, which is the cloud represenation of + application device metadata. + + :param authentication_type: Authentication type used for this device: + either SAS, SelfSigned, or CertificateAuthority. + :type authentication_type: str + :param cloud_to_device_message_count: Count of cloud to device messages + sent to this device. + :type cloud_to_device_message_count: float + :param connection_state: Whether the device is connected or disconnected. + :type connection_state: str + :param device_id: The unique identifier of the device twin. + :type device_id: str + :param etag: A piece of information that describes the content of the + device twin. Each etag is guaranteed to be unique per device twin. + :type etag: str + :param last_activity_time: The ISO8601 timestamp of the last activity. + :type last_activity_time: str + :param properties: Properties JSON element. + :type properties: ~azure.eventgrid.models.DeviceTwinInfoProperties + :param status: Whether the device twin is enabled or disabled. + :type status: str + :param status_update_time: The ISO8601 timestamp of the last device twin + status update. + :type status_update_time: str + :param version: An integer that is incremented by one each time the device + twin is updated. + :type version: float + :param x509_thumbprint: The thumbprint is a unique value for the x509 + certificate, commonly used to find a particular certificate in a + certificate store. The thumbprint is dynamically generated using the SHA1 + algorithm, and does not physically exist in the certificate. + :type x509_thumbprint: + ~azure.eventgrid.models.DeviceTwinInfoX509Thumbprint + """ + + _attribute_map = { + 'authentication_type': {'key': 'authenticationType', 'type': 'str'}, + 'cloud_to_device_message_count': {'key': 'cloudToDeviceMessageCount', 'type': 'float'}, + 'connection_state': {'key': 'connectionState', 'type': 'str'}, + 'device_id': {'key': 'deviceId', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'last_activity_time': {'key': 'lastActivityTime', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'DeviceTwinInfoProperties'}, + 'status': {'key': 'status', 'type': 'str'}, + 'status_update_time': {'key': 'statusUpdateTime', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'float'}, + 'x509_thumbprint': {'key': 'x509Thumbprint', 'type': 'DeviceTwinInfoX509Thumbprint'}, + } + + def __init__(self, **kwargs): + super(DeviceTwinInfo, self).__init__(**kwargs) + self.authentication_type = kwargs.get('authentication_type', None) + self.cloud_to_device_message_count = kwargs.get('cloud_to_device_message_count', None) + self.connection_state = kwargs.get('connection_state', None) + self.device_id = kwargs.get('device_id', None) + self.etag = kwargs.get('etag', None) + self.last_activity_time = kwargs.get('last_activity_time', None) + self.properties = kwargs.get('properties', None) + self.status = kwargs.get('status', None) + self.status_update_time = kwargs.get('status_update_time', None) + self.version = kwargs.get('version', None) + self.x509_thumbprint = kwargs.get('x509_thumbprint', None) diff --git a/azure-eventgrid/azure/eventgrid/models/device_twin_info_properties.py b/azure-eventgrid/azure/eventgrid/models/device_twin_info_properties.py new file mode 100644 index 000000000000..707a8bfb287f --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/device_twin_info_properties.py @@ -0,0 +1,34 @@ +# 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 msrest.serialization import Model + + +class DeviceTwinInfoProperties(Model): + """Properties JSON element. + + :param desired: A portion of the properties that can be written only by + the application back-end, and read by the device. + :type desired: ~azure.eventgrid.models.DeviceTwinProperties + :param reported: A portion of the properties that can be written only by + the device, and read by the application back-end. + :type reported: ~azure.eventgrid.models.DeviceTwinProperties + """ + + _attribute_map = { + 'desired': {'key': 'desired', 'type': 'DeviceTwinProperties'}, + 'reported': {'key': 'reported', 'type': 'DeviceTwinProperties'}, + } + + def __init__(self, **kwargs): + super(DeviceTwinInfoProperties, self).__init__(**kwargs) + self.desired = kwargs.get('desired', None) + self.reported = kwargs.get('reported', None) diff --git a/azure-eventgrid/azure/eventgrid/models/device_twin_info_properties_py3.py b/azure-eventgrid/azure/eventgrid/models/device_twin_info_properties_py3.py new file mode 100644 index 000000000000..efb94dee3d97 --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/device_twin_info_properties_py3.py @@ -0,0 +1,34 @@ +# 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 msrest.serialization import Model + + +class DeviceTwinInfoProperties(Model): + """Properties JSON element. + + :param desired: A portion of the properties that can be written only by + the application back-end, and read by the device. + :type desired: ~azure.eventgrid.models.DeviceTwinProperties + :param reported: A portion of the properties that can be written only by + the device, and read by the application back-end. + :type reported: ~azure.eventgrid.models.DeviceTwinProperties + """ + + _attribute_map = { + 'desired': {'key': 'desired', 'type': 'DeviceTwinProperties'}, + 'reported': {'key': 'reported', 'type': 'DeviceTwinProperties'}, + } + + def __init__(self, *, desired=None, reported=None, **kwargs) -> None: + super(DeviceTwinInfoProperties, self).__init__(**kwargs) + self.desired = desired + self.reported = reported diff --git a/azure-eventgrid/azure/eventgrid/models/device_twin_info_py3.py b/azure-eventgrid/azure/eventgrid/models/device_twin_info_py3.py new file mode 100644 index 000000000000..c496c850aba0 --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/device_twin_info_py3.py @@ -0,0 +1,78 @@ +# 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 msrest.serialization import Model + + +class DeviceTwinInfo(Model): + """Information about the device twin, which is the cloud represenation of + application device metadata. + + :param authentication_type: Authentication type used for this device: + either SAS, SelfSigned, or CertificateAuthority. + :type authentication_type: str + :param cloud_to_device_message_count: Count of cloud to device messages + sent to this device. + :type cloud_to_device_message_count: float + :param connection_state: Whether the device is connected or disconnected. + :type connection_state: str + :param device_id: The unique identifier of the device twin. + :type device_id: str + :param etag: A piece of information that describes the content of the + device twin. Each etag is guaranteed to be unique per device twin. + :type etag: str + :param last_activity_time: The ISO8601 timestamp of the last activity. + :type last_activity_time: str + :param properties: Properties JSON element. + :type properties: ~azure.eventgrid.models.DeviceTwinInfoProperties + :param status: Whether the device twin is enabled or disabled. + :type status: str + :param status_update_time: The ISO8601 timestamp of the last device twin + status update. + :type status_update_time: str + :param version: An integer that is incremented by one each time the device + twin is updated. + :type version: float + :param x509_thumbprint: The thumbprint is a unique value for the x509 + certificate, commonly used to find a particular certificate in a + certificate store. The thumbprint is dynamically generated using the SHA1 + algorithm, and does not physically exist in the certificate. + :type x509_thumbprint: + ~azure.eventgrid.models.DeviceTwinInfoX509Thumbprint + """ + + _attribute_map = { + 'authentication_type': {'key': 'authenticationType', 'type': 'str'}, + 'cloud_to_device_message_count': {'key': 'cloudToDeviceMessageCount', 'type': 'float'}, + 'connection_state': {'key': 'connectionState', 'type': 'str'}, + 'device_id': {'key': 'deviceId', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'last_activity_time': {'key': 'lastActivityTime', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'DeviceTwinInfoProperties'}, + 'status': {'key': 'status', 'type': 'str'}, + 'status_update_time': {'key': 'statusUpdateTime', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'float'}, + 'x509_thumbprint': {'key': 'x509Thumbprint', 'type': 'DeviceTwinInfoX509Thumbprint'}, + } + + def __init__(self, *, authentication_type: str=None, cloud_to_device_message_count: float=None, connection_state: str=None, device_id: str=None, etag: str=None, last_activity_time: str=None, properties=None, status: str=None, status_update_time: str=None, version: float=None, x509_thumbprint=None, **kwargs) -> None: + super(DeviceTwinInfo, self).__init__(**kwargs) + self.authentication_type = authentication_type + self.cloud_to_device_message_count = cloud_to_device_message_count + self.connection_state = connection_state + self.device_id = device_id + self.etag = etag + self.last_activity_time = last_activity_time + self.properties = properties + self.status = status + self.status_update_time = status_update_time + self.version = version + self.x509_thumbprint = x509_thumbprint diff --git a/azure-eventgrid/azure/eventgrid/models/device_twin_info_x509_thumbprint.py b/azure-eventgrid/azure/eventgrid/models/device_twin_info_x509_thumbprint.py new file mode 100644 index 000000000000..abeb5e343bfa --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/device_twin_info_x509_thumbprint.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class DeviceTwinInfoX509Thumbprint(Model): + """The thumbprint is a unique value for the x509 certificate, commonly used to + find a particular certificate in a certificate store. The thumbprint is + dynamically generated using the SHA1 algorithm, and does not physically + exist in the certificate. + + :param primary_thumbprint: Primary thumbprint for the x509 certificate. + :type primary_thumbprint: str + :param secondary_thumbprint: Secondary thumbprint for the x509 + certificate. + :type secondary_thumbprint: str + """ + + _attribute_map = { + 'primary_thumbprint': {'key': 'primaryThumbprint', 'type': 'str'}, + 'secondary_thumbprint': {'key': 'secondaryThumbprint', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DeviceTwinInfoX509Thumbprint, self).__init__(**kwargs) + self.primary_thumbprint = kwargs.get('primary_thumbprint', None) + self.secondary_thumbprint = kwargs.get('secondary_thumbprint', None) diff --git a/azure-eventgrid/azure/eventgrid/models/device_twin_info_x509_thumbprint_py3.py b/azure-eventgrid/azure/eventgrid/models/device_twin_info_x509_thumbprint_py3.py new file mode 100644 index 000000000000..8255b523b0ba --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/device_twin_info_x509_thumbprint_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class DeviceTwinInfoX509Thumbprint(Model): + """The thumbprint is a unique value for the x509 certificate, commonly used to + find a particular certificate in a certificate store. The thumbprint is + dynamically generated using the SHA1 algorithm, and does not physically + exist in the certificate. + + :param primary_thumbprint: Primary thumbprint for the x509 certificate. + :type primary_thumbprint: str + :param secondary_thumbprint: Secondary thumbprint for the x509 + certificate. + :type secondary_thumbprint: str + """ + + _attribute_map = { + 'primary_thumbprint': {'key': 'primaryThumbprint', 'type': 'str'}, + 'secondary_thumbprint': {'key': 'secondaryThumbprint', 'type': 'str'}, + } + + def __init__(self, *, primary_thumbprint: str=None, secondary_thumbprint: str=None, **kwargs) -> None: + super(DeviceTwinInfoX509Thumbprint, self).__init__(**kwargs) + self.primary_thumbprint = primary_thumbprint + self.secondary_thumbprint = secondary_thumbprint diff --git a/azure-eventgrid/azure/eventgrid/models/device_twin_metadata.py b/azure-eventgrid/azure/eventgrid/models/device_twin_metadata.py new file mode 100644 index 000000000000..59219bd36fe2 --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/device_twin_metadata.py @@ -0,0 +1,29 @@ +# 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 msrest.serialization import Model + + +class DeviceTwinMetadata(Model): + """Metadata information for the properties JSON document. + + :param last_updated: The ISO8601 timestamp of the last time the properties + were updated. + :type last_updated: str + """ + + _attribute_map = { + 'last_updated': {'key': 'lastUpdated', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DeviceTwinMetadata, self).__init__(**kwargs) + self.last_updated = kwargs.get('last_updated', None) diff --git a/azure-eventgrid/azure/eventgrid/models/device_twin_metadata_py3.py b/azure-eventgrid/azure/eventgrid/models/device_twin_metadata_py3.py new file mode 100644 index 000000000000..8abb65fda8e2 --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/device_twin_metadata_py3.py @@ -0,0 +1,29 @@ +# 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 msrest.serialization import Model + + +class DeviceTwinMetadata(Model): + """Metadata information for the properties JSON document. + + :param last_updated: The ISO8601 timestamp of the last time the properties + were updated. + :type last_updated: str + """ + + _attribute_map = { + 'last_updated': {'key': 'lastUpdated', 'type': 'str'}, + } + + def __init__(self, *, last_updated: str=None, **kwargs) -> None: + super(DeviceTwinMetadata, self).__init__(**kwargs) + self.last_updated = last_updated diff --git a/azure-eventgrid/azure/eventgrid/models/device_twin_properties.py b/azure-eventgrid/azure/eventgrid/models/device_twin_properties.py new file mode 100644 index 000000000000..9b207d5868ed --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/device_twin_properties.py @@ -0,0 +1,33 @@ +# 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 msrest.serialization import Model + + +class DeviceTwinProperties(Model): + """A portion of the properties that can be written only by the application + back-end, and read by the device. + + :param metadata: Metadata information for the properties JSON document. + :type metadata: ~azure.eventgrid.models.DeviceTwinMetadata + :param version: Version of device twin properties. + :type version: float + """ + + _attribute_map = { + 'metadata': {'key': 'metadata', 'type': 'DeviceTwinMetadata'}, + 'version': {'key': 'version', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(DeviceTwinProperties, self).__init__(**kwargs) + self.metadata = kwargs.get('metadata', None) + self.version = kwargs.get('version', None) diff --git a/azure-eventgrid/azure/eventgrid/models/device_twin_properties_py3.py b/azure-eventgrid/azure/eventgrid/models/device_twin_properties_py3.py new file mode 100644 index 000000000000..d28f52af8f84 --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/device_twin_properties_py3.py @@ -0,0 +1,33 @@ +# 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 msrest.serialization import Model + + +class DeviceTwinProperties(Model): + """A portion of the properties that can be written only by the application + back-end, and read by the device. + + :param metadata: Metadata information for the properties JSON document. + :type metadata: ~azure.eventgrid.models.DeviceTwinMetadata + :param version: Version of device twin properties. + :type version: float + """ + + _attribute_map = { + 'metadata': {'key': 'metadata', 'type': 'DeviceTwinMetadata'}, + 'version': {'key': 'version', 'type': 'float'}, + } + + def __init__(self, *, metadata=None, version: float=None, **kwargs) -> None: + super(DeviceTwinProperties, self).__init__(**kwargs) + self.metadata = metadata + self.version = version diff --git a/azure-eventgrid/azure/eventgrid/models/event_grid_event.py b/azure-eventgrid/azure/eventgrid/models/event_grid_event.py index 4fe511b60b7c..f4828c24dd38 100644 --- a/azure-eventgrid/azure/eventgrid/models/event_grid_event.py +++ b/azure-eventgrid/azure/eventgrid/models/event_grid_event.py @@ -18,21 +18,23 @@ class EventGridEvent(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param id: An unique identifier for the event. + All required parameters must be populated in order to send to Azure. + + :param id: Required. An unique identifier for the event. :type id: str :param topic: The resource path of the event source. :type topic: str - :param subject: A resource path relative to the topic path. + :param subject: Required. A resource path relative to the topic path. :type subject: str - :param data: Event data specific to the event type. + :param data: Required. Event data specific to the event type. :type data: object - :param event_type: The type of the event that occurred. + :param event_type: Required. The type of the event that occurred. :type event_type: str - :param event_time: The time (in UTC) the event was generated. + :param event_time: Required. The time (in UTC) the event was generated. :type event_time: datetime :ivar metadata_version: The schema version of the event metadata. :vartype metadata_version: str - :param data_version: The schema version of the data object. + :param data_version: Required. The schema version of the data object. :type data_version: str """ @@ -57,13 +59,13 @@ class EventGridEvent(Model): 'data_version': {'key': 'dataVersion', 'type': 'str'}, } - def __init__(self, id, subject, data, event_type, event_time, data_version, topic=None): - super(EventGridEvent, self).__init__() - self.id = id - self.topic = topic - self.subject = subject - self.data = data - self.event_type = event_type - self.event_time = event_time + def __init__(self, **kwargs): + super(EventGridEvent, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.topic = kwargs.get('topic', None) + self.subject = kwargs.get('subject', None) + self.data = kwargs.get('data', None) + self.event_type = kwargs.get('event_type', None) + self.event_time = kwargs.get('event_time', None) self.metadata_version = None - self.data_version = data_version + self.data_version = kwargs.get('data_version', None) diff --git a/azure-eventgrid/azure/eventgrid/models/event_grid_event_py3.py b/azure-eventgrid/azure/eventgrid/models/event_grid_event_py3.py new file mode 100644 index 000000000000..1f54ddad918a --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/event_grid_event_py3.py @@ -0,0 +1,71 @@ +# 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 msrest.serialization import Model + + +class EventGridEvent(Model): + """Properties of an event published to an Event Grid topic. + + 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 Azure. + + :param id: Required. An unique identifier for the event. + :type id: str + :param topic: The resource path of the event source. + :type topic: str + :param subject: Required. A resource path relative to the topic path. + :type subject: str + :param data: Required. Event data specific to the event type. + :type data: object + :param event_type: Required. The type of the event that occurred. + :type event_type: str + :param event_time: Required. The time (in UTC) the event was generated. + :type event_time: datetime + :ivar metadata_version: The schema version of the event metadata. + :vartype metadata_version: str + :param data_version: Required. The schema version of the data object. + :type data_version: str + """ + + _validation = { + 'id': {'required': True}, + 'subject': {'required': True}, + 'data': {'required': True}, + 'event_type': {'required': True}, + 'event_time': {'required': True}, + 'metadata_version': {'readonly': True}, + 'data_version': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'topic': {'key': 'topic', 'type': 'str'}, + 'subject': {'key': 'subject', 'type': 'str'}, + 'data': {'key': 'data', 'type': 'object'}, + 'event_type': {'key': 'eventType', 'type': 'str'}, + 'event_time': {'key': 'eventTime', 'type': 'iso-8601'}, + 'metadata_version': {'key': 'metadataVersion', 'type': 'str'}, + 'data_version': {'key': 'dataVersion', 'type': 'str'}, + } + + def __init__(self, *, id: str, subject: str, data, event_type: str, event_time, data_version: str, topic: str=None, **kwargs) -> None: + super(EventGridEvent, self).__init__(**kwargs) + self.id = id + self.topic = topic + self.subject = subject + self.data = data + self.event_type = event_type + self.event_time = event_time + self.metadata_version = None + self.data_version = data_version diff --git a/azure-eventgrid/azure/eventgrid/models/event_hub_capture_file_created_event_data.py b/azure-eventgrid/azure/eventgrid/models/event_hub_capture_file_created_event_data.py index 175501edf583..7cca05430f96 100644 --- a/azure-eventgrid/azure/eventgrid/models/event_hub_capture_file_created_event_data.py +++ b/azure-eventgrid/azure/eventgrid/models/event_hub_capture_file_created_event_data.py @@ -48,14 +48,14 @@ class EventHubCaptureFileCreatedEventData(Model): 'last_enqueue_time': {'key': 'lastEnqueueTime', 'type': 'iso-8601'}, } - def __init__(self, fileurl=None, file_type=None, partition_id=None, size_in_bytes=None, event_count=None, first_sequence_number=None, last_sequence_number=None, first_enqueue_time=None, last_enqueue_time=None): - super(EventHubCaptureFileCreatedEventData, self).__init__() - self.fileurl = fileurl - self.file_type = file_type - self.partition_id = partition_id - self.size_in_bytes = size_in_bytes - self.event_count = event_count - self.first_sequence_number = first_sequence_number - self.last_sequence_number = last_sequence_number - self.first_enqueue_time = first_enqueue_time - self.last_enqueue_time = last_enqueue_time + def __init__(self, **kwargs): + super(EventHubCaptureFileCreatedEventData, self).__init__(**kwargs) + self.fileurl = kwargs.get('fileurl', None) + self.file_type = kwargs.get('file_type', None) + self.partition_id = kwargs.get('partition_id', None) + self.size_in_bytes = kwargs.get('size_in_bytes', None) + self.event_count = kwargs.get('event_count', None) + self.first_sequence_number = kwargs.get('first_sequence_number', None) + self.last_sequence_number = kwargs.get('last_sequence_number', None) + self.first_enqueue_time = kwargs.get('first_enqueue_time', None) + self.last_enqueue_time = kwargs.get('last_enqueue_time', None) diff --git a/azure-eventgrid/azure/eventgrid/models/event_hub_capture_file_created_event_data_py3.py b/azure-eventgrid/azure/eventgrid/models/event_hub_capture_file_created_event_data_py3.py new file mode 100644 index 000000000000..673a61b031e9 --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/event_hub_capture_file_created_event_data_py3.py @@ -0,0 +1,61 @@ +# 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 msrest.serialization import Model + + +class EventHubCaptureFileCreatedEventData(Model): + """Schema of the Data property of an EventGridEvent for an + Microsoft.EventHub.CaptureFileCreated event. + + :param fileurl: The path to the capture file. + :type fileurl: str + :param file_type: The file type of the capture file. + :type file_type: str + :param partition_id: The shard ID. + :type partition_id: str + :param size_in_bytes: The file size. + :type size_in_bytes: int + :param event_count: The number of events in the file. + :type event_count: int + :param first_sequence_number: The smallest sequence number from the queue. + :type first_sequence_number: int + :param last_sequence_number: The last sequence number from the queue. + :type last_sequence_number: int + :param first_enqueue_time: The first time from the queue. + :type first_enqueue_time: datetime + :param last_enqueue_time: The last time from the queue. + :type last_enqueue_time: datetime + """ + + _attribute_map = { + 'fileurl': {'key': 'fileurl', 'type': 'str'}, + 'file_type': {'key': 'fileType', 'type': 'str'}, + 'partition_id': {'key': 'partitionId', 'type': 'str'}, + 'size_in_bytes': {'key': 'sizeInBytes', 'type': 'int'}, + 'event_count': {'key': 'eventCount', 'type': 'int'}, + 'first_sequence_number': {'key': 'firstSequenceNumber', 'type': 'int'}, + 'last_sequence_number': {'key': 'lastSequenceNumber', 'type': 'int'}, + 'first_enqueue_time': {'key': 'firstEnqueueTime', 'type': 'iso-8601'}, + 'last_enqueue_time': {'key': 'lastEnqueueTime', 'type': 'iso-8601'}, + } + + def __init__(self, *, fileurl: str=None, file_type: str=None, partition_id: str=None, size_in_bytes: int=None, event_count: int=None, first_sequence_number: int=None, last_sequence_number: int=None, first_enqueue_time=None, last_enqueue_time=None, **kwargs) -> None: + super(EventHubCaptureFileCreatedEventData, self).__init__(**kwargs) + self.fileurl = fileurl + self.file_type = file_type + self.partition_id = partition_id + self.size_in_bytes = size_in_bytes + self.event_count = event_count + self.first_sequence_number = first_sequence_number + self.last_sequence_number = last_sequence_number + self.first_enqueue_time = first_enqueue_time + self.last_enqueue_time = last_enqueue_time diff --git a/azure-eventgrid/azure/eventgrid/models/iot_hub_device_created_event_data.py b/azure-eventgrid/azure/eventgrid/models/iot_hub_device_created_event_data.py new file mode 100644 index 000000000000..0e9ed01a4866 --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/iot_hub_device_created_event_data.py @@ -0,0 +1,45 @@ +# 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 .device_life_cycle_event_properties import DeviceLifeCycleEventProperties + + +class IotHubDeviceCreatedEventData(DeviceLifeCycleEventProperties): + """Event data for Microsoft.Devices.DeviceCreated event. + + :param device_id: The unique identifier of the device. This case-sensitive + string can be up to 128 characters long, and supports ASCII 7-bit + alphanumeric characters plus the following special characters: - : . + % _ + # * ? ! ( ) , = @ ; $ '. + :type device_id: str + :param hub_name: Name of the IoT Hub where the device was created or + deleted. + :type hub_name: str + :param op_type: The event type specified for this operation by the IoT + Hub. + :type op_type: str + :param operation_timestamp: The ISO8601 timestamp of the operation. + :type operation_timestamp: str + :param twin: Information about the device twin, which is the cloud + represenation of application device metadata. + :type twin: ~azure.eventgrid.models.DeviceTwinInfo + """ + + _attribute_map = { + 'device_id': {'key': 'deviceId', 'type': 'str'}, + 'hub_name': {'key': 'hubName', 'type': 'str'}, + 'op_type': {'key': 'opType', 'type': 'str'}, + 'operation_timestamp': {'key': 'operationTimestamp', 'type': 'str'}, + 'twin': {'key': 'twin', 'type': 'DeviceTwinInfo'}, + } + + def __init__(self, **kwargs): + super(IotHubDeviceCreatedEventData, self).__init__(**kwargs) diff --git a/azure-eventgrid/azure/eventgrid/models/iot_hub_device_created_event_data_py3.py b/azure-eventgrid/azure/eventgrid/models/iot_hub_device_created_event_data_py3.py new file mode 100644 index 000000000000..8ddc99f32782 --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/iot_hub_device_created_event_data_py3.py @@ -0,0 +1,45 @@ +# 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 .device_life_cycle_event_properties import DeviceLifeCycleEventProperties + + +class IotHubDeviceCreatedEventData(DeviceLifeCycleEventProperties): + """Event data for Microsoft.Devices.DeviceCreated event. + + :param device_id: The unique identifier of the device. This case-sensitive + string can be up to 128 characters long, and supports ASCII 7-bit + alphanumeric characters plus the following special characters: - : . + % _ + # * ? ! ( ) , = @ ; $ '. + :type device_id: str + :param hub_name: Name of the IoT Hub where the device was created or + deleted. + :type hub_name: str + :param op_type: The event type specified for this operation by the IoT + Hub. + :type op_type: str + :param operation_timestamp: The ISO8601 timestamp of the operation. + :type operation_timestamp: str + :param twin: Information about the device twin, which is the cloud + represenation of application device metadata. + :type twin: ~azure.eventgrid.models.DeviceTwinInfo + """ + + _attribute_map = { + 'device_id': {'key': 'deviceId', 'type': 'str'}, + 'hub_name': {'key': 'hubName', 'type': 'str'}, + 'op_type': {'key': 'opType', 'type': 'str'}, + 'operation_timestamp': {'key': 'operationTimestamp', 'type': 'str'}, + 'twin': {'key': 'twin', 'type': 'DeviceTwinInfo'}, + } + + def __init__(self, *, device_id: str=None, hub_name: str=None, op_type: str=None, operation_timestamp: str=None, twin=None, **kwargs) -> None: + super(IotHubDeviceCreatedEventData, self).__init__(device_id=device_id, hub_name=hub_name, op_type=op_type, operation_timestamp=operation_timestamp, twin=twin, **kwargs) diff --git a/azure-eventgrid/azure/eventgrid/models/iot_hub_device_deleted_event_data.py b/azure-eventgrid/azure/eventgrid/models/iot_hub_device_deleted_event_data.py new file mode 100644 index 000000000000..ef64033598c8 --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/iot_hub_device_deleted_event_data.py @@ -0,0 +1,45 @@ +# 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 .device_life_cycle_event_properties import DeviceLifeCycleEventProperties + + +class IotHubDeviceDeletedEventData(DeviceLifeCycleEventProperties): + """Event data for Microsoft.Devices.DeviceDeleted event. + + :param device_id: The unique identifier of the device. This case-sensitive + string can be up to 128 characters long, and supports ASCII 7-bit + alphanumeric characters plus the following special characters: - : . + % _ + # * ? ! ( ) , = @ ; $ '. + :type device_id: str + :param hub_name: Name of the IoT Hub where the device was created or + deleted. + :type hub_name: str + :param op_type: The event type specified for this operation by the IoT + Hub. + :type op_type: str + :param operation_timestamp: The ISO8601 timestamp of the operation. + :type operation_timestamp: str + :param twin: Information about the device twin, which is the cloud + represenation of application device metadata. + :type twin: ~azure.eventgrid.models.DeviceTwinInfo + """ + + _attribute_map = { + 'device_id': {'key': 'deviceId', 'type': 'str'}, + 'hub_name': {'key': 'hubName', 'type': 'str'}, + 'op_type': {'key': 'opType', 'type': 'str'}, + 'operation_timestamp': {'key': 'operationTimestamp', 'type': 'str'}, + 'twin': {'key': 'twin', 'type': 'DeviceTwinInfo'}, + } + + def __init__(self, **kwargs): + super(IotHubDeviceDeletedEventData, self).__init__(**kwargs) diff --git a/azure-eventgrid/azure/eventgrid/models/iot_hub_device_deleted_event_data_py3.py b/azure-eventgrid/azure/eventgrid/models/iot_hub_device_deleted_event_data_py3.py new file mode 100644 index 000000000000..7d4745272f77 --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/iot_hub_device_deleted_event_data_py3.py @@ -0,0 +1,45 @@ +# 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 .device_life_cycle_event_properties import DeviceLifeCycleEventProperties + + +class IotHubDeviceDeletedEventData(DeviceLifeCycleEventProperties): + """Event data for Microsoft.Devices.DeviceDeleted event. + + :param device_id: The unique identifier of the device. This case-sensitive + string can be up to 128 characters long, and supports ASCII 7-bit + alphanumeric characters plus the following special characters: - : . + % _ + # * ? ! ( ) , = @ ; $ '. + :type device_id: str + :param hub_name: Name of the IoT Hub where the device was created or + deleted. + :type hub_name: str + :param op_type: The event type specified for this operation by the IoT + Hub. + :type op_type: str + :param operation_timestamp: The ISO8601 timestamp of the operation. + :type operation_timestamp: str + :param twin: Information about the device twin, which is the cloud + represenation of application device metadata. + :type twin: ~azure.eventgrid.models.DeviceTwinInfo + """ + + _attribute_map = { + 'device_id': {'key': 'deviceId', 'type': 'str'}, + 'hub_name': {'key': 'hubName', 'type': 'str'}, + 'op_type': {'key': 'opType', 'type': 'str'}, + 'operation_timestamp': {'key': 'operationTimestamp', 'type': 'str'}, + 'twin': {'key': 'twin', 'type': 'DeviceTwinInfo'}, + } + + def __init__(self, *, device_id: str=None, hub_name: str=None, op_type: str=None, operation_timestamp: str=None, twin=None, **kwargs) -> None: + super(IotHubDeviceDeletedEventData, self).__init__(device_id=device_id, hub_name=hub_name, op_type=op_type, operation_timestamp=operation_timestamp, twin=twin, **kwargs) diff --git a/azure-eventgrid/azure/eventgrid/models/resource_delete_cancel_data.py b/azure-eventgrid/azure/eventgrid/models/resource_delete_cancel_data.py index ba73c18e1742..fe44a24f3482 100644 --- a/azure-eventgrid/azure/eventgrid/models/resource_delete_cancel_data.py +++ b/azure-eventgrid/azure/eventgrid/models/resource_delete_cancel_data.py @@ -55,16 +55,16 @@ class ResourceDeleteCancelData(Model): 'http_request': {'key': 'httpRequest', 'type': 'str'}, } - def __init__(self, tenant_id=None, subscription_id=None, resource_group=None, resource_provider=None, resource_uri=None, operation_name=None, status=None, authorization=None, claims=None, correlation_id=None, http_request=None): - super(ResourceDeleteCancelData, self).__init__() - self.tenant_id = tenant_id - self.subscription_id = subscription_id - self.resource_group = resource_group - self.resource_provider = resource_provider - self.resource_uri = resource_uri - self.operation_name = operation_name - self.status = status - self.authorization = authorization - self.claims = claims - self.correlation_id = correlation_id - self.http_request = http_request + def __init__(self, **kwargs): + super(ResourceDeleteCancelData, self).__init__(**kwargs) + self.tenant_id = kwargs.get('tenant_id', None) + self.subscription_id = kwargs.get('subscription_id', None) + self.resource_group = kwargs.get('resource_group', None) + self.resource_provider = kwargs.get('resource_provider', None) + self.resource_uri = kwargs.get('resource_uri', None) + self.operation_name = kwargs.get('operation_name', None) + self.status = kwargs.get('status', None) + self.authorization = kwargs.get('authorization', None) + self.claims = kwargs.get('claims', None) + self.correlation_id = kwargs.get('correlation_id', None) + self.http_request = kwargs.get('http_request', None) diff --git a/azure-eventgrid/azure/eventgrid/models/resource_delete_cancel_data_py3.py b/azure-eventgrid/azure/eventgrid/models/resource_delete_cancel_data_py3.py new file mode 100644 index 000000000000..d160235c5335 --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/resource_delete_cancel_data_py3.py @@ -0,0 +1,70 @@ +# 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 msrest.serialization import Model + + +class ResourceDeleteCancelData(Model): + """Schema of the Data property of an EventGridEvent for an + Microsoft.Resources.ResourceDeleteCancel event. This is raised when a + resource delete operation is canceled. + + :param tenant_id: The tenant ID of the resource. + :type tenant_id: str + :param subscription_id: The subscription ID of the resource. + :type subscription_id: str + :param resource_group: The resource group of the resource. + :type resource_group: str + :param resource_provider: The resource provider performing the operation. + :type resource_provider: str + :param resource_uri: The URI of the resource in the operation. + :type resource_uri: str + :param operation_name: The operation that was performed. + :type operation_name: str + :param status: The status of the operation. + :type status: str + :param authorization: The requested authorization for the operation. + :type authorization: str + :param claims: The properties of the claims. + :type claims: str + :param correlation_id: An operation ID used for troubleshooting. + :type correlation_id: str + :param http_request: The details of the operation. + :type http_request: str + """ + + _attribute_map = { + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, + 'resource_provider': {'key': 'resourceProvider', 'type': 'str'}, + 'resource_uri': {'key': 'resourceUri', 'type': 'str'}, + 'operation_name': {'key': 'operationName', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'authorization': {'key': 'authorization', 'type': 'str'}, + 'claims': {'key': 'claims', 'type': 'str'}, + 'correlation_id': {'key': 'correlationId', 'type': 'str'}, + 'http_request': {'key': 'httpRequest', 'type': 'str'}, + } + + def __init__(self, *, tenant_id: str=None, subscription_id: str=None, resource_group: str=None, resource_provider: str=None, resource_uri: str=None, operation_name: str=None, status: str=None, authorization: str=None, claims: str=None, correlation_id: str=None, http_request: str=None, **kwargs) -> None: + super(ResourceDeleteCancelData, self).__init__(**kwargs) + self.tenant_id = tenant_id + self.subscription_id = subscription_id + self.resource_group = resource_group + self.resource_provider = resource_provider + self.resource_uri = resource_uri + self.operation_name = operation_name + self.status = status + self.authorization = authorization + self.claims = claims + self.correlation_id = correlation_id + self.http_request = http_request diff --git a/azure-eventgrid/azure/eventgrid/models/resource_delete_failure_data.py b/azure-eventgrid/azure/eventgrid/models/resource_delete_failure_data.py index 4282b099b75a..1354bd7943fa 100644 --- a/azure-eventgrid/azure/eventgrid/models/resource_delete_failure_data.py +++ b/azure-eventgrid/azure/eventgrid/models/resource_delete_failure_data.py @@ -55,16 +55,16 @@ class ResourceDeleteFailureData(Model): 'http_request': {'key': 'httpRequest', 'type': 'str'}, } - def __init__(self, tenant_id=None, subscription_id=None, resource_group=None, resource_provider=None, resource_uri=None, operation_name=None, status=None, authorization=None, claims=None, correlation_id=None, http_request=None): - super(ResourceDeleteFailureData, self).__init__() - self.tenant_id = tenant_id - self.subscription_id = subscription_id - self.resource_group = resource_group - self.resource_provider = resource_provider - self.resource_uri = resource_uri - self.operation_name = operation_name - self.status = status - self.authorization = authorization - self.claims = claims - self.correlation_id = correlation_id - self.http_request = http_request + def __init__(self, **kwargs): + super(ResourceDeleteFailureData, self).__init__(**kwargs) + self.tenant_id = kwargs.get('tenant_id', None) + self.subscription_id = kwargs.get('subscription_id', None) + self.resource_group = kwargs.get('resource_group', None) + self.resource_provider = kwargs.get('resource_provider', None) + self.resource_uri = kwargs.get('resource_uri', None) + self.operation_name = kwargs.get('operation_name', None) + self.status = kwargs.get('status', None) + self.authorization = kwargs.get('authorization', None) + self.claims = kwargs.get('claims', None) + self.correlation_id = kwargs.get('correlation_id', None) + self.http_request = kwargs.get('http_request', None) diff --git a/azure-eventgrid/azure/eventgrid/models/resource_delete_failure_data_py3.py b/azure-eventgrid/azure/eventgrid/models/resource_delete_failure_data_py3.py new file mode 100644 index 000000000000..29524ca382b8 --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/resource_delete_failure_data_py3.py @@ -0,0 +1,70 @@ +# 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 msrest.serialization import Model + + +class ResourceDeleteFailureData(Model): + """Schema of the Data property of an EventGridEvent for a + Microsoft.Resources.ResourceDeleteFailure event. This is raised when a + resource delete operation fails. + + :param tenant_id: The tenant ID of the resource. + :type tenant_id: str + :param subscription_id: The subscription ID of the resource. + :type subscription_id: str + :param resource_group: The resource group of the resource. + :type resource_group: str + :param resource_provider: The resource provider performing the operation. + :type resource_provider: str + :param resource_uri: The URI of the resource in the operation. + :type resource_uri: str + :param operation_name: The operation that was performed. + :type operation_name: str + :param status: The status of the operation. + :type status: str + :param authorization: The requested authorization for the operation. + :type authorization: str + :param claims: The properties of the claims. + :type claims: str + :param correlation_id: An operation ID used for troubleshooting. + :type correlation_id: str + :param http_request: The details of the operation. + :type http_request: str + """ + + _attribute_map = { + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, + 'resource_provider': {'key': 'resourceProvider', 'type': 'str'}, + 'resource_uri': {'key': 'resourceUri', 'type': 'str'}, + 'operation_name': {'key': 'operationName', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'authorization': {'key': 'authorization', 'type': 'str'}, + 'claims': {'key': 'claims', 'type': 'str'}, + 'correlation_id': {'key': 'correlationId', 'type': 'str'}, + 'http_request': {'key': 'httpRequest', 'type': 'str'}, + } + + def __init__(self, *, tenant_id: str=None, subscription_id: str=None, resource_group: str=None, resource_provider: str=None, resource_uri: str=None, operation_name: str=None, status: str=None, authorization: str=None, claims: str=None, correlation_id: str=None, http_request: str=None, **kwargs) -> None: + super(ResourceDeleteFailureData, self).__init__(**kwargs) + self.tenant_id = tenant_id + self.subscription_id = subscription_id + self.resource_group = resource_group + self.resource_provider = resource_provider + self.resource_uri = resource_uri + self.operation_name = operation_name + self.status = status + self.authorization = authorization + self.claims = claims + self.correlation_id = correlation_id + self.http_request = http_request diff --git a/azure-eventgrid/azure/eventgrid/models/resource_delete_success_data.py b/azure-eventgrid/azure/eventgrid/models/resource_delete_success_data.py index 12c994e5ebce..a8a114e554c6 100644 --- a/azure-eventgrid/azure/eventgrid/models/resource_delete_success_data.py +++ b/azure-eventgrid/azure/eventgrid/models/resource_delete_success_data.py @@ -55,16 +55,16 @@ class ResourceDeleteSuccessData(Model): 'http_request': {'key': 'httpRequest', 'type': 'str'}, } - def __init__(self, tenant_id=None, subscription_id=None, resource_group=None, resource_provider=None, resource_uri=None, operation_name=None, status=None, authorization=None, claims=None, correlation_id=None, http_request=None): - super(ResourceDeleteSuccessData, self).__init__() - self.tenant_id = tenant_id - self.subscription_id = subscription_id - self.resource_group = resource_group - self.resource_provider = resource_provider - self.resource_uri = resource_uri - self.operation_name = operation_name - self.status = status - self.authorization = authorization - self.claims = claims - self.correlation_id = correlation_id - self.http_request = http_request + def __init__(self, **kwargs): + super(ResourceDeleteSuccessData, self).__init__(**kwargs) + self.tenant_id = kwargs.get('tenant_id', None) + self.subscription_id = kwargs.get('subscription_id', None) + self.resource_group = kwargs.get('resource_group', None) + self.resource_provider = kwargs.get('resource_provider', None) + self.resource_uri = kwargs.get('resource_uri', None) + self.operation_name = kwargs.get('operation_name', None) + self.status = kwargs.get('status', None) + self.authorization = kwargs.get('authorization', None) + self.claims = kwargs.get('claims', None) + self.correlation_id = kwargs.get('correlation_id', None) + self.http_request = kwargs.get('http_request', None) diff --git a/azure-eventgrid/azure/eventgrid/models/resource_delete_success_data_py3.py b/azure-eventgrid/azure/eventgrid/models/resource_delete_success_data_py3.py new file mode 100644 index 000000000000..6775b5666aa0 --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/resource_delete_success_data_py3.py @@ -0,0 +1,70 @@ +# 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 msrest.serialization import Model + + +class ResourceDeleteSuccessData(Model): + """Schema of the Data property of an EventGridEvent for a + Microsoft.Resources.ResourceDeleteSuccess event. This is raised when a + resource delete operation succeeds. + + :param tenant_id: The tenant ID of the resource. + :type tenant_id: str + :param subscription_id: The subscription ID of the resource. + :type subscription_id: str + :param resource_group: The resource group of the resource. + :type resource_group: str + :param resource_provider: The resource provider performing the operation. + :type resource_provider: str + :param resource_uri: The URI of the resource in the operation. + :type resource_uri: str + :param operation_name: The operation that was performed. + :type operation_name: str + :param status: The status of the operation. + :type status: str + :param authorization: The requested authorization for the operation. + :type authorization: str + :param claims: The properties of the claims. + :type claims: str + :param correlation_id: An operation ID used for troubleshooting. + :type correlation_id: str + :param http_request: The details of the operation. + :type http_request: str + """ + + _attribute_map = { + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, + 'resource_provider': {'key': 'resourceProvider', 'type': 'str'}, + 'resource_uri': {'key': 'resourceUri', 'type': 'str'}, + 'operation_name': {'key': 'operationName', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'authorization': {'key': 'authorization', 'type': 'str'}, + 'claims': {'key': 'claims', 'type': 'str'}, + 'correlation_id': {'key': 'correlationId', 'type': 'str'}, + 'http_request': {'key': 'httpRequest', 'type': 'str'}, + } + + def __init__(self, *, tenant_id: str=None, subscription_id: str=None, resource_group: str=None, resource_provider: str=None, resource_uri: str=None, operation_name: str=None, status: str=None, authorization: str=None, claims: str=None, correlation_id: str=None, http_request: str=None, **kwargs) -> None: + super(ResourceDeleteSuccessData, self).__init__(**kwargs) + self.tenant_id = tenant_id + self.subscription_id = subscription_id + self.resource_group = resource_group + self.resource_provider = resource_provider + self.resource_uri = resource_uri + self.operation_name = operation_name + self.status = status + self.authorization = authorization + self.claims = claims + self.correlation_id = correlation_id + self.http_request = http_request diff --git a/azure-eventgrid/azure/eventgrid/models/resource_write_cancel_data.py b/azure-eventgrid/azure/eventgrid/models/resource_write_cancel_data.py index 668714f77585..7e1b1e14e351 100644 --- a/azure-eventgrid/azure/eventgrid/models/resource_write_cancel_data.py +++ b/azure-eventgrid/azure/eventgrid/models/resource_write_cancel_data.py @@ -55,16 +55,16 @@ class ResourceWriteCancelData(Model): 'http_request': {'key': 'httpRequest', 'type': 'str'}, } - def __init__(self, tenant_id=None, subscription_id=None, resource_group=None, resource_provider=None, resource_uri=None, operation_name=None, status=None, authorization=None, claims=None, correlation_id=None, http_request=None): - super(ResourceWriteCancelData, self).__init__() - self.tenant_id = tenant_id - self.subscription_id = subscription_id - self.resource_group = resource_group - self.resource_provider = resource_provider - self.resource_uri = resource_uri - self.operation_name = operation_name - self.status = status - self.authorization = authorization - self.claims = claims - self.correlation_id = correlation_id - self.http_request = http_request + def __init__(self, **kwargs): + super(ResourceWriteCancelData, self).__init__(**kwargs) + self.tenant_id = kwargs.get('tenant_id', None) + self.subscription_id = kwargs.get('subscription_id', None) + self.resource_group = kwargs.get('resource_group', None) + self.resource_provider = kwargs.get('resource_provider', None) + self.resource_uri = kwargs.get('resource_uri', None) + self.operation_name = kwargs.get('operation_name', None) + self.status = kwargs.get('status', None) + self.authorization = kwargs.get('authorization', None) + self.claims = kwargs.get('claims', None) + self.correlation_id = kwargs.get('correlation_id', None) + self.http_request = kwargs.get('http_request', None) diff --git a/azure-eventgrid/azure/eventgrid/models/resource_write_cancel_data_py3.py b/azure-eventgrid/azure/eventgrid/models/resource_write_cancel_data_py3.py new file mode 100644 index 000000000000..c2ab521c0495 --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/resource_write_cancel_data_py3.py @@ -0,0 +1,70 @@ +# 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 msrest.serialization import Model + + +class ResourceWriteCancelData(Model): + """Schema of the Data property of an EventGridEvent for a + Microsoft.Resources.ResourceWriteCancel event. This is raised when a + resource create or update operation is canceled. + + :param tenant_id: The tenant ID of the resource. + :type tenant_id: str + :param subscription_id: The subscription ID of the resource. + :type subscription_id: str + :param resource_group: The resource group of the resource. + :type resource_group: str + :param resource_provider: The resource provider performing the operation. + :type resource_provider: str + :param resource_uri: The URI of the resource in the operation. + :type resource_uri: str + :param operation_name: The operation that was performed. + :type operation_name: str + :param status: The status of the operation. + :type status: str + :param authorization: The requested authorization for the operation. + :type authorization: str + :param claims: The properties of the claims. + :type claims: str + :param correlation_id: An operation ID used for troubleshooting. + :type correlation_id: str + :param http_request: The details of the operation. + :type http_request: str + """ + + _attribute_map = { + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, + 'resource_provider': {'key': 'resourceProvider', 'type': 'str'}, + 'resource_uri': {'key': 'resourceUri', 'type': 'str'}, + 'operation_name': {'key': 'operationName', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'authorization': {'key': 'authorization', 'type': 'str'}, + 'claims': {'key': 'claims', 'type': 'str'}, + 'correlation_id': {'key': 'correlationId', 'type': 'str'}, + 'http_request': {'key': 'httpRequest', 'type': 'str'}, + } + + def __init__(self, *, tenant_id: str=None, subscription_id: str=None, resource_group: str=None, resource_provider: str=None, resource_uri: str=None, operation_name: str=None, status: str=None, authorization: str=None, claims: str=None, correlation_id: str=None, http_request: str=None, **kwargs) -> None: + super(ResourceWriteCancelData, self).__init__(**kwargs) + self.tenant_id = tenant_id + self.subscription_id = subscription_id + self.resource_group = resource_group + self.resource_provider = resource_provider + self.resource_uri = resource_uri + self.operation_name = operation_name + self.status = status + self.authorization = authorization + self.claims = claims + self.correlation_id = correlation_id + self.http_request = http_request diff --git a/azure-eventgrid/azure/eventgrid/models/resource_write_failure_data.py b/azure-eventgrid/azure/eventgrid/models/resource_write_failure_data.py index 0067da6344df..d36108de8d30 100644 --- a/azure-eventgrid/azure/eventgrid/models/resource_write_failure_data.py +++ b/azure-eventgrid/azure/eventgrid/models/resource_write_failure_data.py @@ -55,16 +55,16 @@ class ResourceWriteFailureData(Model): 'http_request': {'key': 'httpRequest', 'type': 'str'}, } - def __init__(self, tenant_id=None, subscription_id=None, resource_group=None, resource_provider=None, resource_uri=None, operation_name=None, status=None, authorization=None, claims=None, correlation_id=None, http_request=None): - super(ResourceWriteFailureData, self).__init__() - self.tenant_id = tenant_id - self.subscription_id = subscription_id - self.resource_group = resource_group - self.resource_provider = resource_provider - self.resource_uri = resource_uri - self.operation_name = operation_name - self.status = status - self.authorization = authorization - self.claims = claims - self.correlation_id = correlation_id - self.http_request = http_request + def __init__(self, **kwargs): + super(ResourceWriteFailureData, self).__init__(**kwargs) + self.tenant_id = kwargs.get('tenant_id', None) + self.subscription_id = kwargs.get('subscription_id', None) + self.resource_group = kwargs.get('resource_group', None) + self.resource_provider = kwargs.get('resource_provider', None) + self.resource_uri = kwargs.get('resource_uri', None) + self.operation_name = kwargs.get('operation_name', None) + self.status = kwargs.get('status', None) + self.authorization = kwargs.get('authorization', None) + self.claims = kwargs.get('claims', None) + self.correlation_id = kwargs.get('correlation_id', None) + self.http_request = kwargs.get('http_request', None) diff --git a/azure-eventgrid/azure/eventgrid/models/resource_write_failure_data_py3.py b/azure-eventgrid/azure/eventgrid/models/resource_write_failure_data_py3.py new file mode 100644 index 000000000000..ab45309bd180 --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/resource_write_failure_data_py3.py @@ -0,0 +1,70 @@ +# 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 msrest.serialization import Model + + +class ResourceWriteFailureData(Model): + """Schema of the Data property of an EventGridEvent for a + Microsoft.Resources.ResourceWriteFailure event. This is raised when a + resource create or update operation fails. + + :param tenant_id: The tenant ID of the resource. + :type tenant_id: str + :param subscription_id: The subscription ID of the resource. + :type subscription_id: str + :param resource_group: The resource group of the resource. + :type resource_group: str + :param resource_provider: The resource provider performing the operation. + :type resource_provider: str + :param resource_uri: The URI of the resource in the operation. + :type resource_uri: str + :param operation_name: The operation that was performed. + :type operation_name: str + :param status: The status of the operation. + :type status: str + :param authorization: The requested authorization for the operation. + :type authorization: str + :param claims: The properties of the claims. + :type claims: str + :param correlation_id: An operation ID used for troubleshooting. + :type correlation_id: str + :param http_request: The details of the operation. + :type http_request: str + """ + + _attribute_map = { + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, + 'resource_provider': {'key': 'resourceProvider', 'type': 'str'}, + 'resource_uri': {'key': 'resourceUri', 'type': 'str'}, + 'operation_name': {'key': 'operationName', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'authorization': {'key': 'authorization', 'type': 'str'}, + 'claims': {'key': 'claims', 'type': 'str'}, + 'correlation_id': {'key': 'correlationId', 'type': 'str'}, + 'http_request': {'key': 'httpRequest', 'type': 'str'}, + } + + def __init__(self, *, tenant_id: str=None, subscription_id: str=None, resource_group: str=None, resource_provider: str=None, resource_uri: str=None, operation_name: str=None, status: str=None, authorization: str=None, claims: str=None, correlation_id: str=None, http_request: str=None, **kwargs) -> None: + super(ResourceWriteFailureData, self).__init__(**kwargs) + self.tenant_id = tenant_id + self.subscription_id = subscription_id + self.resource_group = resource_group + self.resource_provider = resource_provider + self.resource_uri = resource_uri + self.operation_name = operation_name + self.status = status + self.authorization = authorization + self.claims = claims + self.correlation_id = correlation_id + self.http_request = http_request diff --git a/azure-eventgrid/azure/eventgrid/models/resource_write_success_data.py b/azure-eventgrid/azure/eventgrid/models/resource_write_success_data.py index c392086b2d47..a38370581387 100644 --- a/azure-eventgrid/azure/eventgrid/models/resource_write_success_data.py +++ b/azure-eventgrid/azure/eventgrid/models/resource_write_success_data.py @@ -55,16 +55,16 @@ class ResourceWriteSuccessData(Model): 'http_request': {'key': 'httpRequest', 'type': 'str'}, } - def __init__(self, tenant_id=None, subscription_id=None, resource_group=None, resource_provider=None, resource_uri=None, operation_name=None, status=None, authorization=None, claims=None, correlation_id=None, http_request=None): - super(ResourceWriteSuccessData, self).__init__() - self.tenant_id = tenant_id - self.subscription_id = subscription_id - self.resource_group = resource_group - self.resource_provider = resource_provider - self.resource_uri = resource_uri - self.operation_name = operation_name - self.status = status - self.authorization = authorization - self.claims = claims - self.correlation_id = correlation_id - self.http_request = http_request + def __init__(self, **kwargs): + super(ResourceWriteSuccessData, self).__init__(**kwargs) + self.tenant_id = kwargs.get('tenant_id', None) + self.subscription_id = kwargs.get('subscription_id', None) + self.resource_group = kwargs.get('resource_group', None) + self.resource_provider = kwargs.get('resource_provider', None) + self.resource_uri = kwargs.get('resource_uri', None) + self.operation_name = kwargs.get('operation_name', None) + self.status = kwargs.get('status', None) + self.authorization = kwargs.get('authorization', None) + self.claims = kwargs.get('claims', None) + self.correlation_id = kwargs.get('correlation_id', None) + self.http_request = kwargs.get('http_request', None) diff --git a/azure-eventgrid/azure/eventgrid/models/resource_write_success_data_py3.py b/azure-eventgrid/azure/eventgrid/models/resource_write_success_data_py3.py new file mode 100644 index 000000000000..0aed7ef74931 --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/resource_write_success_data_py3.py @@ -0,0 +1,70 @@ +# 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 msrest.serialization import Model + + +class ResourceWriteSuccessData(Model): + """Schema of the Data property of an EventGridEvent for a + Microsoft.Resources.ResourceWriteSuccess event. This is raised when a + resource create or update operation succeeds. + + :param tenant_id: The tenant ID of the resource. + :type tenant_id: str + :param subscription_id: The subscription ID of the resource. + :type subscription_id: str + :param resource_group: The resource group of the resource. + :type resource_group: str + :param resource_provider: The resource provider performing the operation. + :type resource_provider: str + :param resource_uri: The URI of the resource in the operation. + :type resource_uri: str + :param operation_name: The operation that was performed. + :type operation_name: str + :param status: The status of the operation. + :type status: str + :param authorization: The requested authorization for the operation. + :type authorization: str + :param claims: The properties of the claims. + :type claims: str + :param correlation_id: An operation ID used for troubleshooting. + :type correlation_id: str + :param http_request: The details of the operation. + :type http_request: str + """ + + _attribute_map = { + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, + 'resource_provider': {'key': 'resourceProvider', 'type': 'str'}, + 'resource_uri': {'key': 'resourceUri', 'type': 'str'}, + 'operation_name': {'key': 'operationName', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'authorization': {'key': 'authorization', 'type': 'str'}, + 'claims': {'key': 'claims', 'type': 'str'}, + 'correlation_id': {'key': 'correlationId', 'type': 'str'}, + 'http_request': {'key': 'httpRequest', 'type': 'str'}, + } + + def __init__(self, *, tenant_id: str=None, subscription_id: str=None, resource_group: str=None, resource_provider: str=None, resource_uri: str=None, operation_name: str=None, status: str=None, authorization: str=None, claims: str=None, correlation_id: str=None, http_request: str=None, **kwargs) -> None: + super(ResourceWriteSuccessData, self).__init__(**kwargs) + self.tenant_id = tenant_id + self.subscription_id = subscription_id + self.resource_group = resource_group + self.resource_provider = resource_provider + self.resource_uri = resource_uri + self.operation_name = operation_name + self.status = status + self.authorization = authorization + self.claims = claims + self.correlation_id = correlation_id + self.http_request = http_request diff --git a/azure-eventgrid/azure/eventgrid/models/storage_blob_created_event_data.py b/azure-eventgrid/azure/eventgrid/models/storage_blob_created_event_data.py index 7a87b63b086c..3482b112e469 100644 --- a/azure-eventgrid/azure/eventgrid/models/storage_blob_created_event_data.py +++ b/azure-eventgrid/azure/eventgrid/models/storage_blob_created_event_data.py @@ -60,15 +60,15 @@ class StorageBlobCreatedEventData(Model): 'storage_diagnostics': {'key': 'storageDiagnostics', 'type': 'object'}, } - def __init__(self, api=None, client_request_id=None, request_id=None, e_tag=None, content_type=None, content_length=None, blob_type=None, url=None, sequencer=None, storage_diagnostics=None): - super(StorageBlobCreatedEventData, self).__init__() - self.api = api - self.client_request_id = client_request_id - self.request_id = request_id - self.e_tag = e_tag - self.content_type = content_type - self.content_length = content_length - self.blob_type = blob_type - self.url = url - self.sequencer = sequencer - self.storage_diagnostics = storage_diagnostics + def __init__(self, **kwargs): + super(StorageBlobCreatedEventData, self).__init__(**kwargs) + self.api = kwargs.get('api', None) + self.client_request_id = kwargs.get('client_request_id', None) + self.request_id = kwargs.get('request_id', None) + self.e_tag = kwargs.get('e_tag', None) + self.content_type = kwargs.get('content_type', None) + self.content_length = kwargs.get('content_length', None) + self.blob_type = kwargs.get('blob_type', None) + self.url = kwargs.get('url', None) + self.sequencer = kwargs.get('sequencer', None) + self.storage_diagnostics = kwargs.get('storage_diagnostics', None) diff --git a/azure-eventgrid/azure/eventgrid/models/storage_blob_created_event_data_py3.py b/azure-eventgrid/azure/eventgrid/models/storage_blob_created_event_data_py3.py new file mode 100644 index 000000000000..a66406468c31 --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/storage_blob_created_event_data_py3.py @@ -0,0 +1,74 @@ +# 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 msrest.serialization import Model + + +class StorageBlobCreatedEventData(Model): + """Schema of the Data property of an EventGridEvent for an + Microsoft.Storage.BlobCreated event. + + :param api: The name of the API/operation that triggered this event. + :type api: str + :param client_request_id: A request id provided by the client of the + storage API operation that triggered this event. + :type client_request_id: str + :param request_id: The request id generated by the Storage service for the + storage API operation that triggered this event. + :type request_id: str + :param e_tag: The etag of the object at the time this event was triggered. + :type e_tag: str + :param content_type: The content type of the blob. This is the same as + what would be returned in the Content-Type header from the blob. + :type content_type: str + :param content_length: The size of the blob in bytes. This is the same as + what would be returned in the Content-Length header from the blob. + :type content_length: int + :param blob_type: The type of blob. + :type blob_type: str + :param url: The path to the blob. + :type url: str + :param sequencer: An opaque string value representing the logical sequence + of events for any particular blob name. Users can use standard string + comparison to understand the relative sequence of two events on the same + blob name. + :type sequencer: str + :param storage_diagnostics: For service use only. Diagnostic data + occasionally included by the Azure Storage service. This property should + be ignored by event consumers. + :type storage_diagnostics: object + """ + + _attribute_map = { + 'api': {'key': 'api', 'type': 'str'}, + 'client_request_id': {'key': 'clientRequestId', 'type': 'str'}, + 'request_id': {'key': 'requestId', 'type': 'str'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'content_type': {'key': 'contentType', 'type': 'str'}, + 'content_length': {'key': 'contentLength', 'type': 'int'}, + 'blob_type': {'key': 'blobType', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'sequencer': {'key': 'sequencer', 'type': 'str'}, + 'storage_diagnostics': {'key': 'storageDiagnostics', 'type': 'object'}, + } + + def __init__(self, *, api: str=None, client_request_id: str=None, request_id: str=None, e_tag: str=None, content_type: str=None, content_length: int=None, blob_type: str=None, url: str=None, sequencer: str=None, storage_diagnostics=None, **kwargs) -> None: + super(StorageBlobCreatedEventData, self).__init__(**kwargs) + self.api = api + self.client_request_id = client_request_id + self.request_id = request_id + self.e_tag = e_tag + self.content_type = content_type + self.content_length = content_length + self.blob_type = blob_type + self.url = url + self.sequencer = sequencer + self.storage_diagnostics = storage_diagnostics diff --git a/azure-eventgrid/azure/eventgrid/models/storage_blob_deleted_event_data.py b/azure-eventgrid/azure/eventgrid/models/storage_blob_deleted_event_data.py index 1c9bf95c681d..1b869057d280 100644 --- a/azure-eventgrid/azure/eventgrid/models/storage_blob_deleted_event_data.py +++ b/azure-eventgrid/azure/eventgrid/models/storage_blob_deleted_event_data.py @@ -53,13 +53,13 @@ class StorageBlobDeletedEventData(Model): 'storage_diagnostics': {'key': 'storageDiagnostics', 'type': 'object'}, } - def __init__(self, api=None, client_request_id=None, request_id=None, content_type=None, blob_type=None, url=None, sequencer=None, storage_diagnostics=None): - super(StorageBlobDeletedEventData, self).__init__() - self.api = api - self.client_request_id = client_request_id - self.request_id = request_id - self.content_type = content_type - self.blob_type = blob_type - self.url = url - self.sequencer = sequencer - self.storage_diagnostics = storage_diagnostics + def __init__(self, **kwargs): + super(StorageBlobDeletedEventData, self).__init__(**kwargs) + self.api = kwargs.get('api', None) + self.client_request_id = kwargs.get('client_request_id', None) + self.request_id = kwargs.get('request_id', None) + self.content_type = kwargs.get('content_type', None) + self.blob_type = kwargs.get('blob_type', None) + self.url = kwargs.get('url', None) + self.sequencer = kwargs.get('sequencer', None) + self.storage_diagnostics = kwargs.get('storage_diagnostics', None) diff --git a/azure-eventgrid/azure/eventgrid/models/storage_blob_deleted_event_data_py3.py b/azure-eventgrid/azure/eventgrid/models/storage_blob_deleted_event_data_py3.py new file mode 100644 index 000000000000..7565e6572c24 --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/storage_blob_deleted_event_data_py3.py @@ -0,0 +1,65 @@ +# 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 msrest.serialization import Model + + +class StorageBlobDeletedEventData(Model): + """Schema of the Data property of an EventGridEvent for an + Microsoft.Storage.BlobDeleted event. + + :param api: The name of the API/operation that triggered this event. + :type api: str + :param client_request_id: A request id provided by the client of the + storage API operation that triggered this event. + :type client_request_id: str + :param request_id: The request id generated by the Storage service for the + storage API operation that triggered this event. + :type request_id: str + :param content_type: The content type of the blob. This is the same as + what would be returned in the Content-Type header from the blob. + :type content_type: str + :param blob_type: The type of blob. + :type blob_type: str + :param url: The path to the blob. + :type url: str + :param sequencer: An opaque string value representing the logical sequence + of events for any particular blob name. Users can use standard string + comparison to understand the relative sequence of two events on the same + blob name. + :type sequencer: str + :param storage_diagnostics: For service use only. Diagnostic data + occasionally included by the Azure Storage service. This property should + be ignored by event consumers. + :type storage_diagnostics: object + """ + + _attribute_map = { + 'api': {'key': 'api', 'type': 'str'}, + 'client_request_id': {'key': 'clientRequestId', 'type': 'str'}, + 'request_id': {'key': 'requestId', 'type': 'str'}, + 'content_type': {'key': 'contentType', 'type': 'str'}, + 'blob_type': {'key': 'blobType', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'sequencer': {'key': 'sequencer', 'type': 'str'}, + 'storage_diagnostics': {'key': 'storageDiagnostics', 'type': 'object'}, + } + + def __init__(self, *, api: str=None, client_request_id: str=None, request_id: str=None, content_type: str=None, blob_type: str=None, url: str=None, sequencer: str=None, storage_diagnostics=None, **kwargs) -> None: + super(StorageBlobDeletedEventData, self).__init__(**kwargs) + self.api = api + self.client_request_id = client_request_id + self.request_id = request_id + self.content_type = content_type + self.blob_type = blob_type + self.url = url + self.sequencer = sequencer + self.storage_diagnostics = storage_diagnostics diff --git a/azure-eventgrid/azure/eventgrid/version.py b/azure-eventgrid/azure/eventgrid/version.py index e0ec669828cb..a39916c162ce 100644 --- a/azure-eventgrid/azure/eventgrid/version.py +++ b/azure-eventgrid/azure/eventgrid/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.1.0" +VERSION = "1.0.0" diff --git a/azure-mgmt-automation/azure/mgmt/automation/__init__.py b/azure-mgmt-automation/azure/mgmt/automation/__init__.py new file mode 100644 index 000000000000..583531e6aca2 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/__init__.py @@ -0,0 +1,18 @@ +# 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 .automation_client import AutomationClient +from .version import VERSION + +__all__ = ['AutomationClient'] + +__version__ = VERSION + diff --git a/azure-mgmt-automation/azure/mgmt/automation/automation_client.py b/azure-mgmt-automation/azure/mgmt/automation/automation_client.py new file mode 100644 index 000000000000..8649a585d1ca --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/automation_client.py @@ -0,0 +1,264 @@ +# 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 msrest.service_client import SDKClient +from msrest import Serializer, Deserializer +from msrestazure import AzureConfiguration +from .version import VERSION +from .operations.automation_account_operations import AutomationAccountOperations +from .operations.operations import Operations +from .operations.statistics_operations import StatisticsOperations +from .operations.usages_operations import UsagesOperations +from .operations.keys_operations import KeysOperations +from .operations.certificate_operations import CertificateOperations +from .operations.connection_operations import ConnectionOperations +from .operations.connection_type_operations import ConnectionTypeOperations +from .operations.credential_operations import CredentialOperations +from .operations.dsc_configuration_operations import DscConfigurationOperations +from .operations.hybrid_runbook_worker_group_operations import HybridRunbookWorkerGroupOperations +from .operations.job_schedule_operations import JobScheduleOperations +from .operations.linked_workspace_operations import LinkedWorkspaceOperations +from .operations.activity_operations import ActivityOperations +from .operations.module_operations import ModuleOperations +from .operations.object_data_types_operations import ObjectDataTypesOperations +from .operations.fields_operations import FieldsOperations +from .operations.runbook_draft_operations import RunbookDraftOperations +from .operations.runbook_operations import RunbookOperations +from .operations.test_job_streams_operations import TestJobStreamsOperations +from .operations.test_job_operations import TestJobOperations +from .operations.schedule_operations import ScheduleOperations +from .operations.variable_operations import VariableOperations +from .operations.webhook_operations import WebhookOperations +from .operations.software_update_configurations_operations import SoftwareUpdateConfigurationsOperations +from .operations.software_update_configuration_runs_operations import SoftwareUpdateConfigurationRunsOperations +from .operations.software_update_configuration_machine_runs_operations import SoftwareUpdateConfigurationMachineRunsOperations +from .operations.source_control_operations import SourceControlOperations +from .operations.source_control_sync_job_operations import SourceControlSyncJobOperations +from .operations.job_operations import JobOperations +from .operations.job_stream_operations import JobStreamOperations +from .operations.agent_registration_information_operations import AgentRegistrationInformationOperations +from .operations.dsc_node_operations import DscNodeOperations +from .operations.node_reports_operations import NodeReportsOperations +from .operations.dsc_compilation_job_operations import DscCompilationJobOperations +from .operations.dsc_compilation_job_stream_operations import DscCompilationJobStreamOperations +from .operations.dsc_node_configuration_operations import DscNodeConfigurationOperations +from . import models + + +class AutomationClientConfiguration(AzureConfiguration): + """Configuration for AutomationClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Gets subscription credentials which uniquely + identify Microsoft Azure subscription. The subscription ID forms part of + the URI for every service call. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(AutomationClientConfiguration, self).__init__(base_url) + + self.add_user_agent('azure-mgmt-automation/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id + + +class AutomationClient(SDKClient): + """Automation Client + + :ivar config: Configuration for client. + :vartype config: AutomationClientConfiguration + + :ivar automation_account: AutomationAccount operations + :vartype automation_account: azure.mgmt.automation.operations.AutomationAccountOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.automation.operations.Operations + :ivar statistics: Statistics operations + :vartype statistics: azure.mgmt.automation.operations.StatisticsOperations + :ivar usages: Usages operations + :vartype usages: azure.mgmt.automation.operations.UsagesOperations + :ivar keys: Keys operations + :vartype keys: azure.mgmt.automation.operations.KeysOperations + :ivar certificate: Certificate operations + :vartype certificate: azure.mgmt.automation.operations.CertificateOperations + :ivar connection: Connection operations + :vartype connection: azure.mgmt.automation.operations.ConnectionOperations + :ivar connection_type: ConnectionType operations + :vartype connection_type: azure.mgmt.automation.operations.ConnectionTypeOperations + :ivar credential: Credential operations + :vartype credential: azure.mgmt.automation.operations.CredentialOperations + :ivar dsc_configuration: DscConfiguration operations + :vartype dsc_configuration: azure.mgmt.automation.operations.DscConfigurationOperations + :ivar hybrid_runbook_worker_group: HybridRunbookWorkerGroup operations + :vartype hybrid_runbook_worker_group: azure.mgmt.automation.operations.HybridRunbookWorkerGroupOperations + :ivar job_schedule: JobSchedule operations + :vartype job_schedule: azure.mgmt.automation.operations.JobScheduleOperations + :ivar linked_workspace: LinkedWorkspace operations + :vartype linked_workspace: azure.mgmt.automation.operations.LinkedWorkspaceOperations + :ivar activity: Activity operations + :vartype activity: azure.mgmt.automation.operations.ActivityOperations + :ivar module: Module operations + :vartype module: azure.mgmt.automation.operations.ModuleOperations + :ivar object_data_types: ObjectDataTypes operations + :vartype object_data_types: azure.mgmt.automation.operations.ObjectDataTypesOperations + :ivar fields: Fields operations + :vartype fields: azure.mgmt.automation.operations.FieldsOperations + :ivar runbook_draft: RunbookDraft operations + :vartype runbook_draft: azure.mgmt.automation.operations.RunbookDraftOperations + :ivar runbook: Runbook operations + :vartype runbook: azure.mgmt.automation.operations.RunbookOperations + :ivar test_job_streams: TestJobStreams operations + :vartype test_job_streams: azure.mgmt.automation.operations.TestJobStreamsOperations + :ivar test_job: TestJob operations + :vartype test_job: azure.mgmt.automation.operations.TestJobOperations + :ivar schedule: Schedule operations + :vartype schedule: azure.mgmt.automation.operations.ScheduleOperations + :ivar variable: Variable operations + :vartype variable: azure.mgmt.automation.operations.VariableOperations + :ivar webhook: Webhook operations + :vartype webhook: azure.mgmt.automation.operations.WebhookOperations + :ivar software_update_configurations: SoftwareUpdateConfigurations operations + :vartype software_update_configurations: azure.mgmt.automation.operations.SoftwareUpdateConfigurationsOperations + :ivar software_update_configuration_runs: SoftwareUpdateConfigurationRuns operations + :vartype software_update_configuration_runs: azure.mgmt.automation.operations.SoftwareUpdateConfigurationRunsOperations + :ivar software_update_configuration_machine_runs: SoftwareUpdateConfigurationMachineRuns operations + :vartype software_update_configuration_machine_runs: azure.mgmt.automation.operations.SoftwareUpdateConfigurationMachineRunsOperations + :ivar source_control: SourceControl operations + :vartype source_control: azure.mgmt.automation.operations.SourceControlOperations + :ivar source_control_sync_job: SourceControlSyncJob operations + :vartype source_control_sync_job: azure.mgmt.automation.operations.SourceControlSyncJobOperations + :ivar job: Job operations + :vartype job: azure.mgmt.automation.operations.JobOperations + :ivar job_stream: JobStream operations + :vartype job_stream: azure.mgmt.automation.operations.JobStreamOperations + :ivar agent_registration_information: AgentRegistrationInformation operations + :vartype agent_registration_information: azure.mgmt.automation.operations.AgentRegistrationInformationOperations + :ivar dsc_node: DscNode operations + :vartype dsc_node: azure.mgmt.automation.operations.DscNodeOperations + :ivar node_reports: NodeReports operations + :vartype node_reports: azure.mgmt.automation.operations.NodeReportsOperations + :ivar dsc_compilation_job: DscCompilationJob operations + :vartype dsc_compilation_job: azure.mgmt.automation.operations.DscCompilationJobOperations + :ivar dsc_compilation_job_stream: DscCompilationJobStream operations + :vartype dsc_compilation_job_stream: azure.mgmt.automation.operations.DscCompilationJobStreamOperations + :ivar dsc_node_configuration: DscNodeConfiguration operations + :vartype dsc_node_configuration: azure.mgmt.automation.operations.DscNodeConfigurationOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Gets subscription credentials which uniquely + identify Microsoft Azure subscription. The subscription ID forms part of + the URI for every service call. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = AutomationClientConfiguration(credentials, subscription_id, base_url) + super(AutomationClient, self).__init__(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.automation_account = AutomationAccountOperations( + self._client, self.config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) + self.statistics = StatisticsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.usages = UsagesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.keys = KeysOperations( + self._client, self.config, self._serialize, self._deserialize) + self.certificate = CertificateOperations( + self._client, self.config, self._serialize, self._deserialize) + self.connection = ConnectionOperations( + self._client, self.config, self._serialize, self._deserialize) + self.connection_type = ConnectionTypeOperations( + self._client, self.config, self._serialize, self._deserialize) + self.credential = CredentialOperations( + self._client, self.config, self._serialize, self._deserialize) + self.dsc_configuration = DscConfigurationOperations( + self._client, self.config, self._serialize, self._deserialize) + self.hybrid_runbook_worker_group = HybridRunbookWorkerGroupOperations( + self._client, self.config, self._serialize, self._deserialize) + self.job_schedule = JobScheduleOperations( + self._client, self.config, self._serialize, self._deserialize) + self.linked_workspace = LinkedWorkspaceOperations( + self._client, self.config, self._serialize, self._deserialize) + self.activity = ActivityOperations( + self._client, self.config, self._serialize, self._deserialize) + self.module = ModuleOperations( + self._client, self.config, self._serialize, self._deserialize) + self.object_data_types = ObjectDataTypesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.fields = FieldsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.runbook_draft = RunbookDraftOperations( + self._client, self.config, self._serialize, self._deserialize) + self.runbook = RunbookOperations( + self._client, self.config, self._serialize, self._deserialize) + self.test_job_streams = TestJobStreamsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.test_job = TestJobOperations( + self._client, self.config, self._serialize, self._deserialize) + self.schedule = ScheduleOperations( + self._client, self.config, self._serialize, self._deserialize) + self.variable = VariableOperations( + self._client, self.config, self._serialize, self._deserialize) + self.webhook = WebhookOperations( + self._client, self.config, self._serialize, self._deserialize) + self.software_update_configurations = SoftwareUpdateConfigurationsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.software_update_configuration_runs = SoftwareUpdateConfigurationRunsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.software_update_configuration_machine_runs = SoftwareUpdateConfigurationMachineRunsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.source_control = SourceControlOperations( + self._client, self.config, self._serialize, self._deserialize) + self.source_control_sync_job = SourceControlSyncJobOperations( + self._client, self.config, self._serialize, self._deserialize) + self.job = JobOperations( + self._client, self.config, self._serialize, self._deserialize) + self.job_stream = JobStreamOperations( + self._client, self.config, self._serialize, self._deserialize) + self.agent_registration_information = AgentRegistrationInformationOperations( + self._client, self.config, self._serialize, self._deserialize) + self.dsc_node = DscNodeOperations( + self._client, self.config, self._serialize, self._deserialize) + self.node_reports = NodeReportsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.dsc_compilation_job = DscCompilationJobOperations( + self._client, self.config, self._serialize, self._deserialize) + self.dsc_compilation_job_stream = DscCompilationJobStreamOperations( + self._client, self.config, self._serialize, self._deserialize) + self.dsc_node_configuration = DscNodeConfigurationOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/__init__.py b/azure-mgmt-automation/azure/mgmt/automation/models/__init__.py new file mode 100644 index 000000000000..b4b16ca6f2e2 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/__init__.py @@ -0,0 +1,478 @@ +# 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. +# -------------------------------------------------------------------------- + +try: + from .error_response_py3 import ErrorResponse, ErrorResponseException + from .key_py3 import Key + from .usage_counter_name_py3 import UsageCounterName + from .usage_py3 import Usage + from .statistics_py3 import Statistics + from .runbook_association_property_py3 import RunbookAssociationProperty + from .webhook_py3 import Webhook + from .variable_py3 import Variable + from .job_provisioning_state_property_py3 import JobProvisioningStateProperty + from .dsc_configuration_association_property_py3 import DscConfigurationAssociationProperty + from .dsc_compilation_job_py3 import DscCompilationJob + from .credential_py3 import Credential + from .connection_type_association_property_py3 import ConnectionTypeAssociationProperty + from .connection_py3 import Connection + from .certificate_py3 import Certificate + from .proxy_resource_py3 import ProxyResource + from .resource_py3 import Resource + from .runbook_parameter_py3 import RunbookParameter + from .content_hash_py3 import ContentHash + from .content_link_py3 import ContentLink + from .runbook_draft_py3 import RunbookDraft + from .runbook_py3 import Runbook + from .module_error_info_py3 import ModuleErrorInfo + from .module_py3 import Module + from .content_source_py3 import ContentSource + from .dsc_configuration_parameter_py3 import DscConfigurationParameter + from .dsc_configuration_py3 import DscConfiguration + from .tracked_resource_py3 import TrackedResource + from .sku_py3 import Sku + from .automation_account_py3 import AutomationAccount + from .operation_display_py3 import OperationDisplay + from .operation_py3 import Operation + from .automation_account_create_or_update_parameters_py3 import AutomationAccountCreateOrUpdateParameters + from .automation_account_update_parameters_py3 import AutomationAccountUpdateParameters + from .certificate_update_parameters_py3 import CertificateUpdateParameters + from .certificate_create_or_update_parameters_py3 import CertificateCreateOrUpdateParameters + from .connection_update_parameters_py3 import ConnectionUpdateParameters + from .connection_create_or_update_parameters_py3 import ConnectionCreateOrUpdateParameters + from .field_definition_py3 import FieldDefinition + from .connection_type_py3 import ConnectionType + from .connection_type_create_or_update_parameters_py3 import ConnectionTypeCreateOrUpdateParameters + from .credential_update_parameters_py3 import CredentialUpdateParameters + from .credential_create_or_update_parameters_py3 import CredentialCreateOrUpdateParameters + from .activity_parameter_py3 import ActivityParameter + from .activity_parameter_set_py3 import ActivityParameterSet + from .activity_output_type_py3 import ActivityOutputType + from .activity_py3 import Activity + from .advanced_schedule_monthly_occurrence_py3 import AdvancedScheduleMonthlyOccurrence + from .advanced_schedule_py3 import AdvancedSchedule + from .agent_registration_keys_py3 import AgentRegistrationKeys + from .agent_registration_py3 import AgentRegistration + from .agent_registration_regenerate_key_parameter_py3 import AgentRegistrationRegenerateKeyParameter + from .dsc_compilation_job_create_parameters_py3 import DscCompilationJobCreateParameters + from .dsc_configuration_create_or_update_parameters_py3 import DscConfigurationCreateOrUpdateParameters + from .dsc_configuration_update_parameters_py3 import DscConfigurationUpdateParameters + from .dsc_meta_configuration_py3 import DscMetaConfiguration + from .dsc_node_configuration_create_or_update_parameters_py3 import DscNodeConfigurationCreateOrUpdateParameters + from .dsc_node_configuration_association_property_py3 import DscNodeConfigurationAssociationProperty + from .dsc_node_extension_handler_association_property_py3 import DscNodeExtensionHandlerAssociationProperty + from .dsc_node_update_parameters_properties_py3 import DscNodeUpdateParametersProperties + from .dsc_node_update_parameters_py3 import DscNodeUpdateParameters + from .dsc_report_error_py3 import DscReportError + from .dsc_report_resource_navigation_py3 import DscReportResourceNavigation + from .dsc_report_resource_py3 import DscReportResource + from .dsc_node_report_py3 import DscNodeReport + from .hybrid_runbook_worker_py3 import HybridRunbookWorker + from .run_as_credential_association_property_py3 import RunAsCredentialAssociationProperty + from .hybrid_runbook_worker_group_py3 import HybridRunbookWorkerGroup + from .hybrid_runbook_worker_group_update_parameters_py3 import HybridRunbookWorkerGroupUpdateParameters + from .job_py3 import Job + from .job_create_parameters_py3 import JobCreateParameters + from .job_list_result_py3 import JobListResult + from .schedule_association_property_py3 import ScheduleAssociationProperty + from .job_schedule_create_parameters_py3 import JobScheduleCreateParameters + from .job_schedule_py3 import JobSchedule + from .job_stream_py3 import JobStream + from .job_stream_list_result_py3 import JobStreamListResult + from .linked_workspace_py3 import LinkedWorkspace + from .module_create_or_update_parameters_py3 import ModuleCreateOrUpdateParameters + from .module_update_parameters_py3 import ModuleUpdateParameters + from .runbook_draft_undo_edit_result_py3 import RunbookDraftUndoEditResult + from .runbook_create_or_update_parameters_py3 import RunbookCreateOrUpdateParameters + from .runbook_create_or_update_draft_properties_py3 import RunbookCreateOrUpdateDraftProperties + from .runbook_create_or_update_draft_parameters_py3 import RunbookCreateOrUpdateDraftParameters + from .runbook_update_parameters_py3 import RunbookUpdateParameters + from .schedule_create_or_update_parameters_py3 import ScheduleCreateOrUpdateParameters + from .schedule_properties_py3 import ScheduleProperties + from .schedule_py3 import Schedule + from .schedule_update_parameters_py3 import ScheduleUpdateParameters + from .sub_resource_py3 import SubResource + from .test_job_create_parameters_py3 import TestJobCreateParameters + from .test_job_py3 import TestJob + from .type_field_py3 import TypeField + from .variable_create_or_update_parameters_py3 import VariableCreateOrUpdateParameters + from .variable_update_parameters_py3 import VariableUpdateParameters + from .webhook_create_or_update_parameters_py3 import WebhookCreateOrUpdateParameters + from .webhook_update_parameters_py3 import WebhookUpdateParameters + from .job_collection_item_py3 import JobCollectionItem + from .windows_properties_py3 import WindowsProperties + from .linux_properties_py3 import LinuxProperties + from .update_configuration_py3 import UpdateConfiguration + from .software_update_configuration_py3 import SoftwareUpdateConfiguration + from .collection_item_update_configuration_py3 import CollectionItemUpdateConfiguration + from .software_update_configuration_collection_item_py3 import SoftwareUpdateConfigurationCollectionItem + from .software_update_configuration_list_result_py3 import SoftwareUpdateConfigurationListResult + from .update_configuration_navigation_py3 import UpdateConfigurationNavigation + from .job_navigation_py3 import JobNavigation + from .software_update_configuration_run_py3 import SoftwareUpdateConfigurationRun + from .software_update_configuration_run_list_result_py3 import SoftwareUpdateConfigurationRunListResult + from .software_update_configuration_machine_run_py3 import SoftwareUpdateConfigurationMachineRun + from .software_update_configuration_machine_run_list_result_py3 import SoftwareUpdateConfigurationMachineRunListResult + from .source_control_create_or_update_parameters_py3 import SourceControlCreateOrUpdateParameters + from .source_control_py3 import SourceControl + from .source_control_update_parameters_py3 import SourceControlUpdateParameters + from .source_control_sync_job_py3 import SourceControlSyncJob + from .source_control_sync_job_create_parameters_py3 import SourceControlSyncJobCreateParameters + from .source_control_sync_job_by_id_errors_py3 import SourceControlSyncJobByIdErrors + from .source_control_sync_job_by_id_py3 import SourceControlSyncJobById + from .dsc_node_py3 import DscNode + from .dsc_node_configuration_py3 import DscNodeConfiguration +except (SyntaxError, ImportError): + from .error_response import ErrorResponse, ErrorResponseException + from .key import Key + from .usage_counter_name import UsageCounterName + from .usage import Usage + from .statistics import Statistics + from .runbook_association_property import RunbookAssociationProperty + from .webhook import Webhook + from .variable import Variable + from .job_provisioning_state_property import JobProvisioningStateProperty + from .dsc_configuration_association_property import DscConfigurationAssociationProperty + from .dsc_compilation_job import DscCompilationJob + from .credential import Credential + from .connection_type_association_property import ConnectionTypeAssociationProperty + from .connection import Connection + from .certificate import Certificate + from .proxy_resource import ProxyResource + from .resource import Resource + from .runbook_parameter import RunbookParameter + from .content_hash import ContentHash + from .content_link import ContentLink + from .runbook_draft import RunbookDraft + from .runbook import Runbook + from .module_error_info import ModuleErrorInfo + from .module import Module + from .content_source import ContentSource + from .dsc_configuration_parameter import DscConfigurationParameter + from .dsc_configuration import DscConfiguration + from .tracked_resource import TrackedResource + from .sku import Sku + from .automation_account import AutomationAccount + from .operation_display import OperationDisplay + from .operation import Operation + from .automation_account_create_or_update_parameters import AutomationAccountCreateOrUpdateParameters + from .automation_account_update_parameters import AutomationAccountUpdateParameters + from .certificate_update_parameters import CertificateUpdateParameters + from .certificate_create_or_update_parameters import CertificateCreateOrUpdateParameters + from .connection_update_parameters import ConnectionUpdateParameters + from .connection_create_or_update_parameters import ConnectionCreateOrUpdateParameters + from .field_definition import FieldDefinition + from .connection_type import ConnectionType + from .connection_type_create_or_update_parameters import ConnectionTypeCreateOrUpdateParameters + from .credential_update_parameters import CredentialUpdateParameters + from .credential_create_or_update_parameters import CredentialCreateOrUpdateParameters + from .activity_parameter import ActivityParameter + from .activity_parameter_set import ActivityParameterSet + from .activity_output_type import ActivityOutputType + from .activity import Activity + from .advanced_schedule_monthly_occurrence import AdvancedScheduleMonthlyOccurrence + from .advanced_schedule import AdvancedSchedule + from .agent_registration_keys import AgentRegistrationKeys + from .agent_registration import AgentRegistration + from .agent_registration_regenerate_key_parameter import AgentRegistrationRegenerateKeyParameter + from .dsc_compilation_job_create_parameters import DscCompilationJobCreateParameters + from .dsc_configuration_create_or_update_parameters import DscConfigurationCreateOrUpdateParameters + from .dsc_configuration_update_parameters import DscConfigurationUpdateParameters + from .dsc_meta_configuration import DscMetaConfiguration + from .dsc_node_configuration_create_or_update_parameters import DscNodeConfigurationCreateOrUpdateParameters + from .dsc_node_configuration_association_property import DscNodeConfigurationAssociationProperty + from .dsc_node_extension_handler_association_property import DscNodeExtensionHandlerAssociationProperty + from .dsc_node_update_parameters_properties import DscNodeUpdateParametersProperties + from .dsc_node_update_parameters import DscNodeUpdateParameters + from .dsc_report_error import DscReportError + from .dsc_report_resource_navigation import DscReportResourceNavigation + from .dsc_report_resource import DscReportResource + from .dsc_node_report import DscNodeReport + from .hybrid_runbook_worker import HybridRunbookWorker + from .run_as_credential_association_property import RunAsCredentialAssociationProperty + from .hybrid_runbook_worker_group import HybridRunbookWorkerGroup + from .hybrid_runbook_worker_group_update_parameters import HybridRunbookWorkerGroupUpdateParameters + from .job import Job + from .job_create_parameters import JobCreateParameters + from .job_list_result import JobListResult + from .schedule_association_property import ScheduleAssociationProperty + from .job_schedule_create_parameters import JobScheduleCreateParameters + from .job_schedule import JobSchedule + from .job_stream import JobStream + from .job_stream_list_result import JobStreamListResult + from .linked_workspace import LinkedWorkspace + from .module_create_or_update_parameters import ModuleCreateOrUpdateParameters + from .module_update_parameters import ModuleUpdateParameters + from .runbook_draft_undo_edit_result import RunbookDraftUndoEditResult + from .runbook_create_or_update_parameters import RunbookCreateOrUpdateParameters + from .runbook_create_or_update_draft_properties import RunbookCreateOrUpdateDraftProperties + from .runbook_create_or_update_draft_parameters import RunbookCreateOrUpdateDraftParameters + from .runbook_update_parameters import RunbookUpdateParameters + from .schedule_create_or_update_parameters import ScheduleCreateOrUpdateParameters + from .schedule_properties import ScheduleProperties + from .schedule import Schedule + from .schedule_update_parameters import ScheduleUpdateParameters + from .sub_resource import SubResource + from .test_job_create_parameters import TestJobCreateParameters + from .test_job import TestJob + from .type_field import TypeField + from .variable_create_or_update_parameters import VariableCreateOrUpdateParameters + from .variable_update_parameters import VariableUpdateParameters + from .webhook_create_or_update_parameters import WebhookCreateOrUpdateParameters + from .webhook_update_parameters import WebhookUpdateParameters + from .job_collection_item import JobCollectionItem + from .windows_properties import WindowsProperties + from .linux_properties import LinuxProperties + from .update_configuration import UpdateConfiguration + from .software_update_configuration import SoftwareUpdateConfiguration + from .collection_item_update_configuration import CollectionItemUpdateConfiguration + from .software_update_configuration_collection_item import SoftwareUpdateConfigurationCollectionItem + from .software_update_configuration_list_result import SoftwareUpdateConfigurationListResult + from .update_configuration_navigation import UpdateConfigurationNavigation + from .job_navigation import JobNavigation + from .software_update_configuration_run import SoftwareUpdateConfigurationRun + from .software_update_configuration_run_list_result import SoftwareUpdateConfigurationRunListResult + from .software_update_configuration_machine_run import SoftwareUpdateConfigurationMachineRun + from .software_update_configuration_machine_run_list_result import SoftwareUpdateConfigurationMachineRunListResult + from .source_control_create_or_update_parameters import SourceControlCreateOrUpdateParameters + from .source_control import SourceControl + from .source_control_update_parameters import SourceControlUpdateParameters + from .source_control_sync_job import SourceControlSyncJob + from .source_control_sync_job_create_parameters import SourceControlSyncJobCreateParameters + from .source_control_sync_job_by_id_errors import SourceControlSyncJobByIdErrors + from .source_control_sync_job_by_id import SourceControlSyncJobById + from .dsc_node import DscNode + from .dsc_node_configuration import DscNodeConfiguration +from .automation_account_paged import AutomationAccountPaged +from .operation_paged import OperationPaged +from .statistics_paged import StatisticsPaged +from .usage_paged import UsagePaged +from .key_paged import KeyPaged +from .certificate_paged import CertificatePaged +from .connection_paged import ConnectionPaged +from .connection_type_paged import ConnectionTypePaged +from .credential_paged import CredentialPaged +from .dsc_configuration_paged import DscConfigurationPaged +from .hybrid_runbook_worker_group_paged import HybridRunbookWorkerGroupPaged +from .job_schedule_paged import JobSchedulePaged +from .activity_paged import ActivityPaged +from .module_paged import ModulePaged +from .type_field_paged import TypeFieldPaged +from .runbook_paged import RunbookPaged +from .job_stream_paged import JobStreamPaged +from .schedule_paged import SchedulePaged +from .variable_paged import VariablePaged +from .webhook_paged import WebhookPaged +from .source_control_paged import SourceControlPaged +from .source_control_sync_job_paged import SourceControlSyncJobPaged +from .job_collection_item_paged import JobCollectionItemPaged +from .dsc_node_paged import DscNodePaged +from .dsc_node_report_paged import DscNodeReportPaged +from .dsc_compilation_job_paged import DscCompilationJobPaged +from .dsc_node_configuration_paged import DscNodeConfigurationPaged +from .automation_client_enums import ( + AutomationKeyName, + AutomationKeyPermissions, + JobProvisioningState, + JobStatus, + RunbookTypeEnum, + RunbookState, + RunbookProvisioningState, + ModuleProvisioningState, + ContentSourceType, + DscConfigurationProvisioningState, + DscConfigurationState, + SkuNameEnum, + AutomationAccountState, + ScheduleDay, + AgentRegistrationKeyName, + JobStreamType, + HttpStatusCode, + ScheduleFrequency, + OperatingSystemType, + WindowsUpdateClasses, + LinuxUpdateClasses, + SourceType, + ProvisioningState, +) + +__all__ = [ + 'ErrorResponse', 'ErrorResponseException', + 'Key', + 'UsageCounterName', + 'Usage', + 'Statistics', + 'RunbookAssociationProperty', + 'Webhook', + 'Variable', + 'JobProvisioningStateProperty', + 'DscConfigurationAssociationProperty', + 'DscCompilationJob', + 'Credential', + 'ConnectionTypeAssociationProperty', + 'Connection', + 'Certificate', + 'ProxyResource', + 'Resource', + 'RunbookParameter', + 'ContentHash', + 'ContentLink', + 'RunbookDraft', + 'Runbook', + 'ModuleErrorInfo', + 'Module', + 'ContentSource', + 'DscConfigurationParameter', + 'DscConfiguration', + 'TrackedResource', + 'Sku', + 'AutomationAccount', + 'OperationDisplay', + 'Operation', + 'AutomationAccountCreateOrUpdateParameters', + 'AutomationAccountUpdateParameters', + 'CertificateUpdateParameters', + 'CertificateCreateOrUpdateParameters', + 'ConnectionUpdateParameters', + 'ConnectionCreateOrUpdateParameters', + 'FieldDefinition', + 'ConnectionType', + 'ConnectionTypeCreateOrUpdateParameters', + 'CredentialUpdateParameters', + 'CredentialCreateOrUpdateParameters', + 'ActivityParameter', + 'ActivityParameterSet', + 'ActivityOutputType', + 'Activity', + 'AdvancedScheduleMonthlyOccurrence', + 'AdvancedSchedule', + 'AgentRegistrationKeys', + 'AgentRegistration', + 'AgentRegistrationRegenerateKeyParameter', + 'DscCompilationJobCreateParameters', + 'DscConfigurationCreateOrUpdateParameters', + 'DscConfigurationUpdateParameters', + 'DscMetaConfiguration', + 'DscNodeConfigurationCreateOrUpdateParameters', + 'DscNodeConfigurationAssociationProperty', + 'DscNodeExtensionHandlerAssociationProperty', + 'DscNodeUpdateParametersProperties', + 'DscNodeUpdateParameters', + 'DscReportError', + 'DscReportResourceNavigation', + 'DscReportResource', + 'DscNodeReport', + 'HybridRunbookWorker', + 'RunAsCredentialAssociationProperty', + 'HybridRunbookWorkerGroup', + 'HybridRunbookWorkerGroupUpdateParameters', + 'Job', + 'JobCreateParameters', + 'JobListResult', + 'ScheduleAssociationProperty', + 'JobScheduleCreateParameters', + 'JobSchedule', + 'JobStream', + 'JobStreamListResult', + 'LinkedWorkspace', + 'ModuleCreateOrUpdateParameters', + 'ModuleUpdateParameters', + 'RunbookDraftUndoEditResult', + 'RunbookCreateOrUpdateParameters', + 'RunbookCreateOrUpdateDraftProperties', + 'RunbookCreateOrUpdateDraftParameters', + 'RunbookUpdateParameters', + 'ScheduleCreateOrUpdateParameters', + 'ScheduleProperties', + 'Schedule', + 'ScheduleUpdateParameters', + 'SubResource', + 'TestJobCreateParameters', + 'TestJob', + 'TypeField', + 'VariableCreateOrUpdateParameters', + 'VariableUpdateParameters', + 'WebhookCreateOrUpdateParameters', + 'WebhookUpdateParameters', + 'JobCollectionItem', + 'WindowsProperties', + 'LinuxProperties', + 'UpdateConfiguration', + 'SoftwareUpdateConfiguration', + 'CollectionItemUpdateConfiguration', + 'SoftwareUpdateConfigurationCollectionItem', + 'SoftwareUpdateConfigurationListResult', + 'UpdateConfigurationNavigation', + 'JobNavigation', + 'SoftwareUpdateConfigurationRun', + 'SoftwareUpdateConfigurationRunListResult', + 'SoftwareUpdateConfigurationMachineRun', + 'SoftwareUpdateConfigurationMachineRunListResult', + 'SourceControlCreateOrUpdateParameters', + 'SourceControl', + 'SourceControlUpdateParameters', + 'SourceControlSyncJob', + 'SourceControlSyncJobCreateParameters', + 'SourceControlSyncJobByIdErrors', + 'SourceControlSyncJobById', + 'DscNode', + 'DscNodeConfiguration', + 'AutomationAccountPaged', + 'OperationPaged', + 'StatisticsPaged', + 'UsagePaged', + 'KeyPaged', + 'CertificatePaged', + 'ConnectionPaged', + 'ConnectionTypePaged', + 'CredentialPaged', + 'DscConfigurationPaged', + 'HybridRunbookWorkerGroupPaged', + 'JobSchedulePaged', + 'ActivityPaged', + 'ModulePaged', + 'TypeFieldPaged', + 'RunbookPaged', + 'JobStreamPaged', + 'SchedulePaged', + 'VariablePaged', + 'WebhookPaged', + 'SourceControlPaged', + 'SourceControlSyncJobPaged', + 'JobCollectionItemPaged', + 'DscNodePaged', + 'DscNodeReportPaged', + 'DscCompilationJobPaged', + 'DscNodeConfigurationPaged', + 'AutomationKeyName', + 'AutomationKeyPermissions', + 'JobProvisioningState', + 'JobStatus', + 'RunbookTypeEnum', + 'RunbookState', + 'RunbookProvisioningState', + 'ModuleProvisioningState', + 'ContentSourceType', + 'DscConfigurationProvisioningState', + 'DscConfigurationState', + 'SkuNameEnum', + 'AutomationAccountState', + 'ScheduleDay', + 'AgentRegistrationKeyName', + 'JobStreamType', + 'HttpStatusCode', + 'ScheduleFrequency', + 'OperatingSystemType', + 'WindowsUpdateClasses', + 'LinuxUpdateClasses', + 'SourceType', + 'ProvisioningState', +] diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/activity.py b/azure-mgmt-automation/azure/mgmt/automation/models/activity.py new file mode 100644 index 000000000000..e8aea9bc54e3 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/activity.py @@ -0,0 +1,64 @@ +# 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 msrest.serialization import Model + + +class Activity(Model): + """Definition of the activity. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Gets or sets the id of the resource. + :type id: str + :ivar name: Gets the name of the activity. + :vartype name: str + :param definition: Gets or sets the user name of the activity. + :type definition: str + :param parameter_sets: Gets or sets the parameter sets of the activity. + :type parameter_sets: + list[~azure.mgmt.automation.models.ActivityParameterSet] + :param output_types: Gets or sets the output types of the activity. + :type output_types: list[~azure.mgmt.automation.models.ActivityOutputType] + :param creation_time: Gets or sets the creation time. + :type creation_time: datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: datetime + :param description: Gets or sets the description. + :type description: str + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'definition': {'key': 'properties.definition', 'type': 'str'}, + 'parameter_sets': {'key': 'properties.parameterSets', 'type': '[ActivityParameterSet]'}, + 'output_types': {'key': 'properties.outputTypes', 'type': '[ActivityOutputType]'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Activity, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = None + self.definition = kwargs.get('definition', None) + self.parameter_sets = kwargs.get('parameter_sets', None) + self.output_types = kwargs.get('output_types', None) + self.creation_time = kwargs.get('creation_time', None) + self.last_modified_time = kwargs.get('last_modified_time', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/activity_output_type.py b/azure-mgmt-automation/azure/mgmt/automation/models/activity_output_type.py new file mode 100644 index 000000000000..1bdaff52b130 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/activity_output_type.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class ActivityOutputType(Model): + """Definition of the activity output type. + + :param name: Gets or sets the name of the activity output type. + :type name: str + :param type: Gets or sets the type of the activity output type. + :type type: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ActivityOutputType, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/activity_output_type_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/activity_output_type_py3.py new file mode 100644 index 000000000000..5dfb3cd40130 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/activity_output_type_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class ActivityOutputType(Model): + """Definition of the activity output type. + + :param name: Gets or sets the name of the activity output type. + :type name: str + :param type: Gets or sets the type of the activity output type. + :type type: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, type: str=None, **kwargs) -> None: + super(ActivityOutputType, self).__init__(**kwargs) + self.name = name + self.type = type diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/activity_paged.py b/azure-mgmt-automation/azure/mgmt/automation/models/activity_paged.py new file mode 100644 index 000000000000..2020f7cfa836 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/activity_paged.py @@ -0,0 +1,27 @@ +# 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 msrest.paging import Paged + + +class ActivityPaged(Paged): + """ + A paging container for iterating over a list of :class:`Activity ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Activity]'} + } + + def __init__(self, *args, **kwargs): + + super(ActivityPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/activity_parameter.py b/azure-mgmt-automation/azure/mgmt/automation/models/activity_parameter.py new file mode 100644 index 000000000000..2563abba27a8 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/activity_parameter.py @@ -0,0 +1,71 @@ +# 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 msrest.serialization import Model + + +class ActivityParameter(Model): + """Definition of the activity parameter. + + :param name: Gets or sets the name of the activity parameter. + :type name: str + :param type: Gets or sets the type of the activity parameter. + :type type: str + :param is_mandatory: Gets or sets a Boolean value that indicates true if + the parameter is required. If the value is false, the parameter is + optional. + :type is_mandatory: bool + :param is_dynamic: Gets or sets a Boolean value that indicates true if the + parameter is dynamic. + :type is_dynamic: bool + :param position: Gets or sets the position of the activity parameter. + :type position: bool + :param value_from_pipeline: Gets or sets a Boolean value that indicates + true if the parameter can take values from the incoming pipeline objects. + This setting is used if the cmdlet must access the complete input object. + false indicates that the parameter cannot take values from the complete + input object. + :type value_from_pipeline: bool + :param value_from_pipeline_by_property_name: Gets or sets a Boolean value + that indicates true if the parameter can be filled from a property of the + incoming pipeline object that has the same name as this parameter. false + indicates that the parameter cannot be filled from the incoming pipeline + object property with the same name. + :type value_from_pipeline_by_property_name: bool + :param value_from_remaining_arguments: Gets or sets a Boolean value that + indicates true if the cmdlet parameter accepts all the remaining + command-line arguments that are associated with this parameter in the form + of an array. false if the cmdlet parameter does not accept all the + remaining argument values. + :type value_from_remaining_arguments: bool + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'is_mandatory': {'key': 'isMandatory', 'type': 'bool'}, + 'is_dynamic': {'key': 'isDynamic', 'type': 'bool'}, + 'position': {'key': 'position', 'type': 'bool'}, + 'value_from_pipeline': {'key': 'valueFromPipeline', 'type': 'bool'}, + 'value_from_pipeline_by_property_name': {'key': 'valueFromPipelineByPropertyName', 'type': 'bool'}, + 'value_from_remaining_arguments': {'key': 'valueFromRemainingArguments', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(ActivityParameter, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + self.is_mandatory = kwargs.get('is_mandatory', None) + self.is_dynamic = kwargs.get('is_dynamic', None) + self.position = kwargs.get('position', None) + self.value_from_pipeline = kwargs.get('value_from_pipeline', None) + self.value_from_pipeline_by_property_name = kwargs.get('value_from_pipeline_by_property_name', None) + self.value_from_remaining_arguments = kwargs.get('value_from_remaining_arguments', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/activity_parameter_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/activity_parameter_py3.py new file mode 100644 index 000000000000..3733a8d0cbeb --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/activity_parameter_py3.py @@ -0,0 +1,71 @@ +# 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 msrest.serialization import Model + + +class ActivityParameter(Model): + """Definition of the activity parameter. + + :param name: Gets or sets the name of the activity parameter. + :type name: str + :param type: Gets or sets the type of the activity parameter. + :type type: str + :param is_mandatory: Gets or sets a Boolean value that indicates true if + the parameter is required. If the value is false, the parameter is + optional. + :type is_mandatory: bool + :param is_dynamic: Gets or sets a Boolean value that indicates true if the + parameter is dynamic. + :type is_dynamic: bool + :param position: Gets or sets the position of the activity parameter. + :type position: bool + :param value_from_pipeline: Gets or sets a Boolean value that indicates + true if the parameter can take values from the incoming pipeline objects. + This setting is used if the cmdlet must access the complete input object. + false indicates that the parameter cannot take values from the complete + input object. + :type value_from_pipeline: bool + :param value_from_pipeline_by_property_name: Gets or sets a Boolean value + that indicates true if the parameter can be filled from a property of the + incoming pipeline object that has the same name as this parameter. false + indicates that the parameter cannot be filled from the incoming pipeline + object property with the same name. + :type value_from_pipeline_by_property_name: bool + :param value_from_remaining_arguments: Gets or sets a Boolean value that + indicates true if the cmdlet parameter accepts all the remaining + command-line arguments that are associated with this parameter in the form + of an array. false if the cmdlet parameter does not accept all the + remaining argument values. + :type value_from_remaining_arguments: bool + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'is_mandatory': {'key': 'isMandatory', 'type': 'bool'}, + 'is_dynamic': {'key': 'isDynamic', 'type': 'bool'}, + 'position': {'key': 'position', 'type': 'bool'}, + 'value_from_pipeline': {'key': 'valueFromPipeline', 'type': 'bool'}, + 'value_from_pipeline_by_property_name': {'key': 'valueFromPipelineByPropertyName', 'type': 'bool'}, + 'value_from_remaining_arguments': {'key': 'valueFromRemainingArguments', 'type': 'bool'}, + } + + def __init__(self, *, name: str=None, type: str=None, is_mandatory: bool=None, is_dynamic: bool=None, position: bool=None, value_from_pipeline: bool=None, value_from_pipeline_by_property_name: bool=None, value_from_remaining_arguments: bool=None, **kwargs) -> None: + super(ActivityParameter, self).__init__(**kwargs) + self.name = name + self.type = type + self.is_mandatory = is_mandatory + self.is_dynamic = is_dynamic + self.position = position + self.value_from_pipeline = value_from_pipeline + self.value_from_pipeline_by_property_name = value_from_pipeline_by_property_name + self.value_from_remaining_arguments = value_from_remaining_arguments diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/activity_parameter_set.py b/azure-mgmt-automation/azure/mgmt/automation/models/activity_parameter_set.py new file mode 100644 index 000000000000..ab331d6c74f7 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/activity_parameter_set.py @@ -0,0 +1,33 @@ +# 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 msrest.serialization import Model + + +class ActivityParameterSet(Model): + """Definition of the activity parameter set. + + :param name: Gets or sets the name of the activity parameter set. + :type name: str + :param parameters: Gets or sets the parameters of the activity parameter + set. + :type parameters: list[~azure.mgmt.automation.models.ActivityParameter] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': '[ActivityParameter]'}, + } + + def __init__(self, **kwargs): + super(ActivityParameterSet, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.parameters = kwargs.get('parameters', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/activity_parameter_set_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/activity_parameter_set_py3.py new file mode 100644 index 000000000000..0835b9adccd8 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/activity_parameter_set_py3.py @@ -0,0 +1,33 @@ +# 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 msrest.serialization import Model + + +class ActivityParameterSet(Model): + """Definition of the activity parameter set. + + :param name: Gets or sets the name of the activity parameter set. + :type name: str + :param parameters: Gets or sets the parameters of the activity parameter + set. + :type parameters: list[~azure.mgmt.automation.models.ActivityParameter] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': '[ActivityParameter]'}, + } + + def __init__(self, *, name: str=None, parameters=None, **kwargs) -> None: + super(ActivityParameterSet, self).__init__(**kwargs) + self.name = name + self.parameters = parameters diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/activity_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/activity_py3.py new file mode 100644 index 000000000000..b44113544c75 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/activity_py3.py @@ -0,0 +1,64 @@ +# 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 msrest.serialization import Model + + +class Activity(Model): + """Definition of the activity. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Gets or sets the id of the resource. + :type id: str + :ivar name: Gets the name of the activity. + :vartype name: str + :param definition: Gets or sets the user name of the activity. + :type definition: str + :param parameter_sets: Gets or sets the parameter sets of the activity. + :type parameter_sets: + list[~azure.mgmt.automation.models.ActivityParameterSet] + :param output_types: Gets or sets the output types of the activity. + :type output_types: list[~azure.mgmt.automation.models.ActivityOutputType] + :param creation_time: Gets or sets the creation time. + :type creation_time: datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: datetime + :param description: Gets or sets the description. + :type description: str + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'definition': {'key': 'properties.definition', 'type': 'str'}, + 'parameter_sets': {'key': 'properties.parameterSets', 'type': '[ActivityParameterSet]'}, + 'output_types': {'key': 'properties.outputTypes', 'type': '[ActivityOutputType]'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, definition: str=None, parameter_sets=None, output_types=None, creation_time=None, last_modified_time=None, description: str=None, **kwargs) -> None: + super(Activity, self).__init__(**kwargs) + self.id = id + self.name = None + self.definition = definition + self.parameter_sets = parameter_sets + self.output_types = output_types + self.creation_time = creation_time + self.last_modified_time = last_modified_time + self.description = description diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/advanced_schedule.py b/azure-mgmt-automation/azure/mgmt/automation/models/advanced_schedule.py new file mode 100644 index 000000000000..4f989d9d626b --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/advanced_schedule.py @@ -0,0 +1,38 @@ +# 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 msrest.serialization import Model + + +class AdvancedSchedule(Model): + """The properties of the create Advanced Schedule. + + :param week_days: Days of the week that the job should execute on. + :type week_days: list[str] + :param month_days: Days of the month that the job should execute on. Must + be between 1 and 31. + :type month_days: list[int] + :param monthly_occurrences: Occurrences of days within a month. + :type monthly_occurrences: + list[~azure.mgmt.automation.models.AdvancedScheduleMonthlyOccurrence] + """ + + _attribute_map = { + 'week_days': {'key': 'weekDays', 'type': '[str]'}, + 'month_days': {'key': 'monthDays', 'type': '[int]'}, + 'monthly_occurrences': {'key': 'monthlyOccurrences', 'type': '[AdvancedScheduleMonthlyOccurrence]'}, + } + + def __init__(self, **kwargs): + super(AdvancedSchedule, self).__init__(**kwargs) + self.week_days = kwargs.get('week_days', None) + self.month_days = kwargs.get('month_days', None) + self.monthly_occurrences = kwargs.get('monthly_occurrences', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/advanced_schedule_monthly_occurrence.py b/azure-mgmt-automation/azure/mgmt/automation/models/advanced_schedule_monthly_occurrence.py new file mode 100644 index 000000000000..38613a2e3d12 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/advanced_schedule_monthly_occurrence.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class AdvancedScheduleMonthlyOccurrence(Model): + """The properties of the create advanced schedule monthly occurrence. + + :param occurrence: Occurrence of the week within the month. Must be + between 1 and 5 + :type occurrence: int + :param day: Day of the occurrence. Must be one of monday, tuesday, + wednesday, thursday, friday, saturday, sunday. Possible values include: + 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', + 'Sunday' + :type day: str or ~azure.mgmt.automation.models.ScheduleDay + """ + + _attribute_map = { + 'occurrence': {'key': 'occurrence', 'type': 'int'}, + 'day': {'key': 'day', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AdvancedScheduleMonthlyOccurrence, self).__init__(**kwargs) + self.occurrence = kwargs.get('occurrence', None) + self.day = kwargs.get('day', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/advanced_schedule_monthly_occurrence_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/advanced_schedule_monthly_occurrence_py3.py new file mode 100644 index 000000000000..067f245ad80f --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/advanced_schedule_monthly_occurrence_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class AdvancedScheduleMonthlyOccurrence(Model): + """The properties of the create advanced schedule monthly occurrence. + + :param occurrence: Occurrence of the week within the month. Must be + between 1 and 5 + :type occurrence: int + :param day: Day of the occurrence. Must be one of monday, tuesday, + wednesday, thursday, friday, saturday, sunday. Possible values include: + 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', + 'Sunday' + :type day: str or ~azure.mgmt.automation.models.ScheduleDay + """ + + _attribute_map = { + 'occurrence': {'key': 'occurrence', 'type': 'int'}, + 'day': {'key': 'day', 'type': 'str'}, + } + + def __init__(self, *, occurrence: int=None, day=None, **kwargs) -> None: + super(AdvancedScheduleMonthlyOccurrence, self).__init__(**kwargs) + self.occurrence = occurrence + self.day = day diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/advanced_schedule_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/advanced_schedule_py3.py new file mode 100644 index 000000000000..055f0fba2d02 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/advanced_schedule_py3.py @@ -0,0 +1,38 @@ +# 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 msrest.serialization import Model + + +class AdvancedSchedule(Model): + """The properties of the create Advanced Schedule. + + :param week_days: Days of the week that the job should execute on. + :type week_days: list[str] + :param month_days: Days of the month that the job should execute on. Must + be between 1 and 31. + :type month_days: list[int] + :param monthly_occurrences: Occurrences of days within a month. + :type monthly_occurrences: + list[~azure.mgmt.automation.models.AdvancedScheduleMonthlyOccurrence] + """ + + _attribute_map = { + 'week_days': {'key': 'weekDays', 'type': '[str]'}, + 'month_days': {'key': 'monthDays', 'type': '[int]'}, + 'monthly_occurrences': {'key': 'monthlyOccurrences', 'type': '[AdvancedScheduleMonthlyOccurrence]'}, + } + + def __init__(self, *, week_days=None, month_days=None, monthly_occurrences=None, **kwargs) -> None: + super(AdvancedSchedule, self).__init__(**kwargs) + self.week_days = week_days + self.month_days = month_days + self.monthly_occurrences = monthly_occurrences diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/agent_registration.py b/azure-mgmt-automation/azure/mgmt/automation/models/agent_registration.py new file mode 100644 index 000000000000..63dc3b228888 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/agent_registration.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class AgentRegistration(Model): + """Definition of the agent registration infomration type. + + :param dsc_meta_configuration: Gets or sets the dsc meta configuration. + :type dsc_meta_configuration: str + :param endpoint: Gets or sets the dsc server endpoint. + :type endpoint: str + :param keys: Gets or sets the agent registration keys. + :type keys: ~azure.mgmt.automation.models.AgentRegistrationKeys + :param id: Gets or sets the id. + :type id: str + """ + + _attribute_map = { + 'dsc_meta_configuration': {'key': 'dscMetaConfiguration', 'type': 'str'}, + 'endpoint': {'key': 'endpoint', 'type': 'str'}, + 'keys': {'key': 'keys', 'type': 'AgentRegistrationKeys'}, + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AgentRegistration, self).__init__(**kwargs) + self.dsc_meta_configuration = kwargs.get('dsc_meta_configuration', None) + self.endpoint = kwargs.get('endpoint', None) + self.keys = kwargs.get('keys', None) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/agent_registration_keys.py b/azure-mgmt-automation/azure/mgmt/automation/models/agent_registration_keys.py new file mode 100644 index 000000000000..137865da016f --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/agent_registration_keys.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class AgentRegistrationKeys(Model): + """Definition of the agent registration keys. + + :param primary: Gets or sets the primary key. + :type primary: str + :param secondary: Gets or sets the secondary key. + :type secondary: str + """ + + _attribute_map = { + 'primary': {'key': 'primary', 'type': 'str'}, + 'secondary': {'key': 'secondary', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AgentRegistrationKeys, self).__init__(**kwargs) + self.primary = kwargs.get('primary', None) + self.secondary = kwargs.get('secondary', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/agent_registration_keys_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/agent_registration_keys_py3.py new file mode 100644 index 000000000000..2d38c305260c --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/agent_registration_keys_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class AgentRegistrationKeys(Model): + """Definition of the agent registration keys. + + :param primary: Gets or sets the primary key. + :type primary: str + :param secondary: Gets or sets the secondary key. + :type secondary: str + """ + + _attribute_map = { + 'primary': {'key': 'primary', 'type': 'str'}, + 'secondary': {'key': 'secondary', 'type': 'str'}, + } + + def __init__(self, *, primary: str=None, secondary: str=None, **kwargs) -> None: + super(AgentRegistrationKeys, self).__init__(**kwargs) + self.primary = primary + self.secondary = secondary diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/agent_registration_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/agent_registration_py3.py new file mode 100644 index 000000000000..9c5f8e329008 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/agent_registration_py3.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class AgentRegistration(Model): + """Definition of the agent registration infomration type. + + :param dsc_meta_configuration: Gets or sets the dsc meta configuration. + :type dsc_meta_configuration: str + :param endpoint: Gets or sets the dsc server endpoint. + :type endpoint: str + :param keys: Gets or sets the agent registration keys. + :type keys: ~azure.mgmt.automation.models.AgentRegistrationKeys + :param id: Gets or sets the id. + :type id: str + """ + + _attribute_map = { + 'dsc_meta_configuration': {'key': 'dscMetaConfiguration', 'type': 'str'}, + 'endpoint': {'key': 'endpoint', 'type': 'str'}, + 'keys': {'key': 'keys', 'type': 'AgentRegistrationKeys'}, + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, dsc_meta_configuration: str=None, endpoint: str=None, keys=None, id: str=None, **kwargs) -> None: + super(AgentRegistration, self).__init__(**kwargs) + self.dsc_meta_configuration = dsc_meta_configuration + self.endpoint = endpoint + self.keys = keys + self.id = id diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/agent_registration_regenerate_key_parameter.py b/azure-mgmt-automation/azure/mgmt/automation/models/agent_registration_regenerate_key_parameter.py new file mode 100644 index 000000000000..7c8d841f748e --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/agent_registration_regenerate_key_parameter.py @@ -0,0 +1,48 @@ +# 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 msrest.serialization import Model + + +class AgentRegistrationRegenerateKeyParameter(Model): + """The parameters supplied to the regenerate keys operation. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. Gets or sets the agent registration key name - + primary or secondary. Possible values include: 'primary', 'secondary' + :type key_name: str or + ~azure.mgmt.automation.models.AgentRegistrationKeyName + :param name: Gets or sets the name of the resource. + :type name: str + :param location: Gets or sets the location of the resource. + :type location: str + :param tags: Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(AgentRegistrationRegenerateKeyParameter, self).__init__(**kwargs) + self.key_name = kwargs.get('key_name', None) + self.name = kwargs.get('name', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/agent_registration_regenerate_key_parameter_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/agent_registration_regenerate_key_parameter_py3.py new file mode 100644 index 000000000000..0cf32059b985 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/agent_registration_regenerate_key_parameter_py3.py @@ -0,0 +1,48 @@ +# 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 msrest.serialization import Model + + +class AgentRegistrationRegenerateKeyParameter(Model): + """The parameters supplied to the regenerate keys operation. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. Gets or sets the agent registration key name - + primary or secondary. Possible values include: 'primary', 'secondary' + :type key_name: str or + ~azure.mgmt.automation.models.AgentRegistrationKeyName + :param name: Gets or sets the name of the resource. + :type name: str + :param location: Gets or sets the location of the resource. + :type location: str + :param tags: Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, key_name, name: str=None, location: str=None, tags=None, **kwargs) -> None: + super(AgentRegistrationRegenerateKeyParameter, self).__init__(**kwargs) + self.key_name = key_name + self.name = name + self.location = location + self.tags = tags diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/automation_account.py b/azure-mgmt-automation/azure/mgmt/automation/models/automation_account.py new file mode 100644 index 000000000000..46bb437d295c --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/automation_account.py @@ -0,0 +1,81 @@ +# 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 .tracked_resource import TrackedResource + + +class AutomationAccount(TrackedResource): + """Definition of the automation account type. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: The Azure Region where the resource lives + :type location: str + :param sku: Gets or sets the SKU of account. + :type sku: ~azure.mgmt.automation.models.Sku + :param last_modified_by: Gets or sets the last modified by. + :type last_modified_by: str + :ivar state: Gets status of account. Possible values include: 'Ok', + 'Unavailable', 'Suspended' + :vartype state: str or + ~azure.mgmt.automation.models.AutomationAccountState + :ivar creation_time: Gets the creation time. + :vartype creation_time: datetime + :ivar last_modified_time: Gets the last modified time. + :vartype last_modified_time: datetime + :param description: Gets or sets the description. + :type description: str + :param etag: Gets or sets the etag of the resource. + :type etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'state': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'sku': {'key': 'properties.sku', 'type': 'Sku'}, + 'last_modified_by': {'key': 'properties.lastModifiedBy', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AutomationAccount, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.state = None + self.creation_time = None + self.last_modified_time = None + self.description = kwargs.get('description', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/automation_account_create_or_update_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/automation_account_create_or_update_parameters.py new file mode 100644 index 000000000000..75c83d7ced9f --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/automation_account_create_or_update_parameters.py @@ -0,0 +1,41 @@ +# 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 msrest.serialization import Model + + +class AutomationAccountCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update automation account + operation. + + :param sku: Gets or sets account SKU. + :type sku: ~azure.mgmt.automation.models.Sku + :param name: Gets or sets name of the resource. + :type name: str + :param location: Gets or sets the location of the resource. + :type location: str + :param tags: Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'sku': {'key': 'properties.sku', 'type': 'Sku'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(AutomationAccountCreateOrUpdateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.name = kwargs.get('name', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/automation_account_create_or_update_parameters_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/automation_account_create_or_update_parameters_py3.py new file mode 100644 index 000000000000..33252b8ecd54 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/automation_account_create_or_update_parameters_py3.py @@ -0,0 +1,41 @@ +# 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 msrest.serialization import Model + + +class AutomationAccountCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update automation account + operation. + + :param sku: Gets or sets account SKU. + :type sku: ~azure.mgmt.automation.models.Sku + :param name: Gets or sets name of the resource. + :type name: str + :param location: Gets or sets the location of the resource. + :type location: str + :param tags: Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'sku': {'key': 'properties.sku', 'type': 'Sku'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, sku=None, name: str=None, location: str=None, tags=None, **kwargs) -> None: + super(AutomationAccountCreateOrUpdateParameters, self).__init__(**kwargs) + self.sku = sku + self.name = name + self.location = location + self.tags = tags diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/automation_account_paged.py b/azure-mgmt-automation/azure/mgmt/automation/models/automation_account_paged.py new file mode 100644 index 000000000000..2ded30ea0c31 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/automation_account_paged.py @@ -0,0 +1,27 @@ +# 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 msrest.paging import Paged + + +class AutomationAccountPaged(Paged): + """ + A paging container for iterating over a list of :class:`AutomationAccount ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[AutomationAccount]'} + } + + def __init__(self, *args, **kwargs): + + super(AutomationAccountPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/automation_account_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/automation_account_py3.py new file mode 100644 index 000000000000..0d6dac23eea3 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/automation_account_py3.py @@ -0,0 +1,81 @@ +# 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 .tracked_resource import TrackedResource + + +class AutomationAccount(TrackedResource): + """Definition of the automation account type. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: The Azure Region where the resource lives + :type location: str + :param sku: Gets or sets the SKU of account. + :type sku: ~azure.mgmt.automation.models.Sku + :param last_modified_by: Gets or sets the last modified by. + :type last_modified_by: str + :ivar state: Gets status of account. Possible values include: 'Ok', + 'Unavailable', 'Suspended' + :vartype state: str or + ~azure.mgmt.automation.models.AutomationAccountState + :ivar creation_time: Gets the creation time. + :vartype creation_time: datetime + :ivar last_modified_time: Gets the last modified time. + :vartype last_modified_time: datetime + :param description: Gets or sets the description. + :type description: str + :param etag: Gets or sets the etag of the resource. + :type etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'state': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'sku': {'key': 'properties.sku', 'type': 'Sku'}, + 'last_modified_by': {'key': 'properties.lastModifiedBy', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, tags=None, location: str=None, sku=None, last_modified_by: str=None, description: str=None, etag: str=None, **kwargs) -> None: + super(AutomationAccount, self).__init__(tags=tags, location=location, **kwargs) + self.sku = sku + self.last_modified_by = last_modified_by + self.state = None + self.creation_time = None + self.last_modified_time = None + self.description = description + self.etag = etag diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/automation_account_update_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/automation_account_update_parameters.py new file mode 100644 index 000000000000..9493f7811def --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/automation_account_update_parameters.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class AutomationAccountUpdateParameters(Model): + """The parameters supplied to the update automation account operation. + + :param sku: Gets or sets account SKU. + :type sku: ~azure.mgmt.automation.models.Sku + :param name: Gets or sets the name of the resource. + :type name: str + :param location: Gets or sets the location of the resource. + :type location: str + :param tags: Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'sku': {'key': 'properties.sku', 'type': 'Sku'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(AutomationAccountUpdateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.name = kwargs.get('name', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/automation_account_update_parameters_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/automation_account_update_parameters_py3.py new file mode 100644 index 000000000000..41ffeb1ca0c7 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/automation_account_update_parameters_py3.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class AutomationAccountUpdateParameters(Model): + """The parameters supplied to the update automation account operation. + + :param sku: Gets or sets account SKU. + :type sku: ~azure.mgmt.automation.models.Sku + :param name: Gets or sets the name of the resource. + :type name: str + :param location: Gets or sets the location of the resource. + :type location: str + :param tags: Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'sku': {'key': 'properties.sku', 'type': 'Sku'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, sku=None, name: str=None, location: str=None, tags=None, **kwargs) -> None: + super(AutomationAccountUpdateParameters, self).__init__(**kwargs) + self.sku = sku + self.name = name + self.location = location + self.tags = tags diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/automation_client_enums.py b/azure-mgmt-automation/azure/mgmt/automation/models/automation_client_enums.py new file mode 100644 index 000000000000..74cc3a5a841f --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/automation_client_enums.py @@ -0,0 +1,250 @@ +# 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 enum import Enum + + +class AutomationKeyName(str, Enum): + + primary = "primary" + secondary = "secondary" + + +class AutomationKeyPermissions(str, Enum): + + full = "Full" + + +class JobProvisioningState(str, Enum): + + failed = "Failed" + succeeded = "Succeeded" + suspended = "Suspended" + processing = "Processing" + + +class JobStatus(str, Enum): + + new = "New" + activating = "Activating" + running = "Running" + completed = "Completed" + failed = "Failed" + stopped = "Stopped" + blocked = "Blocked" + suspended = "Suspended" + disconnected = "Disconnected" + suspending = "Suspending" + stopping = "Stopping" + resuming = "Resuming" + removing = "Removing" + + +class RunbookTypeEnum(str, Enum): + + script = "Script" + graph = "Graph" + power_shell_workflow = "PowerShellWorkflow" + power_shell = "PowerShell" + graph_power_shell_workflow = "GraphPowerShellWorkflow" + graph_power_shell = "GraphPowerShell" + + +class RunbookState(str, Enum): + + new = "New" + edit = "Edit" + published = "Published" + + +class RunbookProvisioningState(str, Enum): + + succeeded = "Succeeded" + + +class ModuleProvisioningState(str, Enum): + + created = "Created" + creating = "Creating" + starting_import_module_runbook = "StartingImportModuleRunbook" + running_import_module_runbook = "RunningImportModuleRunbook" + content_retrieved = "ContentRetrieved" + content_downloaded = "ContentDownloaded" + content_validated = "ContentValidated" + connection_type_imported = "ConnectionTypeImported" + content_stored = "ContentStored" + module_data_stored = "ModuleDataStored" + activities_stored = "ActivitiesStored" + module_import_runbook_complete = "ModuleImportRunbookComplete" + succeeded = "Succeeded" + failed = "Failed" + cancelled = "Cancelled" + updating = "Updating" + + +class ContentSourceType(str, Enum): + + embedded_content = "embeddedContent" + uri = "uri" + + +class DscConfigurationProvisioningState(str, Enum): + + succeeded = "Succeeded" + + +class DscConfigurationState(str, Enum): + + new = "New" + edit = "Edit" + published = "Published" + + +class SkuNameEnum(str, Enum): + + free = "Free" + basic = "Basic" + + +class AutomationAccountState(str, Enum): + + ok = "Ok" + unavailable = "Unavailable" + suspended = "Suspended" + + +class ScheduleDay(str, Enum): + + monday = "Monday" + tuesday = "Tuesday" + wednesday = "Wednesday" + thursday = "Thursday" + friday = "Friday" + saturday = "Saturday" + sunday = "Sunday" + + +class AgentRegistrationKeyName(str, Enum): + + primary = "primary" + secondary = "secondary" + + +class JobStreamType(str, Enum): + + progress = "Progress" + output = "Output" + warning = "Warning" + error = "Error" + debug = "Debug" + verbose = "Verbose" + any = "Any" + + +class HttpStatusCode(str, Enum): + + continue_enum = "Continue" + switching_protocols = "SwitchingProtocols" + ok = "OK" + created = "Created" + accepted = "Accepted" + non_authoritative_information = "NonAuthoritativeInformation" + no_content = "NoContent" + reset_content = "ResetContent" + partial_content = "PartialContent" + multiple_choices = "MultipleChoices" + ambiguous = "Ambiguous" + moved_permanently = "MovedPermanently" + moved = "Moved" + found = "Found" + redirect = "Redirect" + see_other = "SeeOther" + redirect_method = "RedirectMethod" + not_modified = "NotModified" + use_proxy = "UseProxy" + unused = "Unused" + temporary_redirect = "TemporaryRedirect" + redirect_keep_verb = "RedirectKeepVerb" + bad_request = "BadRequest" + unauthorized = "Unauthorized" + payment_required = "PaymentRequired" + forbidden = "Forbidden" + not_found = "NotFound" + method_not_allowed = "MethodNotAllowed" + not_acceptable = "NotAcceptable" + proxy_authentication_required = "ProxyAuthenticationRequired" + request_timeout = "RequestTimeout" + conflict = "Conflict" + gone = "Gone" + length_required = "LengthRequired" + precondition_failed = "PreconditionFailed" + request_entity_too_large = "RequestEntityTooLarge" + request_uri_too_long = "RequestUriTooLong" + unsupported_media_type = "UnsupportedMediaType" + requested_range_not_satisfiable = "RequestedRangeNotSatisfiable" + expectation_failed = "ExpectationFailed" + upgrade_required = "UpgradeRequired" + internal_server_error = "InternalServerError" + not_implemented = "NotImplemented" + bad_gateway = "BadGateway" + service_unavailable = "ServiceUnavailable" + gateway_timeout = "GatewayTimeout" + http_version_not_supported = "HttpVersionNotSupported" + + +class ScheduleFrequency(str, Enum): + + one_time = "OneTime" + day = "Day" + hour = "Hour" + week = "Week" + month = "Month" + + +class OperatingSystemType(str, Enum): + + windows = "Windows" + linux = "Linux" + + +class WindowsUpdateClasses(str, Enum): + + unclassified = "Unclassified" + critical = "Critical" + security = "Security" + update_rollup = "UpdateRollup" + feature_pack = "FeaturePack" + service_pack = "ServicePack" + definition = "Definition" + tools = "Tools" + updates = "Updates" + + +class LinuxUpdateClasses(str, Enum): + + unclassified = "Unclassified" + critical = "Critical" + security = "Security" + other = "Other" + + +class SourceType(str, Enum): + + vso_git = "VsoGit" + vso_tfvc = "VsoTfvc" + git_hub = "GitHub" + + +class ProvisioningState(str, Enum): + + completed = "Completed" + failed = "Failed" + running = "Running" diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/certificate.py b/azure-mgmt-automation/azure/mgmt/automation/models/certificate.py new file mode 100644 index 000000000000..d116817e726f --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/certificate.py @@ -0,0 +1,71 @@ +# 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 .proxy_resource import ProxyResource + + +class Certificate(ProxyResource): + """Definition of the certificate. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar thumbprint: Gets the thumbprint of the certificate. + :vartype thumbprint: str + :ivar expiry_time: Gets the expiry time of the certificate. + :vartype expiry_time: datetime + :ivar is_exportable: Gets the is exportable flag of the certificate. + :vartype is_exportable: bool + :ivar creation_time: Gets the creation time. + :vartype creation_time: datetime + :ivar last_modified_time: Gets the last modified time. + :vartype last_modified_time: datetime + :param description: Gets or sets the description. + :type description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'thumbprint': {'readonly': True}, + 'expiry_time': {'readonly': True}, + 'is_exportable': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'expiry_time': {'key': 'properties.expiryTime', 'type': 'iso-8601'}, + 'is_exportable': {'key': 'properties.isExportable', 'type': 'bool'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Certificate, self).__init__(**kwargs) + self.thumbprint = None + self.expiry_time = None + self.is_exportable = None + self.creation_time = None + self.last_modified_time = None + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/certificate_create_or_update_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/certificate_create_or_update_parameters.py new file mode 100644 index 000000000000..1be51ecfea4a --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/certificate_create_or_update_parameters.py @@ -0,0 +1,54 @@ +# 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 msrest.serialization import Model + + +class CertificateCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update or replace certificate + operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the name of the certificate. + :type name: str + :param base64_value: Required. Gets or sets the base64 encoded value of + the certificate. + :type base64_value: str + :param description: Gets or sets the description of the certificate. + :type description: str + :param thumbprint: Gets or sets the thumbprint of the certificate. + :type thumbprint: str + :param is_exportable: Gets or sets the is exportable flag of the + certificate. + :type is_exportable: bool + """ + + _validation = { + 'name': {'required': True}, + 'base64_value': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'base64_value': {'key': 'properties.base64Value', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'is_exportable': {'key': 'properties.isExportable', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(CertificateCreateOrUpdateParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.base64_value = kwargs.get('base64_value', None) + self.description = kwargs.get('description', None) + self.thumbprint = kwargs.get('thumbprint', None) + self.is_exportable = kwargs.get('is_exportable', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/certificate_create_or_update_parameters_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/certificate_create_or_update_parameters_py3.py new file mode 100644 index 000000000000..609f6bf4cfb1 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/certificate_create_or_update_parameters_py3.py @@ -0,0 +1,54 @@ +# 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 msrest.serialization import Model + + +class CertificateCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update or replace certificate + operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the name of the certificate. + :type name: str + :param base64_value: Required. Gets or sets the base64 encoded value of + the certificate. + :type base64_value: str + :param description: Gets or sets the description of the certificate. + :type description: str + :param thumbprint: Gets or sets the thumbprint of the certificate. + :type thumbprint: str + :param is_exportable: Gets or sets the is exportable flag of the + certificate. + :type is_exportable: bool + """ + + _validation = { + 'name': {'required': True}, + 'base64_value': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'base64_value': {'key': 'properties.base64Value', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'is_exportable': {'key': 'properties.isExportable', 'type': 'bool'}, + } + + def __init__(self, *, name: str, base64_value: str, description: str=None, thumbprint: str=None, is_exportable: bool=None, **kwargs) -> None: + super(CertificateCreateOrUpdateParameters, self).__init__(**kwargs) + self.name = name + self.base64_value = base64_value + self.description = description + self.thumbprint = thumbprint + self.is_exportable = is_exportable diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/certificate_paged.py b/azure-mgmt-automation/azure/mgmt/automation/models/certificate_paged.py new file mode 100644 index 000000000000..bb13e8ce3b97 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/certificate_paged.py @@ -0,0 +1,27 @@ +# 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 msrest.paging import Paged + + +class CertificatePaged(Paged): + """ + A paging container for iterating over a list of :class:`Certificate ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Certificate]'} + } + + def __init__(self, *args, **kwargs): + + super(CertificatePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/certificate_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/certificate_py3.py new file mode 100644 index 000000000000..ded31b85e358 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/certificate_py3.py @@ -0,0 +1,71 @@ +# 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 .proxy_resource import ProxyResource + + +class Certificate(ProxyResource): + """Definition of the certificate. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar thumbprint: Gets the thumbprint of the certificate. + :vartype thumbprint: str + :ivar expiry_time: Gets the expiry time of the certificate. + :vartype expiry_time: datetime + :ivar is_exportable: Gets the is exportable flag of the certificate. + :vartype is_exportable: bool + :ivar creation_time: Gets the creation time. + :vartype creation_time: datetime + :ivar last_modified_time: Gets the last modified time. + :vartype last_modified_time: datetime + :param description: Gets or sets the description. + :type description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'thumbprint': {'readonly': True}, + 'expiry_time': {'readonly': True}, + 'is_exportable': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'expiry_time': {'key': 'properties.expiryTime', 'type': 'iso-8601'}, + 'is_exportable': {'key': 'properties.isExportable', 'type': 'bool'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, *, description: str=None, **kwargs) -> None: + super(Certificate, self).__init__(**kwargs) + self.thumbprint = None + self.expiry_time = None + self.is_exportable = None + self.creation_time = None + self.last_modified_time = None + self.description = description diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/certificate_update_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/certificate_update_parameters.py new file mode 100644 index 000000000000..5f92cca4c652 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/certificate_update_parameters.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class CertificateUpdateParameters(Model): + """The parameters supplied to the update certificate operation. + + :param name: Gets or sets the name of the certificate. + :type name: str + :param description: Gets or sets the description of the certificate. + :type description: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CertificateUpdateParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/certificate_update_parameters_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/certificate_update_parameters_py3.py new file mode 100644 index 000000000000..4aeac9c6aeba --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/certificate_update_parameters_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class CertificateUpdateParameters(Model): + """The parameters supplied to the update certificate operation. + + :param name: Gets or sets the name of the certificate. + :type name: str + :param description: Gets or sets the description of the certificate. + :type description: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, description: str=None, **kwargs) -> None: + super(CertificateUpdateParameters, self).__init__(**kwargs) + self.name = name + self.description = description diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/collection_item_update_configuration.py b/azure-mgmt-automation/azure/mgmt/automation/models/collection_item_update_configuration.py new file mode 100644 index 000000000000..8102bddec71b --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/collection_item_update_configuration.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class CollectionItemUpdateConfiguration(Model): + """object returned when requesting a collection of software update + configuration. + + :param azure_virtual_machines: List of azure resource Ids for azure + virtual machines targeted by the software update configuration. + :type azure_virtual_machines: list[str] + :param duration: Maximum time allowed for the software update + configuration run. Duration needs to be specified using the format + PT[n]H[n]M[n]S as per ISO8601 + :type duration: timedelta + """ + + _attribute_map = { + 'azure_virtual_machines': {'key': 'azureVirtualMachines', 'type': '[str]'}, + 'duration': {'key': 'duration', 'type': 'duration'}, + } + + def __init__(self, **kwargs): + super(CollectionItemUpdateConfiguration, self).__init__(**kwargs) + self.azure_virtual_machines = kwargs.get('azure_virtual_machines', None) + self.duration = kwargs.get('duration', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/collection_item_update_configuration_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/collection_item_update_configuration_py3.py new file mode 100644 index 000000000000..6ec50c07c0bd --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/collection_item_update_configuration_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class CollectionItemUpdateConfiguration(Model): + """object returned when requesting a collection of software update + configuration. + + :param azure_virtual_machines: List of azure resource Ids for azure + virtual machines targeted by the software update configuration. + :type azure_virtual_machines: list[str] + :param duration: Maximum time allowed for the software update + configuration run. Duration needs to be specified using the format + PT[n]H[n]M[n]S as per ISO8601 + :type duration: timedelta + """ + + _attribute_map = { + 'azure_virtual_machines': {'key': 'azureVirtualMachines', 'type': '[str]'}, + 'duration': {'key': 'duration', 'type': 'duration'}, + } + + def __init__(self, *, azure_virtual_machines=None, duration=None, **kwargs) -> None: + super(CollectionItemUpdateConfiguration, self).__init__(**kwargs) + self.azure_virtual_machines = azure_virtual_machines + self.duration = duration diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/connection.py b/azure-mgmt-automation/azure/mgmt/automation/models/connection.py new file mode 100644 index 000000000000..2394b4294119 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/connection.py @@ -0,0 +1,67 @@ +# 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 .proxy_resource import ProxyResource + + +class Connection(ProxyResource): + """Definition of the connection. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param connection_type: Gets or sets the connectionType of the connection. + :type connection_type: + ~azure.mgmt.automation.models.ConnectionTypeAssociationProperty + :ivar field_definition_values: Gets the field definition values of the + connection. + :vartype field_definition_values: dict[str, str] + :ivar creation_time: Gets the creation time. + :vartype creation_time: datetime + :ivar last_modified_time: Gets the last modified time. + :vartype last_modified_time: datetime + :param description: Gets or sets the description. + :type description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'field_definition_values': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'connection_type': {'key': 'properties.connectionType', 'type': 'ConnectionTypeAssociationProperty'}, + 'field_definition_values': {'key': 'properties.fieldDefinitionValues', 'type': '{str}'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Connection, self).__init__(**kwargs) + self.connection_type = kwargs.get('connection_type', None) + self.field_definition_values = None + self.creation_time = None + self.last_modified_time = None + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/connection_create_or_update_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/connection_create_or_update_parameters.py new file mode 100644 index 000000000000..b6de8724130f --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/connection_create_or_update_parameters.py @@ -0,0 +1,50 @@ +# 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 msrest.serialization import Model + + +class ConnectionCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update connection operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the name of the connection. + :type name: str + :param description: Gets or sets the description of the connection. + :type description: str + :param connection_type: Required. Gets or sets the connectionType of the + connection. + :type connection_type: + ~azure.mgmt.automation.models.ConnectionTypeAssociationProperty + :param field_definition_values: Gets or sets the field definition + properties of the connection. + :type field_definition_values: dict[str, str] + """ + + _validation = { + 'name': {'required': True}, + 'connection_type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'connection_type': {'key': 'properties.connectionType', 'type': 'ConnectionTypeAssociationProperty'}, + 'field_definition_values': {'key': 'properties.fieldDefinitionValues', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(ConnectionCreateOrUpdateParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.description = kwargs.get('description', None) + self.connection_type = kwargs.get('connection_type', None) + self.field_definition_values = kwargs.get('field_definition_values', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/connection_create_or_update_parameters_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/connection_create_or_update_parameters_py3.py new file mode 100644 index 000000000000..60f11d5ea5ef --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/connection_create_or_update_parameters_py3.py @@ -0,0 +1,50 @@ +# 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 msrest.serialization import Model + + +class ConnectionCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update connection operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the name of the connection. + :type name: str + :param description: Gets or sets the description of the connection. + :type description: str + :param connection_type: Required. Gets or sets the connectionType of the + connection. + :type connection_type: + ~azure.mgmt.automation.models.ConnectionTypeAssociationProperty + :param field_definition_values: Gets or sets the field definition + properties of the connection. + :type field_definition_values: dict[str, str] + """ + + _validation = { + 'name': {'required': True}, + 'connection_type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'connection_type': {'key': 'properties.connectionType', 'type': 'ConnectionTypeAssociationProperty'}, + 'field_definition_values': {'key': 'properties.fieldDefinitionValues', 'type': '{str}'}, + } + + def __init__(self, *, name: str, connection_type, description: str=None, field_definition_values=None, **kwargs) -> None: + super(ConnectionCreateOrUpdateParameters, self).__init__(**kwargs) + self.name = name + self.description = description + self.connection_type = connection_type + self.field_definition_values = field_definition_values diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/connection_paged.py b/azure-mgmt-automation/azure/mgmt/automation/models/connection_paged.py new file mode 100644 index 000000000000..fcae5786fd0d --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/connection_paged.py @@ -0,0 +1,27 @@ +# 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 msrest.paging import Paged + + +class ConnectionPaged(Paged): + """ + A paging container for iterating over a list of :class:`Connection ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Connection]'} + } + + def __init__(self, *args, **kwargs): + + super(ConnectionPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/connection_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/connection_py3.py new file mode 100644 index 000000000000..af5a1bb94fce --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/connection_py3.py @@ -0,0 +1,67 @@ +# 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 .proxy_resource import ProxyResource + + +class Connection(ProxyResource): + """Definition of the connection. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param connection_type: Gets or sets the connectionType of the connection. + :type connection_type: + ~azure.mgmt.automation.models.ConnectionTypeAssociationProperty + :ivar field_definition_values: Gets the field definition values of the + connection. + :vartype field_definition_values: dict[str, str] + :ivar creation_time: Gets the creation time. + :vartype creation_time: datetime + :ivar last_modified_time: Gets the last modified time. + :vartype last_modified_time: datetime + :param description: Gets or sets the description. + :type description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'field_definition_values': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'connection_type': {'key': 'properties.connectionType', 'type': 'ConnectionTypeAssociationProperty'}, + 'field_definition_values': {'key': 'properties.fieldDefinitionValues', 'type': '{str}'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, *, connection_type=None, description: str=None, **kwargs) -> None: + super(Connection, self).__init__(**kwargs) + self.connection_type = connection_type + self.field_definition_values = None + self.creation_time = None + self.last_modified_time = None + self.description = description diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/connection_type.py b/azure-mgmt-automation/azure/mgmt/automation/models/connection_type.py new file mode 100644 index 000000000000..e53594e6567c --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/connection_type.py @@ -0,0 +1,70 @@ +# 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 msrest.serialization import Model + + +class ConnectionType(Model): + """Definition of the connection type. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Gets the id of the resource. + :vartype id: str + :ivar name: Gets the name of the connection type. + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param is_global: Gets or sets a Boolean value to indicate if the + connection type is global. + :type is_global: bool + :ivar field_definitions: Gets the field definitions of the connection + type. + :vartype field_definitions: dict[str, + ~azure.mgmt.automation.models.FieldDefinition] + :ivar creation_time: Gets the creation time. + :vartype creation_time: datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: datetime + :param description: Gets or sets the description. + :type description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'field_definitions': {'readonly': True}, + 'creation_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'is_global': {'key': 'properties.isGlobal', 'type': 'bool'}, + 'field_definitions': {'key': 'properties.fieldDefinitions', 'type': '{FieldDefinition}'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ConnectionType, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.is_global = kwargs.get('is_global', None) + self.field_definitions = None + self.creation_time = None + self.last_modified_time = kwargs.get('last_modified_time', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/connection_type_association_property.py b/azure-mgmt-automation/azure/mgmt/automation/models/connection_type_association_property.py new file mode 100644 index 000000000000..7be12278cddf --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/connection_type_association_property.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class ConnectionTypeAssociationProperty(Model): + """The connection type property associated with the entity. + + :param name: Gets or sets the name of the connection type. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ConnectionTypeAssociationProperty, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/connection_type_association_property_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/connection_type_association_property_py3.py new file mode 100644 index 000000000000..1452ce7562f2 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/connection_type_association_property_py3.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class ConnectionTypeAssociationProperty(Model): + """The connection type property associated with the entity. + + :param name: Gets or sets the name of the connection type. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, **kwargs) -> None: + super(ConnectionTypeAssociationProperty, self).__init__(**kwargs) + self.name = name diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/connection_type_create_or_update_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/connection_type_create_or_update_parameters.py new file mode 100644 index 000000000000..5e7aceac131e --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/connection_type_create_or_update_parameters.py @@ -0,0 +1,46 @@ +# 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 msrest.serialization import Model + + +class ConnectionTypeCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update connection type operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the name of the connection type. + :type name: str + :param is_global: Gets or sets a Boolean value to indicate if the + connection type is global. + :type is_global: bool + :param field_definitions: Required. Gets or sets the field definitions of + the connection type. + :type field_definitions: dict[str, + ~azure.mgmt.automation.models.FieldDefinition] + """ + + _validation = { + 'name': {'required': True}, + 'field_definitions': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_global': {'key': 'properties.isGlobal', 'type': 'bool'}, + 'field_definitions': {'key': 'properties.fieldDefinitions', 'type': '{FieldDefinition}'}, + } + + def __init__(self, **kwargs): + super(ConnectionTypeCreateOrUpdateParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.is_global = kwargs.get('is_global', None) + self.field_definitions = kwargs.get('field_definitions', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/connection_type_create_or_update_parameters_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/connection_type_create_or_update_parameters_py3.py new file mode 100644 index 000000000000..d36c20f059f3 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/connection_type_create_or_update_parameters_py3.py @@ -0,0 +1,46 @@ +# 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 msrest.serialization import Model + + +class ConnectionTypeCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update connection type operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the name of the connection type. + :type name: str + :param is_global: Gets or sets a Boolean value to indicate if the + connection type is global. + :type is_global: bool + :param field_definitions: Required. Gets or sets the field definitions of + the connection type. + :type field_definitions: dict[str, + ~azure.mgmt.automation.models.FieldDefinition] + """ + + _validation = { + 'name': {'required': True}, + 'field_definitions': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_global': {'key': 'properties.isGlobal', 'type': 'bool'}, + 'field_definitions': {'key': 'properties.fieldDefinitions', 'type': '{FieldDefinition}'}, + } + + def __init__(self, *, name: str, field_definitions, is_global: bool=None, **kwargs) -> None: + super(ConnectionTypeCreateOrUpdateParameters, self).__init__(**kwargs) + self.name = name + self.is_global = is_global + self.field_definitions = field_definitions diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/connection_type_paged.py b/azure-mgmt-automation/azure/mgmt/automation/models/connection_type_paged.py new file mode 100644 index 000000000000..1ffa5ec5f162 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/connection_type_paged.py @@ -0,0 +1,27 @@ +# 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 msrest.paging import Paged + + +class ConnectionTypePaged(Paged): + """ + A paging container for iterating over a list of :class:`ConnectionType ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ConnectionType]'} + } + + def __init__(self, *args, **kwargs): + + super(ConnectionTypePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/connection_type_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/connection_type_py3.py new file mode 100644 index 000000000000..2d5b3fb27795 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/connection_type_py3.py @@ -0,0 +1,70 @@ +# 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 msrest.serialization import Model + + +class ConnectionType(Model): + """Definition of the connection type. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Gets the id of the resource. + :vartype id: str + :ivar name: Gets the name of the connection type. + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param is_global: Gets or sets a Boolean value to indicate if the + connection type is global. + :type is_global: bool + :ivar field_definitions: Gets the field definitions of the connection + type. + :vartype field_definitions: dict[str, + ~azure.mgmt.automation.models.FieldDefinition] + :ivar creation_time: Gets the creation time. + :vartype creation_time: datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: datetime + :param description: Gets or sets the description. + :type description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'field_definitions': {'readonly': True}, + 'creation_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'is_global': {'key': 'properties.isGlobal', 'type': 'bool'}, + 'field_definitions': {'key': 'properties.fieldDefinitions', 'type': '{FieldDefinition}'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, *, is_global: bool=None, last_modified_time=None, description: str=None, **kwargs) -> None: + super(ConnectionType, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.is_global = is_global + self.field_definitions = None + self.creation_time = None + self.last_modified_time = last_modified_time + self.description = description diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/connection_update_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/connection_update_parameters.py new file mode 100644 index 000000000000..844a4dfc11b4 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/connection_update_parameters.py @@ -0,0 +1,37 @@ +# 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 msrest.serialization import Model + + +class ConnectionUpdateParameters(Model): + """The parameters supplied to the update connection operation. + + :param name: Gets or sets the name of the connection. + :type name: str + :param description: Gets or sets the description of the connection. + :type description: str + :param field_definition_values: Gets or sets the field definition values + of the connection. + :type field_definition_values: dict[str, str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'field_definition_values': {'key': 'properties.fieldDefinitionValues', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(ConnectionUpdateParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.description = kwargs.get('description', None) + self.field_definition_values = kwargs.get('field_definition_values', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/connection_update_parameters_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/connection_update_parameters_py3.py new file mode 100644 index 000000000000..610a3ab24219 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/connection_update_parameters_py3.py @@ -0,0 +1,37 @@ +# 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 msrest.serialization import Model + + +class ConnectionUpdateParameters(Model): + """The parameters supplied to the update connection operation. + + :param name: Gets or sets the name of the connection. + :type name: str + :param description: Gets or sets the description of the connection. + :type description: str + :param field_definition_values: Gets or sets the field definition values + of the connection. + :type field_definition_values: dict[str, str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'field_definition_values': {'key': 'properties.fieldDefinitionValues', 'type': '{str}'}, + } + + def __init__(self, *, name: str=None, description: str=None, field_definition_values=None, **kwargs) -> None: + super(ConnectionUpdateParameters, self).__init__(**kwargs) + self.name = name + self.description = description + self.field_definition_values = field_definition_values diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/content_hash.py b/azure-mgmt-automation/azure/mgmt/automation/models/content_hash.py new file mode 100644 index 000000000000..20857dc0ceda --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/content_hash.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class ContentHash(Model): + """Definition of the runbook property type. + + All required parameters must be populated in order to send to Azure. + + :param algorithm: Required. Gets or sets the content hash algorithm used + to hash the content. + :type algorithm: str + :param value: Required. Gets or sets expected hash value of the content. + :type value: str + """ + + _validation = { + 'algorithm': {'required': True}, + 'value': {'required': True}, + } + + _attribute_map = { + 'algorithm': {'key': 'algorithm', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ContentHash, self).__init__(**kwargs) + self.algorithm = kwargs.get('algorithm', None) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/content_hash_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/content_hash_py3.py new file mode 100644 index 000000000000..7e77ddf326df --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/content_hash_py3.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class ContentHash(Model): + """Definition of the runbook property type. + + All required parameters must be populated in order to send to Azure. + + :param algorithm: Required. Gets or sets the content hash algorithm used + to hash the content. + :type algorithm: str + :param value: Required. Gets or sets expected hash value of the content. + :type value: str + """ + + _validation = { + 'algorithm': {'required': True}, + 'value': {'required': True}, + } + + _attribute_map = { + 'algorithm': {'key': 'algorithm', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, algorithm: str, value: str, **kwargs) -> None: + super(ContentHash, self).__init__(**kwargs) + self.algorithm = algorithm + self.value = value diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/content_link.py b/azure-mgmt-automation/azure/mgmt/automation/models/content_link.py new file mode 100644 index 000000000000..9285bc0abfaf --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/content_link.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class ContentLink(Model): + """Definition of the content link. + + :param uri: Gets or sets the uri of the runbook content. + :type uri: str + :param content_hash: Gets or sets the hash. + :type content_hash: ~azure.mgmt.automation.models.ContentHash + :param version: Gets or sets the version of the content. + :type version: str + """ + + _attribute_map = { + 'uri': {'key': 'uri', 'type': 'str'}, + 'content_hash': {'key': 'contentHash', 'type': 'ContentHash'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ContentLink, self).__init__(**kwargs) + self.uri = kwargs.get('uri', None) + self.content_hash = kwargs.get('content_hash', None) + self.version = kwargs.get('version', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/content_link_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/content_link_py3.py new file mode 100644 index 000000000000..4361aa88158e --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/content_link_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class ContentLink(Model): + """Definition of the content link. + + :param uri: Gets or sets the uri of the runbook content. + :type uri: str + :param content_hash: Gets or sets the hash. + :type content_hash: ~azure.mgmt.automation.models.ContentHash + :param version: Gets or sets the version of the content. + :type version: str + """ + + _attribute_map = { + 'uri': {'key': 'uri', 'type': 'str'}, + 'content_hash': {'key': 'contentHash', 'type': 'ContentHash'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__(self, *, uri: str=None, content_hash=None, version: str=None, **kwargs) -> None: + super(ContentLink, self).__init__(**kwargs) + self.uri = uri + self.content_hash = content_hash + self.version = version diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/content_source.py b/azure-mgmt-automation/azure/mgmt/automation/models/content_source.py new file mode 100644 index 000000000000..61a65f95f5a2 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/content_source.py @@ -0,0 +1,42 @@ +# 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 msrest.serialization import Model + + +class ContentSource(Model): + """Definition of the content source. + + :param hash: Gets or sets the hash. + :type hash: ~azure.mgmt.automation.models.ContentHash + :param type: Gets or sets the content source type. Possible values + include: 'embeddedContent', 'uri' + :type type: str or ~azure.mgmt.automation.models.ContentSourceType + :param value: Gets or sets the value of the content. This is based on the + content source type. + :type value: str + :param version: Gets or sets the version of the content. + :type version: str + """ + + _attribute_map = { + 'hash': {'key': 'hash', 'type': 'ContentHash'}, + 'type': {'key': 'type', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ContentSource, self).__init__(**kwargs) + self.hash = kwargs.get('hash', None) + self.type = kwargs.get('type', None) + self.value = kwargs.get('value', None) + self.version = kwargs.get('version', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/content_source_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/content_source_py3.py new file mode 100644 index 000000000000..5aadbc73bdd6 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/content_source_py3.py @@ -0,0 +1,42 @@ +# 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 msrest.serialization import Model + + +class ContentSource(Model): + """Definition of the content source. + + :param hash: Gets or sets the hash. + :type hash: ~azure.mgmt.automation.models.ContentHash + :param type: Gets or sets the content source type. Possible values + include: 'embeddedContent', 'uri' + :type type: str or ~azure.mgmt.automation.models.ContentSourceType + :param value: Gets or sets the value of the content. This is based on the + content source type. + :type value: str + :param version: Gets or sets the version of the content. + :type version: str + """ + + _attribute_map = { + 'hash': {'key': 'hash', 'type': 'ContentHash'}, + 'type': {'key': 'type', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__(self, *, hash=None, type=None, value: str=None, version: str=None, **kwargs) -> None: + super(ContentSource, self).__init__(**kwargs) + self.hash = hash + self.type = type + self.value = value + self.version = version diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/credential.py b/azure-mgmt-automation/azure/mgmt/automation/models/credential.py new file mode 100644 index 000000000000..8c42c6c20316 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/credential.py @@ -0,0 +1,61 @@ +# 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 .proxy_resource import ProxyResource + + +class Credential(ProxyResource): + """Definition of the credential. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar user_name: Gets the user name of the credential. + :vartype user_name: str + :ivar creation_time: Gets the creation time. + :vartype creation_time: datetime + :ivar last_modified_time: Gets the last modified time. + :vartype last_modified_time: datetime + :param description: Gets or sets the description. + :type description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'user_name': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'user_name': {'key': 'properties.userName', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Credential, self).__init__(**kwargs) + self.user_name = None + self.creation_time = None + self.last_modified_time = None + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/credential_create_or_update_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/credential_create_or_update_parameters.py new file mode 100644 index 000000000000..106d6a13e3f0 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/credential_create_or_update_parameters.py @@ -0,0 +1,48 @@ +# 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 msrest.serialization import Model + + +class CredentialCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update credential operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the name of the credential. + :type name: str + :param user_name: Required. Gets or sets the user name of the credential. + :type user_name: str + :param password: Required. Gets or sets the password of the credential. + :type password: str + :param description: Gets or sets the description of the credential. + :type description: str + """ + + _validation = { + 'name': {'required': True}, + 'user_name': {'required': True}, + 'password': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'user_name': {'key': 'properties.userName', 'type': 'str'}, + 'password': {'key': 'properties.password', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CredentialCreateOrUpdateParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.user_name = kwargs.get('user_name', None) + self.password = kwargs.get('password', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/credential_create_or_update_parameters_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/credential_create_or_update_parameters_py3.py new file mode 100644 index 000000000000..47fbde30495a --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/credential_create_or_update_parameters_py3.py @@ -0,0 +1,48 @@ +# 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 msrest.serialization import Model + + +class CredentialCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update credential operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the name of the credential. + :type name: str + :param user_name: Required. Gets or sets the user name of the credential. + :type user_name: str + :param password: Required. Gets or sets the password of the credential. + :type password: str + :param description: Gets or sets the description of the credential. + :type description: str + """ + + _validation = { + 'name': {'required': True}, + 'user_name': {'required': True}, + 'password': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'user_name': {'key': 'properties.userName', 'type': 'str'}, + 'password': {'key': 'properties.password', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, *, name: str, user_name: str, password: str, description: str=None, **kwargs) -> None: + super(CredentialCreateOrUpdateParameters, self).__init__(**kwargs) + self.name = name + self.user_name = user_name + self.password = password + self.description = description diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/credential_paged.py b/azure-mgmt-automation/azure/mgmt/automation/models/credential_paged.py new file mode 100644 index 000000000000..75c5d852da17 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/credential_paged.py @@ -0,0 +1,27 @@ +# 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 msrest.paging import Paged + + +class CredentialPaged(Paged): + """ + A paging container for iterating over a list of :class:`Credential ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Credential]'} + } + + def __init__(self, *args, **kwargs): + + super(CredentialPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/credential_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/credential_py3.py new file mode 100644 index 000000000000..6c25a446248a --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/credential_py3.py @@ -0,0 +1,61 @@ +# 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 .proxy_resource import ProxyResource + + +class Credential(ProxyResource): + """Definition of the credential. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar user_name: Gets the user name of the credential. + :vartype user_name: str + :ivar creation_time: Gets the creation time. + :vartype creation_time: datetime + :ivar last_modified_time: Gets the last modified time. + :vartype last_modified_time: datetime + :param description: Gets or sets the description. + :type description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'user_name': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'user_name': {'key': 'properties.userName', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, *, description: str=None, **kwargs) -> None: + super(Credential, self).__init__(**kwargs) + self.user_name = None + self.creation_time = None + self.last_modified_time = None + self.description = description diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/credential_update_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/credential_update_parameters.py new file mode 100644 index 000000000000..446e8b0b3434 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/credential_update_parameters.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class CredentialUpdateParameters(Model): + """The parameters supplied to the Update credential operation. + + :param name: Gets or sets the name of the credential. + :type name: str + :param user_name: Gets or sets the user name of the credential. + :type user_name: str + :param password: Gets or sets the password of the credential. + :type password: str + :param description: Gets or sets the description of the credential. + :type description: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'user_name': {'key': 'properties.userName', 'type': 'str'}, + 'password': {'key': 'properties.password', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CredentialUpdateParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.user_name = kwargs.get('user_name', None) + self.password = kwargs.get('password', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/credential_update_parameters_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/credential_update_parameters_py3.py new file mode 100644 index 000000000000..89e43f7fe7f1 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/credential_update_parameters_py3.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class CredentialUpdateParameters(Model): + """The parameters supplied to the Update credential operation. + + :param name: Gets or sets the name of the credential. + :type name: str + :param user_name: Gets or sets the user name of the credential. + :type user_name: str + :param password: Gets or sets the password of the credential. + :type password: str + :param description: Gets or sets the description of the credential. + :type description: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'user_name': {'key': 'properties.userName', 'type': 'str'}, + 'password': {'key': 'properties.password', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, user_name: str=None, password: str=None, description: str=None, **kwargs) -> None: + super(CredentialUpdateParameters, self).__init__(**kwargs) + self.name = name + self.user_name = user_name + self.password = password + self.description = description diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_compilation_job.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_compilation_job.py new file mode 100644 index 000000000000..204e7702b6db --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_compilation_job.py @@ -0,0 +1,113 @@ +# 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 .proxy_resource import ProxyResource + + +class DscCompilationJob(ProxyResource): + """Definition of the Dsc Compilation 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 + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param configuration: Gets or sets the configuration. + :type configuration: + ~azure.mgmt.automation.models.DscConfigurationAssociationProperty + :ivar started_by: Gets the compilation job started by. + :vartype started_by: str + :ivar job_id: Gets the id of the job. + :vartype job_id: str + :ivar creation_time: Gets the creation time of the job. + :vartype creation_time: datetime + :param provisioning_state: The current provisioning state of the job. + :type provisioning_state: + ~azure.mgmt.automation.models.JobProvisioningStateProperty + :param run_on: Gets or sets the runOn which specifies the group name where + the job is to be executed. + :type run_on: str + :param status: Gets or sets the status of the job. Possible values + include: 'New', 'Activating', 'Running', 'Completed', 'Failed', 'Stopped', + 'Blocked', 'Suspended', 'Disconnected', 'Suspending', 'Stopping', + 'Resuming', 'Removing' + :type status: str or ~azure.mgmt.automation.models.JobStatus + :param status_details: Gets or sets the status details of the job. + :type status_details: str + :ivar start_time: Gets the start time of the job. + :vartype start_time: datetime + :ivar end_time: Gets the end time of the job. + :vartype end_time: datetime + :ivar exception: Gets the exception of the job. + :vartype exception: str + :ivar last_modified_time: Gets the last modified time of the job. + :vartype last_modified_time: datetime + :ivar last_status_modified_time: Gets the last status modified time of the + job. + :vartype last_status_modified_time: datetime + :param parameters: Gets or sets the parameters of the job. + :type parameters: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'started_by': {'readonly': True}, + 'job_id': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'exception': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'last_status_modified_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'configuration': {'key': 'properties.configuration', 'type': 'DscConfigurationAssociationProperty'}, + 'started_by': {'key': 'properties.startedBy', 'type': 'str'}, + 'job_id': {'key': 'properties.jobId', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'JobProvisioningStateProperty'}, + 'run_on': {'key': 'properties.runOn', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'status_details': {'key': 'properties.statusDetails', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'exception': {'key': 'properties.exception', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'last_status_modified_time': {'key': 'properties.lastStatusModifiedTime', 'type': 'iso-8601'}, + 'parameters': {'key': 'properties.parameters', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(DscCompilationJob, self).__init__(**kwargs) + self.configuration = kwargs.get('configuration', None) + self.started_by = None + self.job_id = None + self.creation_time = None + self.provisioning_state = kwargs.get('provisioning_state', None) + self.run_on = kwargs.get('run_on', None) + self.status = kwargs.get('status', None) + self.status_details = kwargs.get('status_details', None) + self.start_time = None + self.end_time = None + self.exception = None + self.last_modified_time = None + self.last_status_modified_time = None + self.parameters = kwargs.get('parameters', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_compilation_job_create_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_compilation_job_create_parameters.py new file mode 100644 index 000000000000..8a483c0c500d --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_compilation_job_create_parameters.py @@ -0,0 +1,56 @@ +# 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 msrest.serialization import Model + + +class DscCompilationJobCreateParameters(Model): + """The parameters supplied to the create compilation job operation. + + All required parameters must be populated in order to send to Azure. + + :param configuration: Required. Gets or sets the configuration. + :type configuration: + ~azure.mgmt.automation.models.DscConfigurationAssociationProperty + :param parameters: Gets or sets the parameters of the job. + :type parameters: dict[str, str] + :param new_node_configuration_build_version_required: If a new build + version of NodeConfiguration is required. + :type new_node_configuration_build_version_required: bool + :param name: Gets or sets name of the resource. + :type name: str + :param location: Gets or sets the location of the resource. + :type location: str + :param tags: Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + """ + + _validation = { + 'configuration': {'required': True}, + } + + _attribute_map = { + 'configuration': {'key': 'properties.configuration', 'type': 'DscConfigurationAssociationProperty'}, + 'parameters': {'key': 'properties.parameters', 'type': '{str}'}, + 'new_node_configuration_build_version_required': {'key': 'properties.newNodeConfigurationBuildVersionRequired', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(DscCompilationJobCreateParameters, self).__init__(**kwargs) + self.configuration = kwargs.get('configuration', None) + self.parameters = kwargs.get('parameters', None) + self.new_node_configuration_build_version_required = kwargs.get('new_node_configuration_build_version_required', None) + self.name = kwargs.get('name', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_compilation_job_create_parameters_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_compilation_job_create_parameters_py3.py new file mode 100644 index 000000000000..2dc97d80d39b --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_compilation_job_create_parameters_py3.py @@ -0,0 +1,56 @@ +# 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 msrest.serialization import Model + + +class DscCompilationJobCreateParameters(Model): + """The parameters supplied to the create compilation job operation. + + All required parameters must be populated in order to send to Azure. + + :param configuration: Required. Gets or sets the configuration. + :type configuration: + ~azure.mgmt.automation.models.DscConfigurationAssociationProperty + :param parameters: Gets or sets the parameters of the job. + :type parameters: dict[str, str] + :param new_node_configuration_build_version_required: If a new build + version of NodeConfiguration is required. + :type new_node_configuration_build_version_required: bool + :param name: Gets or sets name of the resource. + :type name: str + :param location: Gets or sets the location of the resource. + :type location: str + :param tags: Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + """ + + _validation = { + 'configuration': {'required': True}, + } + + _attribute_map = { + 'configuration': {'key': 'properties.configuration', 'type': 'DscConfigurationAssociationProperty'}, + 'parameters': {'key': 'properties.parameters', 'type': '{str}'}, + 'new_node_configuration_build_version_required': {'key': 'properties.newNodeConfigurationBuildVersionRequired', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, configuration, parameters=None, new_node_configuration_build_version_required: bool=None, name: str=None, location: str=None, tags=None, **kwargs) -> None: + super(DscCompilationJobCreateParameters, self).__init__(**kwargs) + self.configuration = configuration + self.parameters = parameters + self.new_node_configuration_build_version_required = new_node_configuration_build_version_required + self.name = name + self.location = location + self.tags = tags diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_compilation_job_paged.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_compilation_job_paged.py new file mode 100644 index 000000000000..78ab64c92a77 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_compilation_job_paged.py @@ -0,0 +1,27 @@ +# 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 msrest.paging import Paged + + +class DscCompilationJobPaged(Paged): + """ + A paging container for iterating over a list of :class:`DscCompilationJob ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DscCompilationJob]'} + } + + def __init__(self, *args, **kwargs): + + super(DscCompilationJobPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_compilation_job_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_compilation_job_py3.py new file mode 100644 index 000000000000..fa095f3e9371 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_compilation_job_py3.py @@ -0,0 +1,113 @@ +# 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 .proxy_resource import ProxyResource + + +class DscCompilationJob(ProxyResource): + """Definition of the Dsc Compilation 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 + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param configuration: Gets or sets the configuration. + :type configuration: + ~azure.mgmt.automation.models.DscConfigurationAssociationProperty + :ivar started_by: Gets the compilation job started by. + :vartype started_by: str + :ivar job_id: Gets the id of the job. + :vartype job_id: str + :ivar creation_time: Gets the creation time of the job. + :vartype creation_time: datetime + :param provisioning_state: The current provisioning state of the job. + :type provisioning_state: + ~azure.mgmt.automation.models.JobProvisioningStateProperty + :param run_on: Gets or sets the runOn which specifies the group name where + the job is to be executed. + :type run_on: str + :param status: Gets or sets the status of the job. Possible values + include: 'New', 'Activating', 'Running', 'Completed', 'Failed', 'Stopped', + 'Blocked', 'Suspended', 'Disconnected', 'Suspending', 'Stopping', + 'Resuming', 'Removing' + :type status: str or ~azure.mgmt.automation.models.JobStatus + :param status_details: Gets or sets the status details of the job. + :type status_details: str + :ivar start_time: Gets the start time of the job. + :vartype start_time: datetime + :ivar end_time: Gets the end time of the job. + :vartype end_time: datetime + :ivar exception: Gets the exception of the job. + :vartype exception: str + :ivar last_modified_time: Gets the last modified time of the job. + :vartype last_modified_time: datetime + :ivar last_status_modified_time: Gets the last status modified time of the + job. + :vartype last_status_modified_time: datetime + :param parameters: Gets or sets the parameters of the job. + :type parameters: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'started_by': {'readonly': True}, + 'job_id': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'exception': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'last_status_modified_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'configuration': {'key': 'properties.configuration', 'type': 'DscConfigurationAssociationProperty'}, + 'started_by': {'key': 'properties.startedBy', 'type': 'str'}, + 'job_id': {'key': 'properties.jobId', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'JobProvisioningStateProperty'}, + 'run_on': {'key': 'properties.runOn', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'status_details': {'key': 'properties.statusDetails', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'exception': {'key': 'properties.exception', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'last_status_modified_time': {'key': 'properties.lastStatusModifiedTime', 'type': 'iso-8601'}, + 'parameters': {'key': 'properties.parameters', 'type': '{str}'}, + } + + def __init__(self, *, configuration=None, provisioning_state=None, run_on: str=None, status=None, status_details: str=None, parameters=None, **kwargs) -> None: + super(DscCompilationJob, self).__init__(**kwargs) + self.configuration = configuration + self.started_by = None + self.job_id = None + self.creation_time = None + self.provisioning_state = provisioning_state + self.run_on = run_on + self.status = status + self.status_details = status_details + self.start_time = None + self.end_time = None + self.exception = None + self.last_modified_time = None + self.last_status_modified_time = None + self.parameters = parameters diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_configuration.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_configuration.py new file mode 100644 index 000000000000..3fd5a6455f7d --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_configuration.py @@ -0,0 +1,92 @@ +# 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 .tracked_resource import TrackedResource + + +class DscConfiguration(TrackedResource): + """Definition of the configuration type. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: The Azure Region where the resource lives + :type location: str + :param provisioning_state: Gets or sets the provisioning state of the + configuration. Possible values include: 'Succeeded' + :type provisioning_state: str or + ~azure.mgmt.automation.models.DscConfigurationProvisioningState + :param job_count: Gets or sets the job count of the configuration. + :type job_count: int + :param parameters: Gets or sets the configuration parameters. + :type parameters: dict[str, + ~azure.mgmt.automation.models.DscConfigurationParameter] + :param source: Gets or sets the source. + :type source: ~azure.mgmt.automation.models.ContentSource + :param state: Gets or sets the state of the configuration. Possible values + include: 'New', 'Edit', 'Published' + :type state: str or ~azure.mgmt.automation.models.DscConfigurationState + :param log_verbose: Gets or sets verbose log option. + :type log_verbose: bool + :param creation_time: Gets or sets the creation time. + :type creation_time: datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: datetime + :param description: Gets or sets the description. + :type description: str + :param etag: Gets or sets the etag of the resource. + :type etag: str + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'DscConfigurationProvisioningState'}, + 'job_count': {'key': 'properties.jobCount', 'type': 'int'}, + 'parameters': {'key': 'properties.parameters', 'type': '{DscConfigurationParameter}'}, + 'source': {'key': 'properties.source', 'type': 'ContentSource'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'log_verbose': {'key': 'properties.logVerbose', 'type': 'bool'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DscConfiguration, self).__init__(**kwargs) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.job_count = kwargs.get('job_count', None) + self.parameters = kwargs.get('parameters', None) + self.source = kwargs.get('source', None) + self.state = kwargs.get('state', None) + self.log_verbose = kwargs.get('log_verbose', None) + self.creation_time = kwargs.get('creation_time', None) + self.last_modified_time = kwargs.get('last_modified_time', None) + self.description = kwargs.get('description', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_configuration_association_property.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_configuration_association_property.py new file mode 100644 index 000000000000..ed27f8bc210b --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_configuration_association_property.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class DscConfigurationAssociationProperty(Model): + """The Dsc configuration property associated with the entity. + + :param name: Gets or sets the name of the Dsc configuration. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DscConfigurationAssociationProperty, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_configuration_association_property_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_configuration_association_property_py3.py new file mode 100644 index 000000000000..5448692e606a --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_configuration_association_property_py3.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class DscConfigurationAssociationProperty(Model): + """The Dsc configuration property associated with the entity. + + :param name: Gets or sets the name of the Dsc configuration. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, **kwargs) -> None: + super(DscConfigurationAssociationProperty, self).__init__(**kwargs) + self.name = name diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_configuration_create_or_update_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_configuration_create_or_update_parameters.py new file mode 100644 index 000000000000..0d36e301c6bf --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_configuration_create_or_update_parameters.py @@ -0,0 +1,63 @@ +# 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 msrest.serialization import Model + + +class DscConfigurationCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update configuration operation. + + All required parameters must be populated in order to send to Azure. + + :param log_verbose: Gets or sets verbose log option. + :type log_verbose: bool + :param log_progress: Gets or sets progress log option. + :type log_progress: bool + :param source: Required. Gets or sets the source. + :type source: ~azure.mgmt.automation.models.ContentSource + :param parameters: Gets or sets the configuration parameters. + :type parameters: dict[str, + ~azure.mgmt.automation.models.DscConfigurationParameter] + :param description: Gets or sets the description of the configuration. + :type description: str + :param name: Gets or sets name of the resource. + :type name: str + :param location: Gets or sets the location of the resource. + :type location: str + :param tags: Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + """ + + _validation = { + 'source': {'required': True}, + } + + _attribute_map = { + 'log_verbose': {'key': 'properties.logVerbose', 'type': 'bool'}, + 'log_progress': {'key': 'properties.logProgress', 'type': 'bool'}, + 'source': {'key': 'properties.source', 'type': 'ContentSource'}, + 'parameters': {'key': 'properties.parameters', 'type': '{DscConfigurationParameter}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(DscConfigurationCreateOrUpdateParameters, self).__init__(**kwargs) + self.log_verbose = kwargs.get('log_verbose', None) + self.log_progress = kwargs.get('log_progress', None) + self.source = kwargs.get('source', None) + self.parameters = kwargs.get('parameters', None) + self.description = kwargs.get('description', None) + self.name = kwargs.get('name', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_configuration_create_or_update_parameters_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_configuration_create_or_update_parameters_py3.py new file mode 100644 index 000000000000..9a23f4165100 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_configuration_create_or_update_parameters_py3.py @@ -0,0 +1,63 @@ +# 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 msrest.serialization import Model + + +class DscConfigurationCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update configuration operation. + + All required parameters must be populated in order to send to Azure. + + :param log_verbose: Gets or sets verbose log option. + :type log_verbose: bool + :param log_progress: Gets or sets progress log option. + :type log_progress: bool + :param source: Required. Gets or sets the source. + :type source: ~azure.mgmt.automation.models.ContentSource + :param parameters: Gets or sets the configuration parameters. + :type parameters: dict[str, + ~azure.mgmt.automation.models.DscConfigurationParameter] + :param description: Gets or sets the description of the configuration. + :type description: str + :param name: Gets or sets name of the resource. + :type name: str + :param location: Gets or sets the location of the resource. + :type location: str + :param tags: Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + """ + + _validation = { + 'source': {'required': True}, + } + + _attribute_map = { + 'log_verbose': {'key': 'properties.logVerbose', 'type': 'bool'}, + 'log_progress': {'key': 'properties.logProgress', 'type': 'bool'}, + 'source': {'key': 'properties.source', 'type': 'ContentSource'}, + 'parameters': {'key': 'properties.parameters', 'type': '{DscConfigurationParameter}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, source, log_verbose: bool=None, log_progress: bool=None, parameters=None, description: str=None, name: str=None, location: str=None, tags=None, **kwargs) -> None: + super(DscConfigurationCreateOrUpdateParameters, self).__init__(**kwargs) + self.log_verbose = log_verbose + self.log_progress = log_progress + self.source = source + self.parameters = parameters + self.description = description + self.name = name + self.location = location + self.tags = tags diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_configuration_paged.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_configuration_paged.py new file mode 100644 index 000000000000..ff3e9a25d1d5 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_configuration_paged.py @@ -0,0 +1,27 @@ +# 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 msrest.paging import Paged + + +class DscConfigurationPaged(Paged): + """ + A paging container for iterating over a list of :class:`DscConfiguration ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DscConfiguration]'} + } + + def __init__(self, *args, **kwargs): + + super(DscConfigurationPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_configuration_parameter.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_configuration_parameter.py new file mode 100644 index 000000000000..d0ed65916ece --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_configuration_parameter.py @@ -0,0 +1,41 @@ +# 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 msrest.serialization import Model + + +class DscConfigurationParameter(Model): + """Definition of the configuration parameter type. + + :param type: Gets or sets the type of the parameter. + :type type: str + :param is_mandatory: Gets or sets a Boolean value to indicate whether the + parameter is madatory or not. + :type is_mandatory: bool + :param position: Get or sets the position of the parameter. + :type position: int + :param default_value: Gets or sets the default value of parameter. + :type default_value: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'is_mandatory': {'key': 'isMandatory', 'type': 'bool'}, + 'position': {'key': 'position', 'type': 'int'}, + 'default_value': {'key': 'defaultValue', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DscConfigurationParameter, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.is_mandatory = kwargs.get('is_mandatory', None) + self.position = kwargs.get('position', None) + self.default_value = kwargs.get('default_value', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_configuration_parameter_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_configuration_parameter_py3.py new file mode 100644 index 000000000000..bcf23c5be99d --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_configuration_parameter_py3.py @@ -0,0 +1,41 @@ +# 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 msrest.serialization import Model + + +class DscConfigurationParameter(Model): + """Definition of the configuration parameter type. + + :param type: Gets or sets the type of the parameter. + :type type: str + :param is_mandatory: Gets or sets a Boolean value to indicate whether the + parameter is madatory or not. + :type is_mandatory: bool + :param position: Get or sets the position of the parameter. + :type position: int + :param default_value: Gets or sets the default value of parameter. + :type default_value: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'is_mandatory': {'key': 'isMandatory', 'type': 'bool'}, + 'position': {'key': 'position', 'type': 'int'}, + 'default_value': {'key': 'defaultValue', 'type': 'str'}, + } + + def __init__(self, *, type: str=None, is_mandatory: bool=None, position: int=None, default_value: str=None, **kwargs) -> None: + super(DscConfigurationParameter, self).__init__(**kwargs) + self.type = type + self.is_mandatory = is_mandatory + self.position = position + self.default_value = default_value diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_configuration_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_configuration_py3.py new file mode 100644 index 000000000000..18e781b4e092 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_configuration_py3.py @@ -0,0 +1,92 @@ +# 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 .tracked_resource import TrackedResource + + +class DscConfiguration(TrackedResource): + """Definition of the configuration type. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: The Azure Region where the resource lives + :type location: str + :param provisioning_state: Gets or sets the provisioning state of the + configuration. Possible values include: 'Succeeded' + :type provisioning_state: str or + ~azure.mgmt.automation.models.DscConfigurationProvisioningState + :param job_count: Gets or sets the job count of the configuration. + :type job_count: int + :param parameters: Gets or sets the configuration parameters. + :type parameters: dict[str, + ~azure.mgmt.automation.models.DscConfigurationParameter] + :param source: Gets or sets the source. + :type source: ~azure.mgmt.automation.models.ContentSource + :param state: Gets or sets the state of the configuration. Possible values + include: 'New', 'Edit', 'Published' + :type state: str or ~azure.mgmt.automation.models.DscConfigurationState + :param log_verbose: Gets or sets verbose log option. + :type log_verbose: bool + :param creation_time: Gets or sets the creation time. + :type creation_time: datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: datetime + :param description: Gets or sets the description. + :type description: str + :param etag: Gets or sets the etag of the resource. + :type etag: str + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'DscConfigurationProvisioningState'}, + 'job_count': {'key': 'properties.jobCount', 'type': 'int'}, + 'parameters': {'key': 'properties.parameters', 'type': '{DscConfigurationParameter}'}, + 'source': {'key': 'properties.source', 'type': 'ContentSource'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'log_verbose': {'key': 'properties.logVerbose', 'type': 'bool'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, tags=None, location: str=None, provisioning_state=None, job_count: int=None, parameters=None, source=None, state=None, log_verbose: bool=None, creation_time=None, last_modified_time=None, description: str=None, etag: str=None, **kwargs) -> None: + super(DscConfiguration, self).__init__(tags=tags, location=location, **kwargs) + self.provisioning_state = provisioning_state + self.job_count = job_count + self.parameters = parameters + self.source = source + self.state = state + self.log_verbose = log_verbose + self.creation_time = creation_time + self.last_modified_time = last_modified_time + self.description = description + self.etag = etag diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_configuration_update_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_configuration_update_parameters.py new file mode 100644 index 000000000000..f08262a4cef2 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_configuration_update_parameters.py @@ -0,0 +1,59 @@ +# 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 msrest.serialization import Model + + +class DscConfigurationUpdateParameters(Model): + """The parameters supplied to the create or update configuration operation. + + All required parameters must be populated in order to send to Azure. + + :param log_verbose: Gets or sets verbose log option. + :type log_verbose: bool + :param log_progress: Gets or sets progress log option. + :type log_progress: bool + :param source: Required. Gets or sets the source. + :type source: ~azure.mgmt.automation.models.ContentSource + :param parameters: Gets or sets the configuration parameters. + :type parameters: dict[str, + ~azure.mgmt.automation.models.DscConfigurationParameter] + :param description: Gets or sets the description of the configuration. + :type description: str + :param name: Gets or sets name of the resource. + :type name: str + :param tags: Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + """ + + _validation = { + 'source': {'required': True}, + } + + _attribute_map = { + 'log_verbose': {'key': 'properties.logVerbose', 'type': 'bool'}, + 'log_progress': {'key': 'properties.logProgress', 'type': 'bool'}, + 'source': {'key': 'properties.source', 'type': 'ContentSource'}, + 'parameters': {'key': 'properties.parameters', 'type': '{DscConfigurationParameter}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(DscConfigurationUpdateParameters, self).__init__(**kwargs) + self.log_verbose = kwargs.get('log_verbose', None) + self.log_progress = kwargs.get('log_progress', None) + self.source = kwargs.get('source', None) + self.parameters = kwargs.get('parameters', None) + self.description = kwargs.get('description', None) + self.name = kwargs.get('name', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_configuration_update_parameters_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_configuration_update_parameters_py3.py new file mode 100644 index 000000000000..aef0b805aedf --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_configuration_update_parameters_py3.py @@ -0,0 +1,59 @@ +# 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 msrest.serialization import Model + + +class DscConfigurationUpdateParameters(Model): + """The parameters supplied to the create or update configuration operation. + + All required parameters must be populated in order to send to Azure. + + :param log_verbose: Gets or sets verbose log option. + :type log_verbose: bool + :param log_progress: Gets or sets progress log option. + :type log_progress: bool + :param source: Required. Gets or sets the source. + :type source: ~azure.mgmt.automation.models.ContentSource + :param parameters: Gets or sets the configuration parameters. + :type parameters: dict[str, + ~azure.mgmt.automation.models.DscConfigurationParameter] + :param description: Gets or sets the description of the configuration. + :type description: str + :param name: Gets or sets name of the resource. + :type name: str + :param tags: Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + """ + + _validation = { + 'source': {'required': True}, + } + + _attribute_map = { + 'log_verbose': {'key': 'properties.logVerbose', 'type': 'bool'}, + 'log_progress': {'key': 'properties.logProgress', 'type': 'bool'}, + 'source': {'key': 'properties.source', 'type': 'ContentSource'}, + 'parameters': {'key': 'properties.parameters', 'type': '{DscConfigurationParameter}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, source, log_verbose: bool=None, log_progress: bool=None, parameters=None, description: str=None, name: str=None, tags=None, **kwargs) -> None: + super(DscConfigurationUpdateParameters, self).__init__(**kwargs) + self.log_verbose = log_verbose + self.log_progress = log_progress + self.source = source + self.parameters = parameters + self.description = description + self.name = name + self.tags = tags diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_meta_configuration.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_meta_configuration.py new file mode 100644 index 000000000000..b47748f4082b --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_meta_configuration.py @@ -0,0 +1,59 @@ +# 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 msrest.serialization import Model + + +class DscMetaConfiguration(Model): + """Definition of the DSC Meta Configuration. + + :param configuration_mode_frequency_mins: Gets or sets the + ConfigurationModeFrequencyMins value of the meta configuration. + :type configuration_mode_frequency_mins: int + :param reboot_node_if_needed: Gets or sets the RebootNodeIfNeeded value of + the meta configuration. + :type reboot_node_if_needed: bool + :param configuration_mode: Gets or sets the ConfigurationMode value of the + meta configuration. + :type configuration_mode: str + :param action_after_reboot: Gets or sets the ActionAfterReboot value of + the meta configuration. + :type action_after_reboot: str + :param certificate_id: Gets or sets the CertificateId value of the meta + configuration. + :type certificate_id: str + :param refresh_frequency_mins: Gets or sets the RefreshFrequencyMins value + of the meta configuration. + :type refresh_frequency_mins: int + :param allow_module_overwrite: Gets or sets the AllowModuleOverwrite value + of the meta configuration. + :type allow_module_overwrite: bool + """ + + _attribute_map = { + 'configuration_mode_frequency_mins': {'key': 'configurationModeFrequencyMins', 'type': 'int'}, + 'reboot_node_if_needed': {'key': 'rebootNodeIfNeeded', 'type': 'bool'}, + 'configuration_mode': {'key': 'configurationMode', 'type': 'str'}, + 'action_after_reboot': {'key': 'actionAfterReboot', 'type': 'str'}, + 'certificate_id': {'key': 'certificateId', 'type': 'str'}, + 'refresh_frequency_mins': {'key': 'refreshFrequencyMins', 'type': 'int'}, + 'allow_module_overwrite': {'key': 'allowModuleOverwrite', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(DscMetaConfiguration, self).__init__(**kwargs) + self.configuration_mode_frequency_mins = kwargs.get('configuration_mode_frequency_mins', None) + self.reboot_node_if_needed = kwargs.get('reboot_node_if_needed', None) + self.configuration_mode = kwargs.get('configuration_mode', None) + self.action_after_reboot = kwargs.get('action_after_reboot', None) + self.certificate_id = kwargs.get('certificate_id', None) + self.refresh_frequency_mins = kwargs.get('refresh_frequency_mins', None) + self.allow_module_overwrite = kwargs.get('allow_module_overwrite', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_meta_configuration_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_meta_configuration_py3.py new file mode 100644 index 000000000000..2a0260494f5c --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_meta_configuration_py3.py @@ -0,0 +1,59 @@ +# 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 msrest.serialization import Model + + +class DscMetaConfiguration(Model): + """Definition of the DSC Meta Configuration. + + :param configuration_mode_frequency_mins: Gets or sets the + ConfigurationModeFrequencyMins value of the meta configuration. + :type configuration_mode_frequency_mins: int + :param reboot_node_if_needed: Gets or sets the RebootNodeIfNeeded value of + the meta configuration. + :type reboot_node_if_needed: bool + :param configuration_mode: Gets or sets the ConfigurationMode value of the + meta configuration. + :type configuration_mode: str + :param action_after_reboot: Gets or sets the ActionAfterReboot value of + the meta configuration. + :type action_after_reboot: str + :param certificate_id: Gets or sets the CertificateId value of the meta + configuration. + :type certificate_id: str + :param refresh_frequency_mins: Gets or sets the RefreshFrequencyMins value + of the meta configuration. + :type refresh_frequency_mins: int + :param allow_module_overwrite: Gets or sets the AllowModuleOverwrite value + of the meta configuration. + :type allow_module_overwrite: bool + """ + + _attribute_map = { + 'configuration_mode_frequency_mins': {'key': 'configurationModeFrequencyMins', 'type': 'int'}, + 'reboot_node_if_needed': {'key': 'rebootNodeIfNeeded', 'type': 'bool'}, + 'configuration_mode': {'key': 'configurationMode', 'type': 'str'}, + 'action_after_reboot': {'key': 'actionAfterReboot', 'type': 'str'}, + 'certificate_id': {'key': 'certificateId', 'type': 'str'}, + 'refresh_frequency_mins': {'key': 'refreshFrequencyMins', 'type': 'int'}, + 'allow_module_overwrite': {'key': 'allowModuleOverwrite', 'type': 'bool'}, + } + + def __init__(self, *, configuration_mode_frequency_mins: int=None, reboot_node_if_needed: bool=None, configuration_mode: str=None, action_after_reboot: str=None, certificate_id: str=None, refresh_frequency_mins: int=None, allow_module_overwrite: bool=None, **kwargs) -> None: + super(DscMetaConfiguration, self).__init__(**kwargs) + self.configuration_mode_frequency_mins = configuration_mode_frequency_mins + self.reboot_node_if_needed = reboot_node_if_needed + self.configuration_mode = configuration_mode + self.action_after_reboot = action_after_reboot + self.certificate_id = certificate_id + self.refresh_frequency_mins = refresh_frequency_mins + self.allow_module_overwrite = allow_module_overwrite diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node.py new file mode 100644 index 000000000000..5a38248bac52 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node.py @@ -0,0 +1,80 @@ +# 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 .proxy_resource import ProxyResource + + +class DscNode(ProxyResource): + """Definition of a DscNode. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param last_seen: Gets or sets the last seen time of the node. + :type last_seen: datetime + :param registration_time: Gets or sets the registration time of the node. + :type registration_time: datetime + :param ip: Gets or sets the ip of the node. + :type ip: str + :param account_id: Gets or sets the account id of the node. + :type account_id: str + :param dsc_node_name: Gets or sets the name of the dsc nodeconfiguration. + :type dsc_node_name: str + :param status: Gets or sets the status of the node. + :type status: str + :param node_id: Gets or sets the node id. + :type node_id: str + :param etag: Gets or sets the etag of the resource. + :type etag: str + :param extension_handler: Gets or sets the list of extensionHandler + properties for a Node. + :type extension_handler: + list[~azure.mgmt.automation.models.DscNodeExtensionHandlerAssociationProperty] + """ + + _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'}, + 'last_seen': {'key': 'properties.lastSeen', 'type': 'iso-8601'}, + 'registration_time': {'key': 'properties.registrationTime', 'type': 'iso-8601'}, + 'ip': {'key': 'properties.ip', 'type': 'str'}, + 'account_id': {'key': 'properties.accountId', 'type': 'str'}, + 'dsc_node_name': {'key': 'properties.nodeConfiguration.name', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'node_id': {'key': 'properties.nodeId', 'type': 'str'}, + 'etag': {'key': 'properties.etag', 'type': 'str'}, + 'extension_handler': {'key': 'properties.extensionHandler', 'type': '[DscNodeExtensionHandlerAssociationProperty]'}, + } + + def __init__(self, **kwargs): + super(DscNode, self).__init__(**kwargs) + self.last_seen = kwargs.get('last_seen', None) + self.registration_time = kwargs.get('registration_time', None) + self.ip = kwargs.get('ip', None) + self.account_id = kwargs.get('account_id', None) + self.dsc_node_name = kwargs.get('dsc_node_name', None) + self.status = kwargs.get('status', None) + self.node_id = kwargs.get('node_id', None) + self.etag = kwargs.get('etag', None) + self.extension_handler = kwargs.get('extension_handler', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_configuration.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_configuration.py new file mode 100644 index 000000000000..5e5a0c936c3d --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_configuration.py @@ -0,0 +1,68 @@ +# 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 .proxy_resource import ProxyResource + + +class DscNodeConfiguration(ProxyResource): + """Definition of the dsc node configuration. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: datetime + :param creation_time: Gets or sets creation time. + :type creation_time: datetime + :param configuration: Gets or sets the configuration of the node. + :type configuration: + ~azure.mgmt.automation.models.DscConfigurationAssociationProperty + :param source: Source of node configuration. + :type source: str + :param node_count: Number of nodes with this nodeconfiguration assigned + :type node_count: long + :param increment_node_configuration_build: If a new build version of + NodeConfiguration is required. + :type increment_node_configuration_build: bool + """ + + _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'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'configuration': {'key': 'properties.configuration', 'type': 'DscConfigurationAssociationProperty'}, + 'source': {'key': 'properties.source', 'type': 'str'}, + 'node_count': {'key': 'properties.nodeCount', 'type': 'long'}, + 'increment_node_configuration_build': {'key': 'properties.incrementNodeConfigurationBuild', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(DscNodeConfiguration, self).__init__(**kwargs) + self.last_modified_time = kwargs.get('last_modified_time', None) + self.creation_time = kwargs.get('creation_time', None) + self.configuration = kwargs.get('configuration', None) + self.source = kwargs.get('source', None) + self.node_count = kwargs.get('node_count', None) + self.increment_node_configuration_build = kwargs.get('increment_node_configuration_build', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_configuration_association_property.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_configuration_association_property.py new file mode 100644 index 000000000000..1ad015dfc35b --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_configuration_association_property.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class DscNodeConfigurationAssociationProperty(Model): + """The dsc nodeconfiguration property associated with the entity. + + :param name: Gets or sets the name of the dsc nodeconfiguration. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DscNodeConfigurationAssociationProperty, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_configuration_association_property_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_configuration_association_property_py3.py new file mode 100644 index 000000000000..8559002fa31a --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_configuration_association_property_py3.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class DscNodeConfigurationAssociationProperty(Model): + """The dsc nodeconfiguration property associated with the entity. + + :param name: Gets or sets the name of the dsc nodeconfiguration. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, **kwargs) -> None: + super(DscNodeConfigurationAssociationProperty, self).__init__(**kwargs) + self.name = name diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_configuration_create_or_update_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_configuration_create_or_update_parameters.py new file mode 100644 index 000000000000..c3900d83643b --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_configuration_create_or_update_parameters.py @@ -0,0 +1,78 @@ +# 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 msrest.serialization import Model + + +class DscNodeConfigurationCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update node configuration + operation. + + All required parameters must be populated in order to send to Azure. + + :param source: Required. Gets or sets the source. + :type source: ~azure.mgmt.automation.models.ContentSource + :param name: Required. Name of the node configuration. + :type name: str + :param configuration: Required. Gets or sets the configuration of the + node. + :type configuration: + ~azure.mgmt.automation.models.DscConfigurationAssociationProperty + :param new_node_configuration_build_version_required: If a new build + version of NodeConfiguration is required. + :type new_node_configuration_build_version_required: bool + :param source1: Required. Gets or sets the source. + :type source1: ~azure.mgmt.automation.models.ContentSource + :param name1: Required. Gets or sets the type of the parameter. + :type name1: str + :param configuration1: Required. Gets or sets the configuration of the + node. + :type configuration1: + ~azure.mgmt.automation.models.DscConfigurationAssociationProperty + :param increment_node_configuration_build: If a new build version of + NodeConfiguration is required. + :type increment_node_configuration_build: bool + :param tags: Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + """ + + _validation = { + 'source': {'required': True}, + 'name': {'required': True}, + 'configuration': {'required': True}, + 'source1': {'required': True}, + 'name1': {'required': True}, + 'configuration1': {'required': True}, + } + + _attribute_map = { + 'source': {'key': 'source', 'type': 'ContentSource'}, + 'name': {'key': 'name', 'type': 'str'}, + 'configuration': {'key': 'configuration', 'type': 'DscConfigurationAssociationProperty'}, + 'new_node_configuration_build_version_required': {'key': 'newNodeConfigurationBuildVersionRequired', 'type': 'bool'}, + 'source1': {'key': 'properties.source', 'type': 'ContentSource'}, + 'name1': {'key': 'properties.name', 'type': 'str'}, + 'configuration1': {'key': 'properties.configuration', 'type': 'DscConfigurationAssociationProperty'}, + 'increment_node_configuration_build': {'key': 'properties.incrementNodeConfigurationBuild', 'type': 'bool'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(DscNodeConfigurationCreateOrUpdateParameters, self).__init__(**kwargs) + self.source = kwargs.get('source', None) + self.name = kwargs.get('name', None) + self.configuration = kwargs.get('configuration', None) + self.new_node_configuration_build_version_required = kwargs.get('new_node_configuration_build_version_required', None) + self.source1 = kwargs.get('source1', None) + self.name1 = kwargs.get('name1', None) + self.configuration1 = kwargs.get('configuration1', None) + self.increment_node_configuration_build = kwargs.get('increment_node_configuration_build', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_configuration_create_or_update_parameters_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_configuration_create_or_update_parameters_py3.py new file mode 100644 index 000000000000..c881ec2ff209 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_configuration_create_or_update_parameters_py3.py @@ -0,0 +1,78 @@ +# 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 msrest.serialization import Model + + +class DscNodeConfigurationCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update node configuration + operation. + + All required parameters must be populated in order to send to Azure. + + :param source: Required. Gets or sets the source. + :type source: ~azure.mgmt.automation.models.ContentSource + :param name: Required. Name of the node configuration. + :type name: str + :param configuration: Required. Gets or sets the configuration of the + node. + :type configuration: + ~azure.mgmt.automation.models.DscConfigurationAssociationProperty + :param new_node_configuration_build_version_required: If a new build + version of NodeConfiguration is required. + :type new_node_configuration_build_version_required: bool + :param source1: Required. Gets or sets the source. + :type source1: ~azure.mgmt.automation.models.ContentSource + :param name1: Required. Gets or sets the type of the parameter. + :type name1: str + :param configuration1: Required. Gets or sets the configuration of the + node. + :type configuration1: + ~azure.mgmt.automation.models.DscConfigurationAssociationProperty + :param increment_node_configuration_build: If a new build version of + NodeConfiguration is required. + :type increment_node_configuration_build: bool + :param tags: Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + """ + + _validation = { + 'source': {'required': True}, + 'name': {'required': True}, + 'configuration': {'required': True}, + 'source1': {'required': True}, + 'name1': {'required': True}, + 'configuration1': {'required': True}, + } + + _attribute_map = { + 'source': {'key': 'source', 'type': 'ContentSource'}, + 'name': {'key': 'name', 'type': 'str'}, + 'configuration': {'key': 'configuration', 'type': 'DscConfigurationAssociationProperty'}, + 'new_node_configuration_build_version_required': {'key': 'newNodeConfigurationBuildVersionRequired', 'type': 'bool'}, + 'source1': {'key': 'properties.source', 'type': 'ContentSource'}, + 'name1': {'key': 'properties.name', 'type': 'str'}, + 'configuration1': {'key': 'properties.configuration', 'type': 'DscConfigurationAssociationProperty'}, + 'increment_node_configuration_build': {'key': 'properties.incrementNodeConfigurationBuild', 'type': 'bool'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, source, name: str, configuration, source1, name1: str, configuration1, new_node_configuration_build_version_required: bool=None, increment_node_configuration_build: bool=None, tags=None, **kwargs) -> None: + super(DscNodeConfigurationCreateOrUpdateParameters, self).__init__(**kwargs) + self.source = source + self.name = name + self.configuration = configuration + self.new_node_configuration_build_version_required = new_node_configuration_build_version_required + self.source1 = source1 + self.name1 = name1 + self.configuration1 = configuration1 + self.increment_node_configuration_build = increment_node_configuration_build + self.tags = tags diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_configuration_paged.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_configuration_paged.py new file mode 100644 index 000000000000..049da571883a --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_configuration_paged.py @@ -0,0 +1,27 @@ +# 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 msrest.paging import Paged + + +class DscNodeConfigurationPaged(Paged): + """ + A paging container for iterating over a list of :class:`DscNodeConfiguration ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DscNodeConfiguration]'} + } + + def __init__(self, *args, **kwargs): + + super(DscNodeConfigurationPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_configuration_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_configuration_py3.py new file mode 100644 index 000000000000..95272cc4261b --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_configuration_py3.py @@ -0,0 +1,68 @@ +# 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 .proxy_resource import ProxyResource + + +class DscNodeConfiguration(ProxyResource): + """Definition of the dsc node configuration. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: datetime + :param creation_time: Gets or sets creation time. + :type creation_time: datetime + :param configuration: Gets or sets the configuration of the node. + :type configuration: + ~azure.mgmt.automation.models.DscConfigurationAssociationProperty + :param source: Source of node configuration. + :type source: str + :param node_count: Number of nodes with this nodeconfiguration assigned + :type node_count: long + :param increment_node_configuration_build: If a new build version of + NodeConfiguration is required. + :type increment_node_configuration_build: bool + """ + + _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'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'configuration': {'key': 'properties.configuration', 'type': 'DscConfigurationAssociationProperty'}, + 'source': {'key': 'properties.source', 'type': 'str'}, + 'node_count': {'key': 'properties.nodeCount', 'type': 'long'}, + 'increment_node_configuration_build': {'key': 'properties.incrementNodeConfigurationBuild', 'type': 'bool'}, + } + + def __init__(self, *, last_modified_time=None, creation_time=None, configuration=None, source: str=None, node_count: int=None, increment_node_configuration_build: bool=None, **kwargs) -> None: + super(DscNodeConfiguration, self).__init__(**kwargs) + self.last_modified_time = last_modified_time + self.creation_time = creation_time + self.configuration = configuration + self.source = source + self.node_count = node_count + self.increment_node_configuration_build = increment_node_configuration_build diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_extension_handler_association_property.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_extension_handler_association_property.py new file mode 100644 index 000000000000..0079ffde252b --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_extension_handler_association_property.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class DscNodeExtensionHandlerAssociationProperty(Model): + """The dsc extensionHandler property associated with the node. + + :param name: Gets or sets the name of the extension handler. + :type name: str + :param version: Gets or sets the version of the extension handler. + :type version: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DscNodeExtensionHandlerAssociationProperty, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.version = kwargs.get('version', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_extension_handler_association_property_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_extension_handler_association_property_py3.py new file mode 100644 index 000000000000..65185703429b --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_extension_handler_association_property_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class DscNodeExtensionHandlerAssociationProperty(Model): + """The dsc extensionHandler property associated with the node. + + :param name: Gets or sets the name of the extension handler. + :type name: str + :param version: Gets or sets the version of the extension handler. + :type version: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, version: str=None, **kwargs) -> None: + super(DscNodeExtensionHandlerAssociationProperty, self).__init__(**kwargs) + self.name = name + self.version = version diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_paged.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_paged.py new file mode 100644 index 000000000000..0a53a4874719 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_paged.py @@ -0,0 +1,27 @@ +# 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 msrest.paging import Paged + + +class DscNodePaged(Paged): + """ + A paging container for iterating over a list of :class:`DscNode ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DscNode]'} + } + + def __init__(self, *args, **kwargs): + + super(DscNodePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_py3.py new file mode 100644 index 000000000000..7c5ca789f23f --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_py3.py @@ -0,0 +1,80 @@ +# 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 .proxy_resource import ProxyResource + + +class DscNode(ProxyResource): + """Definition of a DscNode. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param last_seen: Gets or sets the last seen time of the node. + :type last_seen: datetime + :param registration_time: Gets or sets the registration time of the node. + :type registration_time: datetime + :param ip: Gets or sets the ip of the node. + :type ip: str + :param account_id: Gets or sets the account id of the node. + :type account_id: str + :param dsc_node_name: Gets or sets the name of the dsc nodeconfiguration. + :type dsc_node_name: str + :param status: Gets or sets the status of the node. + :type status: str + :param node_id: Gets or sets the node id. + :type node_id: str + :param etag: Gets or sets the etag of the resource. + :type etag: str + :param extension_handler: Gets or sets the list of extensionHandler + properties for a Node. + :type extension_handler: + list[~azure.mgmt.automation.models.DscNodeExtensionHandlerAssociationProperty] + """ + + _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'}, + 'last_seen': {'key': 'properties.lastSeen', 'type': 'iso-8601'}, + 'registration_time': {'key': 'properties.registrationTime', 'type': 'iso-8601'}, + 'ip': {'key': 'properties.ip', 'type': 'str'}, + 'account_id': {'key': 'properties.accountId', 'type': 'str'}, + 'dsc_node_name': {'key': 'properties.nodeConfiguration.name', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'node_id': {'key': 'properties.nodeId', 'type': 'str'}, + 'etag': {'key': 'properties.etag', 'type': 'str'}, + 'extension_handler': {'key': 'properties.extensionHandler', 'type': '[DscNodeExtensionHandlerAssociationProperty]'}, + } + + def __init__(self, *, last_seen=None, registration_time=None, ip: str=None, account_id: str=None, dsc_node_name: str=None, status: str=None, node_id: str=None, etag: str=None, extension_handler=None, **kwargs) -> None: + super(DscNode, self).__init__(**kwargs) + self.last_seen = last_seen + self.registration_time = registration_time + self.ip = ip + self.account_id = account_id + self.dsc_node_name = dsc_node_name + self.status = status + self.node_id = node_id + self.etag = etag + self.extension_handler = extension_handler diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_report.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_report.py new file mode 100644 index 000000000000..84f633296c58 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_report.py @@ -0,0 +1,110 @@ +# 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 msrest.serialization import Model + + +class DscNodeReport(Model): + """Definition of the dsc node report type. + + :param end_time: Gets or sets the end time of the node report. + :type end_time: datetime + :param last_modified_time: Gets or sets the lastModifiedTime of the node + report. + :type last_modified_time: datetime + :param start_time: Gets or sets the start time of the node report. + :type start_time: datetime + :param type: Gets or sets the type of the node report. + :type type: str + :param report_id: Gets or sets the id of the node report. + :type report_id: str + :param status: Gets or sets the status of the node report. + :type status: str + :param refresh_mode: Gets or sets the refreshMode of the node report. + :type refresh_mode: str + :param reboot_requested: Gets or sets the rebootRequested of the node + report. + :type reboot_requested: str + :param report_format_version: Gets or sets the reportFormatVersion of the + node report. + :type report_format_version: str + :param configuration_version: Gets or sets the configurationVersion of the + node report. + :type configuration_version: str + :param id: Gets or sets the id. + :type id: str + :param errors: Gets or sets the errors for the node report. + :type errors: list[~azure.mgmt.automation.models.DscReportError] + :param resources: Gets or sets the resource for the node report. + :type resources: list[~azure.mgmt.automation.models.DscReportResource] + :param meta_configuration: Gets or sets the metaConfiguration of the node + at the time of the report. + :type meta_configuration: + ~azure.mgmt.automation.models.DscMetaConfiguration + :param host_name: Gets or sets the hostname of the node that sent the + report. + :type host_name: str + :param i_pv4_addresses: Gets or sets the IPv4 address of the node that + sent the report. + :type i_pv4_addresses: list[str] + :param i_pv6_addresses: Gets or sets the IPv6 address of the node that + sent the report. + :type i_pv6_addresses: list[str] + :param number_of_resources: Gets or sets the number of resource in the + node report. + :type number_of_resources: int + :param raw_errors: Gets or sets the unparsed errors for the node report. + :type raw_errors: str + """ + + _attribute_map = { + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'lastModifiedTime', 'type': 'iso-8601'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'type': {'key': 'type', 'type': 'str'}, + 'report_id': {'key': 'reportId', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'refresh_mode': {'key': 'refreshMode', 'type': 'str'}, + 'reboot_requested': {'key': 'rebootRequested', 'type': 'str'}, + 'report_format_version': {'key': 'reportFormatVersion', 'type': 'str'}, + 'configuration_version': {'key': 'configurationVersion', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'errors': {'key': 'errors', 'type': '[DscReportError]'}, + 'resources': {'key': 'resources', 'type': '[DscReportResource]'}, + 'meta_configuration': {'key': 'metaConfiguration', 'type': 'DscMetaConfiguration'}, + 'host_name': {'key': 'hostName', 'type': 'str'}, + 'i_pv4_addresses': {'key': 'iPV4Addresses', 'type': '[str]'}, + 'i_pv6_addresses': {'key': 'iPV6Addresses', 'type': '[str]'}, + 'number_of_resources': {'key': 'numberOfResources', 'type': 'int'}, + 'raw_errors': {'key': 'rawErrors', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DscNodeReport, self).__init__(**kwargs) + self.end_time = kwargs.get('end_time', None) + self.last_modified_time = kwargs.get('last_modified_time', None) + self.start_time = kwargs.get('start_time', None) + self.type = kwargs.get('type', None) + self.report_id = kwargs.get('report_id', None) + self.status = kwargs.get('status', None) + self.refresh_mode = kwargs.get('refresh_mode', None) + self.reboot_requested = kwargs.get('reboot_requested', None) + self.report_format_version = kwargs.get('report_format_version', None) + self.configuration_version = kwargs.get('configuration_version', None) + self.id = kwargs.get('id', None) + self.errors = kwargs.get('errors', None) + self.resources = kwargs.get('resources', None) + self.meta_configuration = kwargs.get('meta_configuration', None) + self.host_name = kwargs.get('host_name', None) + self.i_pv4_addresses = kwargs.get('i_pv4_addresses', None) + self.i_pv6_addresses = kwargs.get('i_pv6_addresses', None) + self.number_of_resources = kwargs.get('number_of_resources', None) + self.raw_errors = kwargs.get('raw_errors', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_report_paged.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_report_paged.py new file mode 100644 index 000000000000..81a95f0c15a2 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_report_paged.py @@ -0,0 +1,27 @@ +# 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 msrest.paging import Paged + + +class DscNodeReportPaged(Paged): + """ + A paging container for iterating over a list of :class:`DscNodeReport ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DscNodeReport]'} + } + + def __init__(self, *args, **kwargs): + + super(DscNodeReportPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_report_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_report_py3.py new file mode 100644 index 000000000000..3f9845190be5 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_report_py3.py @@ -0,0 +1,110 @@ +# 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 msrest.serialization import Model + + +class DscNodeReport(Model): + """Definition of the dsc node report type. + + :param end_time: Gets or sets the end time of the node report. + :type end_time: datetime + :param last_modified_time: Gets or sets the lastModifiedTime of the node + report. + :type last_modified_time: datetime + :param start_time: Gets or sets the start time of the node report. + :type start_time: datetime + :param type: Gets or sets the type of the node report. + :type type: str + :param report_id: Gets or sets the id of the node report. + :type report_id: str + :param status: Gets or sets the status of the node report. + :type status: str + :param refresh_mode: Gets or sets the refreshMode of the node report. + :type refresh_mode: str + :param reboot_requested: Gets or sets the rebootRequested of the node + report. + :type reboot_requested: str + :param report_format_version: Gets or sets the reportFormatVersion of the + node report. + :type report_format_version: str + :param configuration_version: Gets or sets the configurationVersion of the + node report. + :type configuration_version: str + :param id: Gets or sets the id. + :type id: str + :param errors: Gets or sets the errors for the node report. + :type errors: list[~azure.mgmt.automation.models.DscReportError] + :param resources: Gets or sets the resource for the node report. + :type resources: list[~azure.mgmt.automation.models.DscReportResource] + :param meta_configuration: Gets or sets the metaConfiguration of the node + at the time of the report. + :type meta_configuration: + ~azure.mgmt.automation.models.DscMetaConfiguration + :param host_name: Gets or sets the hostname of the node that sent the + report. + :type host_name: str + :param i_pv4_addresses: Gets or sets the IPv4 address of the node that + sent the report. + :type i_pv4_addresses: list[str] + :param i_pv6_addresses: Gets or sets the IPv6 address of the node that + sent the report. + :type i_pv6_addresses: list[str] + :param number_of_resources: Gets or sets the number of resource in the + node report. + :type number_of_resources: int + :param raw_errors: Gets or sets the unparsed errors for the node report. + :type raw_errors: str + """ + + _attribute_map = { + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'lastModifiedTime', 'type': 'iso-8601'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'type': {'key': 'type', 'type': 'str'}, + 'report_id': {'key': 'reportId', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'refresh_mode': {'key': 'refreshMode', 'type': 'str'}, + 'reboot_requested': {'key': 'rebootRequested', 'type': 'str'}, + 'report_format_version': {'key': 'reportFormatVersion', 'type': 'str'}, + 'configuration_version': {'key': 'configurationVersion', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'errors': {'key': 'errors', 'type': '[DscReportError]'}, + 'resources': {'key': 'resources', 'type': '[DscReportResource]'}, + 'meta_configuration': {'key': 'metaConfiguration', 'type': 'DscMetaConfiguration'}, + 'host_name': {'key': 'hostName', 'type': 'str'}, + 'i_pv4_addresses': {'key': 'iPV4Addresses', 'type': '[str]'}, + 'i_pv6_addresses': {'key': 'iPV6Addresses', 'type': '[str]'}, + 'number_of_resources': {'key': 'numberOfResources', 'type': 'int'}, + 'raw_errors': {'key': 'rawErrors', 'type': 'str'}, + } + + def __init__(self, *, end_time=None, last_modified_time=None, start_time=None, type: str=None, report_id: str=None, status: str=None, refresh_mode: str=None, reboot_requested: str=None, report_format_version: str=None, configuration_version: str=None, id: str=None, errors=None, resources=None, meta_configuration=None, host_name: str=None, i_pv4_addresses=None, i_pv6_addresses=None, number_of_resources: int=None, raw_errors: str=None, **kwargs) -> None: + super(DscNodeReport, self).__init__(**kwargs) + self.end_time = end_time + self.last_modified_time = last_modified_time + self.start_time = start_time + self.type = type + self.report_id = report_id + self.status = status + self.refresh_mode = refresh_mode + self.reboot_requested = reboot_requested + self.report_format_version = report_format_version + self.configuration_version = configuration_version + self.id = id + self.errors = errors + self.resources = resources + self.meta_configuration = meta_configuration + self.host_name = host_name + self.i_pv4_addresses = i_pv4_addresses + self.i_pv6_addresses = i_pv6_addresses + self.number_of_resources = number_of_resources + self.raw_errors = raw_errors diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_update_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_update_parameters.py new file mode 100644 index 000000000000..0fc5ec4e3f04 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_update_parameters.py @@ -0,0 +1,38 @@ +# 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 msrest.serialization import Model + + +class DscNodeUpdateParameters(Model): + """The parameters supplied to the update dsc node operation. + + :param node_id: Gets or sets the id of the dsc node. + :type node_id: str + :param node_configuration: Gets or sets the configuration of the node. + :type node_configuration: + ~azure.mgmt.automation.models.DscNodeConfigurationAssociationProperty + :param properties: + :type properties: + ~azure.mgmt.automation.models.DscNodeUpdateParametersProperties + """ + + _attribute_map = { + 'node_id': {'key': 'nodeId', 'type': 'str'}, + 'node_configuration': {'key': 'nodeConfiguration', 'type': 'DscNodeConfigurationAssociationProperty'}, + 'properties': {'key': 'properties', 'type': 'DscNodeUpdateParametersProperties'}, + } + + def __init__(self, **kwargs): + super(DscNodeUpdateParameters, self).__init__(**kwargs) + self.node_id = kwargs.get('node_id', None) + self.node_configuration = kwargs.get('node_configuration', None) + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_update_parameters_properties.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_update_parameters_properties.py new file mode 100644 index 000000000000..8029a4ffd947 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_update_parameters_properties.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class DscNodeUpdateParametersProperties(Model): + """DscNodeUpdateParametersProperties. + + :param name: Gets or sets the name of the dsc nodeconfiguration. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'nodeConfiguration.name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DscNodeUpdateParametersProperties, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_update_parameters_properties_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_update_parameters_properties_py3.py new file mode 100644 index 000000000000..c14c070386eb --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_update_parameters_properties_py3.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class DscNodeUpdateParametersProperties(Model): + """DscNodeUpdateParametersProperties. + + :param name: Gets or sets the name of the dsc nodeconfiguration. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'nodeConfiguration.name', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, **kwargs) -> None: + super(DscNodeUpdateParametersProperties, self).__init__(**kwargs) + self.name = name diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_update_parameters_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_update_parameters_py3.py new file mode 100644 index 000000000000..4f12684a4bf2 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_update_parameters_py3.py @@ -0,0 +1,38 @@ +# 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 msrest.serialization import Model + + +class DscNodeUpdateParameters(Model): + """The parameters supplied to the update dsc node operation. + + :param node_id: Gets or sets the id of the dsc node. + :type node_id: str + :param node_configuration: Gets or sets the configuration of the node. + :type node_configuration: + ~azure.mgmt.automation.models.DscNodeConfigurationAssociationProperty + :param properties: + :type properties: + ~azure.mgmt.automation.models.DscNodeUpdateParametersProperties + """ + + _attribute_map = { + 'node_id': {'key': 'nodeId', 'type': 'str'}, + 'node_configuration': {'key': 'nodeConfiguration', 'type': 'DscNodeConfigurationAssociationProperty'}, + 'properties': {'key': 'properties', 'type': 'DscNodeUpdateParametersProperties'}, + } + + def __init__(self, *, node_id: str=None, node_configuration=None, properties=None, **kwargs) -> None: + super(DscNodeUpdateParameters, self).__init__(**kwargs) + self.node_id = node_id + self.node_configuration = node_configuration + self.properties = properties diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_report_error.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_report_error.py new file mode 100644 index 000000000000..faa250470e4a --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_report_error.py @@ -0,0 +1,49 @@ +# 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 msrest.serialization import Model + + +class DscReportError(Model): + """Definition of the dsc node report error type. + + :param error_source: Gets or sets the source of the error. + :type error_source: str + :param resource_id: Gets or sets the resource ID which generated the + error. + :type resource_id: str + :param error_code: Gets or sets the error code. + :type error_code: str + :param error_message: Gets or sets the error message. + :type error_message: str + :param locale: Gets or sets the locale of the error. + :type locale: str + :param error_details: Gets or sets the error details. + :type error_details: str + """ + + _attribute_map = { + 'error_source': {'key': 'errorSource', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'error_code': {'key': 'errorCode', 'type': 'str'}, + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + 'locale': {'key': 'locale', 'type': 'str'}, + 'error_details': {'key': 'errorDetails', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DscReportError, self).__init__(**kwargs) + self.error_source = kwargs.get('error_source', None) + self.resource_id = kwargs.get('resource_id', None) + self.error_code = kwargs.get('error_code', None) + self.error_message = kwargs.get('error_message', None) + self.locale = kwargs.get('locale', None) + self.error_details = kwargs.get('error_details', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_report_error_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_report_error_py3.py new file mode 100644 index 000000000000..2e172458b5db --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_report_error_py3.py @@ -0,0 +1,49 @@ +# 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 msrest.serialization import Model + + +class DscReportError(Model): + """Definition of the dsc node report error type. + + :param error_source: Gets or sets the source of the error. + :type error_source: str + :param resource_id: Gets or sets the resource ID which generated the + error. + :type resource_id: str + :param error_code: Gets or sets the error code. + :type error_code: str + :param error_message: Gets or sets the error message. + :type error_message: str + :param locale: Gets or sets the locale of the error. + :type locale: str + :param error_details: Gets or sets the error details. + :type error_details: str + """ + + _attribute_map = { + 'error_source': {'key': 'errorSource', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'error_code': {'key': 'errorCode', 'type': 'str'}, + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + 'locale': {'key': 'locale', 'type': 'str'}, + 'error_details': {'key': 'errorDetails', 'type': 'str'}, + } + + def __init__(self, *, error_source: str=None, resource_id: str=None, error_code: str=None, error_message: str=None, locale: str=None, error_details: str=None, **kwargs) -> None: + super(DscReportError, self).__init__(**kwargs) + self.error_source = error_source + self.resource_id = resource_id + self.error_code = error_code + self.error_message = error_message + self.locale = locale + self.error_details = error_details diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_report_resource.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_report_resource.py new file mode 100644 index 000000000000..8984d3791618 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_report_resource.py @@ -0,0 +1,67 @@ +# 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 msrest.serialization import Model + + +class DscReportResource(Model): + """Definition of the DSC Report Resource. + + :param resource_id: Gets or sets the ID of the resource. + :type resource_id: str + :param source_info: Gets or sets the source info of the resource. + :type source_info: str + :param depends_on: Gets or sets the Resource Navigation values for + resources the resource depends on. + :type depends_on: + list[~azure.mgmt.automation.models.DscReportResourceNavigation] + :param module_name: Gets or sets the module name of the resource. + :type module_name: str + :param module_version: Gets or sets the module version of the resource. + :type module_version: str + :param resource_name: Gets or sets the name of the resource. + :type resource_name: str + :param error: Gets or sets the error of the resource. + :type error: str + :param status: Gets or sets the status of the resource. + :type status: str + :param duration_in_seconds: Gets or sets the duration in seconds for the + resource. + :type duration_in_seconds: float + :param start_date: Gets or sets the start date of the resource. + :type start_date: datetime + """ + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'source_info': {'key': 'sourceInfo', 'type': 'str'}, + 'depends_on': {'key': 'dependsOn', 'type': '[DscReportResourceNavigation]'}, + 'module_name': {'key': 'moduleName', 'type': 'str'}, + 'module_version': {'key': 'moduleVersion', 'type': 'str'}, + 'resource_name': {'key': 'resourceName', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'duration_in_seconds': {'key': 'durationInSeconds', 'type': 'float'}, + 'start_date': {'key': 'startDate', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(DscReportResource, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + self.source_info = kwargs.get('source_info', None) + self.depends_on = kwargs.get('depends_on', None) + self.module_name = kwargs.get('module_name', None) + self.module_version = kwargs.get('module_version', None) + self.resource_name = kwargs.get('resource_name', None) + self.error = kwargs.get('error', None) + self.status = kwargs.get('status', None) + self.duration_in_seconds = kwargs.get('duration_in_seconds', None) + self.start_date = kwargs.get('start_date', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_report_resource_navigation.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_report_resource_navigation.py new file mode 100644 index 000000000000..bdf666fb506e --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_report_resource_navigation.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class DscReportResourceNavigation(Model): + """Navigation for DSC Report Resource. + + :param resource_id: Gets or sets the ID of the resource to navigate to. + :type resource_id: str + """ + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DscReportResourceNavigation, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_report_resource_navigation_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_report_resource_navigation_py3.py new file mode 100644 index 000000000000..e18a0696050f --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_report_resource_navigation_py3.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class DscReportResourceNavigation(Model): + """Navigation for DSC Report Resource. + + :param resource_id: Gets or sets the ID of the resource to navigate to. + :type resource_id: str + """ + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + } + + def __init__(self, *, resource_id: str=None, **kwargs) -> None: + super(DscReportResourceNavigation, self).__init__(**kwargs) + self.resource_id = resource_id diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_report_resource_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_report_resource_py3.py new file mode 100644 index 000000000000..b81afaa497ac --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_report_resource_py3.py @@ -0,0 +1,67 @@ +# 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 msrest.serialization import Model + + +class DscReportResource(Model): + """Definition of the DSC Report Resource. + + :param resource_id: Gets or sets the ID of the resource. + :type resource_id: str + :param source_info: Gets or sets the source info of the resource. + :type source_info: str + :param depends_on: Gets or sets the Resource Navigation values for + resources the resource depends on. + :type depends_on: + list[~azure.mgmt.automation.models.DscReportResourceNavigation] + :param module_name: Gets or sets the module name of the resource. + :type module_name: str + :param module_version: Gets or sets the module version of the resource. + :type module_version: str + :param resource_name: Gets or sets the name of the resource. + :type resource_name: str + :param error: Gets or sets the error of the resource. + :type error: str + :param status: Gets or sets the status of the resource. + :type status: str + :param duration_in_seconds: Gets or sets the duration in seconds for the + resource. + :type duration_in_seconds: float + :param start_date: Gets or sets the start date of the resource. + :type start_date: datetime + """ + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'source_info': {'key': 'sourceInfo', 'type': 'str'}, + 'depends_on': {'key': 'dependsOn', 'type': '[DscReportResourceNavigation]'}, + 'module_name': {'key': 'moduleName', 'type': 'str'}, + 'module_version': {'key': 'moduleVersion', 'type': 'str'}, + 'resource_name': {'key': 'resourceName', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'duration_in_seconds': {'key': 'durationInSeconds', 'type': 'float'}, + 'start_date': {'key': 'startDate', 'type': 'iso-8601'}, + } + + def __init__(self, *, resource_id: str=None, source_info: str=None, depends_on=None, module_name: str=None, module_version: str=None, resource_name: str=None, error: str=None, status: str=None, duration_in_seconds: float=None, start_date=None, **kwargs) -> None: + super(DscReportResource, self).__init__(**kwargs) + self.resource_id = resource_id + self.source_info = source_info + self.depends_on = depends_on + self.module_name = module_name + self.module_version = module_version + self.resource_name = resource_name + self.error = error + self.status = status + self.duration_in_seconds = duration_in_seconds + self.start_date = start_date diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/error_response.py b/azure-mgmt-automation/azure/mgmt/automation/models/error_response.py new file mode 100644 index 000000000000..58d5423a976c --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/error_response.py @@ -0,0 +1,45 @@ +# 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 msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class ErrorResponse(Model): + """Error response of an operation failure. + + :param code: Error code + :type code: str + :param message: Error message indicating why the operation failed. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/error_response_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/error_response_py3.py new file mode 100644 index 000000000000..eb5e6375b725 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/error_response_py3.py @@ -0,0 +1,45 @@ +# 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 msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class ErrorResponse(Model): + """Error response of an operation failure. + + :param code: Error code + :type code: str + :param message: Error message indicating why the operation failed. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, message: str=None, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.code = code + self.message = message + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/field_definition.py b/azure-mgmt-automation/azure/mgmt/automation/models/field_definition.py new file mode 100644 index 000000000000..812533832150 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/field_definition.py @@ -0,0 +1,45 @@ +# 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 msrest.serialization import Model + + +class FieldDefinition(Model): + """Definition of the connection fields. + + All required parameters must be populated in order to send to Azure. + + :param is_encrypted: Gets or sets the isEncrypted flag of the connection + field definition. + :type is_encrypted: bool + :param is_optional: Gets or sets the isOptional flag of the connection + field definition. + :type is_optional: bool + :param type: Required. Gets or sets the type of the connection field + definition. + :type type: str + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'is_encrypted': {'key': 'isEncrypted', 'type': 'bool'}, + 'is_optional': {'key': 'isOptional', 'type': 'bool'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(FieldDefinition, self).__init__(**kwargs) + self.is_encrypted = kwargs.get('is_encrypted', None) + self.is_optional = kwargs.get('is_optional', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/field_definition_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/field_definition_py3.py new file mode 100644 index 000000000000..c6db74afb691 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/field_definition_py3.py @@ -0,0 +1,45 @@ +# 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 msrest.serialization import Model + + +class FieldDefinition(Model): + """Definition of the connection fields. + + All required parameters must be populated in order to send to Azure. + + :param is_encrypted: Gets or sets the isEncrypted flag of the connection + field definition. + :type is_encrypted: bool + :param is_optional: Gets or sets the isOptional flag of the connection + field definition. + :type is_optional: bool + :param type: Required. Gets or sets the type of the connection field + definition. + :type type: str + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'is_encrypted': {'key': 'isEncrypted', 'type': 'bool'}, + 'is_optional': {'key': 'isOptional', 'type': 'bool'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, type: str, is_encrypted: bool=None, is_optional: bool=None, **kwargs) -> None: + super(FieldDefinition, self).__init__(**kwargs) + self.is_encrypted = is_encrypted + self.is_optional = is_optional + self.type = type diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/hybrid_runbook_worker.py b/azure-mgmt-automation/azure/mgmt/automation/models/hybrid_runbook_worker.py new file mode 100644 index 000000000000..f127ff46ecda --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/hybrid_runbook_worker.py @@ -0,0 +1,37 @@ +# 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 msrest.serialization import Model + + +class HybridRunbookWorker(Model): + """Definition of hybrid runbook worker. + + :param name: Gets or sets the worker machine name. + :type name: str + :param ip: Gets or sets the assigned machine IP address. + :type ip: str + :param registration_time: Gets or sets the registration time of the worker + machine. + :type registration_time: datetime + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'ip': {'key': 'ip', 'type': 'str'}, + 'registration_time': {'key': 'registrationTime', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(HybridRunbookWorker, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.ip = kwargs.get('ip', None) + self.registration_time = kwargs.get('registration_time', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/hybrid_runbook_worker_group.py b/azure-mgmt-automation/azure/mgmt/automation/models/hybrid_runbook_worker_group.py new file mode 100644 index 000000000000..0adebe5ba3a3 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/hybrid_runbook_worker_group.py @@ -0,0 +1,43 @@ +# 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 msrest.serialization import Model + + +class HybridRunbookWorkerGroup(Model): + """Definition of hybrid runbook worker group. + + :param id: Gets or sets the id of the resource. + :type id: str + :param name: Gets or sets the name of the group. + :type name: str + :param hybrid_runbook_workers: Gets or sets the list of hybrid runbook + workers. + :type hybrid_runbook_workers: + list[~azure.mgmt.automation.models.HybridRunbookWorker] + :param credential: Sets the credential of a worker group. + :type credential: + ~azure.mgmt.automation.models.RunAsCredentialAssociationProperty + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'hybrid_runbook_workers': {'key': 'hybridRunbookWorkers', 'type': '[HybridRunbookWorker]'}, + 'credential': {'key': 'credential', 'type': 'RunAsCredentialAssociationProperty'}, + } + + def __init__(self, **kwargs): + super(HybridRunbookWorkerGroup, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.hybrid_runbook_workers = kwargs.get('hybrid_runbook_workers', None) + self.credential = kwargs.get('credential', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/hybrid_runbook_worker_group_paged.py b/azure-mgmt-automation/azure/mgmt/automation/models/hybrid_runbook_worker_group_paged.py new file mode 100644 index 000000000000..0e13e4babe3b --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/hybrid_runbook_worker_group_paged.py @@ -0,0 +1,27 @@ +# 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 msrest.paging import Paged + + +class HybridRunbookWorkerGroupPaged(Paged): + """ + A paging container for iterating over a list of :class:`HybridRunbookWorkerGroup ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[HybridRunbookWorkerGroup]'} + } + + def __init__(self, *args, **kwargs): + + super(HybridRunbookWorkerGroupPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/hybrid_runbook_worker_group_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/hybrid_runbook_worker_group_py3.py new file mode 100644 index 000000000000..0090a456ef8c --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/hybrid_runbook_worker_group_py3.py @@ -0,0 +1,43 @@ +# 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 msrest.serialization import Model + + +class HybridRunbookWorkerGroup(Model): + """Definition of hybrid runbook worker group. + + :param id: Gets or sets the id of the resource. + :type id: str + :param name: Gets or sets the name of the group. + :type name: str + :param hybrid_runbook_workers: Gets or sets the list of hybrid runbook + workers. + :type hybrid_runbook_workers: + list[~azure.mgmt.automation.models.HybridRunbookWorker] + :param credential: Sets the credential of a worker group. + :type credential: + ~azure.mgmt.automation.models.RunAsCredentialAssociationProperty + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'hybrid_runbook_workers': {'key': 'hybridRunbookWorkers', 'type': '[HybridRunbookWorker]'}, + 'credential': {'key': 'credential', 'type': 'RunAsCredentialAssociationProperty'}, + } + + def __init__(self, *, id: str=None, name: str=None, hybrid_runbook_workers=None, credential=None, **kwargs) -> None: + super(HybridRunbookWorkerGroup, self).__init__(**kwargs) + self.id = id + self.name = name + self.hybrid_runbook_workers = hybrid_runbook_workers + self.credential = credential diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/hybrid_runbook_worker_group_update_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/hybrid_runbook_worker_group_update_parameters.py new file mode 100644 index 000000000000..8bc120a8afc4 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/hybrid_runbook_worker_group_update_parameters.py @@ -0,0 +1,29 @@ +# 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 msrest.serialization import Model + + +class HybridRunbookWorkerGroupUpdateParameters(Model): + """Parameters supplied to the update operation. + + :param credential: Sets the credential of a worker group. + :type credential: + ~azure.mgmt.automation.models.RunAsCredentialAssociationProperty + """ + + _attribute_map = { + 'credential': {'key': 'credential', 'type': 'RunAsCredentialAssociationProperty'}, + } + + def __init__(self, **kwargs): + super(HybridRunbookWorkerGroupUpdateParameters, self).__init__(**kwargs) + self.credential = kwargs.get('credential', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/hybrid_runbook_worker_group_update_parameters_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/hybrid_runbook_worker_group_update_parameters_py3.py new file mode 100644 index 000000000000..58d73108099c --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/hybrid_runbook_worker_group_update_parameters_py3.py @@ -0,0 +1,29 @@ +# 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 msrest.serialization import Model + + +class HybridRunbookWorkerGroupUpdateParameters(Model): + """Parameters supplied to the update operation. + + :param credential: Sets the credential of a worker group. + :type credential: + ~azure.mgmt.automation.models.RunAsCredentialAssociationProperty + """ + + _attribute_map = { + 'credential': {'key': 'credential', 'type': 'RunAsCredentialAssociationProperty'}, + } + + def __init__(self, *, credential=None, **kwargs) -> None: + super(HybridRunbookWorkerGroupUpdateParameters, self).__init__(**kwargs) + self.credential = credential diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/hybrid_runbook_worker_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/hybrid_runbook_worker_py3.py new file mode 100644 index 000000000000..089ab0b7bce4 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/hybrid_runbook_worker_py3.py @@ -0,0 +1,37 @@ +# 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 msrest.serialization import Model + + +class HybridRunbookWorker(Model): + """Definition of hybrid runbook worker. + + :param name: Gets or sets the worker machine name. + :type name: str + :param ip: Gets or sets the assigned machine IP address. + :type ip: str + :param registration_time: Gets or sets the registration time of the worker + machine. + :type registration_time: datetime + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'ip': {'key': 'ip', 'type': 'str'}, + 'registration_time': {'key': 'registrationTime', 'type': 'iso-8601'}, + } + + def __init__(self, *, name: str=None, ip: str=None, registration_time=None, **kwargs) -> None: + super(HybridRunbookWorker, self).__init__(**kwargs) + self.name = name + self.ip = ip + self.registration_time = registration_time diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/job.py b/azure-mgmt-automation/azure/mgmt/automation/models/job.py new file mode 100644 index 000000000000..0be8bd96c2a3 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/job.py @@ -0,0 +1,105 @@ +# 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 .proxy_resource import ProxyResource + + +class Job(ProxyResource): + """Definition of the 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 + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param runbook: Gets or sets the runbook. + :type runbook: ~azure.mgmt.automation.models.RunbookAssociationProperty + :param started_by: Gets or sets the job started by. + :type started_by: str + :param run_on: Gets or sets the runOn which specifies the group name where + the job is to be executed. + :type run_on: str + :param job_id: Gets or sets the id of the job. + :type job_id: str + :param creation_time: Gets or sets the creation time of the job. + :type creation_time: datetime + :param status: Gets or sets the status of the job. Possible values + include: 'New', 'Activating', 'Running', 'Completed', 'Failed', 'Stopped', + 'Blocked', 'Suspended', 'Disconnected', 'Suspending', 'Stopping', + 'Resuming', 'Removing' + :type status: str or ~azure.mgmt.automation.models.JobStatus + :param status_details: Gets or sets the status details of the job. + :type status_details: str + :param start_time: Gets or sets the start time of the job. + :type start_time: datetime + :param end_time: Gets or sets the end time of the job. + :type end_time: datetime + :param exception: Gets or sets the exception of the job. + :type exception: str + :param last_modified_time: Gets or sets the last modified time of the job. + :type last_modified_time: datetime + :param last_status_modified_time: Gets or sets the last status modified + time of the job. + :type last_status_modified_time: datetime + :param parameters: Gets or sets the parameters of the job. + :type parameters: dict[str, str] + :ivar provisioning_state: The provisioning state of a resource. + :vartype provisioning_state: + ~azure.mgmt.automation.models.JobProvisioningStateProperty + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'runbook': {'key': 'properties.runbook', 'type': 'RunbookAssociationProperty'}, + 'started_by': {'key': 'properties.startedBy', 'type': 'str'}, + 'run_on': {'key': 'properties.runOn', 'type': 'str'}, + 'job_id': {'key': 'properties.jobId', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'status_details': {'key': 'properties.statusDetails', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'exception': {'key': 'properties.exception', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'last_status_modified_time': {'key': 'properties.lastStatusModifiedTime', 'type': 'iso-8601'}, + 'parameters': {'key': 'properties.parameters', 'type': '{str}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'JobProvisioningStateProperty'}, + } + + def __init__(self, **kwargs): + super(Job, self).__init__(**kwargs) + self.runbook = kwargs.get('runbook', None) + self.started_by = kwargs.get('started_by', None) + self.run_on = kwargs.get('run_on', None) + self.job_id = kwargs.get('job_id', None) + self.creation_time = kwargs.get('creation_time', None) + self.status = kwargs.get('status', None) + self.status_details = kwargs.get('status_details', None) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.exception = kwargs.get('exception', None) + self.last_modified_time = kwargs.get('last_modified_time', None) + self.last_status_modified_time = kwargs.get('last_status_modified_time', None) + self.parameters = kwargs.get('parameters', None) + self.provisioning_state = None diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/job_collection_item.py b/azure-mgmt-automation/azure/mgmt/automation/models/job_collection_item.py new file mode 100644 index 000000000000..7c63b6ed8334 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/job_collection_item.py @@ -0,0 +1,85 @@ +# 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 .proxy_resource import ProxyResource + + +class JobCollectionItem(ProxyResource): + """Job collection item properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar runbook: The runbook association. + :vartype runbook: ~azure.mgmt.automation.models.RunbookAssociationProperty + :ivar job_id: The id of the job. + :vartype job_id: str + :ivar creation_time: The creation time of the job. + :vartype creation_time: datetime + :ivar status: The status of the job. Possible values include: 'New', + 'Activating', 'Running', 'Completed', 'Failed', 'Stopped', 'Blocked', + 'Suspended', 'Disconnected', 'Suspending', 'Stopping', 'Resuming', + 'Removing' + :vartype status: str or ~azure.mgmt.automation.models.JobStatus + :ivar start_time: The start time of the job. + :vartype start_time: datetime + :ivar end_time: The end time of the job. + :vartype end_time: datetime + :ivar last_modified_time: The last modified time of the job. + :vartype last_modified_time: datetime + :ivar provisioning_state: The provisioning state of a resource. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'runbook': {'readonly': True}, + 'job_id': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'status': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'runbook': {'key': 'properties.runbook', 'type': 'RunbookAssociationProperty'}, + 'job_id': {'key': 'properties.jobId', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(JobCollectionItem, self).__init__(**kwargs) + self.runbook = None + self.job_id = None + self.creation_time = None + self.status = None + self.start_time = None + self.end_time = None + self.last_modified_time = None + self.provisioning_state = None diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/job_collection_item_paged.py b/azure-mgmt-automation/azure/mgmt/automation/models/job_collection_item_paged.py new file mode 100644 index 000000000000..caa9d0b73f80 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/job_collection_item_paged.py @@ -0,0 +1,27 @@ +# 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 msrest.paging import Paged + + +class JobCollectionItemPaged(Paged): + """ + A paging container for iterating over a list of :class:`JobCollectionItem ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[JobCollectionItem]'} + } + + def __init__(self, *args, **kwargs): + + super(JobCollectionItemPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/job_collection_item_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/job_collection_item_py3.py new file mode 100644 index 000000000000..6bddc0447c38 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/job_collection_item_py3.py @@ -0,0 +1,85 @@ +# 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 .proxy_resource import ProxyResource + + +class JobCollectionItem(ProxyResource): + """Job collection item properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar runbook: The runbook association. + :vartype runbook: ~azure.mgmt.automation.models.RunbookAssociationProperty + :ivar job_id: The id of the job. + :vartype job_id: str + :ivar creation_time: The creation time of the job. + :vartype creation_time: datetime + :ivar status: The status of the job. Possible values include: 'New', + 'Activating', 'Running', 'Completed', 'Failed', 'Stopped', 'Blocked', + 'Suspended', 'Disconnected', 'Suspending', 'Stopping', 'Resuming', + 'Removing' + :vartype status: str or ~azure.mgmt.automation.models.JobStatus + :ivar start_time: The start time of the job. + :vartype start_time: datetime + :ivar end_time: The end time of the job. + :vartype end_time: datetime + :ivar last_modified_time: The last modified time of the job. + :vartype last_modified_time: datetime + :ivar provisioning_state: The provisioning state of a resource. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'runbook': {'readonly': True}, + 'job_id': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'status': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'runbook': {'key': 'properties.runbook', 'type': 'RunbookAssociationProperty'}, + 'job_id': {'key': 'properties.jobId', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(JobCollectionItem, self).__init__(**kwargs) + self.runbook = None + self.job_id = None + self.creation_time = None + self.status = None + self.start_time = None + self.end_time = None + self.last_modified_time = None + self.provisioning_state = None diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/job_create_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/job_create_parameters.py new file mode 100644 index 000000000000..a99520f4332d --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/job_create_parameters.py @@ -0,0 +1,43 @@ +# 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 msrest.serialization import Model + + +class JobCreateParameters(Model): + """The parameters supplied to the create job operation. + + All required parameters must be populated in order to send to Azure. + + :param runbook: Required. Gets or sets the runbook. + :type runbook: ~azure.mgmt.automation.models.RunbookAssociationProperty + :param parameters: Gets or sets the parameters of the job. + :type parameters: dict[str, str] + :param run_on: Gets or sets the runOn which specifies the group name where + the job is to be executed. + :type run_on: str + """ + + _validation = { + 'runbook': {'required': True}, + } + + _attribute_map = { + 'runbook': {'key': 'properties.runbook', 'type': 'RunbookAssociationProperty'}, + 'parameters': {'key': 'properties.parameters', 'type': '{str}'}, + 'run_on': {'key': 'properties.runOn', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(JobCreateParameters, self).__init__(**kwargs) + self.runbook = kwargs.get('runbook', None) + self.parameters = kwargs.get('parameters', None) + self.run_on = kwargs.get('run_on', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/job_create_parameters_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/job_create_parameters_py3.py new file mode 100644 index 000000000000..2ae9c7279fc0 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/job_create_parameters_py3.py @@ -0,0 +1,43 @@ +# 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 msrest.serialization import Model + + +class JobCreateParameters(Model): + """The parameters supplied to the create job operation. + + All required parameters must be populated in order to send to Azure. + + :param runbook: Required. Gets or sets the runbook. + :type runbook: ~azure.mgmt.automation.models.RunbookAssociationProperty + :param parameters: Gets or sets the parameters of the job. + :type parameters: dict[str, str] + :param run_on: Gets or sets the runOn which specifies the group name where + the job is to be executed. + :type run_on: str + """ + + _validation = { + 'runbook': {'required': True}, + } + + _attribute_map = { + 'runbook': {'key': 'properties.runbook', 'type': 'RunbookAssociationProperty'}, + 'parameters': {'key': 'properties.parameters', 'type': '{str}'}, + 'run_on': {'key': 'properties.runOn', 'type': 'str'}, + } + + def __init__(self, *, runbook, parameters=None, run_on: str=None, **kwargs) -> None: + super(JobCreateParameters, self).__init__(**kwargs) + self.runbook = runbook + self.parameters = parameters + self.run_on = run_on diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/job_list_result.py b/azure-mgmt-automation/azure/mgmt/automation/models/job_list_result.py new file mode 100644 index 000000000000..eccdec88a824 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/job_list_result.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class JobListResult(Model): + """The response model for the list job operation. + + :param value: Gets or sets a list of jobs. + :type value: list[~azure.mgmt.automation.models.Job] + :param next_link: Gets or sets the next link. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Job]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(JobListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/job_list_result_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/job_list_result_py3.py new file mode 100644 index 000000000000..3987249b10d9 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/job_list_result_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class JobListResult(Model): + """The response model for the list job operation. + + :param value: Gets or sets a list of jobs. + :type value: list[~azure.mgmt.automation.models.Job] + :param next_link: Gets or sets the next link. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Job]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: + super(JobListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/job_navigation.py b/azure-mgmt-automation/azure/mgmt/automation/models/job_navigation.py new file mode 100644 index 000000000000..775212e082f9 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/job_navigation.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class JobNavigation(Model): + """Software update configuration machine run job navigation properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Id of the job associated with the software update configuration + run + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(JobNavigation, self).__init__(**kwargs) + self.id = None diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/job_navigation_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/job_navigation_py3.py new file mode 100644 index 000000000000..bdd663359578 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/job_navigation_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class JobNavigation(Model): + """Software update configuration machine run job navigation properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Id of the job associated with the software update configuration + run + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(JobNavigation, self).__init__(**kwargs) + self.id = None diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/job_provisioning_state_property.py b/azure-mgmt-automation/azure/mgmt/automation/models/job_provisioning_state_property.py new file mode 100644 index 000000000000..50b2aa57efea --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/job_provisioning_state_property.py @@ -0,0 +1,37 @@ +# 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 msrest.serialization import Model + + +class JobProvisioningStateProperty(Model): + """The provisioning state property. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provisioning_state: The provisioning state of the resource. Possible + values include: 'Failed', 'Succeeded', 'Suspended', 'Processing' + :vartype provisioning_state: str or + ~azure.mgmt.automation.models.JobProvisioningState + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(JobProvisioningStateProperty, self).__init__(**kwargs) + self.provisioning_state = None diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/job_provisioning_state_property_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/job_provisioning_state_property_py3.py new file mode 100644 index 000000000000..4bc214ad5d0c --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/job_provisioning_state_property_py3.py @@ -0,0 +1,37 @@ +# 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 msrest.serialization import Model + + +class JobProvisioningStateProperty(Model): + """The provisioning state property. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provisioning_state: The provisioning state of the resource. Possible + values include: 'Failed', 'Succeeded', 'Suspended', 'Processing' + :vartype provisioning_state: str or + ~azure.mgmt.automation.models.JobProvisioningState + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(JobProvisioningStateProperty, self).__init__(**kwargs) + self.provisioning_state = None diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/job_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/job_py3.py new file mode 100644 index 000000000000..24a6ebdf6337 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/job_py3.py @@ -0,0 +1,105 @@ +# 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 .proxy_resource import ProxyResource + + +class Job(ProxyResource): + """Definition of the 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 + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param runbook: Gets or sets the runbook. + :type runbook: ~azure.mgmt.automation.models.RunbookAssociationProperty + :param started_by: Gets or sets the job started by. + :type started_by: str + :param run_on: Gets or sets the runOn which specifies the group name where + the job is to be executed. + :type run_on: str + :param job_id: Gets or sets the id of the job. + :type job_id: str + :param creation_time: Gets or sets the creation time of the job. + :type creation_time: datetime + :param status: Gets or sets the status of the job. Possible values + include: 'New', 'Activating', 'Running', 'Completed', 'Failed', 'Stopped', + 'Blocked', 'Suspended', 'Disconnected', 'Suspending', 'Stopping', + 'Resuming', 'Removing' + :type status: str or ~azure.mgmt.automation.models.JobStatus + :param status_details: Gets or sets the status details of the job. + :type status_details: str + :param start_time: Gets or sets the start time of the job. + :type start_time: datetime + :param end_time: Gets or sets the end time of the job. + :type end_time: datetime + :param exception: Gets or sets the exception of the job. + :type exception: str + :param last_modified_time: Gets or sets the last modified time of the job. + :type last_modified_time: datetime + :param last_status_modified_time: Gets or sets the last status modified + time of the job. + :type last_status_modified_time: datetime + :param parameters: Gets or sets the parameters of the job. + :type parameters: dict[str, str] + :ivar provisioning_state: The provisioning state of a resource. + :vartype provisioning_state: + ~azure.mgmt.automation.models.JobProvisioningStateProperty + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'runbook': {'key': 'properties.runbook', 'type': 'RunbookAssociationProperty'}, + 'started_by': {'key': 'properties.startedBy', 'type': 'str'}, + 'run_on': {'key': 'properties.runOn', 'type': 'str'}, + 'job_id': {'key': 'properties.jobId', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'status_details': {'key': 'properties.statusDetails', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'exception': {'key': 'properties.exception', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'last_status_modified_time': {'key': 'properties.lastStatusModifiedTime', 'type': 'iso-8601'}, + 'parameters': {'key': 'properties.parameters', 'type': '{str}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'JobProvisioningStateProperty'}, + } + + def __init__(self, *, runbook=None, started_by: str=None, run_on: str=None, job_id: str=None, creation_time=None, status=None, status_details: str=None, start_time=None, end_time=None, exception: str=None, last_modified_time=None, last_status_modified_time=None, parameters=None, **kwargs) -> None: + super(Job, self).__init__(**kwargs) + self.runbook = runbook + self.started_by = started_by + self.run_on = run_on + self.job_id = job_id + self.creation_time = creation_time + self.status = status + self.status_details = status_details + self.start_time = start_time + self.end_time = end_time + self.exception = exception + self.last_modified_time = last_modified_time + self.last_status_modified_time = last_status_modified_time + self.parameters = parameters + self.provisioning_state = None diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/job_schedule.py b/azure-mgmt-automation/azure/mgmt/automation/models/job_schedule.py new file mode 100644 index 000000000000..d7efbd4e2471 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/job_schedule.py @@ -0,0 +1,66 @@ +# 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 msrest.serialization import Model + + +class JobSchedule(Model): + """Definition of the job schedule. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Gets the id of the resource. + :vartype id: str + :ivar name: Gets the name of the variable. + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param job_schedule_id: Gets or sets the id of job schedule. + :type job_schedule_id: str + :param schedule: Gets or sets the schedule. + :type schedule: ~azure.mgmt.automation.models.ScheduleAssociationProperty + :param runbook: Gets or sets the runbook. + :type runbook: ~azure.mgmt.automation.models.RunbookAssociationProperty + :param run_on: Gets or sets the hybrid worker group that the scheduled job + should run on. + :type run_on: str + :param parameters: Gets or sets the parameters of the job schedule. + :type parameters: dict[str, str] + """ + + _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'}, + 'job_schedule_id': {'key': 'properties.jobScheduleId', 'type': 'str'}, + 'schedule': {'key': 'properties.schedule', 'type': 'ScheduleAssociationProperty'}, + 'runbook': {'key': 'properties.runbook', 'type': 'RunbookAssociationProperty'}, + 'run_on': {'key': 'properties.runOn', 'type': 'str'}, + 'parameters': {'key': 'properties.parameters', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(JobSchedule, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.job_schedule_id = kwargs.get('job_schedule_id', None) + self.schedule = kwargs.get('schedule', None) + self.runbook = kwargs.get('runbook', None) + self.run_on = kwargs.get('run_on', None) + self.parameters = kwargs.get('parameters', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/job_schedule_create_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/job_schedule_create_parameters.py new file mode 100644 index 000000000000..3100820f4de8 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/job_schedule_create_parameters.py @@ -0,0 +1,48 @@ +# 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 msrest.serialization import Model + + +class JobScheduleCreateParameters(Model): + """The parameters supplied to the create job schedule operation. + + All required parameters must be populated in order to send to Azure. + + :param schedule: Required. Gets or sets the schedule. + :type schedule: ~azure.mgmt.automation.models.ScheduleAssociationProperty + :param runbook: Required. Gets or sets the runbook. + :type runbook: ~azure.mgmt.automation.models.RunbookAssociationProperty + :param run_on: Gets or sets the hybrid worker group that the scheduled job + should run on. + :type run_on: str + :param parameters: Gets or sets a list of job properties. + :type parameters: dict[str, str] + """ + + _validation = { + 'schedule': {'required': True}, + 'runbook': {'required': True}, + } + + _attribute_map = { + 'schedule': {'key': 'properties.schedule', 'type': 'ScheduleAssociationProperty'}, + 'runbook': {'key': 'properties.runbook', 'type': 'RunbookAssociationProperty'}, + 'run_on': {'key': 'properties.runOn', 'type': 'str'}, + 'parameters': {'key': 'properties.parameters', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(JobScheduleCreateParameters, self).__init__(**kwargs) + self.schedule = kwargs.get('schedule', None) + self.runbook = kwargs.get('runbook', None) + self.run_on = kwargs.get('run_on', None) + self.parameters = kwargs.get('parameters', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/job_schedule_create_parameters_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/job_schedule_create_parameters_py3.py new file mode 100644 index 000000000000..d1c71c503f71 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/job_schedule_create_parameters_py3.py @@ -0,0 +1,48 @@ +# 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 msrest.serialization import Model + + +class JobScheduleCreateParameters(Model): + """The parameters supplied to the create job schedule operation. + + All required parameters must be populated in order to send to Azure. + + :param schedule: Required. Gets or sets the schedule. + :type schedule: ~azure.mgmt.automation.models.ScheduleAssociationProperty + :param runbook: Required. Gets or sets the runbook. + :type runbook: ~azure.mgmt.automation.models.RunbookAssociationProperty + :param run_on: Gets or sets the hybrid worker group that the scheduled job + should run on. + :type run_on: str + :param parameters: Gets or sets a list of job properties. + :type parameters: dict[str, str] + """ + + _validation = { + 'schedule': {'required': True}, + 'runbook': {'required': True}, + } + + _attribute_map = { + 'schedule': {'key': 'properties.schedule', 'type': 'ScheduleAssociationProperty'}, + 'runbook': {'key': 'properties.runbook', 'type': 'RunbookAssociationProperty'}, + 'run_on': {'key': 'properties.runOn', 'type': 'str'}, + 'parameters': {'key': 'properties.parameters', 'type': '{str}'}, + } + + def __init__(self, *, schedule, runbook, run_on: str=None, parameters=None, **kwargs) -> None: + super(JobScheduleCreateParameters, self).__init__(**kwargs) + self.schedule = schedule + self.runbook = runbook + self.run_on = run_on + self.parameters = parameters diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/job_schedule_paged.py b/azure-mgmt-automation/azure/mgmt/automation/models/job_schedule_paged.py new file mode 100644 index 000000000000..67dffa06782f --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/job_schedule_paged.py @@ -0,0 +1,27 @@ +# 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 msrest.paging import Paged + + +class JobSchedulePaged(Paged): + """ + A paging container for iterating over a list of :class:`JobSchedule ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[JobSchedule]'} + } + + def __init__(self, *args, **kwargs): + + super(JobSchedulePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/job_schedule_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/job_schedule_py3.py new file mode 100644 index 000000000000..846dd103735f --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/job_schedule_py3.py @@ -0,0 +1,66 @@ +# 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 msrest.serialization import Model + + +class JobSchedule(Model): + """Definition of the job schedule. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Gets the id of the resource. + :vartype id: str + :ivar name: Gets the name of the variable. + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param job_schedule_id: Gets or sets the id of job schedule. + :type job_schedule_id: str + :param schedule: Gets or sets the schedule. + :type schedule: ~azure.mgmt.automation.models.ScheduleAssociationProperty + :param runbook: Gets or sets the runbook. + :type runbook: ~azure.mgmt.automation.models.RunbookAssociationProperty + :param run_on: Gets or sets the hybrid worker group that the scheduled job + should run on. + :type run_on: str + :param parameters: Gets or sets the parameters of the job schedule. + :type parameters: dict[str, str] + """ + + _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'}, + 'job_schedule_id': {'key': 'properties.jobScheduleId', 'type': 'str'}, + 'schedule': {'key': 'properties.schedule', 'type': 'ScheduleAssociationProperty'}, + 'runbook': {'key': 'properties.runbook', 'type': 'RunbookAssociationProperty'}, + 'run_on': {'key': 'properties.runOn', 'type': 'str'}, + 'parameters': {'key': 'properties.parameters', 'type': '{str}'}, + } + + def __init__(self, *, job_schedule_id: str=None, schedule=None, runbook=None, run_on: str=None, parameters=None, **kwargs) -> None: + super(JobSchedule, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.job_schedule_id = job_schedule_id + self.schedule = schedule + self.runbook = runbook + self.run_on = run_on + self.parameters = parameters diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/job_stream.py b/azure-mgmt-automation/azure/mgmt/automation/models/job_stream.py new file mode 100644 index 000000000000..2e763d476ce3 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/job_stream.py @@ -0,0 +1,53 @@ +# 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 msrest.serialization import Model + + +class JobStream(Model): + """Definition of the job stream. + + :param id: Gets or sets the id of the resource. + :type id: str + :param job_stream_id: Gets or sets the id of the job stream. + :type job_stream_id: str + :param time: Gets or sets the creation time of the job. + :type time: datetime + :param stream_type: Gets or sets the stream type. Possible values include: + 'Progress', 'Output', 'Warning', 'Error', 'Debug', 'Verbose', 'Any' + :type stream_type: str or ~azure.mgmt.automation.models.JobStreamType + :param stream_text: Gets or sets the stream text. + :type stream_text: str + :param summary: Gets or sets the summary. + :type summary: str + :param value: Gets or sets the values of the job stream. + :type value: dict[str, object] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'job_stream_id': {'key': 'properties.jobStreamId', 'type': 'str'}, + 'time': {'key': 'properties.time', 'type': 'iso-8601'}, + 'stream_type': {'key': 'properties.streamType', 'type': 'str'}, + 'stream_text': {'key': 'properties.streamText', 'type': 'str'}, + 'summary': {'key': 'properties.summary', 'type': 'str'}, + 'value': {'key': 'properties.value', 'type': '{object}'}, + } + + def __init__(self, **kwargs): + super(JobStream, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.job_stream_id = kwargs.get('job_stream_id', None) + self.time = kwargs.get('time', None) + self.stream_type = kwargs.get('stream_type', None) + self.stream_text = kwargs.get('stream_text', None) + self.summary = kwargs.get('summary', None) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/job_stream_list_result.py b/azure-mgmt-automation/azure/mgmt/automation/models/job_stream_list_result.py new file mode 100644 index 000000000000..283d1517032b --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/job_stream_list_result.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class JobStreamListResult(Model): + """The response model for the list job stream operation. + + :param value: A list of job streams. + :type value: list[~azure.mgmt.automation.models.JobStream] + :param next_link: Gets or sets the next link. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[JobStream]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(JobStreamListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/job_stream_list_result_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/job_stream_list_result_py3.py new file mode 100644 index 000000000000..a71178a0e339 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/job_stream_list_result_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class JobStreamListResult(Model): + """The response model for the list job stream operation. + + :param value: A list of job streams. + :type value: list[~azure.mgmt.automation.models.JobStream] + :param next_link: Gets or sets the next link. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[JobStream]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: + super(JobStreamListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/job_stream_paged.py b/azure-mgmt-automation/azure/mgmt/automation/models/job_stream_paged.py new file mode 100644 index 000000000000..23a2b0883111 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/job_stream_paged.py @@ -0,0 +1,27 @@ +# 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 msrest.paging import Paged + + +class JobStreamPaged(Paged): + """ + A paging container for iterating over a list of :class:`JobStream ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[JobStream]'} + } + + def __init__(self, *args, **kwargs): + + super(JobStreamPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/job_stream_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/job_stream_py3.py new file mode 100644 index 000000000000..aa08cdc94a1e --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/job_stream_py3.py @@ -0,0 +1,53 @@ +# 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 msrest.serialization import Model + + +class JobStream(Model): + """Definition of the job stream. + + :param id: Gets or sets the id of the resource. + :type id: str + :param job_stream_id: Gets or sets the id of the job stream. + :type job_stream_id: str + :param time: Gets or sets the creation time of the job. + :type time: datetime + :param stream_type: Gets or sets the stream type. Possible values include: + 'Progress', 'Output', 'Warning', 'Error', 'Debug', 'Verbose', 'Any' + :type stream_type: str or ~azure.mgmt.automation.models.JobStreamType + :param stream_text: Gets or sets the stream text. + :type stream_text: str + :param summary: Gets or sets the summary. + :type summary: str + :param value: Gets or sets the values of the job stream. + :type value: dict[str, object] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'job_stream_id': {'key': 'properties.jobStreamId', 'type': 'str'}, + 'time': {'key': 'properties.time', 'type': 'iso-8601'}, + 'stream_type': {'key': 'properties.streamType', 'type': 'str'}, + 'stream_text': {'key': 'properties.streamText', 'type': 'str'}, + 'summary': {'key': 'properties.summary', 'type': 'str'}, + 'value': {'key': 'properties.value', 'type': '{object}'}, + } + + def __init__(self, *, id: str=None, job_stream_id: str=None, time=None, stream_type=None, stream_text: str=None, summary: str=None, value=None, **kwargs) -> None: + super(JobStream, self).__init__(**kwargs) + self.id = id + self.job_stream_id = job_stream_id + self.time = time + self.stream_type = stream_type + self.stream_text = stream_text + self.summary = summary + self.value = value diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/key.py b/azure-mgmt-automation/azure/mgmt/automation/models/key.py new file mode 100644 index 000000000000..61490af1fcce --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/key.py @@ -0,0 +1,39 @@ +# 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 msrest.serialization import Model + + +class Key(Model): + """Automation key which is used to register a DSC Node. + + :param key_name: Automation key name. Possible values include: 'primary', + 'secondary' + :type key_name: str or ~azure.mgmt.automation.models.AutomationKeyName + :param permissions: Automation key permissions. Possible values include: + 'Full' + :type permissions: str or + ~azure.mgmt.automation.models.AutomationKeyPermissions + :param value: Value of the Automation Key used for registration. + :type value: str + """ + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'permissions': {'key': 'permissions', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Key, self).__init__(**kwargs) + self.key_name = kwargs.get('key_name', None) + self.permissions = kwargs.get('permissions', None) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/key_paged.py b/azure-mgmt-automation/azure/mgmt/automation/models/key_paged.py new file mode 100644 index 000000000000..52ecde8e3e97 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/key_paged.py @@ -0,0 +1,27 @@ +# 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 msrest.paging import Paged + + +class KeyPaged(Paged): + """ + A paging container for iterating over a list of :class:`Key ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Key]'} + } + + def __init__(self, *args, **kwargs): + + super(KeyPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/key_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/key_py3.py new file mode 100644 index 000000000000..ddc82dd70083 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/key_py3.py @@ -0,0 +1,39 @@ +# 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 msrest.serialization import Model + + +class Key(Model): + """Automation key which is used to register a DSC Node. + + :param key_name: Automation key name. Possible values include: 'primary', + 'secondary' + :type key_name: str or ~azure.mgmt.automation.models.AutomationKeyName + :param permissions: Automation key permissions. Possible values include: + 'Full' + :type permissions: str or + ~azure.mgmt.automation.models.AutomationKeyPermissions + :param value: Value of the Automation Key used for registration. + :type value: str + """ + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'permissions': {'key': 'permissions', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, key_name=None, permissions=None, value: str=None, **kwargs) -> None: + super(Key, self).__init__(**kwargs) + self.key_name = key_name + self.permissions = permissions + self.value = value diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/linked_workspace.py b/azure-mgmt-automation/azure/mgmt/automation/models/linked_workspace.py new file mode 100644 index 000000000000..733c46fef8a9 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/linked_workspace.py @@ -0,0 +1,35 @@ +# 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 msrest.serialization import Model + + +class LinkedWorkspace(Model): + """Definition of the linked workspace. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Gets the id of the linked workspace. + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LinkedWorkspace, self).__init__(**kwargs) + self.id = None diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/linked_workspace_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/linked_workspace_py3.py new file mode 100644 index 000000000000..2c43c6ee01e6 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/linked_workspace_py3.py @@ -0,0 +1,35 @@ +# 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 msrest.serialization import Model + + +class LinkedWorkspace(Model): + """Definition of the linked workspace. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Gets the id of the linked workspace. + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(LinkedWorkspace, self).__init__(**kwargs) + self.id = None diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/linux_properties.py b/azure-mgmt-automation/azure/mgmt/automation/models/linux_properties.py new file mode 100644 index 000000000000..81f2768b28d0 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/linux_properties.py @@ -0,0 +1,41 @@ +# 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 msrest.serialization import Model + + +class LinuxProperties(Model): + """Linux specific update configuration. + + :param included_package_classifications: Update classifications included + in the software update configuration. Possible values include: + 'Unclassified', 'Critical', 'Security', 'Other' + :type included_package_classifications: str or + ~azure.mgmt.automation.models.LinuxUpdateClasses + :param excluded_package_name_masks: packages excluded from the software + update configuration. + :type excluded_package_name_masks: list[str] + :param included_package_name_masks: packages included from the software + update configuration. + :type included_package_name_masks: list[str] + """ + + _attribute_map = { + 'included_package_classifications': {'key': 'includedPackageClassifications', 'type': 'str'}, + 'excluded_package_name_masks': {'key': 'excludedPackageNameMasks', 'type': '[str]'}, + 'included_package_name_masks': {'key': 'includedPackageNameMasks', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(LinuxProperties, self).__init__(**kwargs) + self.included_package_classifications = kwargs.get('included_package_classifications', None) + self.excluded_package_name_masks = kwargs.get('excluded_package_name_masks', None) + self.included_package_name_masks = kwargs.get('included_package_name_masks', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/linux_properties_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/linux_properties_py3.py new file mode 100644 index 000000000000..278230551cf4 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/linux_properties_py3.py @@ -0,0 +1,41 @@ +# 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 msrest.serialization import Model + + +class LinuxProperties(Model): + """Linux specific update configuration. + + :param included_package_classifications: Update classifications included + in the software update configuration. Possible values include: + 'Unclassified', 'Critical', 'Security', 'Other' + :type included_package_classifications: str or + ~azure.mgmt.automation.models.LinuxUpdateClasses + :param excluded_package_name_masks: packages excluded from the software + update configuration. + :type excluded_package_name_masks: list[str] + :param included_package_name_masks: packages included from the software + update configuration. + :type included_package_name_masks: list[str] + """ + + _attribute_map = { + 'included_package_classifications': {'key': 'includedPackageClassifications', 'type': 'str'}, + 'excluded_package_name_masks': {'key': 'excludedPackageNameMasks', 'type': '[str]'}, + 'included_package_name_masks': {'key': 'includedPackageNameMasks', 'type': '[str]'}, + } + + def __init__(self, *, included_package_classifications=None, excluded_package_name_masks=None, included_package_name_masks=None, **kwargs) -> None: + super(LinuxProperties, self).__init__(**kwargs) + self.included_package_classifications = included_package_classifications + self.excluded_package_name_masks = excluded_package_name_masks + self.included_package_name_masks = included_package_name_masks diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/module.py b/azure-mgmt-automation/azure/mgmt/automation/models/module.py new file mode 100644 index 000000000000..42ae30b4df88 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/module.py @@ -0,0 +1,99 @@ +# 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 .tracked_resource import TrackedResource + + +class Module(TrackedResource): + """Definition of the module type. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: The Azure Region where the resource lives + :type location: str + :param is_global: Gets or sets the isGlobal flag of the module. + :type is_global: bool + :param version: Gets or sets the version of the module. + :type version: str + :param size_in_bytes: Gets or sets the size in bytes of the module. + :type size_in_bytes: long + :param activity_count: Gets or sets the activity count of the module. + :type activity_count: int + :param provisioning_state: Gets or sets the provisioning state of the + module. Possible values include: 'Created', 'Creating', + 'StartingImportModuleRunbook', 'RunningImportModuleRunbook', + 'ContentRetrieved', 'ContentDownloaded', 'ContentValidated', + 'ConnectionTypeImported', 'ContentStored', 'ModuleDataStored', + 'ActivitiesStored', 'ModuleImportRunbookComplete', 'Succeeded', 'Failed', + 'Cancelled', 'Updating' + :type provisioning_state: str or + ~azure.mgmt.automation.models.ModuleProvisioningState + :param content_link: Gets or sets the contentLink of the module. + :type content_link: ~azure.mgmt.automation.models.ContentLink + :param error: Gets or sets the error info of the module. + :type error: ~azure.mgmt.automation.models.ModuleErrorInfo + :param creation_time: Gets or sets the creation time. + :type creation_time: datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: datetime + :param description: Gets or sets the description. + :type description: str + :param etag: Gets or sets the etag of the resource. + :type etag: str + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'is_global': {'key': 'properties.isGlobal', 'type': 'bool'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'size_in_bytes': {'key': 'properties.sizeInBytes', 'type': 'long'}, + 'activity_count': {'key': 'properties.activityCount', 'type': 'int'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ModuleProvisioningState'}, + 'content_link': {'key': 'properties.contentLink', 'type': 'ContentLink'}, + 'error': {'key': 'properties.error', 'type': 'ModuleErrorInfo'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Module, self).__init__(**kwargs) + self.is_global = kwargs.get('is_global', None) + self.version = kwargs.get('version', None) + self.size_in_bytes = kwargs.get('size_in_bytes', None) + self.activity_count = kwargs.get('activity_count', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.content_link = kwargs.get('content_link', None) + self.error = kwargs.get('error', None) + self.creation_time = kwargs.get('creation_time', None) + self.last_modified_time = kwargs.get('last_modified_time', None) + self.description = kwargs.get('description', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/module_create_or_update_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/module_create_or_update_parameters.py new file mode 100644 index 000000000000..577e599cc3d4 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/module_create_or_update_parameters.py @@ -0,0 +1,46 @@ +# 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 msrest.serialization import Model + + +class ModuleCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update module operation. + + All required parameters must be populated in order to send to Azure. + + :param content_link: Required. Gets or sets the module content link. + :type content_link: ~azure.mgmt.automation.models.ContentLink + :param name: Gets or sets name of the resource. + :type name: str + :param location: Gets or sets the location of the resource. + :type location: str + :param tags: Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + """ + + _validation = { + 'content_link': {'required': True}, + } + + _attribute_map = { + 'content_link': {'key': 'properties.contentLink', 'type': 'ContentLink'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(ModuleCreateOrUpdateParameters, self).__init__(**kwargs) + self.content_link = kwargs.get('content_link', None) + self.name = kwargs.get('name', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/module_create_or_update_parameters_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/module_create_or_update_parameters_py3.py new file mode 100644 index 000000000000..24d88d21738e --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/module_create_or_update_parameters_py3.py @@ -0,0 +1,46 @@ +# 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 msrest.serialization import Model + + +class ModuleCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update module operation. + + All required parameters must be populated in order to send to Azure. + + :param content_link: Required. Gets or sets the module content link. + :type content_link: ~azure.mgmt.automation.models.ContentLink + :param name: Gets or sets name of the resource. + :type name: str + :param location: Gets or sets the location of the resource. + :type location: str + :param tags: Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + """ + + _validation = { + 'content_link': {'required': True}, + } + + _attribute_map = { + 'content_link': {'key': 'properties.contentLink', 'type': 'ContentLink'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, content_link, name: str=None, location: str=None, tags=None, **kwargs) -> None: + super(ModuleCreateOrUpdateParameters, self).__init__(**kwargs) + self.content_link = content_link + self.name = name + self.location = location + self.tags = tags diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/module_error_info.py b/azure-mgmt-automation/azure/mgmt/automation/models/module_error_info.py new file mode 100644 index 000000000000..c6a71afae26f --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/module_error_info.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class ModuleErrorInfo(Model): + """Definition of the module error info type. + + :param code: Gets or sets the error code. + :type code: str + :param message: Gets or sets the error message. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ModuleErrorInfo, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/module_error_info_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/module_error_info_py3.py new file mode 100644 index 000000000000..d6fef006260f --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/module_error_info_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class ModuleErrorInfo(Model): + """Definition of the module error info type. + + :param code: Gets or sets the error code. + :type code: str + :param message: Gets or sets the error message. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, message: str=None, **kwargs) -> None: + super(ModuleErrorInfo, self).__init__(**kwargs) + self.code = code + self.message = message diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/module_paged.py b/azure-mgmt-automation/azure/mgmt/automation/models/module_paged.py new file mode 100644 index 000000000000..f0ef5b2596c3 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/module_paged.py @@ -0,0 +1,27 @@ +# 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 msrest.paging import Paged + + +class ModulePaged(Paged): + """ + A paging container for iterating over a list of :class:`Module ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Module]'} + } + + def __init__(self, *args, **kwargs): + + super(ModulePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/module_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/module_py3.py new file mode 100644 index 000000000000..f599c432ac5d --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/module_py3.py @@ -0,0 +1,99 @@ +# 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 .tracked_resource import TrackedResource + + +class Module(TrackedResource): + """Definition of the module type. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: The Azure Region where the resource lives + :type location: str + :param is_global: Gets or sets the isGlobal flag of the module. + :type is_global: bool + :param version: Gets or sets the version of the module. + :type version: str + :param size_in_bytes: Gets or sets the size in bytes of the module. + :type size_in_bytes: long + :param activity_count: Gets or sets the activity count of the module. + :type activity_count: int + :param provisioning_state: Gets or sets the provisioning state of the + module. Possible values include: 'Created', 'Creating', + 'StartingImportModuleRunbook', 'RunningImportModuleRunbook', + 'ContentRetrieved', 'ContentDownloaded', 'ContentValidated', + 'ConnectionTypeImported', 'ContentStored', 'ModuleDataStored', + 'ActivitiesStored', 'ModuleImportRunbookComplete', 'Succeeded', 'Failed', + 'Cancelled', 'Updating' + :type provisioning_state: str or + ~azure.mgmt.automation.models.ModuleProvisioningState + :param content_link: Gets or sets the contentLink of the module. + :type content_link: ~azure.mgmt.automation.models.ContentLink + :param error: Gets or sets the error info of the module. + :type error: ~azure.mgmt.automation.models.ModuleErrorInfo + :param creation_time: Gets or sets the creation time. + :type creation_time: datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: datetime + :param description: Gets or sets the description. + :type description: str + :param etag: Gets or sets the etag of the resource. + :type etag: str + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'is_global': {'key': 'properties.isGlobal', 'type': 'bool'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'size_in_bytes': {'key': 'properties.sizeInBytes', 'type': 'long'}, + 'activity_count': {'key': 'properties.activityCount', 'type': 'int'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ModuleProvisioningState'}, + 'content_link': {'key': 'properties.contentLink', 'type': 'ContentLink'}, + 'error': {'key': 'properties.error', 'type': 'ModuleErrorInfo'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, tags=None, location: str=None, is_global: bool=None, version: str=None, size_in_bytes: int=None, activity_count: int=None, provisioning_state=None, content_link=None, error=None, creation_time=None, last_modified_time=None, description: str=None, etag: str=None, **kwargs) -> None: + super(Module, self).__init__(tags=tags, location=location, **kwargs) + self.is_global = is_global + self.version = version + self.size_in_bytes = size_in_bytes + self.activity_count = activity_count + self.provisioning_state = provisioning_state + self.content_link = content_link + self.error = error + self.creation_time = creation_time + self.last_modified_time = last_modified_time + self.description = description + self.etag = etag diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/module_update_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/module_update_parameters.py new file mode 100644 index 000000000000..26c150f96d18 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/module_update_parameters.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class ModuleUpdateParameters(Model): + """The parameters supplied to the update module operation. + + :param content_link: Gets or sets the module content link. + :type content_link: ~azure.mgmt.automation.models.ContentLink + :param name: Gets or sets name of the resource. + :type name: str + :param location: Gets or sets the location of the resource. + :type location: str + :param tags: Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'content_link': {'key': 'properties.contentLink', 'type': 'ContentLink'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(ModuleUpdateParameters, self).__init__(**kwargs) + self.content_link = kwargs.get('content_link', None) + self.name = kwargs.get('name', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/module_update_parameters_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/module_update_parameters_py3.py new file mode 100644 index 000000000000..2fc647d7a4a0 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/module_update_parameters_py3.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class ModuleUpdateParameters(Model): + """The parameters supplied to the update module operation. + + :param content_link: Gets or sets the module content link. + :type content_link: ~azure.mgmt.automation.models.ContentLink + :param name: Gets or sets name of the resource. + :type name: str + :param location: Gets or sets the location of the resource. + :type location: str + :param tags: Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'content_link': {'key': 'properties.contentLink', 'type': 'ContentLink'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, content_link=None, name: str=None, location: str=None, tags=None, **kwargs) -> None: + super(ModuleUpdateParameters, self).__init__(**kwargs) + self.content_link = content_link + self.name = name + self.location = location + self.tags = tags diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/operation.py b/azure-mgmt-automation/azure/mgmt/automation/models/operation.py new file mode 100644 index 000000000000..0ca40f3d1f3c --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/operation.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class Operation(Model): + """Automation REST API operation. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: Provider, Resource and Operation values + :type display: ~azure.mgmt.automation.models.OperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/operation_display.py b/azure-mgmt-automation/azure/mgmt/automation/models/operation_display.py new file mode 100644 index 000000000000..0ee4b0326a86 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/operation_display.py @@ -0,0 +1,37 @@ +# 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 msrest.serialization import Model + + +class OperationDisplay(Model): + """Provider, Resource and Operation values. + + :param provider: Service provider: Microsoft.Automation + :type provider: str + :param resource: Resource on which the operation is performed: Runbooks, + Jobs etc. + :type resource: str + :param operation: Operation type: Read, write, delete, etc. + :type operation: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/operation_display_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/operation_display_py3.py new file mode 100644 index 000000000000..a62509ae366a --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/operation_display_py3.py @@ -0,0 +1,37 @@ +# 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 msrest.serialization import Model + + +class OperationDisplay(Model): + """Provider, Resource and Operation values. + + :param provider: Service provider: Microsoft.Automation + :type provider: str + :param resource: Resource on which the operation is performed: Runbooks, + Jobs etc. + :type resource: str + :param operation: Operation type: Read, write, delete, etc. + :type operation: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/operation_paged.py b/azure-mgmt-automation/azure/mgmt/automation/models/operation_paged.py new file mode 100644 index 000000000000..54f994c4bc4c --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/operation_paged.py @@ -0,0 +1,27 @@ +# 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 msrest.paging import Paged + + +class OperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Operation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Operation]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/operation_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/operation_py3.py new file mode 100644 index 000000000000..7a2cf5bf6945 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/operation_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class Operation(Model): + """Automation REST API operation. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: Provider, Resource and Operation values + :type display: ~azure.mgmt.automation.models.OperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, *, name: str=None, display=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/proxy_resource.py b/azure-mgmt-automation/azure/mgmt/automation/models/proxy_resource.py new file mode 100644 index 000000000000..034561ccb158 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/proxy_resource.py @@ -0,0 +1,43 @@ +# 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 .resource import Resource + + +class ProxyResource(Resource): + """The resource model definition for a ARM proxy resource. It will have + everything other than required location and tags. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + """ + + _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'}, + } + + def __init__(self, **kwargs): + super(ProxyResource, self).__init__(**kwargs) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/proxy_resource_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/proxy_resource_py3.py new file mode 100644 index 000000000000..52afe235bef2 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/proxy_resource_py3.py @@ -0,0 +1,43 @@ +# 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 .resource import Resource + + +class ProxyResource(Resource): + """The resource model definition for a ARM proxy resource. It will have + everything other than required location and tags. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + """ + + _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'}, + } + + def __init__(self, **kwargs) -> None: + super(ProxyResource, self).__init__(**kwargs) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/resource.py b/azure-mgmt-automation/azure/mgmt/automation/models/resource.py new file mode 100644 index 000000000000..a5db7e68c972 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/resource.py @@ -0,0 +1,45 @@ +# 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 msrest.serialization import Model + + +class Resource(Model): + """The core properties of ARM resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + """ + + _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'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/resource_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/resource_py3.py new file mode 100644 index 000000000000..4504e2610512 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/resource_py3.py @@ -0,0 +1,45 @@ +# 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 msrest.serialization import Model + + +class Resource(Model): + """The core properties of ARM resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + """ + + _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'}, + } + + def __init__(self, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/run_as_credential_association_property.py b/azure-mgmt-automation/azure/mgmt/automation/models/run_as_credential_association_property.py new file mode 100644 index 000000000000..924bbddb85b9 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/run_as_credential_association_property.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class RunAsCredentialAssociationProperty(Model): + """Definition of runas credential to use for hybrid worker. + + :param name: Gets or sets the name of the credential. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RunAsCredentialAssociationProperty, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/run_as_credential_association_property_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/run_as_credential_association_property_py3.py new file mode 100644 index 000000000000..8ce6418f8fb2 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/run_as_credential_association_property_py3.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class RunAsCredentialAssociationProperty(Model): + """Definition of runas credential to use for hybrid worker. + + :param name: Gets or sets the name of the credential. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, **kwargs) -> None: + super(RunAsCredentialAssociationProperty, self).__init__(**kwargs) + self.name = name diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/runbook.py b/azure-mgmt-automation/azure/mgmt/automation/models/runbook.py new file mode 100644 index 000000000000..2b67486ad7e9 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/runbook.py @@ -0,0 +1,120 @@ +# 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 .tracked_resource import TrackedResource + + +class Runbook(TrackedResource): + """Definition of the runbook type. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: The Azure Region where the resource lives + :type location: str + :param runbook_type: Gets or sets the type of the runbook. Possible values + include: 'Script', 'Graph', 'PowerShellWorkflow', 'PowerShell', + 'GraphPowerShellWorkflow', 'GraphPowerShell' + :type runbook_type: str or ~azure.mgmt.automation.models.RunbookTypeEnum + :param publish_content_link: Gets or sets the published runbook content + link. + :type publish_content_link: ~azure.mgmt.automation.models.ContentLink + :param state: Gets or sets the state of the runbook. Possible values + include: 'New', 'Edit', 'Published' + :type state: str or ~azure.mgmt.automation.models.RunbookState + :param log_verbose: Gets or sets verbose log option. + :type log_verbose: bool + :param log_progress: Gets or sets progress log option. + :type log_progress: bool + :param log_activity_trace: Gets or sets the option to log activity trace + of the runbook. + :type log_activity_trace: int + :param job_count: Gets or sets the job count of the runbook. + :type job_count: int + :param parameters: Gets or sets the runbook parameters. + :type parameters: dict[str, + ~azure.mgmt.automation.models.RunbookParameter] + :param output_types: Gets or sets the runbook output types. + :type output_types: list[str] + :param draft: Gets or sets the draft runbook properties. + :type draft: ~azure.mgmt.automation.models.RunbookDraft + :param provisioning_state: Gets or sets the provisioning state of the + runbook. Possible values include: 'Succeeded' + :type provisioning_state: str or + ~azure.mgmt.automation.models.RunbookProvisioningState + :param last_modified_by: Gets or sets the last modified by. + :type last_modified_by: str + :param creation_time: Gets or sets the creation time. + :type creation_time: datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: datetime + :param description: Gets or sets the description. + :type description: str + :param etag: Gets or sets the etag of the resource. + :type etag: str + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'runbook_type': {'key': 'properties.runbookType', 'type': 'str'}, + 'publish_content_link': {'key': 'properties.publishContentLink', 'type': 'ContentLink'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'log_verbose': {'key': 'properties.logVerbose', 'type': 'bool'}, + 'log_progress': {'key': 'properties.logProgress', 'type': 'bool'}, + 'log_activity_trace': {'key': 'properties.logActivityTrace', 'type': 'int'}, + 'job_count': {'key': 'properties.jobCount', 'type': 'int'}, + 'parameters': {'key': 'properties.parameters', 'type': '{RunbookParameter}'}, + 'output_types': {'key': 'properties.outputTypes', 'type': '[str]'}, + 'draft': {'key': 'properties.draft', 'type': 'RunbookDraft'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'RunbookProvisioningState'}, + 'last_modified_by': {'key': 'properties.lastModifiedBy', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Runbook, self).__init__(**kwargs) + self.runbook_type = kwargs.get('runbook_type', None) + self.publish_content_link = kwargs.get('publish_content_link', None) + self.state = kwargs.get('state', None) + self.log_verbose = kwargs.get('log_verbose', None) + self.log_progress = kwargs.get('log_progress', None) + self.log_activity_trace = kwargs.get('log_activity_trace', None) + self.job_count = kwargs.get('job_count', None) + self.parameters = kwargs.get('parameters', None) + self.output_types = kwargs.get('output_types', None) + self.draft = kwargs.get('draft', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.creation_time = kwargs.get('creation_time', None) + self.last_modified_time = kwargs.get('last_modified_time', None) + self.description = kwargs.get('description', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/runbook_association_property.py b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_association_property.py new file mode 100644 index 000000000000..a08dec1d2eff --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_association_property.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class RunbookAssociationProperty(Model): + """The runbook property associated with the entity. + + :param name: Gets or sets the name of the runbook. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RunbookAssociationProperty, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/runbook_association_property_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_association_property_py3.py new file mode 100644 index 000000000000..c151e85a9ae0 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_association_property_py3.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class RunbookAssociationProperty(Model): + """The runbook property associated with the entity. + + :param name: Gets or sets the name of the runbook. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, **kwargs) -> None: + super(RunbookAssociationProperty, self).__init__(**kwargs) + self.name = name diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/runbook_create_or_update_draft_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_create_or_update_draft_parameters.py new file mode 100644 index 000000000000..b40bb2b725cc --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_create_or_update_draft_parameters.py @@ -0,0 +1,34 @@ +# 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 msrest.serialization import Model + + +class RunbookCreateOrUpdateDraftParameters(Model): + """The parameters supplied to the create or update runbook operation. + + All required parameters must be populated in order to send to Azure. + + :param runbook_content: Required. Content of the Runbook. + :type runbook_content: str + """ + + _validation = { + 'runbook_content': {'required': True}, + } + + _attribute_map = { + 'runbook_content': {'key': 'runbookContent', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RunbookCreateOrUpdateDraftParameters, self).__init__(**kwargs) + self.runbook_content = kwargs.get('runbook_content', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/runbook_create_or_update_draft_parameters_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_create_or_update_draft_parameters_py3.py new file mode 100644 index 000000000000..66e30d01df63 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_create_or_update_draft_parameters_py3.py @@ -0,0 +1,34 @@ +# 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 msrest.serialization import Model + + +class RunbookCreateOrUpdateDraftParameters(Model): + """The parameters supplied to the create or update runbook operation. + + All required parameters must be populated in order to send to Azure. + + :param runbook_content: Required. Content of the Runbook. + :type runbook_content: str + """ + + _validation = { + 'runbook_content': {'required': True}, + } + + _attribute_map = { + 'runbook_content': {'key': 'runbookContent', 'type': 'str'}, + } + + def __init__(self, *, runbook_content: str, **kwargs) -> None: + super(RunbookCreateOrUpdateDraftParameters, self).__init__(**kwargs) + self.runbook_content = runbook_content diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/runbook_create_or_update_draft_properties.py b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_create_or_update_draft_properties.py new file mode 100644 index 000000000000..837d4e52578b --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_create_or_update_draft_properties.py @@ -0,0 +1,58 @@ +# 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 msrest.serialization import Model + + +class RunbookCreateOrUpdateDraftProperties(Model): + """The parameters supplied to the create or update dratft runbook properties. + + All required parameters must be populated in order to send to Azure. + + :param log_verbose: Gets or sets verbose log option. + :type log_verbose: bool + :param log_progress: Gets or sets progress log option. + :type log_progress: bool + :param runbook_type: Required. Gets or sets the type of the runbook. + Possible values include: 'Script', 'Graph', 'PowerShellWorkflow', + 'PowerShell', 'GraphPowerShellWorkflow', 'GraphPowerShell' + :type runbook_type: str or ~azure.mgmt.automation.models.RunbookTypeEnum + :param draft: Required. Gets or sets the draft runbook properties. + :type draft: ~azure.mgmt.automation.models.RunbookDraft + :param description: Gets or sets the description of the runbook. + :type description: str + :param log_activity_trace: Gets or sets the activity-level tracing options + of the runbook. + :type log_activity_trace: int + """ + + _validation = { + 'runbook_type': {'required': True}, + 'draft': {'required': True}, + } + + _attribute_map = { + 'log_verbose': {'key': 'logVerbose', 'type': 'bool'}, + 'log_progress': {'key': 'logProgress', 'type': 'bool'}, + 'runbook_type': {'key': 'runbookType', 'type': 'str'}, + 'draft': {'key': 'draft', 'type': 'RunbookDraft'}, + 'description': {'key': 'description', 'type': 'str'}, + 'log_activity_trace': {'key': 'logActivityTrace', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(RunbookCreateOrUpdateDraftProperties, self).__init__(**kwargs) + self.log_verbose = kwargs.get('log_verbose', None) + self.log_progress = kwargs.get('log_progress', None) + self.runbook_type = kwargs.get('runbook_type', None) + self.draft = kwargs.get('draft', None) + self.description = kwargs.get('description', None) + self.log_activity_trace = kwargs.get('log_activity_trace', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/runbook_create_or_update_draft_properties_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_create_or_update_draft_properties_py3.py new file mode 100644 index 000000000000..ab14a99076e7 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_create_or_update_draft_properties_py3.py @@ -0,0 +1,58 @@ +# 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 msrest.serialization import Model + + +class RunbookCreateOrUpdateDraftProperties(Model): + """The parameters supplied to the create or update dratft runbook properties. + + All required parameters must be populated in order to send to Azure. + + :param log_verbose: Gets or sets verbose log option. + :type log_verbose: bool + :param log_progress: Gets or sets progress log option. + :type log_progress: bool + :param runbook_type: Required. Gets or sets the type of the runbook. + Possible values include: 'Script', 'Graph', 'PowerShellWorkflow', + 'PowerShell', 'GraphPowerShellWorkflow', 'GraphPowerShell' + :type runbook_type: str or ~azure.mgmt.automation.models.RunbookTypeEnum + :param draft: Required. Gets or sets the draft runbook properties. + :type draft: ~azure.mgmt.automation.models.RunbookDraft + :param description: Gets or sets the description of the runbook. + :type description: str + :param log_activity_trace: Gets or sets the activity-level tracing options + of the runbook. + :type log_activity_trace: int + """ + + _validation = { + 'runbook_type': {'required': True}, + 'draft': {'required': True}, + } + + _attribute_map = { + 'log_verbose': {'key': 'logVerbose', 'type': 'bool'}, + 'log_progress': {'key': 'logProgress', 'type': 'bool'}, + 'runbook_type': {'key': 'runbookType', 'type': 'str'}, + 'draft': {'key': 'draft', 'type': 'RunbookDraft'}, + 'description': {'key': 'description', 'type': 'str'}, + 'log_activity_trace': {'key': 'logActivityTrace', 'type': 'int'}, + } + + def __init__(self, *, runbook_type, draft, log_verbose: bool=None, log_progress: bool=None, description: str=None, log_activity_trace: int=None, **kwargs) -> None: + super(RunbookCreateOrUpdateDraftProperties, self).__init__(**kwargs) + self.log_verbose = log_verbose + self.log_progress = log_progress + self.runbook_type = runbook_type + self.draft = draft + self.description = description + self.log_activity_trace = log_activity_trace diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/runbook_create_or_update_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_create_or_update_parameters.py new file mode 100644 index 000000000000..0b92104234a1 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_create_or_update_parameters.py @@ -0,0 +1,74 @@ +# 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 msrest.serialization import Model + + +class RunbookCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update runbook operation. + + All required parameters must be populated in order to send to Azure. + + :param log_verbose: Gets or sets verbose log option. + :type log_verbose: bool + :param log_progress: Gets or sets progress log option. + :type log_progress: bool + :param runbook_type: Required. Gets or sets the type of the runbook. + Possible values include: 'Script', 'Graph', 'PowerShellWorkflow', + 'PowerShell', 'GraphPowerShellWorkflow', 'GraphPowerShell' + :type runbook_type: str or ~azure.mgmt.automation.models.RunbookTypeEnum + :param draft: Gets or sets the draft runbook properties. + :type draft: ~azure.mgmt.automation.models.RunbookDraft + :param publish_content_link: Gets or sets the published runbook content + link. + :type publish_content_link: ~azure.mgmt.automation.models.ContentLink + :param description: Gets or sets the description of the runbook. + :type description: str + :param log_activity_trace: Gets or sets the activity-level tracing options + of the runbook. + :type log_activity_trace: int + :param name: Gets or sets the name of the resource. + :type name: str + :param location: Gets or sets the location of the resource. + :type location: str + :param tags: Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + """ + + _validation = { + 'runbook_type': {'required': True}, + } + + _attribute_map = { + 'log_verbose': {'key': 'properties.logVerbose', 'type': 'bool'}, + 'log_progress': {'key': 'properties.logProgress', 'type': 'bool'}, + 'runbook_type': {'key': 'properties.runbookType', 'type': 'str'}, + 'draft': {'key': 'properties.draft', 'type': 'RunbookDraft'}, + 'publish_content_link': {'key': 'properties.publishContentLink', 'type': 'ContentLink'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'log_activity_trace': {'key': 'properties.logActivityTrace', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(RunbookCreateOrUpdateParameters, self).__init__(**kwargs) + self.log_verbose = kwargs.get('log_verbose', None) + self.log_progress = kwargs.get('log_progress', None) + self.runbook_type = kwargs.get('runbook_type', None) + self.draft = kwargs.get('draft', None) + self.publish_content_link = kwargs.get('publish_content_link', None) + self.description = kwargs.get('description', None) + self.log_activity_trace = kwargs.get('log_activity_trace', None) + self.name = kwargs.get('name', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/runbook_create_or_update_parameters_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_create_or_update_parameters_py3.py new file mode 100644 index 000000000000..bb46adf42cad --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_create_or_update_parameters_py3.py @@ -0,0 +1,74 @@ +# 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 msrest.serialization import Model + + +class RunbookCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update runbook operation. + + All required parameters must be populated in order to send to Azure. + + :param log_verbose: Gets or sets verbose log option. + :type log_verbose: bool + :param log_progress: Gets or sets progress log option. + :type log_progress: bool + :param runbook_type: Required. Gets or sets the type of the runbook. + Possible values include: 'Script', 'Graph', 'PowerShellWorkflow', + 'PowerShell', 'GraphPowerShellWorkflow', 'GraphPowerShell' + :type runbook_type: str or ~azure.mgmt.automation.models.RunbookTypeEnum + :param draft: Gets or sets the draft runbook properties. + :type draft: ~azure.mgmt.automation.models.RunbookDraft + :param publish_content_link: Gets or sets the published runbook content + link. + :type publish_content_link: ~azure.mgmt.automation.models.ContentLink + :param description: Gets or sets the description of the runbook. + :type description: str + :param log_activity_trace: Gets or sets the activity-level tracing options + of the runbook. + :type log_activity_trace: int + :param name: Gets or sets the name of the resource. + :type name: str + :param location: Gets or sets the location of the resource. + :type location: str + :param tags: Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + """ + + _validation = { + 'runbook_type': {'required': True}, + } + + _attribute_map = { + 'log_verbose': {'key': 'properties.logVerbose', 'type': 'bool'}, + 'log_progress': {'key': 'properties.logProgress', 'type': 'bool'}, + 'runbook_type': {'key': 'properties.runbookType', 'type': 'str'}, + 'draft': {'key': 'properties.draft', 'type': 'RunbookDraft'}, + 'publish_content_link': {'key': 'properties.publishContentLink', 'type': 'ContentLink'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'log_activity_trace': {'key': 'properties.logActivityTrace', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, runbook_type, log_verbose: bool=None, log_progress: bool=None, draft=None, publish_content_link=None, description: str=None, log_activity_trace: int=None, name: str=None, location: str=None, tags=None, **kwargs) -> None: + super(RunbookCreateOrUpdateParameters, self).__init__(**kwargs) + self.log_verbose = log_verbose + self.log_progress = log_progress + self.runbook_type = runbook_type + self.draft = draft + self.publish_content_link = publish_content_link + self.description = description + self.log_activity_trace = log_activity_trace + self.name = name + self.location = location + self.tags = tags diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/runbook_draft.py b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_draft.py new file mode 100644 index 000000000000..ddf11d89d6f4 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_draft.py @@ -0,0 +1,50 @@ +# 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 msrest.serialization import Model + + +class RunbookDraft(Model): + """Definition of the runbook type. + + :param in_edit: Gets or sets whether runbook is in edit mode. + :type in_edit: bool + :param draft_content_link: Gets or sets the draft runbook content link. + :type draft_content_link: ~azure.mgmt.automation.models.ContentLink + :param creation_time: Gets or sets the creation time of the runbook draft. + :type creation_time: datetime + :param last_modified_time: Gets or sets the last modified time of the + runbook draft. + :type last_modified_time: datetime + :param parameters: Gets or sets the runbook draft parameters. + :type parameters: dict[str, + ~azure.mgmt.automation.models.RunbookParameter] + :param output_types: Gets or sets the runbook output types. + :type output_types: list[str] + """ + + _attribute_map = { + 'in_edit': {'key': 'inEdit', 'type': 'bool'}, + 'draft_content_link': {'key': 'draftContentLink', 'type': 'ContentLink'}, + 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'lastModifiedTime', 'type': 'iso-8601'}, + 'parameters': {'key': 'parameters', 'type': '{RunbookParameter}'}, + 'output_types': {'key': 'outputTypes', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(RunbookDraft, self).__init__(**kwargs) + self.in_edit = kwargs.get('in_edit', None) + self.draft_content_link = kwargs.get('draft_content_link', None) + self.creation_time = kwargs.get('creation_time', None) + self.last_modified_time = kwargs.get('last_modified_time', None) + self.parameters = kwargs.get('parameters', None) + self.output_types = kwargs.get('output_types', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/runbook_draft_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_draft_py3.py new file mode 100644 index 000000000000..9a17bdd78333 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_draft_py3.py @@ -0,0 +1,50 @@ +# 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 msrest.serialization import Model + + +class RunbookDraft(Model): + """Definition of the runbook type. + + :param in_edit: Gets or sets whether runbook is in edit mode. + :type in_edit: bool + :param draft_content_link: Gets or sets the draft runbook content link. + :type draft_content_link: ~azure.mgmt.automation.models.ContentLink + :param creation_time: Gets or sets the creation time of the runbook draft. + :type creation_time: datetime + :param last_modified_time: Gets or sets the last modified time of the + runbook draft. + :type last_modified_time: datetime + :param parameters: Gets or sets the runbook draft parameters. + :type parameters: dict[str, + ~azure.mgmt.automation.models.RunbookParameter] + :param output_types: Gets or sets the runbook output types. + :type output_types: list[str] + """ + + _attribute_map = { + 'in_edit': {'key': 'inEdit', 'type': 'bool'}, + 'draft_content_link': {'key': 'draftContentLink', 'type': 'ContentLink'}, + 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'lastModifiedTime', 'type': 'iso-8601'}, + 'parameters': {'key': 'parameters', 'type': '{RunbookParameter}'}, + 'output_types': {'key': 'outputTypes', 'type': '[str]'}, + } + + def __init__(self, *, in_edit: bool=None, draft_content_link=None, creation_time=None, last_modified_time=None, parameters=None, output_types=None, **kwargs) -> None: + super(RunbookDraft, self).__init__(**kwargs) + self.in_edit = in_edit + self.draft_content_link = draft_content_link + self.creation_time = creation_time + self.last_modified_time = last_modified_time + self.parameters = parameters + self.output_types = output_types diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/runbook_draft_undo_edit_result.py b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_draft_undo_edit_result.py new file mode 100644 index 000000000000..ceab272b7b23 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_draft_undo_edit_result.py @@ -0,0 +1,45 @@ +# 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 msrest.serialization import Model + + +class RunbookDraftUndoEditResult(Model): + """The response model for the undoedit runbook operation. + + :param status_code: Possible values include: 'Continue', + 'SwitchingProtocols', 'OK', 'Created', 'Accepted', + 'NonAuthoritativeInformation', 'NoContent', 'ResetContent', + 'PartialContent', 'MultipleChoices', 'Ambiguous', 'MovedPermanently', + 'Moved', 'Found', 'Redirect', 'SeeOther', 'RedirectMethod', 'NotModified', + 'UseProxy', 'Unused', 'TemporaryRedirect', 'RedirectKeepVerb', + 'BadRequest', 'Unauthorized', 'PaymentRequired', 'Forbidden', 'NotFound', + 'MethodNotAllowed', 'NotAcceptable', 'ProxyAuthenticationRequired', + 'RequestTimeout', 'Conflict', 'Gone', 'LengthRequired', + 'PreconditionFailed', 'RequestEntityTooLarge', 'RequestUriTooLong', + 'UnsupportedMediaType', 'RequestedRangeNotSatisfiable', + 'ExpectationFailed', 'UpgradeRequired', 'InternalServerError', + 'NotImplemented', 'BadGateway', 'ServiceUnavailable', 'GatewayTimeout', + 'HttpVersionNotSupported' + :type status_code: str or ~azure.mgmt.automation.models.HttpStatusCode + :param request_id: + :type request_id: str + """ + + _attribute_map = { + 'status_code': {'key': 'statusCode', 'type': 'HttpStatusCode'}, + 'request_id': {'key': 'requestId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RunbookDraftUndoEditResult, self).__init__(**kwargs) + self.status_code = kwargs.get('status_code', None) + self.request_id = kwargs.get('request_id', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/runbook_draft_undo_edit_result_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_draft_undo_edit_result_py3.py new file mode 100644 index 000000000000..5ad27eb0cfdd --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_draft_undo_edit_result_py3.py @@ -0,0 +1,45 @@ +# 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 msrest.serialization import Model + + +class RunbookDraftUndoEditResult(Model): + """The response model for the undoedit runbook operation. + + :param status_code: Possible values include: 'Continue', + 'SwitchingProtocols', 'OK', 'Created', 'Accepted', + 'NonAuthoritativeInformation', 'NoContent', 'ResetContent', + 'PartialContent', 'MultipleChoices', 'Ambiguous', 'MovedPermanently', + 'Moved', 'Found', 'Redirect', 'SeeOther', 'RedirectMethod', 'NotModified', + 'UseProxy', 'Unused', 'TemporaryRedirect', 'RedirectKeepVerb', + 'BadRequest', 'Unauthorized', 'PaymentRequired', 'Forbidden', 'NotFound', + 'MethodNotAllowed', 'NotAcceptable', 'ProxyAuthenticationRequired', + 'RequestTimeout', 'Conflict', 'Gone', 'LengthRequired', + 'PreconditionFailed', 'RequestEntityTooLarge', 'RequestUriTooLong', + 'UnsupportedMediaType', 'RequestedRangeNotSatisfiable', + 'ExpectationFailed', 'UpgradeRequired', 'InternalServerError', + 'NotImplemented', 'BadGateway', 'ServiceUnavailable', 'GatewayTimeout', + 'HttpVersionNotSupported' + :type status_code: str or ~azure.mgmt.automation.models.HttpStatusCode + :param request_id: + :type request_id: str + """ + + _attribute_map = { + 'status_code': {'key': 'statusCode', 'type': 'HttpStatusCode'}, + 'request_id': {'key': 'requestId', 'type': 'str'}, + } + + def __init__(self, *, status_code=None, request_id: str=None, **kwargs) -> None: + super(RunbookDraftUndoEditResult, self).__init__(**kwargs) + self.status_code = status_code + self.request_id = request_id diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/runbook_paged.py b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_paged.py new file mode 100644 index 000000000000..d17b5bda87ba --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_paged.py @@ -0,0 +1,27 @@ +# 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 msrest.paging import Paged + + +class RunbookPaged(Paged): + """ + A paging container for iterating over a list of :class:`Runbook ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Runbook]'} + } + + def __init__(self, *args, **kwargs): + + super(RunbookPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/runbook_parameter.py b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_parameter.py new file mode 100644 index 000000000000..7158fbb2efbd --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_parameter.py @@ -0,0 +1,41 @@ +# 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 msrest.serialization import Model + + +class RunbookParameter(Model): + """Definition of the runbook parameter type. + + :param type: Gets or sets the type of the parameter. + :type type: str + :param is_mandatory: Gets or sets a Boolean value to indicate whether the + parameter is madatory or not. + :type is_mandatory: bool + :param position: Get or sets the position of the parameter. + :type position: int + :param default_value: Gets or sets the default value of parameter. + :type default_value: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'is_mandatory': {'key': 'isMandatory', 'type': 'bool'}, + 'position': {'key': 'position', 'type': 'int'}, + 'default_value': {'key': 'defaultValue', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RunbookParameter, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.is_mandatory = kwargs.get('is_mandatory', None) + self.position = kwargs.get('position', None) + self.default_value = kwargs.get('default_value', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/runbook_parameter_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_parameter_py3.py new file mode 100644 index 000000000000..78f9f5b22bb6 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_parameter_py3.py @@ -0,0 +1,41 @@ +# 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 msrest.serialization import Model + + +class RunbookParameter(Model): + """Definition of the runbook parameter type. + + :param type: Gets or sets the type of the parameter. + :type type: str + :param is_mandatory: Gets or sets a Boolean value to indicate whether the + parameter is madatory or not. + :type is_mandatory: bool + :param position: Get or sets the position of the parameter. + :type position: int + :param default_value: Gets or sets the default value of parameter. + :type default_value: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'is_mandatory': {'key': 'isMandatory', 'type': 'bool'}, + 'position': {'key': 'position', 'type': 'int'}, + 'default_value': {'key': 'defaultValue', 'type': 'str'}, + } + + def __init__(self, *, type: str=None, is_mandatory: bool=None, position: int=None, default_value: str=None, **kwargs) -> None: + super(RunbookParameter, self).__init__(**kwargs) + self.type = type + self.is_mandatory = is_mandatory + self.position = position + self.default_value = default_value diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/runbook_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_py3.py new file mode 100644 index 000000000000..00d3c62e4f0c --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_py3.py @@ -0,0 +1,120 @@ +# 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 .tracked_resource import TrackedResource + + +class Runbook(TrackedResource): + """Definition of the runbook type. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: The Azure Region where the resource lives + :type location: str + :param runbook_type: Gets or sets the type of the runbook. Possible values + include: 'Script', 'Graph', 'PowerShellWorkflow', 'PowerShell', + 'GraphPowerShellWorkflow', 'GraphPowerShell' + :type runbook_type: str or ~azure.mgmt.automation.models.RunbookTypeEnum + :param publish_content_link: Gets or sets the published runbook content + link. + :type publish_content_link: ~azure.mgmt.automation.models.ContentLink + :param state: Gets or sets the state of the runbook. Possible values + include: 'New', 'Edit', 'Published' + :type state: str or ~azure.mgmt.automation.models.RunbookState + :param log_verbose: Gets or sets verbose log option. + :type log_verbose: bool + :param log_progress: Gets or sets progress log option. + :type log_progress: bool + :param log_activity_trace: Gets or sets the option to log activity trace + of the runbook. + :type log_activity_trace: int + :param job_count: Gets or sets the job count of the runbook. + :type job_count: int + :param parameters: Gets or sets the runbook parameters. + :type parameters: dict[str, + ~azure.mgmt.automation.models.RunbookParameter] + :param output_types: Gets or sets the runbook output types. + :type output_types: list[str] + :param draft: Gets or sets the draft runbook properties. + :type draft: ~azure.mgmt.automation.models.RunbookDraft + :param provisioning_state: Gets or sets the provisioning state of the + runbook. Possible values include: 'Succeeded' + :type provisioning_state: str or + ~azure.mgmt.automation.models.RunbookProvisioningState + :param last_modified_by: Gets or sets the last modified by. + :type last_modified_by: str + :param creation_time: Gets or sets the creation time. + :type creation_time: datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: datetime + :param description: Gets or sets the description. + :type description: str + :param etag: Gets or sets the etag of the resource. + :type etag: str + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'runbook_type': {'key': 'properties.runbookType', 'type': 'str'}, + 'publish_content_link': {'key': 'properties.publishContentLink', 'type': 'ContentLink'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'log_verbose': {'key': 'properties.logVerbose', 'type': 'bool'}, + 'log_progress': {'key': 'properties.logProgress', 'type': 'bool'}, + 'log_activity_trace': {'key': 'properties.logActivityTrace', 'type': 'int'}, + 'job_count': {'key': 'properties.jobCount', 'type': 'int'}, + 'parameters': {'key': 'properties.parameters', 'type': '{RunbookParameter}'}, + 'output_types': {'key': 'properties.outputTypes', 'type': '[str]'}, + 'draft': {'key': 'properties.draft', 'type': 'RunbookDraft'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'RunbookProvisioningState'}, + 'last_modified_by': {'key': 'properties.lastModifiedBy', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, tags=None, location: str=None, runbook_type=None, publish_content_link=None, state=None, log_verbose: bool=None, log_progress: bool=None, log_activity_trace: int=None, job_count: int=None, parameters=None, output_types=None, draft=None, provisioning_state=None, last_modified_by: str=None, creation_time=None, last_modified_time=None, description: str=None, etag: str=None, **kwargs) -> None: + super(Runbook, self).__init__(tags=tags, location=location, **kwargs) + self.runbook_type = runbook_type + self.publish_content_link = publish_content_link + self.state = state + self.log_verbose = log_verbose + self.log_progress = log_progress + self.log_activity_trace = log_activity_trace + self.job_count = job_count + self.parameters = parameters + self.output_types = output_types + self.draft = draft + self.provisioning_state = provisioning_state + self.last_modified_by = last_modified_by + self.creation_time = creation_time + self.last_modified_time = last_modified_time + self.description = description + self.etag = etag diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/runbook_update_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_update_parameters.py new file mode 100644 index 000000000000..89c309654d1a --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_update_parameters.py @@ -0,0 +1,53 @@ +# 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 msrest.serialization import Model + + +class RunbookUpdateParameters(Model): + """The parameters supplied to the update runbook operation. + + :param description: Gets or sets the description of the runbook. + :type description: str + :param log_verbose: Gets or sets verbose log option. + :type log_verbose: bool + :param log_progress: Gets or sets progress log option. + :type log_progress: bool + :param log_activity_trace: Gets or sets the activity-level tracing options + of the runbook. + :type log_activity_trace: int + :param name: Gets or sets the name of the resource. + :type name: str + :param location: Gets or sets the location of the resource. + :type location: str + :param tags: Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'description': {'key': 'properties.description', 'type': 'str'}, + 'log_verbose': {'key': 'properties.logVerbose', 'type': 'bool'}, + 'log_progress': {'key': 'properties.logProgress', 'type': 'bool'}, + 'log_activity_trace': {'key': 'properties.logActivityTrace', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(RunbookUpdateParameters, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.log_verbose = kwargs.get('log_verbose', None) + self.log_progress = kwargs.get('log_progress', None) + self.log_activity_trace = kwargs.get('log_activity_trace', None) + self.name = kwargs.get('name', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/runbook_update_parameters_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_update_parameters_py3.py new file mode 100644 index 000000000000..2a94a4d6b297 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_update_parameters_py3.py @@ -0,0 +1,53 @@ +# 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 msrest.serialization import Model + + +class RunbookUpdateParameters(Model): + """The parameters supplied to the update runbook operation. + + :param description: Gets or sets the description of the runbook. + :type description: str + :param log_verbose: Gets or sets verbose log option. + :type log_verbose: bool + :param log_progress: Gets or sets progress log option. + :type log_progress: bool + :param log_activity_trace: Gets or sets the activity-level tracing options + of the runbook. + :type log_activity_trace: int + :param name: Gets or sets the name of the resource. + :type name: str + :param location: Gets or sets the location of the resource. + :type location: str + :param tags: Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'description': {'key': 'properties.description', 'type': 'str'}, + 'log_verbose': {'key': 'properties.logVerbose', 'type': 'bool'}, + 'log_progress': {'key': 'properties.logProgress', 'type': 'bool'}, + 'log_activity_trace': {'key': 'properties.logActivityTrace', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, description: str=None, log_verbose: bool=None, log_progress: bool=None, log_activity_trace: int=None, name: str=None, location: str=None, tags=None, **kwargs) -> None: + super(RunbookUpdateParameters, self).__init__(**kwargs) + self.description = description + self.log_verbose = log_verbose + self.log_progress = log_progress + self.log_activity_trace = log_activity_trace + self.name = name + self.location = location + self.tags = tags diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/schedule.py b/azure-mgmt-automation/azure/mgmt/automation/models/schedule.py new file mode 100644 index 000000000000..9af9363d2b27 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/schedule.py @@ -0,0 +1,106 @@ +# 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 msrest.serialization import Model + + +class Schedule(Model): + """Definition of the schedule. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Gets the id of the resource. + :vartype id: str + :ivar name: Gets name of the schedule. + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param start_time: Gets or sets the start time of the schedule. + :type start_time: datetime + :ivar start_time_offset_minutes: Gets the start time's offset in minutes. + :vartype start_time_offset_minutes: float + :param expiry_time: Gets or sets the end time of the schedule. + :type expiry_time: datetime + :param expiry_time_offset_minutes: Gets or sets the expiry time's offset + in minutes. + :type expiry_time_offset_minutes: float + :param is_enabled: Gets or sets a value indicating whether this schedule + is enabled. Default value: False . + :type is_enabled: bool + :param next_run: Gets or sets the next run time of the schedule. + :type next_run: datetime + :param next_run_offset_minutes: Gets or sets the next run time's offset in + minutes. + :type next_run_offset_minutes: float + :param interval: Gets or sets the interval of the schedule. + :type interval: int + :param frequency: Gets or sets the frequency of the schedule. Possible + values include: 'OneTime', 'Day', 'Hour', 'Week', 'Month' + :type frequency: str or ~azure.mgmt.automation.models.ScheduleFrequency + :param time_zone: Gets or sets the time zone of the schedule. + :type time_zone: str + :param advanced_schedule: Gets or sets the advanced schedule. + :type advanced_schedule: ~azure.mgmt.automation.models.AdvancedSchedule + :param creation_time: Gets or sets the creation time. + :type creation_time: datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: datetime + :param description: Gets or sets the description. + :type description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'start_time_offset_minutes': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'start_time_offset_minutes': {'key': 'properties.startTimeOffsetMinutes', 'type': 'float'}, + 'expiry_time': {'key': 'properties.expiryTime', 'type': 'iso-8601'}, + 'expiry_time_offset_minutes': {'key': 'properties.expiryTimeOffsetMinutes', 'type': 'float'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + 'next_run': {'key': 'properties.nextRun', 'type': 'iso-8601'}, + 'next_run_offset_minutes': {'key': 'properties.nextRunOffsetMinutes', 'type': 'float'}, + 'interval': {'key': 'properties.interval', 'type': 'int'}, + 'frequency': {'key': 'properties.frequency', 'type': 'str'}, + 'time_zone': {'key': 'properties.timeZone', 'type': 'str'}, + 'advanced_schedule': {'key': 'properties.advancedSchedule', 'type': 'AdvancedSchedule'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Schedule, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.start_time = kwargs.get('start_time', None) + self.start_time_offset_minutes = None + self.expiry_time = kwargs.get('expiry_time', None) + self.expiry_time_offset_minutes = kwargs.get('expiry_time_offset_minutes', None) + self.is_enabled = kwargs.get('is_enabled', False) + self.next_run = kwargs.get('next_run', None) + self.next_run_offset_minutes = kwargs.get('next_run_offset_minutes', None) + self.interval = kwargs.get('interval', None) + self.frequency = kwargs.get('frequency', None) + self.time_zone = kwargs.get('time_zone', None) + self.advanced_schedule = kwargs.get('advanced_schedule', None) + self.creation_time = kwargs.get('creation_time', None) + self.last_modified_time = kwargs.get('last_modified_time', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/schedule_association_property.py b/azure-mgmt-automation/azure/mgmt/automation/models/schedule_association_property.py new file mode 100644 index 000000000000..06a626bb9d64 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/schedule_association_property.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class ScheduleAssociationProperty(Model): + """The schedule property associated with the entity. + + :param name: Gets or sets the name of the schedule. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ScheduleAssociationProperty, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/schedule_association_property_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/schedule_association_property_py3.py new file mode 100644 index 000000000000..3d32d31a235f --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/schedule_association_property_py3.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class ScheduleAssociationProperty(Model): + """The schedule property associated with the entity. + + :param name: Gets or sets the name of the schedule. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, **kwargs) -> None: + super(ScheduleAssociationProperty, self).__init__(**kwargs) + self.name = name diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/schedule_create_or_update_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/schedule_create_or_update_parameters.py new file mode 100644 index 000000000000..95a97137f72b --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/schedule_create_or_update_parameters.py @@ -0,0 +1,65 @@ +# 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 msrest.serialization import Model + + +class ScheduleCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update schedule operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the name of the schedule. + :type name: str + :param description: Gets or sets the description of the schedule. + :type description: str + :param start_time: Required. Gets or sets the start time of the schedule. + :type start_time: datetime + :param expiry_time: Gets or sets the end time of the schedule. + :type expiry_time: datetime + :param interval: Gets or sets the interval of the schedule. + :type interval: object + :param frequency: Required. Possible values include: 'OneTime', 'Day', + 'Hour', 'Week', 'Month' + :type frequency: str or ~azure.mgmt.automation.models.ScheduleFrequency + :param time_zone: Gets or sets the time zone of the schedule. + :type time_zone: str + :param advanced_schedule: Gets or sets the AdvancedSchedule. + :type advanced_schedule: ~azure.mgmt.automation.models.AdvancedSchedule + """ + + _validation = { + 'name': {'required': True}, + 'start_time': {'required': True}, + 'frequency': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'expiry_time': {'key': 'properties.expiryTime', 'type': 'iso-8601'}, + 'interval': {'key': 'properties.interval', 'type': 'object'}, + 'frequency': {'key': 'properties.frequency', 'type': 'str'}, + 'time_zone': {'key': 'properties.timeZone', 'type': 'str'}, + 'advanced_schedule': {'key': 'properties.advancedSchedule', 'type': 'AdvancedSchedule'}, + } + + def __init__(self, **kwargs): + super(ScheduleCreateOrUpdateParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.description = kwargs.get('description', None) + self.start_time = kwargs.get('start_time', None) + self.expiry_time = kwargs.get('expiry_time', None) + self.interval = kwargs.get('interval', None) + self.frequency = kwargs.get('frequency', None) + self.time_zone = kwargs.get('time_zone', None) + self.advanced_schedule = kwargs.get('advanced_schedule', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/schedule_create_or_update_parameters_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/schedule_create_or_update_parameters_py3.py new file mode 100644 index 000000000000..f491ce536c6c --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/schedule_create_or_update_parameters_py3.py @@ -0,0 +1,65 @@ +# 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 msrest.serialization import Model + + +class ScheduleCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update schedule operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the name of the schedule. + :type name: str + :param description: Gets or sets the description of the schedule. + :type description: str + :param start_time: Required. Gets or sets the start time of the schedule. + :type start_time: datetime + :param expiry_time: Gets or sets the end time of the schedule. + :type expiry_time: datetime + :param interval: Gets or sets the interval of the schedule. + :type interval: object + :param frequency: Required. Possible values include: 'OneTime', 'Day', + 'Hour', 'Week', 'Month' + :type frequency: str or ~azure.mgmt.automation.models.ScheduleFrequency + :param time_zone: Gets or sets the time zone of the schedule. + :type time_zone: str + :param advanced_schedule: Gets or sets the AdvancedSchedule. + :type advanced_schedule: ~azure.mgmt.automation.models.AdvancedSchedule + """ + + _validation = { + 'name': {'required': True}, + 'start_time': {'required': True}, + 'frequency': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'expiry_time': {'key': 'properties.expiryTime', 'type': 'iso-8601'}, + 'interval': {'key': 'properties.interval', 'type': 'object'}, + 'frequency': {'key': 'properties.frequency', 'type': 'str'}, + 'time_zone': {'key': 'properties.timeZone', 'type': 'str'}, + 'advanced_schedule': {'key': 'properties.advancedSchedule', 'type': 'AdvancedSchedule'}, + } + + def __init__(self, *, name: str, start_time, frequency, description: str=None, expiry_time=None, interval=None, time_zone: str=None, advanced_schedule=None, **kwargs) -> None: + super(ScheduleCreateOrUpdateParameters, self).__init__(**kwargs) + self.name = name + self.description = description + self.start_time = start_time + self.expiry_time = expiry_time + self.interval = interval + self.frequency = frequency + self.time_zone = time_zone + self.advanced_schedule = advanced_schedule diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/schedule_paged.py b/azure-mgmt-automation/azure/mgmt/automation/models/schedule_paged.py new file mode 100644 index 000000000000..a19b966390c9 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/schedule_paged.py @@ -0,0 +1,27 @@ +# 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 msrest.paging import Paged + + +class SchedulePaged(Paged): + """ + A paging container for iterating over a list of :class:`Schedule ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Schedule]'} + } + + def __init__(self, *args, **kwargs): + + super(SchedulePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/schedule_properties.py b/azure-mgmt-automation/azure/mgmt/automation/models/schedule_properties.py new file mode 100644 index 000000000000..ca5388ed8a67 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/schedule_properties.py @@ -0,0 +1,91 @@ +# 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 msrest.serialization import Model + + +class ScheduleProperties(Model): + """Definition of schedule parameters. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param start_time: Gets or sets the start time of the schedule. + :type start_time: datetime + :ivar start_time_offset_minutes: Gets the start time's offset in minutes. + :vartype start_time_offset_minutes: float + :param expiry_time: Gets or sets the end time of the schedule. + :type expiry_time: datetime + :param expiry_time_offset_minutes: Gets or sets the expiry time's offset + in minutes. + :type expiry_time_offset_minutes: float + :param is_enabled: Gets or sets a value indicating whether this schedule + is enabled. Default value: False . + :type is_enabled: bool + :param next_run: Gets or sets the next run time of the schedule. + :type next_run: datetime + :param next_run_offset_minutes: Gets or sets the next run time's offset in + minutes. + :type next_run_offset_minutes: float + :param interval: Gets or sets the interval of the schedule. + :type interval: int + :param frequency: Gets or sets the frequency of the schedule. Possible + values include: 'OneTime', 'Day', 'Hour', 'Week', 'Month' + :type frequency: str or ~azure.mgmt.automation.models.ScheduleFrequency + :param time_zone: Gets or sets the time zone of the schedule. + :type time_zone: str + :param advanced_schedule: Gets or sets the advanced schedule. + :type advanced_schedule: ~azure.mgmt.automation.models.AdvancedSchedule + :param creation_time: Gets or sets the creation time. + :type creation_time: datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: datetime + :param description: Gets or sets the description. + :type description: str + """ + + _validation = { + 'start_time_offset_minutes': {'readonly': True}, + } + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'start_time_offset_minutes': {'key': 'startTimeOffsetMinutes', 'type': 'float'}, + 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, + 'expiry_time_offset_minutes': {'key': 'expiryTimeOffsetMinutes', 'type': 'float'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'next_run': {'key': 'nextRun', 'type': 'iso-8601'}, + 'next_run_offset_minutes': {'key': 'nextRunOffsetMinutes', 'type': 'float'}, + 'interval': {'key': 'interval', 'type': 'int'}, + 'frequency': {'key': 'frequency', 'type': 'str'}, + 'time_zone': {'key': 'timeZone', 'type': 'str'}, + 'advanced_schedule': {'key': 'advancedSchedule', 'type': 'AdvancedSchedule'}, + 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ScheduleProperties, self).__init__(**kwargs) + self.start_time = kwargs.get('start_time', None) + self.start_time_offset_minutes = None + self.expiry_time = kwargs.get('expiry_time', None) + self.expiry_time_offset_minutes = kwargs.get('expiry_time_offset_minutes', None) + self.is_enabled = kwargs.get('is_enabled', False) + self.next_run = kwargs.get('next_run', None) + self.next_run_offset_minutes = kwargs.get('next_run_offset_minutes', None) + self.interval = kwargs.get('interval', None) + self.frequency = kwargs.get('frequency', None) + self.time_zone = kwargs.get('time_zone', None) + self.advanced_schedule = kwargs.get('advanced_schedule', None) + self.creation_time = kwargs.get('creation_time', None) + self.last_modified_time = kwargs.get('last_modified_time', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/schedule_properties_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/schedule_properties_py3.py new file mode 100644 index 000000000000..a1482c6fbe53 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/schedule_properties_py3.py @@ -0,0 +1,91 @@ +# 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 msrest.serialization import Model + + +class ScheduleProperties(Model): + """Definition of schedule parameters. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param start_time: Gets or sets the start time of the schedule. + :type start_time: datetime + :ivar start_time_offset_minutes: Gets the start time's offset in minutes. + :vartype start_time_offset_minutes: float + :param expiry_time: Gets or sets the end time of the schedule. + :type expiry_time: datetime + :param expiry_time_offset_minutes: Gets or sets the expiry time's offset + in minutes. + :type expiry_time_offset_minutes: float + :param is_enabled: Gets or sets a value indicating whether this schedule + is enabled. Default value: False . + :type is_enabled: bool + :param next_run: Gets or sets the next run time of the schedule. + :type next_run: datetime + :param next_run_offset_minutes: Gets or sets the next run time's offset in + minutes. + :type next_run_offset_minutes: float + :param interval: Gets or sets the interval of the schedule. + :type interval: int + :param frequency: Gets or sets the frequency of the schedule. Possible + values include: 'OneTime', 'Day', 'Hour', 'Week', 'Month' + :type frequency: str or ~azure.mgmt.automation.models.ScheduleFrequency + :param time_zone: Gets or sets the time zone of the schedule. + :type time_zone: str + :param advanced_schedule: Gets or sets the advanced schedule. + :type advanced_schedule: ~azure.mgmt.automation.models.AdvancedSchedule + :param creation_time: Gets or sets the creation time. + :type creation_time: datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: datetime + :param description: Gets or sets the description. + :type description: str + """ + + _validation = { + 'start_time_offset_minutes': {'readonly': True}, + } + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'start_time_offset_minutes': {'key': 'startTimeOffsetMinutes', 'type': 'float'}, + 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, + 'expiry_time_offset_minutes': {'key': 'expiryTimeOffsetMinutes', 'type': 'float'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'next_run': {'key': 'nextRun', 'type': 'iso-8601'}, + 'next_run_offset_minutes': {'key': 'nextRunOffsetMinutes', 'type': 'float'}, + 'interval': {'key': 'interval', 'type': 'int'}, + 'frequency': {'key': 'frequency', 'type': 'str'}, + 'time_zone': {'key': 'timeZone', 'type': 'str'}, + 'advanced_schedule': {'key': 'advancedSchedule', 'type': 'AdvancedSchedule'}, + 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, start_time=None, expiry_time=None, expiry_time_offset_minutes: float=None, is_enabled: bool=False, next_run=None, next_run_offset_minutes: float=None, interval: int=None, frequency=None, time_zone: str=None, advanced_schedule=None, creation_time=None, last_modified_time=None, description: str=None, **kwargs) -> None: + super(ScheduleProperties, self).__init__(**kwargs) + self.start_time = start_time + self.start_time_offset_minutes = None + self.expiry_time = expiry_time + self.expiry_time_offset_minutes = expiry_time_offset_minutes + self.is_enabled = is_enabled + self.next_run = next_run + self.next_run_offset_minutes = next_run_offset_minutes + self.interval = interval + self.frequency = frequency + self.time_zone = time_zone + self.advanced_schedule = advanced_schedule + self.creation_time = creation_time + self.last_modified_time = last_modified_time + self.description = description diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/schedule_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/schedule_py3.py new file mode 100644 index 000000000000..936889ddea69 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/schedule_py3.py @@ -0,0 +1,106 @@ +# 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 msrest.serialization import Model + + +class Schedule(Model): + """Definition of the schedule. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Gets the id of the resource. + :vartype id: str + :ivar name: Gets name of the schedule. + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param start_time: Gets or sets the start time of the schedule. + :type start_time: datetime + :ivar start_time_offset_minutes: Gets the start time's offset in minutes. + :vartype start_time_offset_minutes: float + :param expiry_time: Gets or sets the end time of the schedule. + :type expiry_time: datetime + :param expiry_time_offset_minutes: Gets or sets the expiry time's offset + in minutes. + :type expiry_time_offset_minutes: float + :param is_enabled: Gets or sets a value indicating whether this schedule + is enabled. Default value: False . + :type is_enabled: bool + :param next_run: Gets or sets the next run time of the schedule. + :type next_run: datetime + :param next_run_offset_minutes: Gets or sets the next run time's offset in + minutes. + :type next_run_offset_minutes: float + :param interval: Gets or sets the interval of the schedule. + :type interval: int + :param frequency: Gets or sets the frequency of the schedule. Possible + values include: 'OneTime', 'Day', 'Hour', 'Week', 'Month' + :type frequency: str or ~azure.mgmt.automation.models.ScheduleFrequency + :param time_zone: Gets or sets the time zone of the schedule. + :type time_zone: str + :param advanced_schedule: Gets or sets the advanced schedule. + :type advanced_schedule: ~azure.mgmt.automation.models.AdvancedSchedule + :param creation_time: Gets or sets the creation time. + :type creation_time: datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: datetime + :param description: Gets or sets the description. + :type description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'start_time_offset_minutes': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'start_time_offset_minutes': {'key': 'properties.startTimeOffsetMinutes', 'type': 'float'}, + 'expiry_time': {'key': 'properties.expiryTime', 'type': 'iso-8601'}, + 'expiry_time_offset_minutes': {'key': 'properties.expiryTimeOffsetMinutes', 'type': 'float'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + 'next_run': {'key': 'properties.nextRun', 'type': 'iso-8601'}, + 'next_run_offset_minutes': {'key': 'properties.nextRunOffsetMinutes', 'type': 'float'}, + 'interval': {'key': 'properties.interval', 'type': 'int'}, + 'frequency': {'key': 'properties.frequency', 'type': 'str'}, + 'time_zone': {'key': 'properties.timeZone', 'type': 'str'}, + 'advanced_schedule': {'key': 'properties.advancedSchedule', 'type': 'AdvancedSchedule'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, *, start_time=None, expiry_time=None, expiry_time_offset_minutes: float=None, is_enabled: bool=False, next_run=None, next_run_offset_minutes: float=None, interval: int=None, frequency=None, time_zone: str=None, advanced_schedule=None, creation_time=None, last_modified_time=None, description: str=None, **kwargs) -> None: + super(Schedule, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.start_time = start_time + self.start_time_offset_minutes = None + self.expiry_time = expiry_time + self.expiry_time_offset_minutes = expiry_time_offset_minutes + self.is_enabled = is_enabled + self.next_run = next_run + self.next_run_offset_minutes = next_run_offset_minutes + self.interval = interval + self.frequency = frequency + self.time_zone = time_zone + self.advanced_schedule = advanced_schedule + self.creation_time = creation_time + self.last_modified_time = last_modified_time + self.description = description diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/schedule_update_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/schedule_update_parameters.py new file mode 100644 index 000000000000..fef62876c164 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/schedule_update_parameters.py @@ -0,0 +1,37 @@ +# 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 msrest.serialization import Model + + +class ScheduleUpdateParameters(Model): + """The parameters supplied to the update schedule operation. + + :param name: Gets or sets the name of the schedule. + :type name: str + :param description: Gets or sets the description of the schedule. + :type description: str + :param is_enabled: Gets or sets a value indicating whether this schedule + is enabled. + :type is_enabled: bool + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(ScheduleUpdateParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.description = kwargs.get('description', None) + self.is_enabled = kwargs.get('is_enabled', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/schedule_update_parameters_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/schedule_update_parameters_py3.py new file mode 100644 index 000000000000..d38f89562ee1 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/schedule_update_parameters_py3.py @@ -0,0 +1,37 @@ +# 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 msrest.serialization import Model + + +class ScheduleUpdateParameters(Model): + """The parameters supplied to the update schedule operation. + + :param name: Gets or sets the name of the schedule. + :type name: str + :param description: Gets or sets the description of the schedule. + :type description: str + :param is_enabled: Gets or sets a value indicating whether this schedule + is enabled. + :type is_enabled: bool + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + } + + def __init__(self, *, name: str=None, description: str=None, is_enabled: bool=None, **kwargs) -> None: + super(ScheduleUpdateParameters, self).__init__(**kwargs) + self.name = name + self.description = description + self.is_enabled = is_enabled diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/sku.py b/azure-mgmt-automation/azure/mgmt/automation/models/sku.py new file mode 100644 index 000000000000..b60d75249ad5 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/sku.py @@ -0,0 +1,43 @@ +# 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 msrest.serialization import Model + + +class Sku(Model): + """The account SKU. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the SKU name of the account. Possible + values include: 'Free', 'Basic' + :type name: str or ~azure.mgmt.automation.models.SkuNameEnum + :param family: Gets or sets the SKU family. + :type family: str + :param capacity: Gets or sets the SKU capacity. + :type capacity: int + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.family = kwargs.get('family', None) + self.capacity = kwargs.get('capacity', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/sku_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/sku_py3.py new file mode 100644 index 000000000000..49cba7f14588 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/sku_py3.py @@ -0,0 +1,43 @@ +# 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 msrest.serialization import Model + + +class Sku(Model): + """The account SKU. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the SKU name of the account. Possible + values include: 'Free', 'Basic' + :type name: str or ~azure.mgmt.automation.models.SkuNameEnum + :param family: Gets or sets the SKU family. + :type family: str + :param capacity: Gets or sets the SKU capacity. + :type capacity: int + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, *, name, family: str=None, capacity: int=None, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + self.family = family + self.capacity = capacity diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration.py b/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration.py new file mode 100644 index 000000000000..b2e5eec93568 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration.py @@ -0,0 +1,93 @@ +# 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 msrest.serialization import Model + + +class SoftwareUpdateConfiguration(Model): + """Software update 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 Azure. + + :ivar name: Resource name. + :vartype name: str + :ivar id: Resource Id. + :vartype id: str + :ivar type: Resource type + :vartype type: str + :param update_configuration: Required. update specific properties for the + Software update configuration + :type update_configuration: + ~azure.mgmt.automation.models.UpdateConfiguration + :param schedule_info: Required. Schedule information for the Software + update configuration + :type schedule_info: ~azure.mgmt.automation.models.ScheduleProperties + :ivar provisioning_state: Provisioning state for the software update + configuration, which only appears in the response. + :vartype provisioning_state: str + :param error: detailes of provisioning error + :type error: ~azure.mgmt.automation.models.ErrorResponse + :ivar creation_time: Creation time of theresource, which only appears in + the response. + :vartype creation_time: datetime + :ivar created_by: createdBy property, which only appears in the response. + :vartype created_by: str + :ivar last_modified_time: Last time resource was modified, which only + appears in the response. + :vartype last_modified_time: datetime + :ivar last_modified_by: lastModifiedBy property, which only appears in the + response. + :vartype last_modified_by: str + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'update_configuration': {'required': True}, + 'schedule_info': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'created_by': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'last_modified_by': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'update_configuration': {'key': 'properties.updateConfiguration', 'type': 'UpdateConfiguration'}, + 'schedule_info': {'key': 'properties.scheduleInfo', 'type': 'ScheduleProperties'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'error': {'key': 'properties.error', 'type': 'ErrorResponse'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'created_by': {'key': 'properties.createdBy', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'properties.lastModifiedBy', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SoftwareUpdateConfiguration, self).__init__(**kwargs) + self.name = None + self.id = None + self.type = None + self.update_configuration = kwargs.get('update_configuration', None) + self.schedule_info = kwargs.get('schedule_info', None) + self.provisioning_state = None + self.error = kwargs.get('error', None) + self.creation_time = None + self.created_by = None + self.last_modified_time = None + self.last_modified_by = None diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_collection_item.py b/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_collection_item.py new file mode 100644 index 000000000000..0f97f991cb86 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_collection_item.py @@ -0,0 +1,78 @@ +# 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 msrest.serialization import Model + + +class SoftwareUpdateConfigurationCollectionItem(Model): + """Software update configuration collection item properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Name of the software update configuration. + :vartype name: str + :ivar id: Resource Id of the software update configuration + :vartype id: str + :param update_configuration: Update specific properties of the software + update configuration. + :type update_configuration: + ~azure.mgmt.automation.models.CollectionItemUpdateConfiguration + :param frequency: execution frequency of the schedule associated with the + software update configuration. Possible values include: 'OneTime', 'Day', + 'Hour', 'Week', 'Month' + :type frequency: str or ~azure.mgmt.automation.models.ScheduleFrequency + :param start_time: the start time of the update. + :type start_time: datetime + :ivar creation_time: Creation time of the software update configuration, + which only appears in the response. + :vartype creation_time: datetime + :ivar last_modified_time: Last time software update configuration was + modified, which only appears in the response. + :vartype last_modified_time: datetime + :ivar provisioning_state: Provisioning state for the software update + configuration, which only appears in the response. + :vartype provisioning_state: str + :param next_run: ext run time of the update. + :type next_run: datetime + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'update_configuration': {'key': 'properties.updateConfiguration', 'type': 'CollectionItemUpdateConfiguration'}, + 'frequency': {'key': 'properties.frequency', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'next_run': {'key': 'properties.nextRun', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(SoftwareUpdateConfigurationCollectionItem, self).__init__(**kwargs) + self.name = None + self.id = None + self.update_configuration = kwargs.get('update_configuration', None) + self.frequency = kwargs.get('frequency', None) + self.start_time = kwargs.get('start_time', None) + self.creation_time = None + self.last_modified_time = None + self.provisioning_state = None + self.next_run = kwargs.get('next_run', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_collection_item_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_collection_item_py3.py new file mode 100644 index 000000000000..62cb1f0d1ea9 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_collection_item_py3.py @@ -0,0 +1,78 @@ +# 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 msrest.serialization import Model + + +class SoftwareUpdateConfigurationCollectionItem(Model): + """Software update configuration collection item properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Name of the software update configuration. + :vartype name: str + :ivar id: Resource Id of the software update configuration + :vartype id: str + :param update_configuration: Update specific properties of the software + update configuration. + :type update_configuration: + ~azure.mgmt.automation.models.CollectionItemUpdateConfiguration + :param frequency: execution frequency of the schedule associated with the + software update configuration. Possible values include: 'OneTime', 'Day', + 'Hour', 'Week', 'Month' + :type frequency: str or ~azure.mgmt.automation.models.ScheduleFrequency + :param start_time: the start time of the update. + :type start_time: datetime + :ivar creation_time: Creation time of the software update configuration, + which only appears in the response. + :vartype creation_time: datetime + :ivar last_modified_time: Last time software update configuration was + modified, which only appears in the response. + :vartype last_modified_time: datetime + :ivar provisioning_state: Provisioning state for the software update + configuration, which only appears in the response. + :vartype provisioning_state: str + :param next_run: ext run time of the update. + :type next_run: datetime + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'update_configuration': {'key': 'properties.updateConfiguration', 'type': 'CollectionItemUpdateConfiguration'}, + 'frequency': {'key': 'properties.frequency', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'next_run': {'key': 'properties.nextRun', 'type': 'iso-8601'}, + } + + def __init__(self, *, update_configuration=None, frequency=None, start_time=None, next_run=None, **kwargs) -> None: + super(SoftwareUpdateConfigurationCollectionItem, self).__init__(**kwargs) + self.name = None + self.id = None + self.update_configuration = update_configuration + self.frequency = frequency + self.start_time = start_time + self.creation_time = None + self.last_modified_time = None + self.provisioning_state = None + self.next_run = next_run diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_list_result.py b/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_list_result.py new file mode 100644 index 000000000000..e29160d8b3df --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_list_result.py @@ -0,0 +1,30 @@ +# 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 msrest.serialization import Model + + +class SoftwareUpdateConfigurationListResult(Model): + """result of listing all software update configuration. + + :param value: outer object returned when listing all software update + configurations + :type value: + list[~azure.mgmt.automation.models.SoftwareUpdateConfigurationCollectionItem] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SoftwareUpdateConfigurationCollectionItem]'}, + } + + def __init__(self, **kwargs): + super(SoftwareUpdateConfigurationListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_list_result_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_list_result_py3.py new file mode 100644 index 000000000000..e8775fae90f7 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_list_result_py3.py @@ -0,0 +1,30 @@ +# 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 msrest.serialization import Model + + +class SoftwareUpdateConfigurationListResult(Model): + """result of listing all software update configuration. + + :param value: outer object returned when listing all software update + configurations + :type value: + list[~azure.mgmt.automation.models.SoftwareUpdateConfigurationCollectionItem] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SoftwareUpdateConfigurationCollectionItem]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(SoftwareUpdateConfigurationListResult, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_machine_run.py b/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_machine_run.py new file mode 100644 index 000000000000..5307f22d1d3c --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_machine_run.py @@ -0,0 +1,124 @@ +# 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 msrest.serialization import Model + + +class SoftwareUpdateConfigurationMachineRun(Model): + """Software update configuration machine run model. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Name of the software update configuration machine run + :vartype name: str + :ivar id: Resource Id of the software update configuration machine run + :vartype id: str + :ivar target_computer: name of the updated computer + :vartype target_computer: str + :ivar target_computer_type: type of the updated computer. + :vartype target_computer_type: str + :param software_update_configuration: software update configuration + triggered this run + :type software_update_configuration: + ~azure.mgmt.automation.models.UpdateConfigurationNavigation + :ivar status: Status of the software update configuration machine run. + :vartype status: str + :ivar os_type: Operating system target of the software update + configuration triggered this run + :vartype os_type: str + :ivar correlation_id: correlation id of the software update configuration + machine run + :vartype correlation_id: str + :ivar source_computer_id: source computer id of the software update + configuration machine run + :vartype source_computer_id: str + :ivar start_time: Start time of the software update configuration machine + run. + :vartype start_time: datetime + :ivar end_time: End time of the software update configuration machine run. + :vartype end_time: datetime + :ivar configured_duration: configured duration for the software update + configuration run. + :vartype configured_duration: str + :param job: Job associated with the software update configuration machine + run + :type job: ~azure.mgmt.automation.models.JobNavigation + :ivar creation_time: Creation time of theresource, which only appears in + the response. + :vartype creation_time: datetime + :ivar created_by: createdBy property, which only appears in the response. + :vartype created_by: str + :ivar last_modified_time: Last time resource was modified, which only + appears in the response. + :vartype last_modified_time: datetime + :ivar last_modified_by: lastModifiedBy property, which only appears in the + response. + :vartype last_modified_by: str + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'target_computer': {'readonly': True}, + 'target_computer_type': {'readonly': True}, + 'status': {'readonly': True}, + 'os_type': {'readonly': True}, + 'correlation_id': {'readonly': True}, + 'source_computer_id': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'configured_duration': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'created_by': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'last_modified_by': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'target_computer': {'key': 'properties.targetComputer', 'type': 'str'}, + 'target_computer_type': {'key': 'properties.targetComputerType', 'type': 'str'}, + 'software_update_configuration': {'key': 'properties.softwareUpdateConfiguration', 'type': 'UpdateConfigurationNavigation'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'correlation_id': {'key': 'properties.correlationId', 'type': 'str'}, + 'source_computer_id': {'key': 'properties.sourceComputerId', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'configured_duration': {'key': 'properties.configuredDuration', 'type': 'str'}, + 'job': {'key': 'properties.job', 'type': 'JobNavigation'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'created_by': {'key': 'properties.createdBy', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'properties.lastModifiedBy', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SoftwareUpdateConfigurationMachineRun, self).__init__(**kwargs) + self.name = None + self.id = None + self.target_computer = None + self.target_computer_type = None + self.software_update_configuration = kwargs.get('software_update_configuration', None) + self.status = None + self.os_type = None + self.correlation_id = None + self.source_computer_id = None + self.start_time = None + self.end_time = None + self.configured_duration = None + self.job = kwargs.get('job', None) + self.creation_time = None + self.created_by = None + self.last_modified_time = None + self.last_modified_by = None diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_machine_run_list_result.py b/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_machine_run_list_result.py new file mode 100644 index 000000000000..1b86f66bd4ed --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_machine_run_list_result.py @@ -0,0 +1,34 @@ +# 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 msrest.serialization import Model + + +class SoftwareUpdateConfigurationMachineRunListResult(Model): + """result of listing all software update configuration machine runs. + + :param value: outer object returned when listing all software update + configuration machine runs + :type value: + list[~azure.mgmt.automation.models.SoftwareUpdateConfigurationMachineRun] + :param next_link: link to next page of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SoftwareUpdateConfigurationMachineRun]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SoftwareUpdateConfigurationMachineRunListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_machine_run_list_result_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_machine_run_list_result_py3.py new file mode 100644 index 000000000000..5e5294543df2 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_machine_run_list_result_py3.py @@ -0,0 +1,34 @@ +# 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 msrest.serialization import Model + + +class SoftwareUpdateConfigurationMachineRunListResult(Model): + """result of listing all software update configuration machine runs. + + :param value: outer object returned when listing all software update + configuration machine runs + :type value: + list[~azure.mgmt.automation.models.SoftwareUpdateConfigurationMachineRun] + :param next_link: link to next page of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SoftwareUpdateConfigurationMachineRun]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: + super(SoftwareUpdateConfigurationMachineRunListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_machine_run_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_machine_run_py3.py new file mode 100644 index 000000000000..55927e6f7590 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_machine_run_py3.py @@ -0,0 +1,124 @@ +# 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 msrest.serialization import Model + + +class SoftwareUpdateConfigurationMachineRun(Model): + """Software update configuration machine run model. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Name of the software update configuration machine run + :vartype name: str + :ivar id: Resource Id of the software update configuration machine run + :vartype id: str + :ivar target_computer: name of the updated computer + :vartype target_computer: str + :ivar target_computer_type: type of the updated computer. + :vartype target_computer_type: str + :param software_update_configuration: software update configuration + triggered this run + :type software_update_configuration: + ~azure.mgmt.automation.models.UpdateConfigurationNavigation + :ivar status: Status of the software update configuration machine run. + :vartype status: str + :ivar os_type: Operating system target of the software update + configuration triggered this run + :vartype os_type: str + :ivar correlation_id: correlation id of the software update configuration + machine run + :vartype correlation_id: str + :ivar source_computer_id: source computer id of the software update + configuration machine run + :vartype source_computer_id: str + :ivar start_time: Start time of the software update configuration machine + run. + :vartype start_time: datetime + :ivar end_time: End time of the software update configuration machine run. + :vartype end_time: datetime + :ivar configured_duration: configured duration for the software update + configuration run. + :vartype configured_duration: str + :param job: Job associated with the software update configuration machine + run + :type job: ~azure.mgmt.automation.models.JobNavigation + :ivar creation_time: Creation time of theresource, which only appears in + the response. + :vartype creation_time: datetime + :ivar created_by: createdBy property, which only appears in the response. + :vartype created_by: str + :ivar last_modified_time: Last time resource was modified, which only + appears in the response. + :vartype last_modified_time: datetime + :ivar last_modified_by: lastModifiedBy property, which only appears in the + response. + :vartype last_modified_by: str + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'target_computer': {'readonly': True}, + 'target_computer_type': {'readonly': True}, + 'status': {'readonly': True}, + 'os_type': {'readonly': True}, + 'correlation_id': {'readonly': True}, + 'source_computer_id': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'configured_duration': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'created_by': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'last_modified_by': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'target_computer': {'key': 'properties.targetComputer', 'type': 'str'}, + 'target_computer_type': {'key': 'properties.targetComputerType', 'type': 'str'}, + 'software_update_configuration': {'key': 'properties.softwareUpdateConfiguration', 'type': 'UpdateConfigurationNavigation'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'correlation_id': {'key': 'properties.correlationId', 'type': 'str'}, + 'source_computer_id': {'key': 'properties.sourceComputerId', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'configured_duration': {'key': 'properties.configuredDuration', 'type': 'str'}, + 'job': {'key': 'properties.job', 'type': 'JobNavigation'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'created_by': {'key': 'properties.createdBy', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'properties.lastModifiedBy', 'type': 'str'}, + } + + def __init__(self, *, software_update_configuration=None, job=None, **kwargs) -> None: + super(SoftwareUpdateConfigurationMachineRun, self).__init__(**kwargs) + self.name = None + self.id = None + self.target_computer = None + self.target_computer_type = None + self.software_update_configuration = software_update_configuration + self.status = None + self.os_type = None + self.correlation_id = None + self.source_computer_id = None + self.start_time = None + self.end_time = None + self.configured_duration = None + self.job = job + self.creation_time = None + self.created_by = None + self.last_modified_time = None + self.last_modified_by = None diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_py3.py new file mode 100644 index 000000000000..9c5b28ff2cb5 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_py3.py @@ -0,0 +1,93 @@ +# 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 msrest.serialization import Model + + +class SoftwareUpdateConfiguration(Model): + """Software update 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 Azure. + + :ivar name: Resource name. + :vartype name: str + :ivar id: Resource Id. + :vartype id: str + :ivar type: Resource type + :vartype type: str + :param update_configuration: Required. update specific properties for the + Software update configuration + :type update_configuration: + ~azure.mgmt.automation.models.UpdateConfiguration + :param schedule_info: Required. Schedule information for the Software + update configuration + :type schedule_info: ~azure.mgmt.automation.models.ScheduleProperties + :ivar provisioning_state: Provisioning state for the software update + configuration, which only appears in the response. + :vartype provisioning_state: str + :param error: detailes of provisioning error + :type error: ~azure.mgmt.automation.models.ErrorResponse + :ivar creation_time: Creation time of theresource, which only appears in + the response. + :vartype creation_time: datetime + :ivar created_by: createdBy property, which only appears in the response. + :vartype created_by: str + :ivar last_modified_time: Last time resource was modified, which only + appears in the response. + :vartype last_modified_time: datetime + :ivar last_modified_by: lastModifiedBy property, which only appears in the + response. + :vartype last_modified_by: str + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'update_configuration': {'required': True}, + 'schedule_info': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'created_by': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'last_modified_by': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'update_configuration': {'key': 'properties.updateConfiguration', 'type': 'UpdateConfiguration'}, + 'schedule_info': {'key': 'properties.scheduleInfo', 'type': 'ScheduleProperties'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'error': {'key': 'properties.error', 'type': 'ErrorResponse'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'created_by': {'key': 'properties.createdBy', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'properties.lastModifiedBy', 'type': 'str'}, + } + + def __init__(self, *, update_configuration, schedule_info, error=None, **kwargs) -> None: + super(SoftwareUpdateConfiguration, self).__init__(**kwargs) + self.name = None + self.id = None + self.type = None + self.update_configuration = update_configuration + self.schedule_info = schedule_info + self.provisioning_state = None + self.error = error + self.creation_time = None + self.created_by = None + self.last_modified_time = None + self.last_modified_by = None diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_run.py b/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_run.py new file mode 100644 index 000000000000..71c188478ea2 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_run.py @@ -0,0 +1,107 @@ +# 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 msrest.serialization import Model + + +class SoftwareUpdateConfigurationRun(Model): + """Software update configuration Run properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Name of the software update configuration run. + :vartype name: str + :ivar id: Resource Id of the software update configuration run + :vartype id: str + :param software_update_configuration: software update configuration + triggered this run + :type software_update_configuration: + ~azure.mgmt.automation.models.UpdateConfigurationNavigation + :ivar status: Status of the software update configuration run. + :vartype status: str + :ivar configured_duration: configured duration for the software update + configuration run. + :vartype configured_duration: str + :ivar os_type: Operating system target of the software update + configuration triggered this run + :vartype os_type: str + :ivar start_time: Etart time of the software update configuration run. + :vartype start_time: datetime + :ivar end_time: End time of the software update configuration run. + :vartype end_time: datetime + :ivar computer_count: Number of computers in the software update + configuration run. + :vartype computer_count: int + :ivar failed_count: Number of computers with failed status. + :vartype failed_count: int + :ivar creation_time: Creation time of theresource, which only appears in + the response. + :vartype creation_time: datetime + :ivar created_by: createdBy property, which only appears in the response. + :vartype created_by: str + :ivar last_modified_time: Last time resource was modified, which only + appears in the response. + :vartype last_modified_time: datetime + :ivar last_modified_by: lastModifiedBy property, which only appears in the + response. + :vartype last_modified_by: str + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'status': {'readonly': True}, + 'configured_duration': {'readonly': True}, + 'os_type': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'computer_count': {'readonly': True}, + 'failed_count': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'created_by': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'last_modified_by': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'software_update_configuration': {'key': 'properties.softwareUpdateConfiguration', 'type': 'UpdateConfigurationNavigation'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'configured_duration': {'key': 'properties.configuredDuration', 'type': 'str'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'computer_count': {'key': 'properties.computerCount', 'type': 'int'}, + 'failed_count': {'key': 'properties.failedCount', 'type': 'int'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'created_by': {'key': 'properties.createdBy', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'properties.lastModifiedBy', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SoftwareUpdateConfigurationRun, self).__init__(**kwargs) + self.name = None + self.id = None + self.software_update_configuration = kwargs.get('software_update_configuration', None) + self.status = None + self.configured_duration = None + self.os_type = None + self.start_time = None + self.end_time = None + self.computer_count = None + self.failed_count = None + self.creation_time = None + self.created_by = None + self.last_modified_time = None + self.last_modified_by = None diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_run_list_result.py b/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_run_list_result.py new file mode 100644 index 000000000000..4aaac9712199 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_run_list_result.py @@ -0,0 +1,34 @@ +# 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 msrest.serialization import Model + + +class SoftwareUpdateConfigurationRunListResult(Model): + """result of listing all software update configuration runs. + + :param value: outer object returned when listing all software update + configuration runs + :type value: + list[~azure.mgmt.automation.models.SoftwareUpdateConfigurationRun] + :param next_link: link to next page of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SoftwareUpdateConfigurationRun]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SoftwareUpdateConfigurationRunListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_run_list_result_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_run_list_result_py3.py new file mode 100644 index 000000000000..340328d63fe7 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_run_list_result_py3.py @@ -0,0 +1,34 @@ +# 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 msrest.serialization import Model + + +class SoftwareUpdateConfigurationRunListResult(Model): + """result of listing all software update configuration runs. + + :param value: outer object returned when listing all software update + configuration runs + :type value: + list[~azure.mgmt.automation.models.SoftwareUpdateConfigurationRun] + :param next_link: link to next page of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SoftwareUpdateConfigurationRun]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: + super(SoftwareUpdateConfigurationRunListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_run_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_run_py3.py new file mode 100644 index 000000000000..e2ed13d8cc76 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_run_py3.py @@ -0,0 +1,107 @@ +# 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 msrest.serialization import Model + + +class SoftwareUpdateConfigurationRun(Model): + """Software update configuration Run properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Name of the software update configuration run. + :vartype name: str + :ivar id: Resource Id of the software update configuration run + :vartype id: str + :param software_update_configuration: software update configuration + triggered this run + :type software_update_configuration: + ~azure.mgmt.automation.models.UpdateConfigurationNavigation + :ivar status: Status of the software update configuration run. + :vartype status: str + :ivar configured_duration: configured duration for the software update + configuration run. + :vartype configured_duration: str + :ivar os_type: Operating system target of the software update + configuration triggered this run + :vartype os_type: str + :ivar start_time: Etart time of the software update configuration run. + :vartype start_time: datetime + :ivar end_time: End time of the software update configuration run. + :vartype end_time: datetime + :ivar computer_count: Number of computers in the software update + configuration run. + :vartype computer_count: int + :ivar failed_count: Number of computers with failed status. + :vartype failed_count: int + :ivar creation_time: Creation time of theresource, which only appears in + the response. + :vartype creation_time: datetime + :ivar created_by: createdBy property, which only appears in the response. + :vartype created_by: str + :ivar last_modified_time: Last time resource was modified, which only + appears in the response. + :vartype last_modified_time: datetime + :ivar last_modified_by: lastModifiedBy property, which only appears in the + response. + :vartype last_modified_by: str + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'status': {'readonly': True}, + 'configured_duration': {'readonly': True}, + 'os_type': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'computer_count': {'readonly': True}, + 'failed_count': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'created_by': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'last_modified_by': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'software_update_configuration': {'key': 'properties.softwareUpdateConfiguration', 'type': 'UpdateConfigurationNavigation'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'configured_duration': {'key': 'properties.configuredDuration', 'type': 'str'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'computer_count': {'key': 'properties.computerCount', 'type': 'int'}, + 'failed_count': {'key': 'properties.failedCount', 'type': 'int'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'created_by': {'key': 'properties.createdBy', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'properties.lastModifiedBy', 'type': 'str'}, + } + + def __init__(self, *, software_update_configuration=None, **kwargs) -> None: + super(SoftwareUpdateConfigurationRun, self).__init__(**kwargs) + self.name = None + self.id = None + self.software_update_configuration = software_update_configuration + self.status = None + self.configured_duration = None + self.os_type = None + self.start_time = None + self.end_time = None + self.computer_count = None + self.failed_count = None + self.creation_time = None + self.created_by = None + self.last_modified_time = None + self.last_modified_by = None diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/source_control.py b/azure-mgmt-automation/azure/mgmt/automation/models/source_control.py new file mode 100644 index 000000000000..312903a5b3a3 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/source_control.py @@ -0,0 +1,85 @@ +# 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 msrest.serialization import Model + + +class SourceControl(Model): + """Definition of the source control. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Resource name. + :vartype name: str + :ivar id: Resource Id. + :vartype id: str + :ivar type: Resource type. + :vartype type: str + :param repo_url: Gets or sets the repo url of the source control. + :type repo_url: str + :param branch: Gets or sets the repo branch of the source control. Include + branch as empty string for VsoTfvc. + :type branch: str + :param folder_path: Gets or sets the folder path of the source control. + :type folder_path: str + :param auto_sync: Gets or sets auto async of the source control. Default + is false. + :type auto_sync: bool + :param publish_runbook: Gets or sets the auto publish of the source + control. Default is true. + :type publish_runbook: bool + :param source_type: The source type. Must be one of VsoGit, VsoTfvc, + GitHub. Possible values include: 'VsoGit', 'VsoTfvc', 'GitHub' + :type source_type: str or ~azure.mgmt.automation.models.SourceType + :param description: Gets or sets the description. + :type description: str + :param creation_time: Gets or sets the creation time. + :type creation_time: datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: datetime + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'repo_url': {'key': 'properties.repoUrl', 'type': 'str'}, + 'branch': {'key': 'properties.branch', 'type': 'str'}, + 'folder_path': {'key': 'properties.folderPath', 'type': 'str'}, + 'auto_sync': {'key': 'properties.autoSync', 'type': 'bool'}, + 'publish_runbook': {'key': 'properties.publishRunbook', 'type': 'bool'}, + 'source_type': {'key': 'properties.sourceType', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(SourceControl, self).__init__(**kwargs) + self.name = None + self.id = None + self.type = None + self.repo_url = kwargs.get('repo_url', None) + self.branch = kwargs.get('branch', None) + self.folder_path = kwargs.get('folder_path', None) + self.auto_sync = kwargs.get('auto_sync', None) + self.publish_runbook = kwargs.get('publish_runbook', None) + self.source_type = kwargs.get('source_type', None) + self.description = kwargs.get('description', None) + self.creation_time = kwargs.get('creation_time', None) + self.last_modified_time = kwargs.get('last_modified_time', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/source_control_create_or_update_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/source_control_create_or_update_parameters.py new file mode 100644 index 000000000000..834d55cde542 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/source_control_create_or_update_parameters.py @@ -0,0 +1,72 @@ +# 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 msrest.serialization import Model + + +class SourceControlCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update source control operation. + + :param repo_url: Gets or sets the repo url of the source control. + :type repo_url: str + :param branch: Gets or sets the repo branch of the source control. Include + branch as empty string for VsoTfvc. + :type branch: str + :param folder_path: Gets or sets the folder path of the source control. + Path must be relative. + :type folder_path: str + :param auto_sync: Gets or sets auto async of the source control. Default + is false. + :type auto_sync: bool + :param publish_runbook: Gets or sets the auto publish of the source + control. Default is true. + :type publish_runbook: bool + :param source_type: The source type. Must be one of VsoGit, VsoTfvc, + GitHub, case sensitive. Possible values include: 'VsoGit', 'VsoTfvc', + 'GitHub' + :type source_type: str or ~azure.mgmt.automation.models.SourceType + :param security_token: Gets or sets the authorization token for the repo + of the source control. + :type security_token: str + :param description: Gets or sets the user description of the source + control. + :type description: str + """ + + _validation = { + 'repo_url': {'max_length': 2000}, + 'branch': {'max_length': 255}, + 'folder_path': {'max_length': 255}, + 'security_token': {'max_length': 1024}, + 'description': {'max_length': 512}, + } + + _attribute_map = { + 'repo_url': {'key': 'properties.repoUrl', 'type': 'str'}, + 'branch': {'key': 'properties.branch', 'type': 'str'}, + 'folder_path': {'key': 'properties.folderPath', 'type': 'str'}, + 'auto_sync': {'key': 'properties.autoSync', 'type': 'bool'}, + 'publish_runbook': {'key': 'properties.publishRunbook', 'type': 'bool'}, + 'source_type': {'key': 'properties.sourceType', 'type': 'str'}, + 'security_token': {'key': 'properties.securityToken', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SourceControlCreateOrUpdateParameters, self).__init__(**kwargs) + self.repo_url = kwargs.get('repo_url', None) + self.branch = kwargs.get('branch', None) + self.folder_path = kwargs.get('folder_path', None) + self.auto_sync = kwargs.get('auto_sync', None) + self.publish_runbook = kwargs.get('publish_runbook', None) + self.source_type = kwargs.get('source_type', None) + self.security_token = kwargs.get('security_token', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/source_control_create_or_update_parameters_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/source_control_create_or_update_parameters_py3.py new file mode 100644 index 000000000000..339f602fdc33 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/source_control_create_or_update_parameters_py3.py @@ -0,0 +1,72 @@ +# 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 msrest.serialization import Model + + +class SourceControlCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update source control operation. + + :param repo_url: Gets or sets the repo url of the source control. + :type repo_url: str + :param branch: Gets or sets the repo branch of the source control. Include + branch as empty string for VsoTfvc. + :type branch: str + :param folder_path: Gets or sets the folder path of the source control. + Path must be relative. + :type folder_path: str + :param auto_sync: Gets or sets auto async of the source control. Default + is false. + :type auto_sync: bool + :param publish_runbook: Gets or sets the auto publish of the source + control. Default is true. + :type publish_runbook: bool + :param source_type: The source type. Must be one of VsoGit, VsoTfvc, + GitHub, case sensitive. Possible values include: 'VsoGit', 'VsoTfvc', + 'GitHub' + :type source_type: str or ~azure.mgmt.automation.models.SourceType + :param security_token: Gets or sets the authorization token for the repo + of the source control. + :type security_token: str + :param description: Gets or sets the user description of the source + control. + :type description: str + """ + + _validation = { + 'repo_url': {'max_length': 2000}, + 'branch': {'max_length': 255}, + 'folder_path': {'max_length': 255}, + 'security_token': {'max_length': 1024}, + 'description': {'max_length': 512}, + } + + _attribute_map = { + 'repo_url': {'key': 'properties.repoUrl', 'type': 'str'}, + 'branch': {'key': 'properties.branch', 'type': 'str'}, + 'folder_path': {'key': 'properties.folderPath', 'type': 'str'}, + 'auto_sync': {'key': 'properties.autoSync', 'type': 'bool'}, + 'publish_runbook': {'key': 'properties.publishRunbook', 'type': 'bool'}, + 'source_type': {'key': 'properties.sourceType', 'type': 'str'}, + 'security_token': {'key': 'properties.securityToken', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, *, repo_url: str=None, branch: str=None, folder_path: str=None, auto_sync: bool=None, publish_runbook: bool=None, source_type=None, security_token: str=None, description: str=None, **kwargs) -> None: + super(SourceControlCreateOrUpdateParameters, self).__init__(**kwargs) + self.repo_url = repo_url + self.branch = branch + self.folder_path = folder_path + self.auto_sync = auto_sync + self.publish_runbook = publish_runbook + self.source_type = source_type + self.security_token = security_token + self.description = description diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/source_control_paged.py b/azure-mgmt-automation/azure/mgmt/automation/models/source_control_paged.py new file mode 100644 index 000000000000..bf214640dd4e --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/source_control_paged.py @@ -0,0 +1,27 @@ +# 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 msrest.paging import Paged + + +class SourceControlPaged(Paged): + """ + A paging container for iterating over a list of :class:`SourceControl ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[SourceControl]'} + } + + def __init__(self, *args, **kwargs): + + super(SourceControlPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/source_control_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/source_control_py3.py new file mode 100644 index 000000000000..478fa0999f09 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/source_control_py3.py @@ -0,0 +1,85 @@ +# 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 msrest.serialization import Model + + +class SourceControl(Model): + """Definition of the source control. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Resource name. + :vartype name: str + :ivar id: Resource Id. + :vartype id: str + :ivar type: Resource type. + :vartype type: str + :param repo_url: Gets or sets the repo url of the source control. + :type repo_url: str + :param branch: Gets or sets the repo branch of the source control. Include + branch as empty string for VsoTfvc. + :type branch: str + :param folder_path: Gets or sets the folder path of the source control. + :type folder_path: str + :param auto_sync: Gets or sets auto async of the source control. Default + is false. + :type auto_sync: bool + :param publish_runbook: Gets or sets the auto publish of the source + control. Default is true. + :type publish_runbook: bool + :param source_type: The source type. Must be one of VsoGit, VsoTfvc, + GitHub. Possible values include: 'VsoGit', 'VsoTfvc', 'GitHub' + :type source_type: str or ~azure.mgmt.automation.models.SourceType + :param description: Gets or sets the description. + :type description: str + :param creation_time: Gets or sets the creation time. + :type creation_time: datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: datetime + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'repo_url': {'key': 'properties.repoUrl', 'type': 'str'}, + 'branch': {'key': 'properties.branch', 'type': 'str'}, + 'folder_path': {'key': 'properties.folderPath', 'type': 'str'}, + 'auto_sync': {'key': 'properties.autoSync', 'type': 'bool'}, + 'publish_runbook': {'key': 'properties.publishRunbook', 'type': 'bool'}, + 'source_type': {'key': 'properties.sourceType', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + } + + def __init__(self, *, repo_url: str=None, branch: str=None, folder_path: str=None, auto_sync: bool=None, publish_runbook: bool=None, source_type=None, description: str=None, creation_time=None, last_modified_time=None, **kwargs) -> None: + super(SourceControl, self).__init__(**kwargs) + self.name = None + self.id = None + self.type = None + self.repo_url = repo_url + self.branch = branch + self.folder_path = folder_path + self.auto_sync = auto_sync + self.publish_runbook = publish_runbook + self.source_type = source_type + self.description = description + self.creation_time = creation_time + self.last_modified_time = last_modified_time diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/source_control_sync_job.py b/azure-mgmt-automation/azure/mgmt/automation/models/source_control_sync_job.py new file mode 100644 index 000000000000..d5554314106b --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/source_control_sync_job.py @@ -0,0 +1,74 @@ +# 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 msrest.serialization import Model + + +class SourceControlSyncJob(Model): + """Definition of the source control sync job. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar id: Resource id. + :vartype id: str + :param source_control_sync_job_id: Gets the source control sync job id. + :type source_control_sync_job_id: str + :ivar creation_time: Gets the creation time of the job. + :vartype creation_time: datetime + :param provisioning_state: Gets the provisioning state of the job. + Possible values include: 'Completed', 'Failed', 'Running' + :type provisioning_state: str or + ~azure.mgmt.automation.models.ProvisioningState + :ivar start_time: Gets the start time of the job. + :vartype start_time: datetime + :ivar end_time: Gets the end time of the job. + :vartype end_time: datetime + :param started_by: Gets the user who started the sync job. + :type started_by: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'id': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'source_control_sync_job_id': {'key': 'properties.sourceControlSyncJobId', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'started_by': {'key': 'properties.startedBy', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SourceControlSyncJob, self).__init__(**kwargs) + self.name = None + self.type = None + self.id = None + self.source_control_sync_job_id = kwargs.get('source_control_sync_job_id', None) + self.creation_time = None + self.provisioning_state = kwargs.get('provisioning_state', None) + self.start_time = None + self.end_time = None + self.started_by = kwargs.get('started_by', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/source_control_sync_job_by_id.py b/azure-mgmt-automation/azure/mgmt/automation/models/source_control_sync_job_by_id.py new file mode 100644 index 000000000000..d507d1518fea --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/source_control_sync_job_by_id.py @@ -0,0 +1,67 @@ +# 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 msrest.serialization import Model + + +class SourceControlSyncJobById(Model): + """Definition of the source control sync job. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Gets the id of the job. + :type id: str + :param source_control_sync_job_id: Gets the source control sync job id. + :type source_control_sync_job_id: str + :ivar creation_time: Gets the creation time of the job. + :vartype creation_time: datetime + :param provisioning_state: Gets the provisioning state of the job. + Possible values include: 'Completed', 'Failed', 'Running' + :type provisioning_state: str or + ~azure.mgmt.automation.models.ProvisioningState + :ivar start_time: Gets the start time of the job. + :vartype start_time: datetime + :ivar end_time: Gets the end time of the job. + :vartype end_time: datetime + :param started_by: Gets the user who started the sync job. + :type started_by: str + :param errors: Error details of the source control sync job. + :type errors: ~azure.mgmt.automation.models.SourceControlSyncJobByIdErrors + """ + + _validation = { + 'creation_time': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'source_control_sync_job_id': {'key': 'properties.sourceControlSyncJobId', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'started_by': {'key': 'properties.startedBy', 'type': 'str'}, + 'errors': {'key': 'properties.errors', 'type': 'SourceControlSyncJobByIdErrors'}, + } + + def __init__(self, **kwargs): + super(SourceControlSyncJobById, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.source_control_sync_job_id = kwargs.get('source_control_sync_job_id', None) + self.creation_time = None + self.provisioning_state = kwargs.get('provisioning_state', None) + self.start_time = None + self.end_time = None + self.started_by = kwargs.get('started_by', None) + self.errors = kwargs.get('errors', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/source_control_sync_job_by_id_errors.py b/azure-mgmt-automation/azure/mgmt/automation/models/source_control_sync_job_by_id_errors.py new file mode 100644 index 000000000000..7e054662bfca --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/source_control_sync_job_by_id_errors.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class SourceControlSyncJobByIdErrors(Model): + """Error details of the source control sync job. + + :param code: Gets the error code for the job. + :type code: str + :param message: Gets the error message for the job. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SourceControlSyncJobByIdErrors, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/source_control_sync_job_by_id_errors_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/source_control_sync_job_by_id_errors_py3.py new file mode 100644 index 000000000000..5a2dec480535 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/source_control_sync_job_by_id_errors_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class SourceControlSyncJobByIdErrors(Model): + """Error details of the source control sync job. + + :param code: Gets the error code for the job. + :type code: str + :param message: Gets the error message for the job. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, message: str=None, **kwargs) -> None: + super(SourceControlSyncJobByIdErrors, self).__init__(**kwargs) + self.code = code + self.message = message diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/source_control_sync_job_by_id_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/source_control_sync_job_by_id_py3.py new file mode 100644 index 000000000000..b7bc4dc12ee9 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/source_control_sync_job_by_id_py3.py @@ -0,0 +1,67 @@ +# 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 msrest.serialization import Model + + +class SourceControlSyncJobById(Model): + """Definition of the source control sync job. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Gets the id of the job. + :type id: str + :param source_control_sync_job_id: Gets the source control sync job id. + :type source_control_sync_job_id: str + :ivar creation_time: Gets the creation time of the job. + :vartype creation_time: datetime + :param provisioning_state: Gets the provisioning state of the job. + Possible values include: 'Completed', 'Failed', 'Running' + :type provisioning_state: str or + ~azure.mgmt.automation.models.ProvisioningState + :ivar start_time: Gets the start time of the job. + :vartype start_time: datetime + :ivar end_time: Gets the end time of the job. + :vartype end_time: datetime + :param started_by: Gets the user who started the sync job. + :type started_by: str + :param errors: Error details of the source control sync job. + :type errors: ~azure.mgmt.automation.models.SourceControlSyncJobByIdErrors + """ + + _validation = { + 'creation_time': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'source_control_sync_job_id': {'key': 'properties.sourceControlSyncJobId', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'started_by': {'key': 'properties.startedBy', 'type': 'str'}, + 'errors': {'key': 'properties.errors', 'type': 'SourceControlSyncJobByIdErrors'}, + } + + def __init__(self, *, id: str=None, source_control_sync_job_id: str=None, provisioning_state=None, started_by: str=None, errors=None, **kwargs) -> None: + super(SourceControlSyncJobById, self).__init__(**kwargs) + self.id = id + self.source_control_sync_job_id = source_control_sync_job_id + self.creation_time = None + self.provisioning_state = provisioning_state + self.start_time = None + self.end_time = None + self.started_by = started_by + self.errors = errors diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/source_control_sync_job_create_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/source_control_sync_job_create_parameters.py new file mode 100644 index 000000000000..468fbcc09fd3 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/source_control_sync_job_create_parameters.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class SourceControlSyncJobCreateParameters(Model): + """The parameters supplied to the create source control sync job operation. + + :param commit_id: Sets the commit id of the source control sync job. + :type commit_id: str + """ + + _attribute_map = { + 'commit_id': {'key': 'properties.commitId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SourceControlSyncJobCreateParameters, self).__init__(**kwargs) + self.commit_id = kwargs.get('commit_id', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/source_control_sync_job_create_parameters_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/source_control_sync_job_create_parameters_py3.py new file mode 100644 index 000000000000..cc0cee5c2d84 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/source_control_sync_job_create_parameters_py3.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class SourceControlSyncJobCreateParameters(Model): + """The parameters supplied to the create source control sync job operation. + + :param commit_id: Sets the commit id of the source control sync job. + :type commit_id: str + """ + + _attribute_map = { + 'commit_id': {'key': 'properties.commitId', 'type': 'str'}, + } + + def __init__(self, *, commit_id: str=None, **kwargs) -> None: + super(SourceControlSyncJobCreateParameters, self).__init__(**kwargs) + self.commit_id = commit_id diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/source_control_sync_job_paged.py b/azure-mgmt-automation/azure/mgmt/automation/models/source_control_sync_job_paged.py new file mode 100644 index 000000000000..db7622ff89a7 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/source_control_sync_job_paged.py @@ -0,0 +1,27 @@ +# 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 msrest.paging import Paged + + +class SourceControlSyncJobPaged(Paged): + """ + A paging container for iterating over a list of :class:`SourceControlSyncJob ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[SourceControlSyncJob]'} + } + + def __init__(self, *args, **kwargs): + + super(SourceControlSyncJobPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/source_control_sync_job_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/source_control_sync_job_py3.py new file mode 100644 index 000000000000..dc49197edf59 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/source_control_sync_job_py3.py @@ -0,0 +1,74 @@ +# 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 msrest.serialization import Model + + +class SourceControlSyncJob(Model): + """Definition of the source control sync job. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar id: Resource id. + :vartype id: str + :param source_control_sync_job_id: Gets the source control sync job id. + :type source_control_sync_job_id: str + :ivar creation_time: Gets the creation time of the job. + :vartype creation_time: datetime + :param provisioning_state: Gets the provisioning state of the job. + Possible values include: 'Completed', 'Failed', 'Running' + :type provisioning_state: str or + ~azure.mgmt.automation.models.ProvisioningState + :ivar start_time: Gets the start time of the job. + :vartype start_time: datetime + :ivar end_time: Gets the end time of the job. + :vartype end_time: datetime + :param started_by: Gets the user who started the sync job. + :type started_by: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'id': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'source_control_sync_job_id': {'key': 'properties.sourceControlSyncJobId', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'started_by': {'key': 'properties.startedBy', 'type': 'str'}, + } + + def __init__(self, *, source_control_sync_job_id: str=None, provisioning_state=None, started_by: str=None, **kwargs) -> None: + super(SourceControlSyncJob, self).__init__(**kwargs) + self.name = None + self.type = None + self.id = None + self.source_control_sync_job_id = source_control_sync_job_id + self.creation_time = None + self.provisioning_state = provisioning_state + self.start_time = None + self.end_time = None + self.started_by = started_by diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/source_control_update_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/source_control_update_parameters.py new file mode 100644 index 000000000000..d8c94cc4a931 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/source_control_update_parameters.py @@ -0,0 +1,53 @@ +# 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 msrest.serialization import Model + + +class SourceControlUpdateParameters(Model): + """The parameters supplied to the update source control operation. + + :param branch: Gets or sets the repo branch of the source control. + :type branch: str + :param folder_path: Gets or sets the folder path of the source control. + Path must be relative. + :type folder_path: str + :param auto_sync: Gets or sets auto async of the source control. Default + is false. + :type auto_sync: bool + :param publish_runbook: Gets or sets the auto publish of the source + control. Default is true. + :type publish_runbook: bool + :param security_token: Gets or sets the authorization token for the repo + of the source control. + :type security_token: str + :param description: Gets or sets the user description of the source + control. + :type description: str + """ + + _attribute_map = { + 'branch': {'key': 'properties.branch', 'type': 'str'}, + 'folder_path': {'key': 'properties.folderPath', 'type': 'str'}, + 'auto_sync': {'key': 'properties.autoSync', 'type': 'bool'}, + 'publish_runbook': {'key': 'properties.publishRunbook', 'type': 'bool'}, + 'security_token': {'key': 'properties.securityToken', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SourceControlUpdateParameters, self).__init__(**kwargs) + self.branch = kwargs.get('branch', None) + self.folder_path = kwargs.get('folder_path', None) + self.auto_sync = kwargs.get('auto_sync', None) + self.publish_runbook = kwargs.get('publish_runbook', None) + self.security_token = kwargs.get('security_token', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/source_control_update_parameters_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/source_control_update_parameters_py3.py new file mode 100644 index 000000000000..2bacac81551a --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/source_control_update_parameters_py3.py @@ -0,0 +1,53 @@ +# 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 msrest.serialization import Model + + +class SourceControlUpdateParameters(Model): + """The parameters supplied to the update source control operation. + + :param branch: Gets or sets the repo branch of the source control. + :type branch: str + :param folder_path: Gets or sets the folder path of the source control. + Path must be relative. + :type folder_path: str + :param auto_sync: Gets or sets auto async of the source control. Default + is false. + :type auto_sync: bool + :param publish_runbook: Gets or sets the auto publish of the source + control. Default is true. + :type publish_runbook: bool + :param security_token: Gets or sets the authorization token for the repo + of the source control. + :type security_token: str + :param description: Gets or sets the user description of the source + control. + :type description: str + """ + + _attribute_map = { + 'branch': {'key': 'properties.branch', 'type': 'str'}, + 'folder_path': {'key': 'properties.folderPath', 'type': 'str'}, + 'auto_sync': {'key': 'properties.autoSync', 'type': 'bool'}, + 'publish_runbook': {'key': 'properties.publishRunbook', 'type': 'bool'}, + 'security_token': {'key': 'properties.securityToken', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, *, branch: str=None, folder_path: str=None, auto_sync: bool=None, publish_runbook: bool=None, security_token: str=None, description: str=None, **kwargs) -> None: + super(SourceControlUpdateParameters, self).__init__(**kwargs) + self.branch = branch + self.folder_path = folder_path + self.auto_sync = auto_sync + self.publish_runbook = publish_runbook + self.security_token = security_token + self.description = description diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/statistics.py b/azure-mgmt-automation/azure/mgmt/automation/models/statistics.py new file mode 100644 index 000000000000..6c27f5c61b6f --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/statistics.py @@ -0,0 +1,55 @@ +# 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 msrest.serialization import Model + + +class Statistics(Model): + """Definition of the statistic. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar counter_property: Gets the property value of the statistic. + :vartype counter_property: str + :ivar counter_value: Gets the value of the statistic. + :vartype counter_value: long + :ivar start_time: Gets the startTime of the statistic. + :vartype start_time: datetime + :ivar end_time: Gets the endTime of the statistic. + :vartype end_time: datetime + :ivar id: Gets the id. + :vartype id: str + """ + + _validation = { + 'counter_property': {'readonly': True}, + 'counter_value': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'id': {'readonly': True}, + } + + _attribute_map = { + 'counter_property': {'key': 'counterProperty', 'type': 'str'}, + 'counter_value': {'key': 'counterValue', 'type': 'long'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Statistics, self).__init__(**kwargs) + self.counter_property = None + self.counter_value = None + self.start_time = None + self.end_time = None + self.id = None diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/statistics_paged.py b/azure-mgmt-automation/azure/mgmt/automation/models/statistics_paged.py new file mode 100644 index 000000000000..64b736569df9 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/statistics_paged.py @@ -0,0 +1,27 @@ +# 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 msrest.paging import Paged + + +class StatisticsPaged(Paged): + """ + A paging container for iterating over a list of :class:`Statistics ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Statistics]'} + } + + def __init__(self, *args, **kwargs): + + super(StatisticsPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/statistics_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/statistics_py3.py new file mode 100644 index 000000000000..5a505fe552c8 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/statistics_py3.py @@ -0,0 +1,55 @@ +# 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 msrest.serialization import Model + + +class Statistics(Model): + """Definition of the statistic. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar counter_property: Gets the property value of the statistic. + :vartype counter_property: str + :ivar counter_value: Gets the value of the statistic. + :vartype counter_value: long + :ivar start_time: Gets the startTime of the statistic. + :vartype start_time: datetime + :ivar end_time: Gets the endTime of the statistic. + :vartype end_time: datetime + :ivar id: Gets the id. + :vartype id: str + """ + + _validation = { + 'counter_property': {'readonly': True}, + 'counter_value': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'id': {'readonly': True}, + } + + _attribute_map = { + 'counter_property': {'key': 'counterProperty', 'type': 'str'}, + 'counter_value': {'key': 'counterValue', 'type': 'long'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Statistics, self).__init__(**kwargs) + self.counter_property = None + self.counter_value = None + self.start_time = None + self.end_time = None + self.id = None diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/sub_resource.py b/azure-mgmt-automation/azure/mgmt/automation/models/sub_resource.py new file mode 100644 index 000000000000..67fc677ce5cb --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/sub_resource.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class SubResource(Model): + """The Sub Resource definition. + + :param id: Resource Id + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SubResource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/sub_resource_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/sub_resource_py3.py new file mode 100644 index 000000000000..f24bc94f9375 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/sub_resource_py3.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class SubResource(Model): + """The Sub Resource definition. + + :param id: Resource Id + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(SubResource, self).__init__(**kwargs) + self.id = id diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/test_job.py b/azure-mgmt-automation/azure/mgmt/automation/models/test_job.py new file mode 100644 index 000000000000..33980835c7d2 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/test_job.py @@ -0,0 +1,72 @@ +# 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 msrest.serialization import Model + + +class TestJob(Model): + """Definition of the test job. + + :param creation_time: Gets or sets the creation time of the test job. + :type creation_time: datetime + :param status: Gets or sets the status of the test job. + :type status: str + :param status_details: Gets or sets the status details of the test job. + :type status_details: str + :param run_on: Gets or sets the runOn which specifies the group name where + the job is to be executed. + :type run_on: str + :param start_time: Gets or sets the start time of the test job. + :type start_time: datetime + :param end_time: Gets or sets the end time of the test job. + :type end_time: datetime + :param exception: Gets or sets the exception of the test job. + :type exception: str + :param last_modified_time: Gets or sets the last modified time of the test + job. + :type last_modified_time: datetime + :param last_status_modified_time: Gets or sets the last status modified + time of the test job. + :type last_status_modified_time: datetime + :param parameters: Gets or sets the parameters of the test job. + :type parameters: dict[str, str] + :param log_activity_trace: The activity-level tracing options of the + runbook. + :type log_activity_trace: int + """ + + _attribute_map = { + 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, + 'status': {'key': 'status', 'type': 'str'}, + 'status_details': {'key': 'statusDetails', 'type': 'str'}, + 'run_on': {'key': 'runOn', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'exception': {'key': 'exception', 'type': 'str'}, + 'last_modified_time': {'key': 'lastModifiedTime', 'type': 'iso-8601'}, + 'last_status_modified_time': {'key': 'lastStatusModifiedTime', 'type': 'iso-8601'}, + 'parameters': {'key': 'parameters', 'type': '{str}'}, + 'log_activity_trace': {'key': 'logActivityTrace', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(TestJob, self).__init__(**kwargs) + self.creation_time = kwargs.get('creation_time', None) + self.status = kwargs.get('status', None) + self.status_details = kwargs.get('status_details', None) + self.run_on = kwargs.get('run_on', None) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.exception = kwargs.get('exception', None) + self.last_modified_time = kwargs.get('last_modified_time', None) + self.last_status_modified_time = kwargs.get('last_status_modified_time', None) + self.parameters = kwargs.get('parameters', None) + self.log_activity_trace = kwargs.get('log_activity_trace', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/test_job_create_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/test_job_create_parameters.py new file mode 100644 index 000000000000..c1715600596a --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/test_job_create_parameters.py @@ -0,0 +1,33 @@ +# 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 msrest.serialization import Model + + +class TestJobCreateParameters(Model): + """The parameters supplied to the create test job operation. + + :param parameters: Gets or sets the parameters of the test job. + :type parameters: dict[str, str] + :param run_on: Gets or sets the runOn which specifies the group name where + the job is to be executed. + :type run_on: str + """ + + _attribute_map = { + 'parameters': {'key': 'parameters', 'type': '{str}'}, + 'run_on': {'key': 'runOn', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TestJobCreateParameters, self).__init__(**kwargs) + self.parameters = kwargs.get('parameters', None) + self.run_on = kwargs.get('run_on', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/test_job_create_parameters_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/test_job_create_parameters_py3.py new file mode 100644 index 000000000000..f52032b6b7d8 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/test_job_create_parameters_py3.py @@ -0,0 +1,33 @@ +# 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 msrest.serialization import Model + + +class TestJobCreateParameters(Model): + """The parameters supplied to the create test job operation. + + :param parameters: Gets or sets the parameters of the test job. + :type parameters: dict[str, str] + :param run_on: Gets or sets the runOn which specifies the group name where + the job is to be executed. + :type run_on: str + """ + + _attribute_map = { + 'parameters': {'key': 'parameters', 'type': '{str}'}, + 'run_on': {'key': 'runOn', 'type': 'str'}, + } + + def __init__(self, *, parameters=None, run_on: str=None, **kwargs) -> None: + super(TestJobCreateParameters, self).__init__(**kwargs) + self.parameters = parameters + self.run_on = run_on diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/test_job_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/test_job_py3.py new file mode 100644 index 000000000000..9660c6fd58a1 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/test_job_py3.py @@ -0,0 +1,72 @@ +# 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 msrest.serialization import Model + + +class TestJob(Model): + """Definition of the test job. + + :param creation_time: Gets or sets the creation time of the test job. + :type creation_time: datetime + :param status: Gets or sets the status of the test job. + :type status: str + :param status_details: Gets or sets the status details of the test job. + :type status_details: str + :param run_on: Gets or sets the runOn which specifies the group name where + the job is to be executed. + :type run_on: str + :param start_time: Gets or sets the start time of the test job. + :type start_time: datetime + :param end_time: Gets or sets the end time of the test job. + :type end_time: datetime + :param exception: Gets or sets the exception of the test job. + :type exception: str + :param last_modified_time: Gets or sets the last modified time of the test + job. + :type last_modified_time: datetime + :param last_status_modified_time: Gets or sets the last status modified + time of the test job. + :type last_status_modified_time: datetime + :param parameters: Gets or sets the parameters of the test job. + :type parameters: dict[str, str] + :param log_activity_trace: The activity-level tracing options of the + runbook. + :type log_activity_trace: int + """ + + _attribute_map = { + 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, + 'status': {'key': 'status', 'type': 'str'}, + 'status_details': {'key': 'statusDetails', 'type': 'str'}, + 'run_on': {'key': 'runOn', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'exception': {'key': 'exception', 'type': 'str'}, + 'last_modified_time': {'key': 'lastModifiedTime', 'type': 'iso-8601'}, + 'last_status_modified_time': {'key': 'lastStatusModifiedTime', 'type': 'iso-8601'}, + 'parameters': {'key': 'parameters', 'type': '{str}'}, + 'log_activity_trace': {'key': 'logActivityTrace', 'type': 'int'}, + } + + def __init__(self, *, creation_time=None, status: str=None, status_details: str=None, run_on: str=None, start_time=None, end_time=None, exception: str=None, last_modified_time=None, last_status_modified_time=None, parameters=None, log_activity_trace: int=None, **kwargs) -> None: + super(TestJob, self).__init__(**kwargs) + self.creation_time = creation_time + self.status = status + self.status_details = status_details + self.run_on = run_on + self.start_time = start_time + self.end_time = end_time + self.exception = exception + self.last_modified_time = last_modified_time + self.last_status_modified_time = last_status_modified_time + self.parameters = parameters + self.log_activity_trace = log_activity_trace diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/tracked_resource.py b/azure-mgmt-automation/azure/mgmt/automation/models/tracked_resource.py new file mode 100644 index 000000000000..924351890e0e --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/tracked_resource.py @@ -0,0 +1,50 @@ +# 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 .resource import Resource + + +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level 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 + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: The Azure Region where the resource lives + :type location: str + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TrackedResource, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.location = kwargs.get('location', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/tracked_resource_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/tracked_resource_py3.py new file mode 100644 index 000000000000..97a942fbc1c0 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/tracked_resource_py3.py @@ -0,0 +1,50 @@ +# 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 .resource import Resource + + +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level 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 + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: The Azure Region where the resource lives + :type location: str + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, *, tags=None, location: str=None, **kwargs) -> None: + super(TrackedResource, self).__init__(**kwargs) + self.tags = tags + self.location = location diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/type_field.py b/azure-mgmt-automation/azure/mgmt/automation/models/type_field.py new file mode 100644 index 000000000000..2c64397d6000 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/type_field.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class TypeField(Model): + """Information about a field of a type. + + :param name: Gets or sets the name of the field. + :type name: str + :param type: Gets or sets the type of the field. + :type type: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TypeField, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/type_field_paged.py b/azure-mgmt-automation/azure/mgmt/automation/models/type_field_paged.py new file mode 100644 index 000000000000..70c9702982e5 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/type_field_paged.py @@ -0,0 +1,27 @@ +# 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 msrest.paging import Paged + + +class TypeFieldPaged(Paged): + """ + A paging container for iterating over a list of :class:`TypeField ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[TypeField]'} + } + + def __init__(self, *args, **kwargs): + + super(TypeFieldPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/type_field_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/type_field_py3.py new file mode 100644 index 000000000000..d522b7658ebd --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/type_field_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class TypeField(Model): + """Information about a field of a type. + + :param name: Gets or sets the name of the field. + :type name: str + :param type: Gets or sets the type of the field. + :type type: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, type: str=None, **kwargs) -> None: + super(TypeField, self).__init__(**kwargs) + self.name = name + self.type = type diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/update_configuration.py b/azure-mgmt-automation/azure/mgmt/automation/models/update_configuration.py new file mode 100644 index 000000000000..0f8336bba09c --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/update_configuration.py @@ -0,0 +1,60 @@ +# 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 msrest.serialization import Model + + +class UpdateConfiguration(Model): + """Update specifc properties of the software update configuration. + + All required parameters must be populated in order to send to Azure. + + :param operating_system: Required. operating system of target machines. + Possible values include: 'Windows', 'Linux' + :type operating_system: str or + ~azure.mgmt.automation.models.OperatingSystemType + :param windows: Windows specific update configuration. + :type windows: ~azure.mgmt.automation.models.WindowsProperties + :param linux: Linux specific update configuration. + :type linux: ~azure.mgmt.automation.models.LinuxProperties + :param duration: Maximum time allowed for the software update + configuration run. Duration needs to be specified using the format + PT[n]H[n]M[n]S as per ISO8601 + :type duration: timedelta + :param azure_virtual_machines: List of azure resource Ids for azure + virtual machines targeted by the software update configuration. + :type azure_virtual_machines: list[str] + :param non_azure_computer_names: List of names of non-azure machines + targeted by the software update configuration. + :type non_azure_computer_names: list[str] + """ + + _validation = { + 'operating_system': {'required': True}, + } + + _attribute_map = { + 'operating_system': {'key': 'operatingSystem', 'type': 'OperatingSystemType'}, + 'windows': {'key': 'windows', 'type': 'WindowsProperties'}, + 'linux': {'key': 'linux', 'type': 'LinuxProperties'}, + 'duration': {'key': 'duration', 'type': 'duration'}, + 'azure_virtual_machines': {'key': 'azureVirtualMachines', 'type': '[str]'}, + 'non_azure_computer_names': {'key': 'nonAzureComputerNames', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(UpdateConfiguration, self).__init__(**kwargs) + self.operating_system = kwargs.get('operating_system', None) + self.windows = kwargs.get('windows', None) + self.linux = kwargs.get('linux', None) + self.duration = kwargs.get('duration', None) + self.azure_virtual_machines = kwargs.get('azure_virtual_machines', None) + self.non_azure_computer_names = kwargs.get('non_azure_computer_names', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/update_configuration_navigation.py b/azure-mgmt-automation/azure/mgmt/automation/models/update_configuration_navigation.py new file mode 100644 index 000000000000..a130e8b5afd0 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/update_configuration_navigation.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class UpdateConfigurationNavigation(Model): + """Software update configuration Run Navigation model. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Name of the software update configuration triggered the + software update configuration run + :vartype name: str + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UpdateConfigurationNavigation, self).__init__(**kwargs) + self.name = None diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/update_configuration_navigation_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/update_configuration_navigation_py3.py new file mode 100644 index 000000000000..6eb6f542f17c --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/update_configuration_navigation_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class UpdateConfigurationNavigation(Model): + """Software update configuration Run Navigation model. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Name of the software update configuration triggered the + software update configuration run + :vartype name: str + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(UpdateConfigurationNavigation, self).__init__(**kwargs) + self.name = None diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/update_configuration_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/update_configuration_py3.py new file mode 100644 index 000000000000..05c73897ed11 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/update_configuration_py3.py @@ -0,0 +1,60 @@ +# 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 msrest.serialization import Model + + +class UpdateConfiguration(Model): + """Update specifc properties of the software update configuration. + + All required parameters must be populated in order to send to Azure. + + :param operating_system: Required. operating system of target machines. + Possible values include: 'Windows', 'Linux' + :type operating_system: str or + ~azure.mgmt.automation.models.OperatingSystemType + :param windows: Windows specific update configuration. + :type windows: ~azure.mgmt.automation.models.WindowsProperties + :param linux: Linux specific update configuration. + :type linux: ~azure.mgmt.automation.models.LinuxProperties + :param duration: Maximum time allowed for the software update + configuration run. Duration needs to be specified using the format + PT[n]H[n]M[n]S as per ISO8601 + :type duration: timedelta + :param azure_virtual_machines: List of azure resource Ids for azure + virtual machines targeted by the software update configuration. + :type azure_virtual_machines: list[str] + :param non_azure_computer_names: List of names of non-azure machines + targeted by the software update configuration. + :type non_azure_computer_names: list[str] + """ + + _validation = { + 'operating_system': {'required': True}, + } + + _attribute_map = { + 'operating_system': {'key': 'operatingSystem', 'type': 'OperatingSystemType'}, + 'windows': {'key': 'windows', 'type': 'WindowsProperties'}, + 'linux': {'key': 'linux', 'type': 'LinuxProperties'}, + 'duration': {'key': 'duration', 'type': 'duration'}, + 'azure_virtual_machines': {'key': 'azureVirtualMachines', 'type': '[str]'}, + 'non_azure_computer_names': {'key': 'nonAzureComputerNames', 'type': '[str]'}, + } + + def __init__(self, *, operating_system, windows=None, linux=None, duration=None, azure_virtual_machines=None, non_azure_computer_names=None, **kwargs) -> None: + super(UpdateConfiguration, self).__init__(**kwargs) + self.operating_system = operating_system + self.windows = windows + self.linux = linux + self.duration = duration + self.azure_virtual_machines = azure_virtual_machines + self.non_azure_computer_names = non_azure_computer_names diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/usage.py b/azure-mgmt-automation/azure/mgmt/automation/models/usage.py new file mode 100644 index 000000000000..4d0acc13cf85 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/usage.py @@ -0,0 +1,48 @@ +# 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 msrest.serialization import Model + + +class Usage(Model): + """Definition of Usage. + + :param id: Gets or sets the id of the resource. + :type id: str + :param name: Gets or sets the usage counter name. + :type name: ~azure.mgmt.automation.models.UsageCounterName + :param unit: Gets or sets the usage unit name. + :type unit: str + :param current_value: Gets or sets the current usage value. + :type current_value: float + :param limit: Gets or sets max limit. -1 for unlimited + :type limit: long + :param throttle_status: Gets or sets the throttle status. + :type throttle_status: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'UsageCounterName'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'current_value': {'key': 'currentValue', 'type': 'float'}, + 'limit': {'key': 'limit', 'type': 'long'}, + 'throttle_status': {'key': 'throttleStatus', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Usage, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.unit = kwargs.get('unit', None) + self.current_value = kwargs.get('current_value', None) + self.limit = kwargs.get('limit', None) + self.throttle_status = kwargs.get('throttle_status', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/usage_counter_name.py b/azure-mgmt-automation/azure/mgmt/automation/models/usage_counter_name.py new file mode 100644 index 000000000000..c5a6c69093f9 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/usage_counter_name.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class UsageCounterName(Model): + """Definition of usage counter name. + + :param value: Gets or sets the usage counter name. + :type value: str + :param localized_value: Gets or sets the localized usage counter name. + :type localized_value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UsageCounterName, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.localized_value = kwargs.get('localized_value', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/usage_counter_name_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/usage_counter_name_py3.py new file mode 100644 index 000000000000..6fa02857189b --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/usage_counter_name_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class UsageCounterName(Model): + """Definition of usage counter name. + + :param value: Gets or sets the usage counter name. + :type value: str + :param localized_value: Gets or sets the localized usage counter name. + :type localized_value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, *, value: str=None, localized_value: str=None, **kwargs) -> None: + super(UsageCounterName, self).__init__(**kwargs) + self.value = value + self.localized_value = localized_value diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/usage_paged.py b/azure-mgmt-automation/azure/mgmt/automation/models/usage_paged.py new file mode 100644 index 000000000000..72d2f0a2d170 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/usage_paged.py @@ -0,0 +1,27 @@ +# 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 msrest.paging import Paged + + +class UsagePaged(Paged): + """ + A paging container for iterating over a list of :class:`Usage ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Usage]'} + } + + def __init__(self, *args, **kwargs): + + super(UsagePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/usage_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/usage_py3.py new file mode 100644 index 000000000000..107f38f6fae3 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/usage_py3.py @@ -0,0 +1,48 @@ +# 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 msrest.serialization import Model + + +class Usage(Model): + """Definition of Usage. + + :param id: Gets or sets the id of the resource. + :type id: str + :param name: Gets or sets the usage counter name. + :type name: ~azure.mgmt.automation.models.UsageCounterName + :param unit: Gets or sets the usage unit name. + :type unit: str + :param current_value: Gets or sets the current usage value. + :type current_value: float + :param limit: Gets or sets max limit. -1 for unlimited + :type limit: long + :param throttle_status: Gets or sets the throttle status. + :type throttle_status: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'UsageCounterName'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'current_value': {'key': 'currentValue', 'type': 'float'}, + 'limit': {'key': 'limit', 'type': 'long'}, + 'throttle_status': {'key': 'throttleStatus', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, name=None, unit: str=None, current_value: float=None, limit: int=None, throttle_status: str=None, **kwargs) -> None: + super(Usage, self).__init__(**kwargs) + self.id = id + self.name = name + self.unit = unit + self.current_value = current_value + self.limit = limit + self.throttle_status = throttle_status diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/variable.py b/azure-mgmt-automation/azure/mgmt/automation/models/variable.py new file mode 100644 index 000000000000..bcf7f9816f65 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/variable.py @@ -0,0 +1,62 @@ +# 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 .proxy_resource import ProxyResource + + +class Variable(ProxyResource): + """Definition of the varible. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param value: Gets or sets the value of the variable. + :type value: str + :param is_encrypted: Gets or sets the encrypted flag of the variable. + :type is_encrypted: bool + :param creation_time: Gets or sets the creation time. + :type creation_time: datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: datetime + :param description: Gets or sets the description. + :type description: str + """ + + _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'}, + 'value': {'key': 'properties.value', 'type': 'str'}, + 'is_encrypted': {'key': 'properties.isEncrypted', 'type': 'bool'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Variable, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.is_encrypted = kwargs.get('is_encrypted', None) + self.creation_time = kwargs.get('creation_time', None) + self.last_modified_time = kwargs.get('last_modified_time', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/variable_create_or_update_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/variable_create_or_update_parameters.py new file mode 100644 index 000000000000..c847a873ff1d --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/variable_create_or_update_parameters.py @@ -0,0 +1,46 @@ +# 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 msrest.serialization import Model + + +class VariableCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update variable operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the name of the variable. + :type name: str + :param value: Gets or sets the value of the variable. + :type value: str + :param description: Gets or sets the description of the variable. + :type description: str + :param is_encrypted: Gets or sets the encrypted flag of the variable. + :type is_encrypted: bool + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'properties.value', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'is_encrypted': {'key': 'properties.isEncrypted', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(VariableCreateOrUpdateParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) + self.description = kwargs.get('description', None) + self.is_encrypted = kwargs.get('is_encrypted', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/variable_create_or_update_parameters_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/variable_create_or_update_parameters_py3.py new file mode 100644 index 000000000000..b9ba8f691aec --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/variable_create_or_update_parameters_py3.py @@ -0,0 +1,46 @@ +# 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 msrest.serialization import Model + + +class VariableCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update variable operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the name of the variable. + :type name: str + :param value: Gets or sets the value of the variable. + :type value: str + :param description: Gets or sets the description of the variable. + :type description: str + :param is_encrypted: Gets or sets the encrypted flag of the variable. + :type is_encrypted: bool + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'properties.value', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'is_encrypted': {'key': 'properties.isEncrypted', 'type': 'bool'}, + } + + def __init__(self, *, name: str, value: str=None, description: str=None, is_encrypted: bool=None, **kwargs) -> None: + super(VariableCreateOrUpdateParameters, self).__init__(**kwargs) + self.name = name + self.value = value + self.description = description + self.is_encrypted = is_encrypted diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/variable_paged.py b/azure-mgmt-automation/azure/mgmt/automation/models/variable_paged.py new file mode 100644 index 000000000000..8e3f82c98cba --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/variable_paged.py @@ -0,0 +1,27 @@ +# 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 msrest.paging import Paged + + +class VariablePaged(Paged): + """ + A paging container for iterating over a list of :class:`Variable ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Variable]'} + } + + def __init__(self, *args, **kwargs): + + super(VariablePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/variable_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/variable_py3.py new file mode 100644 index 000000000000..44306794f570 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/variable_py3.py @@ -0,0 +1,62 @@ +# 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 .proxy_resource import ProxyResource + + +class Variable(ProxyResource): + """Definition of the varible. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param value: Gets or sets the value of the variable. + :type value: str + :param is_encrypted: Gets or sets the encrypted flag of the variable. + :type is_encrypted: bool + :param creation_time: Gets or sets the creation time. + :type creation_time: datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: datetime + :param description: Gets or sets the description. + :type description: str + """ + + _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'}, + 'value': {'key': 'properties.value', 'type': 'str'}, + 'is_encrypted': {'key': 'properties.isEncrypted', 'type': 'bool'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, *, value: str=None, is_encrypted: bool=None, creation_time=None, last_modified_time=None, description: str=None, **kwargs) -> None: + super(Variable, self).__init__(**kwargs) + self.value = value + self.is_encrypted = is_encrypted + self.creation_time = creation_time + self.last_modified_time = last_modified_time + self.description = description diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/variable_update_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/variable_update_parameters.py new file mode 100644 index 000000000000..fee6bda9c3f6 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/variable_update_parameters.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class VariableUpdateParameters(Model): + """The parameters supplied to the update variable operation. + + :param name: Gets or sets the name of the variable. + :type name: str + :param value: Gets or sets the value of the variable. + :type value: str + :param description: Gets or sets the description of the variable. + :type description: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'properties.value', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VariableUpdateParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/variable_update_parameters_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/variable_update_parameters_py3.py new file mode 100644 index 000000000000..0f8ac764918f --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/variable_update_parameters_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class VariableUpdateParameters(Model): + """The parameters supplied to the update variable operation. + + :param name: Gets or sets the name of the variable. + :type name: str + :param value: Gets or sets the value of the variable. + :type value: str + :param description: Gets or sets the description of the variable. + :type description: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'properties.value', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, value: str=None, description: str=None, **kwargs) -> None: + super(VariableUpdateParameters, self).__init__(**kwargs) + self.name = name + self.value = value + self.description = description diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/webhook.py b/azure-mgmt-automation/azure/mgmt/automation/models/webhook.py new file mode 100644 index 000000000000..5c1f151824c8 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/webhook.py @@ -0,0 +1,85 @@ +# 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 .proxy_resource import ProxyResource + + +class Webhook(ProxyResource): + """Definition of the webhook type. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param is_enabled: Gets or sets the value of the enabled flag of the + webhook. Default value: False . + :type is_enabled: bool + :param uri: Gets or sets the webhook uri. + :type uri: str + :param expiry_time: Gets or sets the expiry time. + :type expiry_time: datetime + :param last_invoked_time: Gets or sets the last invoked time. + :type last_invoked_time: datetime + :param parameters: Gets or sets the parameters of the job that is created + when the webhook calls the runbook it is associated with. + :type parameters: dict[str, str] + :param runbook: Gets or sets the runbook the webhook is associated with. + :type runbook: ~azure.mgmt.automation.models.RunbookAssociationProperty + :param run_on: Gets or sets the name of the hybrid worker group the + webhook job will run on. + :type run_on: str + :param creation_time: Gets or sets the creation time. + :type creation_time: datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: datetime + :param description: Gets or sets the description. + :type description: str + """ + + _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'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + 'uri': {'key': 'properties.uri', 'type': 'str'}, + 'expiry_time': {'key': 'properties.expiryTime', 'type': 'iso-8601'}, + 'last_invoked_time': {'key': 'properties.lastInvokedTime', 'type': 'iso-8601'}, + 'parameters': {'key': 'properties.parameters', 'type': '{str}'}, + 'runbook': {'key': 'properties.runbook', 'type': 'RunbookAssociationProperty'}, + 'run_on': {'key': 'properties.runOn', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Webhook, self).__init__(**kwargs) + self.is_enabled = kwargs.get('is_enabled', False) + self.uri = kwargs.get('uri', None) + self.expiry_time = kwargs.get('expiry_time', None) + self.last_invoked_time = kwargs.get('last_invoked_time', None) + self.parameters = kwargs.get('parameters', None) + self.runbook = kwargs.get('runbook', None) + self.run_on = kwargs.get('run_on', None) + self.creation_time = kwargs.get('creation_time', None) + self.last_modified_time = kwargs.get('last_modified_time', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/webhook_create_or_update_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/webhook_create_or_update_parameters.py new file mode 100644 index 000000000000..bf3aa1d7875a --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/webhook_create_or_update_parameters.py @@ -0,0 +1,59 @@ +# 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 msrest.serialization import Model + + +class WebhookCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update webhook operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the name of the webhook. + :type name: str + :param is_enabled: Gets or sets the value of the enabled flag of webhook. + :type is_enabled: bool + :param uri: Gets or sets the uri. + :type uri: str + :param expiry_time: Gets or sets the expiry time. + :type expiry_time: datetime + :param parameters: Gets or sets the parameters of the job. + :type parameters: dict[str, str] + :param runbook: Gets or sets the runbook. + :type runbook: ~azure.mgmt.automation.models.RunbookAssociationProperty + :param run_on: Gets or sets the name of the hybrid worker group the + webhook job will run on. + :type run_on: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + 'uri': {'key': 'properties.uri', 'type': 'str'}, + 'expiry_time': {'key': 'properties.expiryTime', 'type': 'iso-8601'}, + 'parameters': {'key': 'properties.parameters', 'type': '{str}'}, + 'runbook': {'key': 'properties.runbook', 'type': 'RunbookAssociationProperty'}, + 'run_on': {'key': 'properties.runOn', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(WebhookCreateOrUpdateParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.is_enabled = kwargs.get('is_enabled', None) + self.uri = kwargs.get('uri', None) + self.expiry_time = kwargs.get('expiry_time', None) + self.parameters = kwargs.get('parameters', None) + self.runbook = kwargs.get('runbook', None) + self.run_on = kwargs.get('run_on', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/webhook_create_or_update_parameters_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/webhook_create_or_update_parameters_py3.py new file mode 100644 index 000000000000..7396bfb36a8f --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/webhook_create_or_update_parameters_py3.py @@ -0,0 +1,59 @@ +# 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 msrest.serialization import Model + + +class WebhookCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update webhook operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the name of the webhook. + :type name: str + :param is_enabled: Gets or sets the value of the enabled flag of webhook. + :type is_enabled: bool + :param uri: Gets or sets the uri. + :type uri: str + :param expiry_time: Gets or sets the expiry time. + :type expiry_time: datetime + :param parameters: Gets or sets the parameters of the job. + :type parameters: dict[str, str] + :param runbook: Gets or sets the runbook. + :type runbook: ~azure.mgmt.automation.models.RunbookAssociationProperty + :param run_on: Gets or sets the name of the hybrid worker group the + webhook job will run on. + :type run_on: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + 'uri': {'key': 'properties.uri', 'type': 'str'}, + 'expiry_time': {'key': 'properties.expiryTime', 'type': 'iso-8601'}, + 'parameters': {'key': 'properties.parameters', 'type': '{str}'}, + 'runbook': {'key': 'properties.runbook', 'type': 'RunbookAssociationProperty'}, + 'run_on': {'key': 'properties.runOn', 'type': 'str'}, + } + + def __init__(self, *, name: str, is_enabled: bool=None, uri: str=None, expiry_time=None, parameters=None, runbook=None, run_on: str=None, **kwargs) -> None: + super(WebhookCreateOrUpdateParameters, self).__init__(**kwargs) + self.name = name + self.is_enabled = is_enabled + self.uri = uri + self.expiry_time = expiry_time + self.parameters = parameters + self.runbook = runbook + self.run_on = run_on diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/webhook_paged.py b/azure-mgmt-automation/azure/mgmt/automation/models/webhook_paged.py new file mode 100644 index 000000000000..40429a9dd160 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/webhook_paged.py @@ -0,0 +1,27 @@ +# 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 msrest.paging import Paged + + +class WebhookPaged(Paged): + """ + A paging container for iterating over a list of :class:`Webhook ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Webhook]'} + } + + def __init__(self, *args, **kwargs): + + super(WebhookPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/webhook_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/webhook_py3.py new file mode 100644 index 000000000000..c328cf18503b --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/webhook_py3.py @@ -0,0 +1,85 @@ +# 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 .proxy_resource import ProxyResource + + +class Webhook(ProxyResource): + """Definition of the webhook type. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param is_enabled: Gets or sets the value of the enabled flag of the + webhook. Default value: False . + :type is_enabled: bool + :param uri: Gets or sets the webhook uri. + :type uri: str + :param expiry_time: Gets or sets the expiry time. + :type expiry_time: datetime + :param last_invoked_time: Gets or sets the last invoked time. + :type last_invoked_time: datetime + :param parameters: Gets or sets the parameters of the job that is created + when the webhook calls the runbook it is associated with. + :type parameters: dict[str, str] + :param runbook: Gets or sets the runbook the webhook is associated with. + :type runbook: ~azure.mgmt.automation.models.RunbookAssociationProperty + :param run_on: Gets or sets the name of the hybrid worker group the + webhook job will run on. + :type run_on: str + :param creation_time: Gets or sets the creation time. + :type creation_time: datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: datetime + :param description: Gets or sets the description. + :type description: str + """ + + _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'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + 'uri': {'key': 'properties.uri', 'type': 'str'}, + 'expiry_time': {'key': 'properties.expiryTime', 'type': 'iso-8601'}, + 'last_invoked_time': {'key': 'properties.lastInvokedTime', 'type': 'iso-8601'}, + 'parameters': {'key': 'properties.parameters', 'type': '{str}'}, + 'runbook': {'key': 'properties.runbook', 'type': 'RunbookAssociationProperty'}, + 'run_on': {'key': 'properties.runOn', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, *, is_enabled: bool=False, uri: str=None, expiry_time=None, last_invoked_time=None, parameters=None, runbook=None, run_on: str=None, creation_time=None, last_modified_time=None, description: str=None, **kwargs) -> None: + super(Webhook, self).__init__(**kwargs) + self.is_enabled = is_enabled + self.uri = uri + self.expiry_time = expiry_time + self.last_invoked_time = last_invoked_time + self.parameters = parameters + self.runbook = runbook + self.run_on = run_on + self.creation_time = creation_time + self.last_modified_time = last_modified_time + self.description = description diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/webhook_update_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/webhook_update_parameters.py new file mode 100644 index 000000000000..aaf3100b5caf --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/webhook_update_parameters.py @@ -0,0 +1,45 @@ +# 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 msrest.serialization import Model + + +class WebhookUpdateParameters(Model): + """The parameters supplied to the update webhook operation. + + :param name: Gets or sets the name of the webhook. + :type name: str + :param is_enabled: Gets or sets the value of the enabled flag of webhook. + :type is_enabled: bool + :param run_on: Gets or sets the name of the hybrid worker group the + webhook job will run on. + :type run_on: str + :param parameters: Gets or sets the parameters of the job. + :type parameters: dict[str, str] + :param description: Gets or sets the description of the webhook. + :type description: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + 'run_on': {'key': 'properties.runOn', 'type': 'str'}, + 'parameters': {'key': 'properties.parameters', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(WebhookUpdateParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.is_enabled = kwargs.get('is_enabled', None) + self.run_on = kwargs.get('run_on', None) + self.parameters = kwargs.get('parameters', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/webhook_update_parameters_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/webhook_update_parameters_py3.py new file mode 100644 index 000000000000..0d1514b01349 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/webhook_update_parameters_py3.py @@ -0,0 +1,45 @@ +# 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 msrest.serialization import Model + + +class WebhookUpdateParameters(Model): + """The parameters supplied to the update webhook operation. + + :param name: Gets or sets the name of the webhook. + :type name: str + :param is_enabled: Gets or sets the value of the enabled flag of webhook. + :type is_enabled: bool + :param run_on: Gets or sets the name of the hybrid worker group the + webhook job will run on. + :type run_on: str + :param parameters: Gets or sets the parameters of the job. + :type parameters: dict[str, str] + :param description: Gets or sets the description of the webhook. + :type description: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + 'run_on': {'key': 'properties.runOn', 'type': 'str'}, + 'parameters': {'key': 'properties.parameters', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, is_enabled: bool=None, run_on: str=None, parameters=None, description: str=None, **kwargs) -> None: + super(WebhookUpdateParameters, self).__init__(**kwargs) + self.name = name + self.is_enabled = is_enabled + self.run_on = run_on + self.parameters = parameters + self.description = description diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/windows_properties.py b/azure-mgmt-automation/azure/mgmt/automation/models/windows_properties.py new file mode 100644 index 000000000000..46c0241c5472 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/windows_properties.py @@ -0,0 +1,43 @@ +# 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 msrest.serialization import Model + + +class WindowsProperties(Model): + """Windows specific update configuration. + + :param included_update_classifications: Update classification included in + the software update configuration. A comma separated string with required + values. Possible values include: 'Unclassified', 'Critical', 'Security', + 'UpdateRollup', 'FeaturePack', 'ServicePack', 'Definition', 'Tools', + 'Updates' + :type included_update_classifications: str or + ~azure.mgmt.automation.models.WindowsUpdateClasses + :param excluded_kb_numbers: KB numbers excluded from the software update + configuration. + :type excluded_kb_numbers: list[str] + :param included_kb_numbers: KB numbers included from the software update + configuration. + :type included_kb_numbers: list[str] + """ + + _attribute_map = { + 'included_update_classifications': {'key': 'includedUpdateClassifications', 'type': 'str'}, + 'excluded_kb_numbers': {'key': 'excludedKbNumbers', 'type': '[str]'}, + 'included_kb_numbers': {'key': 'includedKbNumbers', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(WindowsProperties, self).__init__(**kwargs) + self.included_update_classifications = kwargs.get('included_update_classifications', None) + self.excluded_kb_numbers = kwargs.get('excluded_kb_numbers', None) + self.included_kb_numbers = kwargs.get('included_kb_numbers', None) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/windows_properties_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/windows_properties_py3.py new file mode 100644 index 000000000000..a33abd3d0481 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/windows_properties_py3.py @@ -0,0 +1,43 @@ +# 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 msrest.serialization import Model + + +class WindowsProperties(Model): + """Windows specific update configuration. + + :param included_update_classifications: Update classification included in + the software update configuration. A comma separated string with required + values. Possible values include: 'Unclassified', 'Critical', 'Security', + 'UpdateRollup', 'FeaturePack', 'ServicePack', 'Definition', 'Tools', + 'Updates' + :type included_update_classifications: str or + ~azure.mgmt.automation.models.WindowsUpdateClasses + :param excluded_kb_numbers: KB numbers excluded from the software update + configuration. + :type excluded_kb_numbers: list[str] + :param included_kb_numbers: KB numbers included from the software update + configuration. + :type included_kb_numbers: list[str] + """ + + _attribute_map = { + 'included_update_classifications': {'key': 'includedUpdateClassifications', 'type': 'str'}, + 'excluded_kb_numbers': {'key': 'excludedKbNumbers', 'type': '[str]'}, + 'included_kb_numbers': {'key': 'includedKbNumbers', 'type': '[str]'}, + } + + def __init__(self, *, included_update_classifications=None, excluded_kb_numbers=None, included_kb_numbers=None, **kwargs) -> None: + super(WindowsProperties, self).__init__(**kwargs) + self.included_update_classifications = included_update_classifications + self.excluded_kb_numbers = excluded_kb_numbers + self.included_kb_numbers = included_kb_numbers diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/__init__.py b/azure-mgmt-automation/azure/mgmt/automation/operations/__init__.py new file mode 100644 index 000000000000..0669ef392a1b --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/__init__.py @@ -0,0 +1,88 @@ +# 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 .automation_account_operations import AutomationAccountOperations +from .operations import Operations +from .statistics_operations import StatisticsOperations +from .usages_operations import UsagesOperations +from .keys_operations import KeysOperations +from .certificate_operations import CertificateOperations +from .connection_operations import ConnectionOperations +from .connection_type_operations import ConnectionTypeOperations +from .credential_operations import CredentialOperations +from .dsc_configuration_operations import DscConfigurationOperations +from .hybrid_runbook_worker_group_operations import HybridRunbookWorkerGroupOperations +from .job_schedule_operations import JobScheduleOperations +from .linked_workspace_operations import LinkedWorkspaceOperations +from .activity_operations import ActivityOperations +from .module_operations import ModuleOperations +from .object_data_types_operations import ObjectDataTypesOperations +from .fields_operations import FieldsOperations +from .runbook_draft_operations import RunbookDraftOperations +from .runbook_operations import RunbookOperations +from .test_job_streams_operations import TestJobStreamsOperations +from .test_job_operations import TestJobOperations +from .schedule_operations import ScheduleOperations +from .variable_operations import VariableOperations +from .webhook_operations import WebhookOperations +from .software_update_configurations_operations import SoftwareUpdateConfigurationsOperations +from .software_update_configuration_runs_operations import SoftwareUpdateConfigurationRunsOperations +from .software_update_configuration_machine_runs_operations import SoftwareUpdateConfigurationMachineRunsOperations +from .source_control_operations import SourceControlOperations +from .source_control_sync_job_operations import SourceControlSyncJobOperations +from .job_operations import JobOperations +from .job_stream_operations import JobStreamOperations +from .agent_registration_information_operations import AgentRegistrationInformationOperations +from .dsc_node_operations import DscNodeOperations +from .node_reports_operations import NodeReportsOperations +from .dsc_compilation_job_operations import DscCompilationJobOperations +from .dsc_compilation_job_stream_operations import DscCompilationJobStreamOperations +from .dsc_node_configuration_operations import DscNodeConfigurationOperations + +__all__ = [ + 'AutomationAccountOperations', + 'Operations', + 'StatisticsOperations', + 'UsagesOperations', + 'KeysOperations', + 'CertificateOperations', + 'ConnectionOperations', + 'ConnectionTypeOperations', + 'CredentialOperations', + 'DscConfigurationOperations', + 'HybridRunbookWorkerGroupOperations', + 'JobScheduleOperations', + 'LinkedWorkspaceOperations', + 'ActivityOperations', + 'ModuleOperations', + 'ObjectDataTypesOperations', + 'FieldsOperations', + 'RunbookDraftOperations', + 'RunbookOperations', + 'TestJobStreamsOperations', + 'TestJobOperations', + 'ScheduleOperations', + 'VariableOperations', + 'WebhookOperations', + 'SoftwareUpdateConfigurationsOperations', + 'SoftwareUpdateConfigurationRunsOperations', + 'SoftwareUpdateConfigurationMachineRunsOperations', + 'SourceControlOperations', + 'SourceControlSyncJobOperations', + 'JobOperations', + 'JobStreamOperations', + 'AgentRegistrationInformationOperations', + 'DscNodeOperations', + 'NodeReportsOperations', + 'DscCompilationJobOperations', + 'DscCompilationJobStreamOperations', + 'DscNodeConfigurationOperations', +] diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/activity_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/activity_operations.py new file mode 100644 index 000000000000..1417657b75e3 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/activity_operations.py @@ -0,0 +1,178 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ActivityOperations(object): + """ActivityOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-10-31". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-10-31" + + self.config = config + + def get( + self, resource_group_name, automation_account_name, module_name, activity_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the activity in the module identified by module name and + activity name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param module_name: The name of module. + :type module_name: str + :param activity_name: The name of activity. + :type activity_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Activity or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Activity or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'moduleName': self._serialize.url("module_name", module_name, 'str'), + 'activityName': self._serialize.url("activity_name", activity_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Activity', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}/activities/{activityName}'} + + def list_by_module( + self, resource_group_name, automation_account_name, module_name, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of activities in the module identified by module name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param module_name: The name of module. + :type module_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Activity + :rtype: + ~azure.mgmt.automation.models.ActivityPaged[~azure.mgmt.automation.models.Activity] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_module.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'moduleName': self._serialize.url("module_name", module_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ActivityPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ActivityPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_module.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}/activities'} diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/agent_registration_information_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/agent_registration_information_operations.py new file mode 100644 index 000000000000..d2256473d424 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/agent_registration_information_operations.py @@ -0,0 +1,167 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class AgentRegistrationInformationOperations(object): + """AgentRegistrationInformationOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2018-01-15". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-15" + + self.config = config + + def get( + self, resource_group_name, automation_account_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the automation agent registration information. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AgentRegistration or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.AgentRegistration or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('AgentRegistration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/agentRegistrationInformation'} + + def regenerate_key( + self, resource_group_name, automation_account_name, parameters, custom_headers=None, raw=False, **operation_config): + """Regenerate a primary or secondary agent registration key. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param parameters: The name of the agent registration key to be + regenerated + :type parameters: + ~azure.mgmt.automation.models.AgentRegistrationRegenerateKeyParameter + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AgentRegistration or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.AgentRegistration or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.regenerate_key.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'AgentRegistrationRegenerateKeyParameter') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('AgentRegistration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/agentRegistrationInformation/regenerateKey'} diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/automation_account_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/automation_account_operations.py new file mode 100644 index 000000000000..242ab5e56e2d --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/automation_account_operations.py @@ -0,0 +1,425 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class AutomationAccountOperations(object): + """AutomationAccountOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-10-31". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-10-31" + + self.config = config + + def update( + self, resource_group_name, automation_account_name, parameters, custom_headers=None, raw=False, **operation_config): + """Update an automation account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param automation_account_name: Automation account name. + :type automation_account_name: str + :param parameters: Parameters supplied to the update automation + account. + :type parameters: + ~azure.mgmt.automation.models.AutomationAccountUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AutomationAccount or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.AutomationAccount or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'AutomationAccountUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('AutomationAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}'} + + def create_or_update( + self, resource_group_name, automation_account_name, parameters, custom_headers=None, raw=False, **operation_config): + """Create or update automation account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param automation_account_name: Parameters supplied to the create or + update automation account. + :type automation_account_name: str + :param parameters: Parameters supplied to the create or update + automation account. + :type parameters: + ~azure.mgmt.automation.models.AutomationAccountCreateOrUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AutomationAccount or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.AutomationAccount or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'AutomationAccountCreateOrUpdateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('AutomationAccount', response) + if response.status_code == 201: + deserialized = self._deserialize('AutomationAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}'} + + def delete( + self, resource_group_name, automation_account_name, custom_headers=None, raw=False, **operation_config): + """Delete an automation account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param automation_account_name: Automation account name. + :type automation_account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}'} + + def get( + self, resource_group_name, automation_account_name, custom_headers=None, raw=False, **operation_config): + """Get information about an Automation Account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AutomationAccount or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.AutomationAccount or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('AutomationAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of accounts within a given resource group. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of AutomationAccount + :rtype: + ~azure.mgmt.automation.models.AutomationAccountPaged[~azure.mgmt.automation.models.AutomationAccount] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.AutomationAccountPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.AutomationAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists the Automation Accounts within an Azure subscription. + + Retrieve a list of accounts within a given subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of AutomationAccount + :rtype: + ~azure.mgmt.automation.models.AutomationAccountPaged[~azure.mgmt.automation.models.AutomationAccount] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.AutomationAccountPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.AutomationAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Automation/automationAccounts'} diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/certificate_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/certificate_operations.py new file mode 100644 index 000000000000..cf162ee165df --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/certificate_operations.py @@ -0,0 +1,377 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class CertificateOperations(object): + """CertificateOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-10-31". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-10-31" + + self.config = config + + def delete( + self, resource_group_name, automation_account_name, certificate_name, custom_headers=None, raw=False, **operation_config): + """Delete the certificate. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param certificate_name: The name of certificate. + :type certificate_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'certificateName': self._serialize.url("certificate_name", certificate_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates/{certificateName}'} + + def get( + self, resource_group_name, automation_account_name, certificate_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the certificate identified by certificate name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param certificate_name: The name of certificate. + :type certificate_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Certificate or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Certificate or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'certificateName': self._serialize.url("certificate_name", certificate_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Certificate', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates/{certificateName}'} + + def create_or_update( + self, resource_group_name, automation_account_name, certificate_name, parameters, custom_headers=None, raw=False, **operation_config): + """Create a certificate. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param certificate_name: The parameters supplied to the create or + update certificate operation. + :type certificate_name: str + :param parameters: The parameters supplied to the create or update + certificate operation. + :type parameters: + ~azure.mgmt.automation.models.CertificateCreateOrUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Certificate or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Certificate or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'certificateName': self._serialize.url("certificate_name", certificate_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'CertificateCreateOrUpdateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Certificate', response) + if response.status_code == 201: + deserialized = self._deserialize('Certificate', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates/{certificateName}'} + + def update( + self, resource_group_name, automation_account_name, certificate_name, name=None, description=None, custom_headers=None, raw=False, **operation_config): + """Update a certificate. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param certificate_name: The parameters supplied to the update + certificate operation. + :type certificate_name: str + :param name: Gets or sets the name of the certificate. + :type name: str + :param description: Gets or sets the description of the certificate. + :type description: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Certificate or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Certificate or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.CertificateUpdateParameters(name=name, description=description) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'certificateName': self._serialize.url("certificate_name", certificate_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'CertificateUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Certificate', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates/{certificateName}'} + + def list_by_automation_account( + self, resource_group_name, automation_account_name, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of certificates. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Certificate + :rtype: + ~azure.mgmt.automation.models.CertificatePaged[~azure.mgmt.automation.models.Certificate] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.CertificatePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.CertificatePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates'} diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/connection_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/connection_operations.py new file mode 100644 index 000000000000..6480b2095ce9 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/connection_operations.py @@ -0,0 +1,383 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ConnectionOperations(object): + """ConnectionOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-10-31". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-10-31" + + self.config = config + + def delete( + self, resource_group_name, automation_account_name, connection_name, custom_headers=None, raw=False, **operation_config): + """Delete the connection. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param connection_name: The name of connection. + :type connection_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Connection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Connection or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Connection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections/{connectionName}'} + + def get( + self, resource_group_name, automation_account_name, connection_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the connection identified by connection name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param connection_name: The name of connection. + :type connection_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Connection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Connection or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Connection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections/{connectionName}'} + + def create_or_update( + self, resource_group_name, automation_account_name, connection_name, parameters, custom_headers=None, raw=False, **operation_config): + """Create or update a connection. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param connection_name: The parameters supplied to the create or + update connection operation. + :type connection_name: str + :param parameters: The parameters supplied to the create or update + connection operation. + :type parameters: + ~azure.mgmt.automation.models.ConnectionCreateOrUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Connection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Connection or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ConnectionCreateOrUpdateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Connection', response) + if response.status_code == 201: + deserialized = self._deserialize('Connection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections/{connectionName}'} + + def update( + self, resource_group_name, automation_account_name, connection_name, parameters, custom_headers=None, raw=False, **operation_config): + """Update a connection. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param connection_name: The parameters supplied to the update a + connection operation. + :type connection_name: str + :param parameters: The parameters supplied to the update a connection + operation. + :type parameters: + ~azure.mgmt.automation.models.ConnectionUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Connection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Connection or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ConnectionUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Connection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections/{connectionName}'} + + def list_by_automation_account( + self, resource_group_name, automation_account_name, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of connections. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Connection + :rtype: + ~azure.mgmt.automation.models.ConnectionPaged[~azure.mgmt.automation.models.Connection] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ConnectionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ConnectionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections'} diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/connection_type_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/connection_type_operations.py new file mode 100644 index 000000000000..f26cf3db4db1 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/connection_type_operations.py @@ -0,0 +1,302 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ConnectionTypeOperations(object): + """ConnectionTypeOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-10-31". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-10-31" + + self.config = config + + def delete( + self, resource_group_name, automation_account_name, connection_type_name, custom_headers=None, raw=False, **operation_config): + """Delete the connectiontype. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param connection_type_name: The name of connectiontype. + :type connection_type_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'connectionTypeName': self._serialize.url("connection_type_name", connection_type_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connectionTypes/{connectionTypeName}'} + + def get( + self, resource_group_name, automation_account_name, connection_type_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the connectiontype identified by connectiontype name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param connection_type_name: The name of connectiontype. + :type connection_type_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ConnectionType or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.ConnectionType or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'connectionTypeName': self._serialize.url("connection_type_name", connection_type_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ConnectionType', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connectionTypes/{connectionTypeName}'} + + def create_or_update( + self, resource_group_name, automation_account_name, connection_type_name, parameters, custom_headers=None, raw=False, **operation_config): + """Create a connectiontype. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param connection_type_name: The parameters supplied to the create or + update connectiontype operation. + :type connection_type_name: str + :param parameters: The parameters supplied to the create or update + connectiontype operation. + :type parameters: + ~azure.mgmt.automation.models.ConnectionTypeCreateOrUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ConnectionType or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.ConnectionType or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'connectionTypeName': self._serialize.url("connection_type_name", connection_type_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ConnectionTypeCreateOrUpdateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [201, 409]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 201: + deserialized = self._deserialize('ConnectionType', response) + if response.status_code == 409: + deserialized = self._deserialize('ConnectionType', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connectionTypes/{connectionTypeName}'} + + def list_by_automation_account( + self, resource_group_name, automation_account_name, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of connectiontypes. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ConnectionType + :rtype: + ~azure.mgmt.automation.models.ConnectionTypePaged[~azure.mgmt.automation.models.ConnectionType] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ConnectionTypePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ConnectionTypePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connectionTypes'} diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/credential_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/credential_operations.py new file mode 100644 index 000000000000..424ee4368561 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/credential_operations.py @@ -0,0 +1,377 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class CredentialOperations(object): + """CredentialOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-10-31". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-10-31" + + self.config = config + + def delete( + self, resource_group_name, automation_account_name, credential_name, custom_headers=None, raw=False, **operation_config): + """Delete the credential. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param credential_name: The name of credential. + :type credential_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'credentialName': self._serialize.url("credential_name", credential_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials/{credentialName}'} + + def get( + self, resource_group_name, automation_account_name, credential_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the credential identified by credential name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param credential_name: The name of credential. + :type credential_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Credential or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Credential or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'credentialName': self._serialize.url("credential_name", credential_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Credential', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials/{credentialName}'} + + def create_or_update( + self, resource_group_name, automation_account_name, credential_name, parameters, custom_headers=None, raw=False, **operation_config): + """Create a credential. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param credential_name: The parameters supplied to the create or + update credential operation. + :type credential_name: str + :param parameters: The parameters supplied to the create or update + credential operation. + :type parameters: + ~azure.mgmt.automation.models.CredentialCreateOrUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Credential or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Credential or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'credentialName': self._serialize.url("credential_name", credential_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'CredentialCreateOrUpdateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Credential', response) + if response.status_code == 201: + deserialized = self._deserialize('Credential', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials/{credentialName}'} + + def update( + self, resource_group_name, automation_account_name, credential_name, parameters, custom_headers=None, raw=False, **operation_config): + """Update a credential. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param credential_name: The parameters supplied to the Update + credential operation. + :type credential_name: str + :param parameters: The parameters supplied to the Update credential + operation. + :type parameters: + ~azure.mgmt.automation.models.CredentialUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Credential or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Credential or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'credentialName': self._serialize.url("credential_name", credential_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'CredentialUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Credential', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials/{credentialName}'} + + def list_by_automation_account( + self, resource_group_name, automation_account_name, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of credentials. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Credential + :rtype: + ~azure.mgmt.automation.models.CredentialPaged[~azure.mgmt.automation.models.Credential] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.CredentialPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.CredentialPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials'} diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/dsc_compilation_job_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/dsc_compilation_job_operations.py new file mode 100644 index 000000000000..547ed687bfd1 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/dsc_compilation_job_operations.py @@ -0,0 +1,349 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class DscCompilationJobOperations(object): + """DscCompilationJobOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2018-01-15". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-15" + + self.config = config + + + def _create_initial( + self, resource_group_name, automation_account_name, compilation_job_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'compilationJobName': self._serialize.url("compilation_job_name", compilation_job_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'DscCompilationJobCreateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 201: + deserialized = self._deserialize('DscCompilationJob', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, automation_account_name, compilation_job_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates the Dsc compilation job of the configuration. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param compilation_job_name: The the DSC configuration Id. + :type compilation_job_name: str + :param parameters: The parameters supplied to the create compilation + job operation. + :type parameters: + ~azure.mgmt.automation.models.DscCompilationJobCreateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns DscCompilationJob or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.automation.models.DscCompilationJob] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.automation.models.DscCompilationJob]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + compilation_job_name=compilation_job_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DscCompilationJob', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs/{compilationJobName}'} + + def get( + self, resource_group_name, automation_account_name, compilation_job_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the Dsc configuration compilation job identified by job id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param compilation_job_name: The the DSC configuration Id. + :type compilation_job_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DscCompilationJob or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.DscCompilationJob or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'compilationJobName': self._serialize.url("compilation_job_name", compilation_job_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DscCompilationJob', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs/{compilationJobName}'} + + def list_by_automation_account( + self, resource_group_name, automation_account_name, filter=None, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of dsc compilation jobs. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of DscCompilationJob + :rtype: + ~azure.mgmt.automation.models.DscCompilationJobPaged[~azure.mgmt.automation.models.DscCompilationJob] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.DscCompilationJobPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DscCompilationJobPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs'} + + def get_stream( + self, resource_group_name, automation_account_name, job_id, job_stream_id, custom_headers=None, raw=False, **operation_config): + """Retrieve the job stream identified by job stream id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param job_id: The job id. + :type job_id: str + :param job_stream_id: The job stream id. + :type job_stream_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: JobStream or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.JobStream or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_stream.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'jobId': self._serialize.url("job_id", job_id, 'str'), + 'jobStreamId': self._serialize.url("job_stream_id", job_stream_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('JobStream', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_stream.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs/{jobId}/streams/{jobStreamId}'} diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/dsc_compilation_job_stream_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/dsc_compilation_job_stream_operations.py new file mode 100644 index 000000000000..ebc519b12743 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/dsc_compilation_job_stream_operations.py @@ -0,0 +1,101 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class DscCompilationJobStreamOperations(object): + """DscCompilationJobStreamOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2018-01-15". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-15" + + self.config = config + + def list_by_job( + self, resource_group_name, automation_account_name, job_id, custom_headers=None, raw=False, **operation_config): + """Retrieve all the job streams for the compilation Job. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param job_id: The job id. + :type job_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: JobStreamListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.JobStreamListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_by_job.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'jobId': self._serialize.url("job_id", job_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('JobStreamListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs/{jobId}/streams'} diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/dsc_configuration_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/dsc_configuration_operations.py new file mode 100644 index 000000000000..9154a8c5a916 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/dsc_configuration_operations.py @@ -0,0 +1,439 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class DscConfigurationOperations(object): + """DscConfigurationOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-10-31". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-10-31" + + self.config = config + + def delete( + self, resource_group_name, automation_account_name, configuration_name, custom_headers=None, raw=False, **operation_config): + """Delete the dsc configuration identified by configuration name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param configuration_name: The configuration name. + :type configuration_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'configurationName': self._serialize.url("configuration_name", configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}'} + + def get( + self, resource_group_name, automation_account_name, configuration_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the configuration identified by configuration name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param configuration_name: The configuration name. + :type configuration_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DscConfiguration or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.DscConfiguration or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'configurationName': self._serialize.url("configuration_name", configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DscConfiguration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}'} + + def create_or_update( + self, resource_group_name, automation_account_name, configuration_name, parameters, custom_headers=None, raw=False, **operation_config): + """Create the configuration identified by configuration name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param configuration_name: The create or update parameters for + configuration. + :type configuration_name: str + :param parameters: The create or update parameters for configuration. + :type parameters: + ~azure.mgmt.automation.models.DscConfigurationCreateOrUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DscConfiguration or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.DscConfiguration or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'configurationName': self._serialize.url("configuration_name", configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'DscConfigurationCreateOrUpdateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DscConfiguration', response) + if response.status_code == 201: + deserialized = self._deserialize('DscConfiguration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}'} + + def update( + self, resource_group_name, automation_account_name, configuration_name, parameters=None, custom_headers=None, raw=False, **operation_config): + """Create the configuration identified by configuration name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param configuration_name: The create or update parameters for + configuration. + :type configuration_name: str + :param parameters: The create or update parameters for configuration. + :type parameters: + ~azure.mgmt.automation.models.DscConfigurationUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DscConfiguration or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.DscConfiguration or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'configurationName': self._serialize.url("configuration_name", configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + if parameters is not None: + body_content = self._serialize.body(parameters, 'DscConfigurationUpdateParameters') + else: + body_content = None + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DscConfiguration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}'} + + def get_content( + self, resource_group_name, automation_account_name, configuration_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the configuration script identified by configuration name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param configuration_name: The configuration name. + :type configuration_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_content.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'configurationName': self._serialize.url("configuration_name", configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('str', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_content.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}/content'} + + def list_by_automation_account( + self, resource_group_name, automation_account_name, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of configurations. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of DscConfiguration + :rtype: + ~azure.mgmt.automation.models.DscConfigurationPaged[~azure.mgmt.automation.models.DscConfiguration] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.DscConfigurationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DscConfigurationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations'} diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/dsc_node_configuration_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/dsc_node_configuration_operations.py new file mode 100644 index 000000000000..af2019e032d1 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/dsc_node_configuration_operations.py @@ -0,0 +1,337 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class DscNodeConfigurationOperations(object): + """DscNodeConfigurationOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2018-01-15". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-15" + + self.config = config + + def delete( + self, resource_group_name, automation_account_name, node_configuration_name, custom_headers=None, raw=False, **operation_config): + """Delete the Dsc node configurations by node configuration. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param node_configuration_name: The Dsc node configuration name. + :type node_configuration_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'nodeConfigurationName': self._serialize.url("node_configuration_name", node_configuration_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodeConfigurations/{nodeConfigurationName}'} + + def get( + self, resource_group_name, automation_account_name, node_configuration_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the Dsc node configurations by node configuration. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param node_configuration_name: The Dsc node configuration name. + :type node_configuration_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DscNodeConfiguration or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.DscNodeConfiguration or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'nodeConfigurationName': self._serialize.url("node_configuration_name", node_configuration_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DscNodeConfiguration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodeConfigurations/{nodeConfigurationName}'} + + + def _create_or_update_initial( + self, resource_group_name, automation_account_name, node_configuration_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'nodeConfigurationName': self._serialize.url("node_configuration_name", node_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'DscNodeConfigurationCreateOrUpdateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 201: + deserialized = self._deserialize('DscNodeConfiguration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, automation_account_name, node_configuration_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Create the node configuration identified by node configuration name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param node_configuration_name: The Dsc node configuration name. + :type node_configuration_name: str + :param parameters: The create or update parameters for configuration. + :type parameters: + ~azure.mgmt.automation.models.DscNodeConfigurationCreateOrUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns DscNodeConfiguration or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.automation.models.DscNodeConfiguration] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.automation.models.DscNodeConfiguration]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + node_configuration_name=node_configuration_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DscNodeConfiguration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodeConfigurations/{nodeConfigurationName}'} + + def list_by_automation_account( + self, resource_group_name, automation_account_name, filter=None, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of dsc node configurations. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of DscNodeConfiguration + :rtype: + ~azure.mgmt.automation.models.DscNodeConfigurationPaged[~azure.mgmt.automation.models.DscNodeConfiguration] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.DscNodeConfigurationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DscNodeConfigurationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodeConfigurations'} diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/dsc_node_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/dsc_node_operations.py new file mode 100644 index 000000000000..aa1e6c97f9b6 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/dsc_node_operations.py @@ -0,0 +1,311 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class DscNodeOperations(object): + """DscNodeOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2018-01-15". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-15" + + self.config = config + + def delete( + self, resource_group_name, automation_account_name, node_id, custom_headers=None, raw=False, **operation_config): + """Delete the dsc node identified by node id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param node_id: The node id. + :type node_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DscNode or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.DscNode or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'nodeId': self._serialize.url("node_id", node_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DscNode', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}'} + + def get( + self, resource_group_name, automation_account_name, node_id, custom_headers=None, raw=False, **operation_config): + """Retrieve the dsc node identified by node id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param node_id: The node id. + :type node_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DscNode or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.DscNode or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'nodeId': self._serialize.url("node_id", node_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DscNode', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}'} + + def update( + self, resource_group_name, automation_account_name, node_id, dsc_node_update_parameters, custom_headers=None, raw=False, **operation_config): + """Update the dsc node. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param node_id: Parameters supplied to the update dsc node. + :type node_id: str + :param dsc_node_update_parameters: Parameters supplied to the update + dsc node. + :type dsc_node_update_parameters: + ~azure.mgmt.automation.models.DscNodeUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DscNode or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.DscNode or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'nodeId': self._serialize.url("node_id", node_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(dsc_node_update_parameters, 'DscNodeUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DscNode', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}'} + + def list_by_automation_account( + self, resource_group_name, automation_account_name, filter=None, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of dsc nodes. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of DscNode + :rtype: + ~azure.mgmt.automation.models.DscNodePaged[~azure.mgmt.automation.models.DscNode] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.DscNodePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DscNodePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes'} diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/fields_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/fields_operations.py new file mode 100644 index 000000000000..0f43c7c5989e --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/fields_operations.py @@ -0,0 +1,113 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class FieldsOperations(object): + """FieldsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-10-31". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-10-31" + + self.config = config + + def list_by_type( + self, resource_group_name, automation_account_name, module_name, type_name, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of fields of a given type identified by module name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param module_name: The name of module. + :type module_name: str + :param type_name: The name of type. + :type type_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of TypeField + :rtype: + ~azure.mgmt.automation.models.TypeFieldPaged[~azure.mgmt.automation.models.TypeField] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_type.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'moduleName': self._serialize.url("module_name", module_name, 'str'), + 'typeName': self._serialize.url("type_name", type_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.TypeFieldPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.TypeFieldPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_type.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}/types/{typeName}/fields'} diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/hybrid_runbook_worker_group_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/hybrid_runbook_worker_group_operations.py new file mode 100644 index 000000000000..a058b9c4bac6 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/hybrid_runbook_worker_group_operations.py @@ -0,0 +1,303 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class HybridRunbookWorkerGroupOperations(object): + """HybridRunbookWorkerGroupOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-10-31". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-10-31" + + self.config = config + + def delete( + self, resource_group_name, automation_account_name, hybrid_runbook_worker_group_name, custom_headers=None, raw=False, **operation_config): + """Delete a hybrid runbook worker group. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: Automation account name. + :type automation_account_name: str + :param hybrid_runbook_worker_group_name: The hybrid runbook worker + group name + :type hybrid_runbook_worker_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'hybridRunbookWorkerGroupName': self._serialize.url("hybrid_runbook_worker_group_name", hybrid_runbook_worker_group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/hybridRunbookWorkerGroups/{hybridRunbookWorkerGroupName}'} + + def get( + self, resource_group_name, automation_account_name, hybrid_runbook_worker_group_name, custom_headers=None, raw=False, **operation_config): + """Retrieve a hybrid runbook worker group. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param hybrid_runbook_worker_group_name: The hybrid runbook worker + group name + :type hybrid_runbook_worker_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: HybridRunbookWorkerGroup or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.HybridRunbookWorkerGroup or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'hybridRunbookWorkerGroupName': self._serialize.url("hybrid_runbook_worker_group_name", hybrid_runbook_worker_group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('HybridRunbookWorkerGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/hybridRunbookWorkerGroups/{hybridRunbookWorkerGroupName}'} + + def update( + self, resource_group_name, automation_account_name, hybrid_runbook_worker_group_name, credential=None, custom_headers=None, raw=False, **operation_config): + """Update a hybrid runbook worker group. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param hybrid_runbook_worker_group_name: The hybrid runbook worker + group name + :type hybrid_runbook_worker_group_name: str + :param credential: Sets the credential of a worker group. + :type credential: + ~azure.mgmt.automation.models.RunAsCredentialAssociationProperty + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: HybridRunbookWorkerGroup or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.HybridRunbookWorkerGroup or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.HybridRunbookWorkerGroupUpdateParameters(credential=credential) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'hybridRunbookWorkerGroupName': self._serialize.url("hybrid_runbook_worker_group_name", hybrid_runbook_worker_group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'HybridRunbookWorkerGroupUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('HybridRunbookWorkerGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/hybridRunbookWorkerGroups/{hybridRunbookWorkerGroupName}'} + + def list_by_automation_account( + self, resource_group_name, automation_account_name, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of hybrid runbook worker groups. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of HybridRunbookWorkerGroup + :rtype: + ~azure.mgmt.automation.models.HybridRunbookWorkerGroupPaged[~azure.mgmt.automation.models.HybridRunbookWorkerGroup] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.HybridRunbookWorkerGroupPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.HybridRunbookWorkerGroupPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/hybridRunbookWorkerGroups'} diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/job_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/job_operations.py new file mode 100644 index 000000000000..238618a3e166 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/job_operations.py @@ -0,0 +1,575 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class JobOperations(object): + """JobOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2017-05-15-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-05-15-preview" + + self.config = config + + def get_output( + self, resource_group_name, automation_account_name, job_name, client_request_id=None, custom_headers=None, raw=False, **operation_config): + """Retrieve the job output identified by job name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param job_name: The name of the job to be created. + :type job_name: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_output.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('str', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_output.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/output'} + + def get_runbook_content( + self, resource_group_name, automation_account_name, job_name, client_request_id=None, custom_headers=None, raw=False, **operation_config): + """Retrieve the runbook content of the job identified by job name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param job_name: The job name. + :type job_name: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_runbook_content.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('str', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_runbook_content.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/runbookContent'} + + def suspend( + self, resource_group_name, automation_account_name, job_name, client_request_id=None, custom_headers=None, raw=False, **operation_config): + """Suspend the job identified by job name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param job_name: The job name. + :type job_name: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.suspend.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + suspend.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/suspend'} + + def stop( + self, resource_group_name, automation_account_name, job_name, client_request_id=None, custom_headers=None, raw=False, **operation_config): + """Stop the job identified by jobName. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param job_name: The job name. + :type job_name: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.stop.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/stop'} + + def get( + self, resource_group_name, automation_account_name, job_name, client_request_id=None, custom_headers=None, raw=False, **operation_config): + """Retrieve the job identified by job name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param job_name: The job name. + :type job_name: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Job or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Job or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Job', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}'} + + def create( + self, resource_group_name, automation_account_name, job_name, parameters, client_request_id=None, custom_headers=None, raw=False, **operation_config): + """Create a job of the runbook. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param job_name: The job name. + :type job_name: str + :param parameters: The parameters supplied to the create job + operation. + :type parameters: ~azure.mgmt.automation.models.JobCreateParameters + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Job or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Job or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'JobCreateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 201: + deserialized = self._deserialize('Job', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}'} + + def list_by_automation_account( + self, resource_group_name, automation_account_name, filter=None, client_request_id=None, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of jobs. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of JobCollectionItem + :rtype: + ~azure.mgmt.automation.models.JobCollectionItemPaged[~azure.mgmt.automation.models.JobCollectionItem] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.JobCollectionItemPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.JobCollectionItemPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs'} + + def resume( + self, resource_group_name, automation_account_name, job_name, client_request_id=None, custom_headers=None, raw=False, **operation_config): + """Resume the job identified by jobName. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param job_name: The job name. + :type job_name: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.resume.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + resume.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/resume'} diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/job_schedule_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/job_schedule_operations.py new file mode 100644 index 000000000000..b9d435b2fa63 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/job_schedule_operations.py @@ -0,0 +1,299 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class JobScheduleOperations(object): + """JobScheduleOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-10-31". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-10-31" + + self.config = config + + def delete( + self, resource_group_name, automation_account_name, job_schedule_id, custom_headers=None, raw=False, **operation_config): + """Delete the job schedule identified by job schedule name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param job_schedule_id: The job schedule name. + :type job_schedule_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'jobScheduleId': self._serialize.url("job_schedule_id", job_schedule_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobSchedules/{jobScheduleId}'} + + def get( + self, resource_group_name, automation_account_name, job_schedule_id, custom_headers=None, raw=False, **operation_config): + """Retrieve the job schedule identified by job schedule name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param job_schedule_id: The job schedule name. + :type job_schedule_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: JobSchedule or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.JobSchedule or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'jobScheduleId': self._serialize.url("job_schedule_id", job_schedule_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('JobSchedule', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobSchedules/{jobScheduleId}'} + + def create( + self, resource_group_name, automation_account_name, job_schedule_id, parameters, custom_headers=None, raw=False, **operation_config): + """Create a job schedule. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param job_schedule_id: The job schedule name. + :type job_schedule_id: str + :param parameters: The parameters supplied to the create job schedule + operation. + :type parameters: + ~azure.mgmt.automation.models.JobScheduleCreateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: JobSchedule or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.JobSchedule or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'jobScheduleId': self._serialize.url("job_schedule_id", job_schedule_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'JobScheduleCreateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 201: + deserialized = self._deserialize('JobSchedule', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobSchedules/{jobScheduleId}'} + + def list_by_automation_account( + self, resource_group_name, automation_account_name, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of job schedules. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of JobSchedule + :rtype: + ~azure.mgmt.automation.models.JobSchedulePaged[~azure.mgmt.automation.models.JobSchedule] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.JobSchedulePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.JobSchedulePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobSchedules'} diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/job_stream_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/job_stream_operations.py new file mode 100644 index 000000000000..7d15f15de940 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/job_stream_operations.py @@ -0,0 +1,189 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class JobStreamOperations(object): + """JobStreamOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2017-05-15-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-05-15-preview" + + self.config = config + + def get( + self, resource_group_name, automation_account_name, job_name, job_stream_id, client_request_id=None, custom_headers=None, raw=False, **operation_config): + """Retrieve the job stream identified by job stream id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param job_name: The job name. + :type job_name: str + :param job_stream_id: The job stream id. + :type job_stream_id: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: JobStream or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.JobStream or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str'), + 'jobStreamId': self._serialize.url("job_stream_id", job_stream_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('JobStream', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/streams/{jobStreamId}'} + + def list_by_job( + self, resource_group_name, automation_account_name, job_name, filter=None, client_request_id=None, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of jobs streams identified by job name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param job_name: The job name. + :type job_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of JobStream + :rtype: + ~azure.mgmt.automation.models.JobStreamPaged[~azure.mgmt.automation.models.JobStream] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_job.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.JobStreamPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.JobStreamPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/streams'} diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/keys_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/keys_operations.py new file mode 100644 index 000000000000..cb29a67fd8e3 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/keys_operations.py @@ -0,0 +1,107 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class KeysOperations(object): + """KeysOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-10-31". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-10-31" + + self.config = config + + def list_by_automation_account( + self, resource_group_name, automation_account_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the automation keys for an account. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Key + :rtype: + ~azure.mgmt.automation.models.KeyPaged[~azure.mgmt.automation.models.Key] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.KeyPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.KeyPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/listKeys'} diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/linked_workspace_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/linked_workspace_operations.py new file mode 100644 index 000000000000..e00618422045 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/linked_workspace_operations.py @@ -0,0 +1,98 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class LinkedWorkspaceOperations(object): + """LinkedWorkspaceOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-10-31". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-10-31" + + self.config = config + + def get( + self, resource_group_name, automation_account_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the linked workspace for the account id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: LinkedWorkspace or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.LinkedWorkspace or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('LinkedWorkspace', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/linkedWorkspace'} diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/module_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/module_operations.py new file mode 100644 index 000000000000..f045737464c6 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/module_operations.py @@ -0,0 +1,370 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ModuleOperations(object): + """ModuleOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-10-31". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-10-31" + + self.config = config + + def delete( + self, resource_group_name, automation_account_name, module_name, custom_headers=None, raw=False, **operation_config): + """Delete the module by name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param module_name: The module name. + :type module_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'moduleName': self._serialize.url("module_name", module_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}'} + + def get( + self, resource_group_name, automation_account_name, module_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the module identified by module name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param module_name: The module name. + :type module_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Module or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Module or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'moduleName': self._serialize.url("module_name", module_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Module', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}'} + + def create_or_update( + self, resource_group_name, automation_account_name, module_name, parameters, custom_headers=None, raw=False, **operation_config): + """Create or Update the module identified by module name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param module_name: The name of module. + :type module_name: str + :param parameters: The create or update parameters for module. + :type parameters: + ~azure.mgmt.automation.models.ModuleCreateOrUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Module or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Module or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'moduleName': self._serialize.url("module_name", module_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ModuleCreateOrUpdateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Module', response) + if response.status_code == 201: + deserialized = self._deserialize('Module', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}'} + + def update( + self, resource_group_name, automation_account_name, module_name, parameters, custom_headers=None, raw=False, **operation_config): + """Update the module identified by module name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param module_name: The name of module. + :type module_name: str + :param parameters: The update parameters for module. + :type parameters: ~azure.mgmt.automation.models.ModuleUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Module or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Module or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'moduleName': self._serialize.url("module_name", module_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ModuleUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Module', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}'} + + def list_by_automation_account( + self, resource_group_name, automation_account_name, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of modules. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Module + :rtype: + ~azure.mgmt.automation.models.ModulePaged[~azure.mgmt.automation.models.Module] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ModulePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ModulePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules'} diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/node_reports_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/node_reports_operations.py new file mode 100644 index 000000000000..2c05c40a2540 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/node_reports_operations.py @@ -0,0 +1,247 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class NodeReportsOperations(object): + """NodeReportsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2018-01-15". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-15" + + self.config = config + + def list_by_node( + self, resource_group_name, automation_account_name, node_id, filter=None, custom_headers=None, raw=False, **operation_config): + """Retrieve the Dsc node report list by node id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param node_id: The parameters supplied to the list operation. + :type node_id: str + :param filter: The filter to apply on the operation. + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of DscNodeReport + :rtype: + ~azure.mgmt.automation.models.DscNodeReportPaged[~azure.mgmt.automation.models.DscNodeReport] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_node.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'nodeId': self._serialize.url("node_id", node_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.DscNodeReportPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DscNodeReportPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_node.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}/reports'} + + def get( + self, resource_group_name, automation_account_name, node_id, report_id, custom_headers=None, raw=False, **operation_config): + """Retrieve the Dsc node report data by node id and report id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param node_id: The Dsc node id. + :type node_id: str + :param report_id: The report id. + :type report_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DscNodeReport or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.DscNodeReport or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'nodeId': self._serialize.url("node_id", node_id, 'str'), + 'reportId': self._serialize.url("report_id", report_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DscNodeReport', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}/reports/{reportId}'} + + def get_content( + self, resource_group_name, automation_account_name, node_id, report_id, custom_headers=None, raw=False, **operation_config): + """Retrieve the Dsc node reports by node id and report id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param node_id: The Dsc node id. + :type node_id: str + :param report_id: The report id. + :type report_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_content.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'nodeId': self._serialize.url("node_id", node_id, 'str'), + 'reportId': self._serialize.url("report_id", report_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('object', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_content.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}/reports/{reportId}/content'} diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/object_data_types_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/object_data_types_operations.py new file mode 100644 index 000000000000..e721f63e86ac --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/object_data_types_operations.py @@ -0,0 +1,187 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ObjectDataTypesOperations(object): + """ObjectDataTypesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-10-31". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-10-31" + + self.config = config + + def list_fields_by_module_and_type( + self, resource_group_name, automation_account_name, module_name, type_name, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of fields of a given type identified by module name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param module_name: The name of module. + :type module_name: str + :param type_name: The name of type. + :type type_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of TypeField + :rtype: + ~azure.mgmt.automation.models.TypeFieldPaged[~azure.mgmt.automation.models.TypeField] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_fields_by_module_and_type.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'moduleName': self._serialize.url("module_name", module_name, 'str'), + 'typeName': self._serialize.url("type_name", type_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.TypeFieldPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.TypeFieldPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_fields_by_module_and_type.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}/objectDataTypes/{typeName}/fields'} + + def list_fields_by_type( + self, resource_group_name, automation_account_name, type_name, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of fields of a given type across all accessible + modules. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param type_name: The name of type. + :type type_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of TypeField + :rtype: + ~azure.mgmt.automation.models.TypeFieldPaged[~azure.mgmt.automation.models.TypeField] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_fields_by_type.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'typeName': self._serialize.url("type_name", type_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.TypeFieldPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.TypeFieldPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_fields_by_type.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/objectDataTypes/{typeName}/fields'} diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/operations.py new file mode 100644 index 000000000000..104b10d28aad --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/operations.py @@ -0,0 +1,97 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class Operations(object): + """Operations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-10-31". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-10-31" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available Automation REST API operations. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Operation + :rtype: + ~azure.mgmt.automation.models.OperationPaged[~azure.mgmt.automation.models.Operation] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Automation/operations'} diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/runbook_draft_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/runbook_draft_operations.py new file mode 100644 index 000000000000..a3a92d351729 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/runbook_draft_operations.py @@ -0,0 +1,447 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class RunbookDraftOperations(object): + """RunbookDraftOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-10-31". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-10-31" + + self.config = config + + def get_content( + self, resource_group_name, automation_account_name, runbook_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the content of runbook draft identified by runbook name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_content.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('str', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_content.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/content'} + + + def _replace_content_initial( + self, resource_group_name, automation_account_name, runbook_name, runbook_content, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.replace_content.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'text/powershell' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(runbook_content, 'str') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('str', response) + header_dict = { + 'location': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + def replace_content( + self, resource_group_name, automation_account_name, runbook_name, runbook_content, custom_headers=None, raw=False, polling=True, **operation_config): + """Replaces the runbook draft content. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :param runbook_content: The runbook draft content. + :type runbook_content: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns str or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[str] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[str]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._replace_content_initial( + resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + runbook_name=runbook_name, + runbook_content=runbook_content, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + header_dict = { + 'location': 'str', + } + deserialized = self._deserialize('str', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + replace_content.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/content'} + + def get( + self, resource_group_name, automation_account_name, runbook_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the runbook draft identified by runbook name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: RunbookDraft or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.RunbookDraft or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('RunbookDraft', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft'} + + + def _publish_initial( + self, resource_group_name, automation_account_name, runbook_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.publish.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('str', response) + header_dict = { + 'location': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + def publish( + self, resource_group_name, automation_account_name, runbook_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Publish runbook draft. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param runbook_name: The parameters supplied to the publish runbook + operation. + :type runbook_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns str or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[str] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[str]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._publish_initial( + resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + runbook_name=runbook_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + header_dict = { + 'location': 'str', + } + deserialized = self._deserialize('str', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + publish.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/publish'} + + def undo_edit( + self, resource_group_name, automation_account_name, runbook_name, custom_headers=None, raw=False, **operation_config): + """Undo draft edit to last known published state identified by runbook + name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: RunbookDraftUndoEditResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.RunbookDraftUndoEditResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.undo_edit.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('RunbookDraftUndoEditResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + undo_edit.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/undoEdit'} diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/runbook_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/runbook_operations.py new file mode 100644 index 000000000000..5bd122c8713e --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/runbook_operations.py @@ -0,0 +1,438 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class RunbookOperations(object): + """RunbookOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-10-31". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-10-31" + + self.config = config + + def get_content( + self, resource_group_name, automation_account_name, runbook_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the content of runbook identified by runbook name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_content.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('str', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_content.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/content'} + + def get( + self, resource_group_name, automation_account_name, runbook_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the runbook identified by runbook name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Runbook or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Runbook or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Runbook', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}'} + + def create_or_update( + self, resource_group_name, automation_account_name, runbook_name, parameters, custom_headers=None, raw=False, **operation_config): + """Create the runbook identified by runbook name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :param parameters: The create or update parameters for runbook. + Provide either content link for a published runbook or draft, not + both. + :type parameters: + ~azure.mgmt.automation.models.RunbookCreateOrUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Runbook or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Runbook or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'RunbookCreateOrUpdateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201, 400]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Runbook', response) + if response.status_code == 201: + deserialized = self._deserialize('Runbook', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}'} + + def update( + self, resource_group_name, automation_account_name, runbook_name, parameters, custom_headers=None, raw=False, **operation_config): + """Update the runbook identified by runbook name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :param parameters: The update parameters for runbook. + :type parameters: + ~azure.mgmt.automation.models.RunbookUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Runbook or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Runbook or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'RunbookUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Runbook', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}'} + + def delete( + self, resource_group_name, automation_account_name, runbook_name, custom_headers=None, raw=False, **operation_config): + """Delete the runbook by name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}'} + + def list_by_automation_account( + self, resource_group_name, automation_account_name, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of runbooks. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Runbook + :rtype: + ~azure.mgmt.automation.models.RunbookPaged[~azure.mgmt.automation.models.Runbook] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.RunbookPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.RunbookPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks'} diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/schedule_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/schedule_operations.py new file mode 100644 index 000000000000..00e66e349823 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/schedule_operations.py @@ -0,0 +1,371 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ScheduleOperations(object): + """ScheduleOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-10-31". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-10-31" + + self.config = config + + def create_or_update( + self, resource_group_name, automation_account_name, schedule_name, parameters, custom_headers=None, raw=False, **operation_config): + """Create a schedule. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param schedule_name: The schedule name. + :type schedule_name: str + :param parameters: The parameters supplied to the create or update + schedule operation. + :type parameters: + ~azure.mgmt.automation.models.ScheduleCreateOrUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Schedule or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Schedule or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'scheduleName': self._serialize.url("schedule_name", schedule_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ScheduleCreateOrUpdateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [201, 409]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 201: + deserialized = self._deserialize('Schedule', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules/{scheduleName}'} + + def update( + self, resource_group_name, automation_account_name, schedule_name, parameters, custom_headers=None, raw=False, **operation_config): + """Update the schedule identified by schedule name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param schedule_name: The schedule name. + :type schedule_name: str + :param parameters: The parameters supplied to the update schedule + operation. + :type parameters: + ~azure.mgmt.automation.models.ScheduleUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Schedule or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Schedule or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'scheduleName': self._serialize.url("schedule_name", schedule_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ScheduleUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Schedule', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules/{scheduleName}'} + + def get( + self, resource_group_name, automation_account_name, schedule_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the schedule identified by schedule name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param schedule_name: The schedule name. + :type schedule_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Schedule or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Schedule or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'scheduleName': self._serialize.url("schedule_name", schedule_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Schedule', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules/{scheduleName}'} + + def delete( + self, resource_group_name, automation_account_name, schedule_name, custom_headers=None, raw=False, **operation_config): + """Delete the schedule identified by schedule name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param schedule_name: The schedule name. + :type schedule_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'scheduleName': self._serialize.url("schedule_name", schedule_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 404]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules/{scheduleName}'} + + def list_by_automation_account( + self, resource_group_name, automation_account_name, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of schedules. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Schedule + :rtype: + ~azure.mgmt.automation.models.SchedulePaged[~azure.mgmt.automation.models.Schedule] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.SchedulePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.SchedulePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules'} diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/software_update_configuration_machine_runs_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/software_update_configuration_machine_runs_operations.py new file mode 100644 index 000000000000..212a9174deab --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/software_update_configuration_machine_runs_operations.py @@ -0,0 +1,194 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class SoftwareUpdateConfigurationMachineRunsOperations(object): + """SoftwareUpdateConfigurationMachineRunsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2017-05-15-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-05-15-preview" + + self.config = config + + def get_by_id( + self, resource_group_name, automation_account_name, software_update_configuration_machine_run_id, client_request_id=None, custom_headers=None, raw=False, **operation_config): + """Get a single software update configuration machine run by Id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param software_update_configuration_machine_run_id: The Id of the + software update configuration machine run. + :type software_update_configuration_machine_run_id: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SoftwareUpdateConfigurationMachineRun or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.automation.models.SoftwareUpdateConfigurationMachineRun or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_by_id.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'softwareUpdateConfigurationMachineRunId': self._serialize.url("software_update_configuration_machine_run_id", software_update_configuration_machine_run_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 404]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SoftwareUpdateConfigurationMachineRun', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_by_id.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurationMachineRuns/{softwareUpdateConfigurationMachineRunId}'} + + def list( + self, resource_group_name, automation_account_name, client_request_id=None, filter=None, skip=None, top=None, custom_headers=None, raw=False, **operation_config): + """Return list of software update configuration machine runs. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :param filter: The filter to apply on the operation. You can use the + following filters: 'properties/osType', 'properties/status', + 'properties/startTime', and + 'properties/softwareUpdateConfiguration/name' + :type filter: str + :param skip: number of entries you skip before returning results + :type skip: str + :param top: Maximum number of entries returned in the results + collection + :type top: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SoftwareUpdateConfigurationMachineRunListResult or + ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.automation.models.SoftwareUpdateConfigurationMachineRunListResult + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 404]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SoftwareUpdateConfigurationMachineRunListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurationMachineRuns'} diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/software_update_configuration_runs_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/software_update_configuration_runs_operations.py new file mode 100644 index 000000000000..788b7d3af5d2 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/software_update_configuration_runs_operations.py @@ -0,0 +1,193 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class SoftwareUpdateConfigurationRunsOperations(object): + """SoftwareUpdateConfigurationRunsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2017-05-15-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-05-15-preview" + + self.config = config + + def get_by_id( + self, resource_group_name, automation_account_name, software_update_configuration_run_id, client_request_id=None, custom_headers=None, raw=False, **operation_config): + """Get a single software update configuration Run by Id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param software_update_configuration_run_id: The Id of the software + update configuration run. + :type software_update_configuration_run_id: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SoftwareUpdateConfigurationRun or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.automation.models.SoftwareUpdateConfigurationRun + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_by_id.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'softwareUpdateConfigurationRunId': self._serialize.url("software_update_configuration_run_id", software_update_configuration_run_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 404]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SoftwareUpdateConfigurationRun', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_by_id.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurationRuns/{softwareUpdateConfigurationRunId}'} + + def list( + self, resource_group_name, automation_account_name, client_request_id=None, filter=None, skip=None, top=None, custom_headers=None, raw=False, **operation_config): + """Return list of software update configuration runs. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :param filter: The filter to apply on the operation. You can use the + following filters: 'properties/osType', 'properties/status', + 'properties/startTime', and + 'properties/softwareUpdateConfiguration/name' + :type filter: str + :param skip: number of entries you skip before returning results + :type skip: str + :param top: Maximum number of entries returned in the results + collection + :type top: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SoftwareUpdateConfigurationRunListResult or ClientRawResponse + if raw=true + :rtype: + ~azure.mgmt.automation.models.SoftwareUpdateConfigurationRunListResult + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 404]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SoftwareUpdateConfigurationRunListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurationRuns'} diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/software_update_configurations_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/software_update_configurations_operations.py new file mode 100644 index 000000000000..ae0770932489 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/software_update_configurations_operations.py @@ -0,0 +1,322 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class SoftwareUpdateConfigurationsOperations(object): + """SoftwareUpdateConfigurationsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2017-05-15-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-05-15-preview" + + self.config = config + + def create( + self, resource_group_name, automation_account_name, software_update_configuration_name, parameters, client_request_id=None, custom_headers=None, raw=False, **operation_config): + """Create a new software update configuration with the name given in the + URI. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param software_update_configuration_name: The name of the software + update configuration to be created. + :type software_update_configuration_name: str + :param parameters: Request body. + :type parameters: + ~azure.mgmt.automation.models.SoftwareUpdateConfiguration + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SoftwareUpdateConfiguration or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.SoftwareUpdateConfiguration or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'softwareUpdateConfigurationName': self._serialize.url("software_update_configuration_name", software_update_configuration_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'SoftwareUpdateConfiguration') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201, 400, 404, 409]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SoftwareUpdateConfiguration', response) + if response.status_code == 201: + deserialized = self._deserialize('SoftwareUpdateConfiguration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurations/{softwareUpdateConfigurationName}'} + + def get_by_name( + self, resource_group_name, automation_account_name, software_update_configuration_name, client_request_id=None, custom_headers=None, raw=False, **operation_config): + """Get a single software update configuration by name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param software_update_configuration_name: The name of the software + update configuration to be created. + :type software_update_configuration_name: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SoftwareUpdateConfiguration or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.SoftwareUpdateConfiguration or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_by_name.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'softwareUpdateConfigurationName': self._serialize.url("software_update_configuration_name", software_update_configuration_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 404]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SoftwareUpdateConfiguration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_by_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurations/{softwareUpdateConfigurationName}'} + + def delete( + self, resource_group_name, automation_account_name, software_update_configuration_name, client_request_id=None, custom_headers=None, raw=False, **operation_config): + """delete a specific software update configuration. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param software_update_configuration_name: The name of the software + update configuration to be created. + :type software_update_configuration_name: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'softwareUpdateConfigurationName': self._serialize.url("software_update_configuration_name", software_update_configuration_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204, 404]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurations/{softwareUpdateConfigurationName}'} + + def list( + self, resource_group_name, automation_account_name, client_request_id=None, filter=None, custom_headers=None, raw=False, **operation_config): + """Get all software update configurations for the account. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :param filter: The filter to apply on the operation. + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SoftwareUpdateConfigurationListResult or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.automation.models.SoftwareUpdateConfigurationListResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 404]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SoftwareUpdateConfigurationListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurations'} diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/source_control_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/source_control_operations.py new file mode 100644 index 000000000000..d11a8b65f250 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/source_control_operations.py @@ -0,0 +1,377 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class SourceControlOperations(object): + """SourceControlOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2017-05-15-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-05-15-preview" + + self.config = config + + def create_or_update( + self, resource_group_name, automation_account_name, source_control_name, parameters, custom_headers=None, raw=False, **operation_config): + """Create a source control. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param source_control_name: The source control name. + :type source_control_name: str + :param parameters: The parameters supplied to the create or update + source control operation. + :type parameters: + ~azure.mgmt.automation.models.SourceControlCreateOrUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SourceControl or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.SourceControl or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'sourceControlName': self._serialize.url("source_control_name", source_control_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'SourceControlCreateOrUpdateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SourceControl', response) + if response.status_code == 201: + deserialized = self._deserialize('SourceControl', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}'} + + def update( + self, resource_group_name, automation_account_name, source_control_name, parameters, custom_headers=None, raw=False, **operation_config): + """Update a source control. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param source_control_name: The source control name. + :type source_control_name: str + :param parameters: The parameters supplied to the update source + control operation. + :type parameters: + ~azure.mgmt.automation.models.SourceControlUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SourceControl or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.SourceControl or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'sourceControlName': self._serialize.url("source_control_name", source_control_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'SourceControlUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SourceControl', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}'} + + def delete( + self, resource_group_name, automation_account_name, source_control_name, custom_headers=None, raw=False, **operation_config): + """Delete the source control. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param source_control_name: The name of source control. + :type source_control_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'sourceControlName': self._serialize.url("source_control_name", source_control_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}'} + + def get( + self, resource_group_name, automation_account_name, source_control_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the source control identified by source control name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param source_control_name: The name of source control. + :type source_control_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SourceControl or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.SourceControl or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'sourceControlName': self._serialize.url("source_control_name", source_control_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SourceControl', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}'} + + def list_by_automation_account( + self, resource_group_name, automation_account_name, filter=None, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of source controls. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of SourceControl + :rtype: + ~azure.mgmt.automation.models.SourceControlPaged[~azure.mgmt.automation.models.SourceControl] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.SourceControlPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.SourceControlPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls'} diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/source_control_sync_job_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/source_control_sync_job_operations.py new file mode 100644 index 000000000000..834a6a8aae1d --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/source_control_sync_job_operations.py @@ -0,0 +1,256 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class SourceControlSyncJobOperations(object): + """SourceControlSyncJobOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2017-05-15-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-05-15-preview" + + self.config = config + + def create( + self, resource_group_name, automation_account_name, source_control_name, source_control_sync_job_id, commit_id=None, custom_headers=None, raw=False, **operation_config): + """Creates the sync job for a source control. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param source_control_name: The source control name. + :type source_control_name: str + :param source_control_sync_job_id: The source control sync job id. + :type source_control_sync_job_id: str + :param commit_id: Sets the commit id of the source control sync job. + :type commit_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SourceControlSyncJob or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.SourceControlSyncJob or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.SourceControlSyncJobCreateParameters(commit_id=commit_id) + + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'sourceControlName': self._serialize.url("source_control_name", source_control_name, 'str'), + 'sourceControlSyncJobId': self._serialize.url("source_control_sync_job_id", source_control_sync_job_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'SourceControlSyncJobCreateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 201: + deserialized = self._deserialize('SourceControlSyncJob', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}/sourceControlSyncJobs/{sourceControlSyncJobId}'} + + def get( + self, resource_group_name, automation_account_name, source_control_name, source_control_sync_job_id, custom_headers=None, raw=False, **operation_config): + """Retrieve the source control sync job identified by job id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param source_control_name: The source control name. + :type source_control_name: str + :param source_control_sync_job_id: The source control sync job id. + :type source_control_sync_job_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SourceControlSyncJobById or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.SourceControlSyncJobById or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'sourceControlName': self._serialize.url("source_control_name", source_control_name, 'str'), + 'sourceControlSyncJobId': self._serialize.url("source_control_sync_job_id", source_control_sync_job_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SourceControlSyncJobById', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}/sourceControlSyncJobs/{sourceControlSyncJobId}'} + + def list_by_automation_account( + self, resource_group_name, automation_account_name, source_control_name, filter=None, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of source control sync jobs. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param source_control_name: The source control name. + :type source_control_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of SourceControlSyncJob + :rtype: + ~azure.mgmt.automation.models.SourceControlSyncJobPaged[~azure.mgmt.automation.models.SourceControlSyncJob] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'sourceControlName': self._serialize.url("source_control_name", source_control_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.SourceControlSyncJobPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.SourceControlSyncJobPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}/sourceControlSyncJobs'} diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/statistics_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/statistics_operations.py new file mode 100644 index 000000000000..987b078ada70 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/statistics_operations.py @@ -0,0 +1,111 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class StatisticsOperations(object): + """StatisticsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-10-31". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-10-31" + + self.config = config + + def list_by_automation_account( + self, resource_group_name, automation_account_name, filter=None, custom_headers=None, raw=False, **operation_config): + """Retrieve the statistics for the account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Statistics + :rtype: + ~azure.mgmt.automation.models.StatisticsPaged[~azure.mgmt.automation.models.Statistics] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.StatisticsPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.StatisticsPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/statistics'} diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/test_job_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/test_job_operations.py new file mode 100644 index 000000000000..2ab8929fc3da --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/test_job_operations.py @@ -0,0 +1,345 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class TestJobOperations(object): + """TestJobOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-10-31". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-10-31" + + self.config = config + + def create( + self, resource_group_name, automation_account_name, runbook_name, parameters=None, run_on=None, custom_headers=None, raw=False, **operation_config): + """Create a test job of the runbook. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param runbook_name: The parameters supplied to the create test job + operation. + :type runbook_name: str + :param parameters: Gets or sets the parameters of the test job. + :type parameters: dict[str, str] + :param run_on: Gets or sets the runOn which specifies the group name + where the job is to be executed. + :type run_on: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: TestJob or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.TestJob or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters1 = models.TestJobCreateParameters(parameters=parameters, run_on=run_on) + + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters1, 'TestJobCreateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 201: + deserialized = self._deserialize('TestJob', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob'} + + def get( + self, resource_group_name, automation_account_name, runbook_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the test job for the specified runbook. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: TestJob or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.TestJob or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('TestJob', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob'} + + def resume( + self, resource_group_name, automation_account_name, runbook_name, custom_headers=None, raw=False, **operation_config): + """Resume the test job. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.resume.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + resume.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob/resume'} + + def stop( + self, resource_group_name, automation_account_name, runbook_name, custom_headers=None, raw=False, **operation_config): + """Stop the test job. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.stop.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob/stop'} + + def suspend( + self, resource_group_name, automation_account_name, runbook_name, custom_headers=None, raw=False, **operation_config): + """Suspend the test job. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.suspend.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + suspend.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob/suspend'} diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/test_job_streams_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/test_job_streams_operations.py new file mode 100644 index 000000000000..6e6974b45989 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/test_job_streams_operations.py @@ -0,0 +1,182 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class TestJobStreamsOperations(object): + """TestJobStreamsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-10-31". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-10-31" + + self.config = config + + def get( + self, resource_group_name, automation_account_name, runbook_name, job_stream_id, custom_headers=None, raw=False, **operation_config): + """Retrieve a test job stream of the test job identified by runbook name + and stream id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :param job_stream_id: The job stream id. + :type job_stream_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: JobStream or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.JobStream or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str'), + 'jobStreamId': self._serialize.url("job_stream_id", job_stream_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('JobStream', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob/streams/{jobStreamId}'} + + def list_by_test_job( + self, resource_group_name, automation_account_name, runbook_name, filter=None, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of test job streams identified by runbook name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of JobStream + :rtype: + ~azure.mgmt.automation.models.JobStreamPaged[~azure.mgmt.automation.models.JobStream] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_test_job.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.JobStreamPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.JobStreamPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_test_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob/streams'} diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/usages_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/usages_operations.py new file mode 100644 index 000000000000..f34570cc7bd9 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/usages_operations.py @@ -0,0 +1,107 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class UsagesOperations(object): + """UsagesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-10-31". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-10-31" + + self.config = config + + def list_by_automation_account( + self, resource_group_name, automation_account_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the usage for the account id. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Usage + :rtype: + ~azure.mgmt.automation.models.UsagePaged[~azure.mgmt.automation.models.Usage] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.UsagePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.UsagePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/usages'} diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/variable_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/variable_operations.py new file mode 100644 index 000000000000..21775f64800c --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/variable_operations.py @@ -0,0 +1,373 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class VariableOperations(object): + """VariableOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-10-31". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-10-31" + + self.config = config + + def create_or_update( + self, resource_group_name, automation_account_name, variable_name, parameters, custom_headers=None, raw=False, **operation_config): + """Create a variable. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param variable_name: The variable name. + :type variable_name: str + :param parameters: The parameters supplied to the create or update + variable operation. + :type parameters: + ~azure.mgmt.automation.models.VariableCreateOrUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Variable or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Variable or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'variableName': self._serialize.url("variable_name", variable_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'VariableCreateOrUpdateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Variable', response) + if response.status_code == 201: + deserialized = self._deserialize('Variable', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables/{variableName}'} + + def update( + self, resource_group_name, automation_account_name, variable_name, parameters, custom_headers=None, raw=False, **operation_config): + """Update a variable. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param variable_name: The variable name. + :type variable_name: str + :param parameters: The parameters supplied to the update variable + operation. + :type parameters: + ~azure.mgmt.automation.models.VariableUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Variable or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Variable or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'variableName': self._serialize.url("variable_name", variable_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'VariableUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Variable', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables/{variableName}'} + + def delete( + self, resource_group_name, automation_account_name, variable_name, custom_headers=None, raw=False, **operation_config): + """Delete the variable. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param variable_name: The name of variable. + :type variable_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'variableName': self._serialize.url("variable_name", variable_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables/{variableName}'} + + def get( + self, resource_group_name, automation_account_name, variable_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the variable identified by variable name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param variable_name: The name of variable. + :type variable_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Variable or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Variable or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'variableName': self._serialize.url("variable_name", variable_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Variable', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables/{variableName}'} + + def list_by_automation_account( + self, resource_group_name, automation_account_name, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of variables. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Variable + :rtype: + ~azure.mgmt.automation.models.VariablePaged[~azure.mgmt.automation.models.Variable] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.VariablePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.VariablePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables'} diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/webhook_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/webhook_operations.py new file mode 100644 index 000000000000..244e11319a91 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/webhook_operations.py @@ -0,0 +1,435 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class WebhookOperations(object): + """WebhookOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-10-31". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-10-31" + + self.config = config + + def generate_uri( + self, resource_group_name, automation_account_name, custom_headers=None, raw=False, **operation_config): + """Generates a Uri for use in creating a webhook. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.generate_uri.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('str', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + generate_uri.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/generateUri'} + + def delete( + self, resource_group_name, automation_account_name, webhook_name, custom_headers=None, raw=False, **operation_config): + """Delete the webhook by name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param webhook_name: The webhook name. + :type webhook_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'webhookName': self._serialize.url("webhook_name", webhook_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/{webhookName}'} + + def get( + self, resource_group_name, automation_account_name, webhook_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the webhook identified by webhook name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param webhook_name: The webhook name. + :type webhook_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Webhook or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Webhook or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'webhookName': self._serialize.url("webhook_name", webhook_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Webhook', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/{webhookName}'} + + def create_or_update( + self, resource_group_name, automation_account_name, webhook_name, parameters, custom_headers=None, raw=False, **operation_config): + """Create the webhook identified by webhook name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param webhook_name: The webhook name. + :type webhook_name: str + :param parameters: The create or update parameters for webhook. + :type parameters: + ~azure.mgmt.automation.models.WebhookCreateOrUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Webhook or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Webhook or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'webhookName': self._serialize.url("webhook_name", webhook_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'WebhookCreateOrUpdateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Webhook', response) + if response.status_code == 201: + deserialized = self._deserialize('Webhook', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/{webhookName}'} + + def update( + self, resource_group_name, automation_account_name, webhook_name, parameters, custom_headers=None, raw=False, **operation_config): + """Update the webhook identified by webhook name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param webhook_name: The webhook name. + :type webhook_name: str + :param parameters: The update parameters for webhook. + :type parameters: + ~azure.mgmt.automation.models.WebhookUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Webhook or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Webhook or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'webhookName': self._serialize.url("webhook_name", webhook_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'WebhookUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Webhook', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/{webhookName}'} + + def list_by_automation_account( + self, resource_group_name, automation_account_name, filter=None, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of webhooks. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Webhook + :rtype: + ~azure.mgmt.automation.models.WebhookPaged[~azure.mgmt.automation.models.Webhook] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.WebhookPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.WebhookPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks'} diff --git a/azure-mgmt-automation/azure/mgmt/automation/version.py b/azure-mgmt-automation/azure/mgmt/automation/version.py new file mode 100644 index 000000000000..9bd1dfac7ecb --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/version.py @@ -0,0 +1,13 @@ +# 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. +# -------------------------------------------------------------------------- + +VERSION = "0.2.0" + diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/network_management_client.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/network_management_client.py index 83d61852c713..67ebc03a056b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/network_management_client.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/network_management_client.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import ServiceClient +from msrest.service_client import SDKClient from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION @@ -73,7 +73,7 @@ def __init__( self.subscription_id = subscription_id -class NetworkManagementClient(object): +class NetworkManagementClient(SDKClient): """Network Client :ivar config: Configuration for client. @@ -130,7 +130,7 @@ def __init__( self, credentials, subscription_id, base_url=None): self.config = NetworkManagementClientConfiguration(credentials, subscription_id, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + super(NetworkManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self.api_version = '2015-06-15' diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/network_management_client.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/network_management_client.py index 42cc01c5a2db..7100a271308e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/network_management_client.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/network_management_client.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import ServiceClient +from msrest.service_client import SDKClient from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION @@ -76,7 +76,7 @@ def __init__( self.subscription_id = subscription_id -class NetworkManagementClient(object): +class NetworkManagementClient(SDKClient): """Network Client :ivar config: Configuration for client. @@ -139,7 +139,7 @@ def __init__( self, credentials, subscription_id, base_url=None): self.config = NetworkManagementClientConfiguration(credentials, subscription_id, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + super(NetworkManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self.api_version = '2016-09-01' diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/network_management_client.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/network_management_client.py index e3add9ad6aaf..2e6c8cbfcd31 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/network_management_client.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/network_management_client.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import ServiceClient +from msrest.service_client import SDKClient from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION @@ -79,7 +79,7 @@ def __init__( self.subscription_id = subscription_id -class NetworkManagementClient(object): +class NetworkManagementClient(SDKClient): """Network Client :ivar config: Configuration for client. @@ -148,7 +148,7 @@ def __init__( self, credentials, subscription_id, base_url=None): self.config = NetworkManagementClientConfiguration(credentials, subscription_id, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + super(NetworkManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self.api_version = '2016-12-01' diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/network_management_client.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/network_management_client.py index 9b7710270611..2038ad13a152 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/network_management_client.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/network_management_client.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import ServiceClient +from msrest.service_client import SDKClient from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION @@ -79,7 +79,7 @@ def __init__( self.subscription_id = subscription_id -class NetworkManagementClient(object): +class NetworkManagementClient(SDKClient): """Network Client :ivar config: Configuration for client. @@ -148,7 +148,7 @@ def __init__( self, credentials, subscription_id, base_url=None): self.config = NetworkManagementClientConfiguration(credentials, subscription_id, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + super(NetworkManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/network_management_client.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/network_management_client.py index e22c7eac3c70..75784b8b0a08 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/network_management_client.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/network_management_client.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import ServiceClient +from msrest.service_client import SDKClient from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION @@ -89,7 +89,7 @@ def __init__( self.subscription_id = subscription_id -class NetworkManagementClient(object): +class NetworkManagementClient(SDKClient): """Network Client :ivar config: Configuration for client. @@ -178,7 +178,7 @@ def __init__( self, credentials, subscription_id, base_url=None): self.config = NetworkManagementClientConfiguration(credentials, subscription_id, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + super(NetworkManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/network_management_client.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/network_management_client.py index a80115b17ca8..0928a3bcc00c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/network_management_client.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/network_management_client.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import ServiceClient +from msrest.service_client import SDKClient from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION @@ -89,7 +89,7 @@ def __init__( self.subscription_id = subscription_id -class NetworkManagementClient(object): +class NetworkManagementClient(SDKClient): """Network Client :ivar config: Configuration for client. @@ -178,7 +178,7 @@ def __init__( self, credentials, subscription_id, base_url=None): self.config = NetworkManagementClientConfiguration(credentials, subscription_id, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + super(NetworkManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/network_management_client.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/network_management_client.py index a26ee74b754a..a6660a669738 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/network_management_client.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/network_management_client.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import ServiceClient +from msrest.service_client import SDKClient from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION @@ -91,7 +91,7 @@ def __init__( self.subscription_id = subscription_id -class NetworkManagementClient(object): +class NetworkManagementClient(SDKClient): """Network Client :ivar config: Configuration for client. @@ -184,7 +184,7 @@ def __init__( self, credentials, subscription_id, base_url=None): self.config = NetworkManagementClientConfiguration(credentials, subscription_id, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + super(NetworkManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/network_management_client.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/network_management_client.py index 8b37e2000264..a8705d53fdbc 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/network_management_client.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/network_management_client.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import ServiceClient +from msrest.service_client import SDKClient from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION @@ -92,7 +92,7 @@ def __init__( self.subscription_id = subscription_id -class NetworkManagementClient(object): +class NetworkManagementClient(SDKClient): """Network Client :ivar config: Configuration for client. @@ -187,7 +187,7 @@ def __init__( self, credentials, subscription_id, base_url=None): self.config = NetworkManagementClientConfiguration(credentials, subscription_id, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + super(NetworkManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/network_management_client.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/network_management_client.py index 35b21d404d8e..a35d83f8360a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/network_management_client.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/network_management_client.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import ServiceClient +from msrest.service_client import SDKClient from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION @@ -92,7 +92,7 @@ def __init__( self.subscription_id = subscription_id -class NetworkManagementClient(object): +class NetworkManagementClient(SDKClient): """Network Client :ivar config: Configuration for client. @@ -187,7 +187,7 @@ def __init__( self, credentials, subscription_id, base_url=None): self.config = NetworkManagementClientConfiguration(credentials, subscription_id, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + super(NetworkManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/network_management_client.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/network_management_client.py index 398496371570..33c858d31bb0 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/network_management_client.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/network_management_client.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import ServiceClient +from msrest.service_client import SDKClient from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION @@ -92,7 +92,7 @@ def __init__( self.subscription_id = subscription_id -class NetworkManagementClient(object): +class NetworkManagementClient(SDKClient): """Network Client :ivar config: Configuration for client. @@ -187,7 +187,7 @@ def __init__( self, credentials, subscription_id, base_url=None): self.config = NetworkManagementClientConfiguration(credentials, subscription_id, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + super(NetworkManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_02_01/models/express_route_cross_connection.py b/azure-mgmt-network/azure/mgmt/network/v2018_02_01/models/express_route_cross_connection.py index c638f55f4eb9..08edcdf5afea 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_02_01/models/express_route_cross_connection.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_02_01/models/express_route_cross_connection.py @@ -34,12 +34,12 @@ class ExpressRouteCrossConnection(Resource): :vartype secondary_azure_port: str :ivar s_tag: The identifier of the circuit traffic. :vartype s_tag: int - :ivar peering_location: The peering location of the ExpressRoute circuit. - :vartype peering_location: str - :ivar bandwidth_in_mbps: The circuit bandwidth In Mbps. - :vartype bandwidth_in_mbps: int - :ivar express_route_circuit: The ExpressRouteCircuit - :vartype express_route_circuit: + :param peering_location: The peering location of the ExpressRoute circuit. + :type peering_location: str + :param bandwidth_in_mbps: The circuit bandwidth In Mbps. + :type bandwidth_in_mbps: int + :param express_route_circuit: The ExpressRouteCircuit + :type express_route_circuit: ~azure.mgmt.network.v2018_02_01.models.ExpressRouteCircuitReference :param service_provider_provisioning_state: The provisioning state of the circuit in the connectivity provider system. Possible values are @@ -67,9 +67,6 @@ class ExpressRouteCrossConnection(Resource): 'primary_azure_port': {'readonly': True}, 'secondary_azure_port': {'readonly': True}, 's_tag': {'readonly': True}, - 'peering_location': {'readonly': True}, - 'bandwidth_in_mbps': {'readonly': True}, - 'express_route_circuit': {'readonly': True}, 'provisioning_state': {'readonly': True}, 'etag': {'readonly': True}, } @@ -98,9 +95,9 @@ def __init__(self, **kwargs): self.primary_azure_port = None self.secondary_azure_port = None self.s_tag = None - self.peering_location = None - self.bandwidth_in_mbps = None - self.express_route_circuit = None + self.peering_location = kwargs.get('peering_location', None) + self.bandwidth_in_mbps = kwargs.get('bandwidth_in_mbps', None) + self.express_route_circuit = kwargs.get('express_route_circuit', None) self.service_provider_provisioning_state = kwargs.get('service_provider_provisioning_state', None) self.service_provider_notes = kwargs.get('service_provider_notes', None) self.provisioning_state = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_02_01/models/express_route_cross_connection_peering.py b/azure-mgmt-network/azure/mgmt/network/v2018_02_01/models/express_route_cross_connection_peering.py index fc40e491ec08..4154d2207fa3 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_02_01/models/express_route_cross_connection_peering.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_02_01/models/express_route_cross_connection_peering.py @@ -50,8 +50,8 @@ class ExpressRouteCrossConnectionPeering(SubResource): :ivar provisioning_state: Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. :vartype provisioning_state: str - :ivar gateway_manager_etag: The GatewayManager Etag. - :vartype gateway_manager_etag: str + :param gateway_manager_etag: The GatewayManager Etag. + :type gateway_manager_etag: str :param last_modified_by: Gets whether the provider or the customer last modified the peering. :type last_modified_by: str @@ -72,7 +72,6 @@ class ExpressRouteCrossConnectionPeering(SubResource): 'primary_azure_port': {'readonly': True}, 'secondary_azure_port': {'readonly': True}, 'provisioning_state': {'readonly': True}, - 'gateway_manager_etag': {'readonly': True}, 'etag': {'readonly': True}, } @@ -111,7 +110,7 @@ def __init__(self, **kwargs): self.vlan_id = kwargs.get('vlan_id', None) self.microsoft_peering_config = kwargs.get('microsoft_peering_config', None) self.provisioning_state = None - self.gateway_manager_etag = None + self.gateway_manager_etag = kwargs.get('gateway_manager_etag', None) self.last_modified_by = kwargs.get('last_modified_by', None) self.ipv6_peering_config = kwargs.get('ipv6_peering_config', None) self.name = kwargs.get('name', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_02_01/models/express_route_cross_connection_peering_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_02_01/models/express_route_cross_connection_peering_py3.py index 0b5a24b10771..eb8e9a2a650c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_02_01/models/express_route_cross_connection_peering_py3.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_02_01/models/express_route_cross_connection_peering_py3.py @@ -50,8 +50,8 @@ class ExpressRouteCrossConnectionPeering(SubResource): :ivar provisioning_state: Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. :vartype provisioning_state: str - :ivar gateway_manager_etag: The GatewayManager Etag. - :vartype gateway_manager_etag: str + :param gateway_manager_etag: The GatewayManager Etag. + :type gateway_manager_etag: str :param last_modified_by: Gets whether the provider or the customer last modified the peering. :type last_modified_by: str @@ -72,7 +72,6 @@ class ExpressRouteCrossConnectionPeering(SubResource): 'primary_azure_port': {'readonly': True}, 'secondary_azure_port': {'readonly': True}, 'provisioning_state': {'readonly': True}, - 'gateway_manager_etag': {'readonly': True}, 'etag': {'readonly': True}, } @@ -97,7 +96,7 @@ class ExpressRouteCrossConnectionPeering(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, *, id: str=None, peering_type=None, state=None, peer_asn: int=None, primary_peer_address_prefix: str=None, secondary_peer_address_prefix: str=None, shared_key: str=None, vlan_id: int=None, microsoft_peering_config=None, last_modified_by: str=None, ipv6_peering_config=None, name: str=None, **kwargs) -> None: + def __init__(self, *, id: str=None, peering_type=None, state=None, peer_asn: int=None, primary_peer_address_prefix: str=None, secondary_peer_address_prefix: str=None, shared_key: str=None, vlan_id: int=None, microsoft_peering_config=None, gateway_manager_etag: str=None, last_modified_by: str=None, ipv6_peering_config=None, name: str=None, **kwargs) -> None: super(ExpressRouteCrossConnectionPeering, self).__init__(id=id, **kwargs) self.peering_type = peering_type self.state = state @@ -111,7 +110,7 @@ def __init__(self, *, id: str=None, peering_type=None, state=None, peer_asn: int self.vlan_id = vlan_id self.microsoft_peering_config = microsoft_peering_config self.provisioning_state = None - self.gateway_manager_etag = None + self.gateway_manager_etag = gateway_manager_etag self.last_modified_by = last_modified_by self.ipv6_peering_config = ipv6_peering_config self.name = name diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_02_01/models/express_route_cross_connection_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_02_01/models/express_route_cross_connection_py3.py index 32faab74803c..db594ff9c0d3 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_02_01/models/express_route_cross_connection_py3.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_02_01/models/express_route_cross_connection_py3.py @@ -34,12 +34,12 @@ class ExpressRouteCrossConnection(Resource): :vartype secondary_azure_port: str :ivar s_tag: The identifier of the circuit traffic. :vartype s_tag: int - :ivar peering_location: The peering location of the ExpressRoute circuit. - :vartype peering_location: str - :ivar bandwidth_in_mbps: The circuit bandwidth In Mbps. - :vartype bandwidth_in_mbps: int - :ivar express_route_circuit: The ExpressRouteCircuit - :vartype express_route_circuit: + :param peering_location: The peering location of the ExpressRoute circuit. + :type peering_location: str + :param bandwidth_in_mbps: The circuit bandwidth In Mbps. + :type bandwidth_in_mbps: int + :param express_route_circuit: The ExpressRouteCircuit + :type express_route_circuit: ~azure.mgmt.network.v2018_02_01.models.ExpressRouteCircuitReference :param service_provider_provisioning_state: The provisioning state of the circuit in the connectivity provider system. Possible values are @@ -67,9 +67,6 @@ class ExpressRouteCrossConnection(Resource): 'primary_azure_port': {'readonly': True}, 'secondary_azure_port': {'readonly': True}, 's_tag': {'readonly': True}, - 'peering_location': {'readonly': True}, - 'bandwidth_in_mbps': {'readonly': True}, - 'express_route_circuit': {'readonly': True}, 'provisioning_state': {'readonly': True}, 'etag': {'readonly': True}, } @@ -93,14 +90,14 @@ class ExpressRouteCrossConnection(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, *, id: str=None, location: str=None, tags=None, service_provider_provisioning_state=None, service_provider_notes: str=None, peerings=None, **kwargs) -> None: + def __init__(self, *, id: str=None, location: str=None, tags=None, peering_location: str=None, bandwidth_in_mbps: int=None, express_route_circuit=None, service_provider_provisioning_state=None, service_provider_notes: str=None, peerings=None, **kwargs) -> None: super(ExpressRouteCrossConnection, self).__init__(id=id, location=location, tags=tags, **kwargs) self.primary_azure_port = None self.secondary_azure_port = None self.s_tag = None - self.peering_location = None - self.bandwidth_in_mbps = None - self.express_route_circuit = None + self.peering_location = peering_location + self.bandwidth_in_mbps = bandwidth_in_mbps + self.express_route_circuit = express_route_circuit self.service_provider_provisioning_state = service_provider_provisioning_state self.service_provider_notes = service_provider_notes self.provisioning_state = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_02_01/network_management_client.py b/azure-mgmt-network/azure/mgmt/network/v2018_02_01/network_management_client.py index 2981aba6da52..7dcc83da9494 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_02_01/network_management_client.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_02_01/network_management_client.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import ServiceClient +from msrest.service_client import SDKClient from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION @@ -96,7 +96,7 @@ def __init__( self.subscription_id = subscription_id -class NetworkManagementClient(object): +class NetworkManagementClient(SDKClient): """Network Client :ivar config: Configuration for client. @@ -199,7 +199,7 @@ def __init__( self, credentials, subscription_id, base_url=None): self.config = NetworkManagementClientConfiguration(credentials, subscription_id, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + super(NetworkManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/__init__.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/__init__.py index b769252f8a14..28d9624d67c0 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/__init__.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/__init__.py @@ -9,40 +9,75 @@ # regenerated. # -------------------------------------------------------------------------- -from .tracked_resource import TrackedResource -from .resource import Resource -from .resource_namespace_patch import ResourceNamespacePatch -from .sb_sku import SBSku -from .sb_namespace import SBNamespace -from .sb_namespace_update_parameters import SBNamespaceUpdateParameters -from .sb_authorization_rule import SBAuthorizationRule -from .authorization_rule_properties import AuthorizationRuleProperties -from .access_keys import AccessKeys -from .regenerate_access_key_parameters import RegenerateAccessKeyParameters -from .message_count_details import MessageCountDetails -from .sb_queue import SBQueue -from .sb_topic import SBTopic -from .sb_subscription import SBSubscription -from .check_name_availability import CheckNameAvailability -from .check_name_availability_result import CheckNameAvailabilityResult -from .operation_display import OperationDisplay -from .operation import Operation -from .error_response import ErrorResponse, ErrorResponseException -from .action import Action -from .sql_filter import SqlFilter -from .correlation_filter import CorrelationFilter -from .rule import Rule -from .sql_rule_action import SqlRuleAction -from .premium_messaging_regions_properties import PremiumMessagingRegionsProperties -from .premium_messaging_regions import PremiumMessagingRegions -from .destination import Destination -from .capture_description import CaptureDescription -from .eventhub import Eventhub -from .arm_disaster_recovery import ArmDisasterRecovery +try: + from .tracked_resource_py3 import TrackedResource + from .resource_py3 import Resource + from .resource_namespace_patch_py3 import ResourceNamespacePatch + from .sb_sku_py3 import SBSku + from .sb_namespace_py3 import SBNamespace + from .sb_namespace_update_parameters_py3 import SBNamespaceUpdateParameters + from .sb_authorization_rule_py3 import SBAuthorizationRule + from .authorization_rule_properties_py3 import AuthorizationRuleProperties + from .access_keys_py3 import AccessKeys + from .regenerate_access_key_parameters_py3 import RegenerateAccessKeyParameters + from .message_count_details_py3 import MessageCountDetails + from .sb_queue_py3 import SBQueue + from .sb_topic_py3 import SBTopic + from .sb_subscription_py3 import SBSubscription + from .check_name_availability_py3 import CheckNameAvailability + from .check_name_availability_result_py3 import CheckNameAvailabilityResult + from .operation_display_py3 import OperationDisplay + from .operation_py3 import Operation + from .error_response_py3 import ErrorResponse, ErrorResponseException + from .action_py3 import Action + from .sql_filter_py3 import SqlFilter + from .correlation_filter_py3 import CorrelationFilter + from .rule_py3 import Rule + from .sql_rule_action_py3 import SqlRuleAction + from .premium_messaging_regions_properties_py3 import PremiumMessagingRegionsProperties + from .premium_messaging_regions_py3 import PremiumMessagingRegions + from .destination_py3 import Destination + from .capture_description_py3 import CaptureDescription + from .eventhub_py3 import Eventhub + from .arm_disaster_recovery_py3 import ArmDisasterRecovery + from .migration_config_properties_py3 import MigrationConfigProperties +except (SyntaxError, ImportError): + from .tracked_resource import TrackedResource + from .resource import Resource + from .resource_namespace_patch import ResourceNamespacePatch + from .sb_sku import SBSku + from .sb_namespace import SBNamespace + from .sb_namespace_update_parameters import SBNamespaceUpdateParameters + from .sb_authorization_rule import SBAuthorizationRule + from .authorization_rule_properties import AuthorizationRuleProperties + from .access_keys import AccessKeys + from .regenerate_access_key_parameters import RegenerateAccessKeyParameters + from .message_count_details import MessageCountDetails + from .sb_queue import SBQueue + from .sb_topic import SBTopic + from .sb_subscription import SBSubscription + from .check_name_availability import CheckNameAvailability + from .check_name_availability_result import CheckNameAvailabilityResult + from .operation_display import OperationDisplay + from .operation import Operation + from .error_response import ErrorResponse, ErrorResponseException + from .action import Action + from .sql_filter import SqlFilter + from .correlation_filter import CorrelationFilter + from .rule import Rule + from .sql_rule_action import SqlRuleAction + from .premium_messaging_regions_properties import PremiumMessagingRegionsProperties + from .premium_messaging_regions import PremiumMessagingRegions + from .destination import Destination + from .capture_description import CaptureDescription + from .eventhub import Eventhub + from .arm_disaster_recovery import ArmDisasterRecovery + from .migration_config_properties import MigrationConfigProperties from .operation_paged import OperationPaged from .sb_namespace_paged import SBNamespacePaged from .sb_authorization_rule_paged import SBAuthorizationRulePaged from .arm_disaster_recovery_paged import ArmDisasterRecoveryPaged +from .migration_config_properties_paged import MigrationConfigPropertiesPaged from .sb_queue_paged import SBQueuePaged from .sb_topic_paged import SBTopicPaged from .sb_subscription_paged import SBSubscriptionPaged @@ -93,10 +128,12 @@ 'CaptureDescription', 'Eventhub', 'ArmDisasterRecovery', + 'MigrationConfigProperties', 'OperationPaged', 'SBNamespacePaged', 'SBAuthorizationRulePaged', 'ArmDisasterRecoveryPaged', + 'MigrationConfigPropertiesPaged', 'SBQueuePaged', 'SBTopicPaged', 'SBSubscriptionPaged', diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/access_keys.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/access_keys.py index 4d2c757edf7c..4995a92fa359 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/access_keys.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/access_keys.py @@ -60,8 +60,8 @@ class AccessKeys(Model): 'key_name': {'key': 'keyName', 'type': 'str'}, } - def __init__(self): - super(AccessKeys, self).__init__() + def __init__(self, **kwargs): + super(AccessKeys, self).__init__(**kwargs) self.primary_connection_string = None self.secondary_connection_string = None self.alias_primary_connection_string = None diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/access_keys_py3.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/access_keys_py3.py new file mode 100644 index 000000000000..c21004e78f4b --- /dev/null +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/access_keys_py3.py @@ -0,0 +1,71 @@ +# 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 msrest.serialization import Model + + +class AccessKeys(Model): + """Namespace/ServiceBus Connection String. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar primary_connection_string: Primary connection string of the created + namespace authorization rule. + :vartype primary_connection_string: str + :ivar secondary_connection_string: Secondary connection string of the + created namespace authorization rule. + :vartype secondary_connection_string: str + :ivar alias_primary_connection_string: Primary connection string of the + alias if GEO DR is enabled + :vartype alias_primary_connection_string: str + :ivar alias_secondary_connection_string: Secondary connection string of + the alias if GEO DR is enabled + :vartype alias_secondary_connection_string: str + :ivar primary_key: A base64-encoded 256-bit primary key for signing and + validating the SAS token. + :vartype primary_key: str + :ivar secondary_key: A base64-encoded 256-bit primary key for signing and + validating the SAS token. + :vartype secondary_key: str + :ivar key_name: A string that describes the authorization rule. + :vartype key_name: str + """ + + _validation = { + 'primary_connection_string': {'readonly': True}, + 'secondary_connection_string': {'readonly': True}, + 'alias_primary_connection_string': {'readonly': True}, + 'alias_secondary_connection_string': {'readonly': True}, + 'primary_key': {'readonly': True}, + 'secondary_key': {'readonly': True}, + 'key_name': {'readonly': True}, + } + + _attribute_map = { + 'primary_connection_string': {'key': 'primaryConnectionString', 'type': 'str'}, + 'secondary_connection_string': {'key': 'secondaryConnectionString', 'type': 'str'}, + 'alias_primary_connection_string': {'key': 'aliasPrimaryConnectionString', 'type': 'str'}, + 'alias_secondary_connection_string': {'key': 'aliasSecondaryConnectionString', 'type': 'str'}, + 'primary_key': {'key': 'primaryKey', 'type': 'str'}, + 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(AccessKeys, self).__init__(**kwargs) + self.primary_connection_string = None + self.secondary_connection_string = None + self.alias_primary_connection_string = None + self.alias_secondary_connection_string = None + self.primary_key = None + self.secondary_key = None + self.key_name = None diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/action.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/action.py index 7501dcc84ff3..8aa038c7cddb 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/action.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/action.py @@ -32,8 +32,8 @@ class Action(Model): 'requires_preprocessing': {'key': 'requiresPreprocessing', 'type': 'bool'}, } - def __init__(self, sql_expression=None, compatibility_level=None, requires_preprocessing=True): - super(Action, self).__init__() - self.sql_expression = sql_expression - self.compatibility_level = compatibility_level - self.requires_preprocessing = requires_preprocessing + def __init__(self, **kwargs): + super(Action, self).__init__(**kwargs) + self.sql_expression = kwargs.get('sql_expression', None) + self.compatibility_level = kwargs.get('compatibility_level', None) + self.requires_preprocessing = kwargs.get('requires_preprocessing', True) diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/action_py3.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/action_py3.py new file mode 100644 index 000000000000..f1dfd16c6a44 --- /dev/null +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/action_py3.py @@ -0,0 +1,39 @@ +# 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 msrest.serialization import Model + + +class Action(Model): + """Represents the filter actions which are allowed for the transformation of a + message that have been matched by a filter expression. + + :param sql_expression: SQL expression. e.g. MyProperty='ABC' + :type sql_expression: str + :param compatibility_level: This property is reserved for future use. An + integer value showing the compatibility level, currently hard-coded to 20. + :type compatibility_level: int + :param requires_preprocessing: Value that indicates whether the rule + action requires preprocessing. Default value: True . + :type requires_preprocessing: bool + """ + + _attribute_map = { + 'sql_expression': {'key': 'sqlExpression', 'type': 'str'}, + 'compatibility_level': {'key': 'compatibilityLevel', 'type': 'int'}, + 'requires_preprocessing': {'key': 'requiresPreprocessing', 'type': 'bool'}, + } + + def __init__(self, *, sql_expression: str=None, compatibility_level: int=None, requires_preprocessing: bool=True, **kwargs) -> None: + super(Action, self).__init__(**kwargs) + self.sql_expression = sql_expression + self.compatibility_level = compatibility_level + self.requires_preprocessing = requires_preprocessing diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/arm_disaster_recovery.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/arm_disaster_recovery.py index 9e722e9b3754..6fe549cab86e 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/arm_disaster_recovery.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/arm_disaster_recovery.py @@ -60,9 +60,9 @@ class ArmDisasterRecovery(Resource): 'role': {'key': 'properties.role', 'type': 'RoleDisasterRecovery'}, } - def __init__(self, partner_namespace=None, alternate_name=None): - super(ArmDisasterRecovery, self).__init__() + def __init__(self, **kwargs): + super(ArmDisasterRecovery, self).__init__(**kwargs) self.provisioning_state = None - self.partner_namespace = partner_namespace - self.alternate_name = alternate_name + self.partner_namespace = kwargs.get('partner_namespace', None) + self.alternate_name = kwargs.get('alternate_name', None) self.role = None diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/arm_disaster_recovery_py3.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/arm_disaster_recovery_py3.py new file mode 100644 index 000000000000..da8dd42bd676 --- /dev/null +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/arm_disaster_recovery_py3.py @@ -0,0 +1,68 @@ +# 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 .resource import Resource + + +class ArmDisasterRecovery(Resource): + """Single item in List or Get Alias(Disaster Recovery configuration) + operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :ivar provisioning_state: Provisioning state of the Alias(Disaster + Recovery configuration) - possible values 'Accepted' or 'Succeeded' or + 'Failed'. Possible values include: 'Accepted', 'Succeeded', 'Failed' + :vartype provisioning_state: str or + ~azure.mgmt.servicebus.models.ProvisioningStateDR + :param partner_namespace: ARM Id of the Primary/Secondary eventhub + namespace name, which is part of GEO DR pairning + :type partner_namespace: str + :param alternate_name: Primary/Secondary eventhub namespace name, which is + part of GEO DR pairning + :type alternate_name: str + :ivar role: role of namespace in GEO DR - possible values 'Primary' or + 'PrimaryNotReplicating' or 'Secondary'. Possible values include: + 'Primary', 'PrimaryNotReplicating', 'Secondary' + :vartype role: str or ~azure.mgmt.servicebus.models.RoleDisasterRecovery + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'role': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningStateDR'}, + 'partner_namespace': {'key': 'properties.partnerNamespace', 'type': 'str'}, + 'alternate_name': {'key': 'properties.alternateName', 'type': 'str'}, + 'role': {'key': 'properties.role', 'type': 'RoleDisasterRecovery'}, + } + + def __init__(self, *, partner_namespace: str=None, alternate_name: str=None, **kwargs) -> None: + super(ArmDisasterRecovery, self).__init__(**kwargs) + self.provisioning_state = None + self.partner_namespace = partner_namespace + self.alternate_name = alternate_name + self.role = None diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/authorization_rule_properties.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/authorization_rule_properties.py index d52106c600be..5d48e82cf3a3 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/authorization_rule_properties.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/authorization_rule_properties.py @@ -15,7 +15,9 @@ class AuthorizationRuleProperties(Model): """AuthorizationRule properties. - :param rights: The rights associated with the rule. + All required parameters must be populated in order to send to Azure. + + :param rights: Required. The rights associated with the rule. :type rights: list[str or ~azure.mgmt.servicebus.models.AccessRights] """ @@ -27,6 +29,6 @@ class AuthorizationRuleProperties(Model): 'rights': {'key': 'rights', 'type': '[AccessRights]'}, } - def __init__(self, rights): - super(AuthorizationRuleProperties, self).__init__() - self.rights = rights + def __init__(self, **kwargs): + super(AuthorizationRuleProperties, self).__init__(**kwargs) + self.rights = kwargs.get('rights', None) diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/authorization_rule_properties_py3.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/authorization_rule_properties_py3.py new file mode 100644 index 000000000000..810b59a3a42b --- /dev/null +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/authorization_rule_properties_py3.py @@ -0,0 +1,34 @@ +# 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 msrest.serialization import Model + + +class AuthorizationRuleProperties(Model): + """AuthorizationRule properties. + + All required parameters must be populated in order to send to Azure. + + :param rights: Required. The rights associated with the rule. + :type rights: list[str or ~azure.mgmt.servicebus.models.AccessRights] + """ + + _validation = { + 'rights': {'required': True}, + } + + _attribute_map = { + 'rights': {'key': 'rights', 'type': '[AccessRights]'}, + } + + def __init__(self, *, rights, **kwargs) -> None: + super(AuthorizationRuleProperties, self).__init__(**kwargs) + self.rights = rights diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/capture_description.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/capture_description.py index db8c8e2aca75..ac65ccb3f40f 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/capture_description.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/capture_description.py @@ -48,10 +48,10 @@ class CaptureDescription(Model): 'destination': {'key': 'destination', 'type': 'Destination'}, } - def __init__(self, enabled=None, encoding=None, interval_in_seconds=None, size_limit_in_bytes=None, destination=None): - super(CaptureDescription, self).__init__() - self.enabled = enabled - self.encoding = encoding - self.interval_in_seconds = interval_in_seconds - self.size_limit_in_bytes = size_limit_in_bytes - self.destination = destination + def __init__(self, **kwargs): + super(CaptureDescription, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.encoding = kwargs.get('encoding', None) + self.interval_in_seconds = kwargs.get('interval_in_seconds', None) + self.size_limit_in_bytes = kwargs.get('size_limit_in_bytes', None) + self.destination = kwargs.get('destination', None) diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/capture_description_py3.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/capture_description_py3.py new file mode 100644 index 000000000000..f34f6be7252c --- /dev/null +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/capture_description_py3.py @@ -0,0 +1,57 @@ +# 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 msrest.serialization import Model + + +class CaptureDescription(Model): + """Properties to configure capture description for eventhub. + + :param enabled: A value that indicates whether capture description is + enabled. + :type enabled: bool + :param encoding: Enumerates the possible values for the encoding format of + capture description. Possible values include: 'Avro', 'AvroDeflate' + :type encoding: str or + ~azure.mgmt.servicebus.models.EncodingCaptureDescription + :param interval_in_seconds: The time window allows you to set the + frequency with which the capture to Azure Blobs will happen, value should + between 60 to 900 seconds + :type interval_in_seconds: int + :param size_limit_in_bytes: The size window defines the amount of data + built up in your Event Hub before an capture operation, value should be + between 10485760 and 524288000 bytes + :type size_limit_in_bytes: int + :param destination: Properties of Destination where capture will be + stored. (Storage Account, Blob Names) + :type destination: ~azure.mgmt.servicebus.models.Destination + """ + + _validation = { + 'interval_in_seconds': {'maximum': 900, 'minimum': 60}, + 'size_limit_in_bytes': {'maximum': 524288000, 'minimum': 10485760}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'encoding': {'key': 'encoding', 'type': 'EncodingCaptureDescription'}, + 'interval_in_seconds': {'key': 'intervalInSeconds', 'type': 'int'}, + 'size_limit_in_bytes': {'key': 'sizeLimitInBytes', 'type': 'int'}, + 'destination': {'key': 'destination', 'type': 'Destination'}, + } + + def __init__(self, *, enabled: bool=None, encoding=None, interval_in_seconds: int=None, size_limit_in_bytes: int=None, destination=None, **kwargs) -> None: + super(CaptureDescription, self).__init__(**kwargs) + self.enabled = enabled + self.encoding = encoding + self.interval_in_seconds = interval_in_seconds + self.size_limit_in_bytes = size_limit_in_bytes + self.destination = destination diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/check_name_availability.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/check_name_availability.py index bd55e823ca8c..46029ace9293 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/check_name_availability.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/check_name_availability.py @@ -15,8 +15,10 @@ class CheckNameAvailability(Model): """Description of a Check Name availability request properties. - :param name: The Name to check the namespce name availability and The - namespace name can contain only letters, numbers, and hyphens. The + All required parameters must be populated in order to send to Azure. + + :param name: Required. The Name to check the namespce name availability + and The namespace name can contain only letters, numbers, and hyphens. The namespace must start with a letter, and it must end with a letter or number. :type name: str @@ -30,6 +32,6 @@ class CheckNameAvailability(Model): 'name': {'key': 'name', 'type': 'str'}, } - def __init__(self, name): - super(CheckNameAvailability, self).__init__() - self.name = name + def __init__(self, **kwargs): + super(CheckNameAvailability, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/check_name_availability_py3.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/check_name_availability_py3.py new file mode 100644 index 000000000000..c04f123ecafa --- /dev/null +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/check_name_availability_py3.py @@ -0,0 +1,37 @@ +# 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 msrest.serialization import Model + + +class CheckNameAvailability(Model): + """Description of a Check Name availability request properties. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The Name to check the namespce name availability + and The namespace name can contain only letters, numbers, and hyphens. The + namespace must start with a letter, and it must end with a letter or + number. + :type name: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name: str, **kwargs) -> None: + super(CheckNameAvailability, self).__init__(**kwargs) + self.name = name diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/check_name_availability_result.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/check_name_availability_result.py index d23340a4b515..08a5c03733ac 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/check_name_availability_result.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/check_name_availability_result.py @@ -40,8 +40,8 @@ class CheckNameAvailabilityResult(Model): 'reason': {'key': 'reason', 'type': 'UnavailableReason'}, } - def __init__(self, name_available=None, reason=None): - super(CheckNameAvailabilityResult, self).__init__() + def __init__(self, **kwargs): + super(CheckNameAvailabilityResult, self).__init__(**kwargs) self.message = None - self.name_available = name_available - self.reason = reason + self.name_available = kwargs.get('name_available', None) + self.reason = kwargs.get('reason', None) diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/check_name_availability_result_py3.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/check_name_availability_result_py3.py new file mode 100644 index 000000000000..8e37f0c94559 --- /dev/null +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/check_name_availability_result_py3.py @@ -0,0 +1,47 @@ +# 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 msrest.serialization import Model + + +class CheckNameAvailabilityResult(Model): + """Description of a Check Name availability request properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar message: The detailed info regarding the reason associated with the + namespace. + :vartype message: str + :param name_available: Value indicating namespace is availability, true if + the namespace is available; otherwise, false. + :type name_available: bool + :param reason: The reason for unavailability of a namespace. Possible + values include: 'None', 'InvalidName', 'SubscriptionIsDisabled', + 'NameInUse', 'NameInLockdown', 'TooManyNamespaceInCurrentSubscription' + :type reason: str or ~azure.mgmt.servicebus.models.UnavailableReason + """ + + _validation = { + 'message': {'readonly': True}, + } + + _attribute_map = { + 'message': {'key': 'message', 'type': 'str'}, + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'UnavailableReason'}, + } + + def __init__(self, *, name_available: bool=None, reason=None, **kwargs) -> None: + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.message = None + self.name_available = name_available + self.reason = reason diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/correlation_filter.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/correlation_filter.py index 2d0a24c5d789..dfb1585de553 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/correlation_filter.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/correlation_filter.py @@ -15,6 +15,8 @@ class CorrelationFilter(Model): """Represents the correlation filter expression. + :param properties: dictionary object for custom filters + :type properties: dict[str, str] :param correlation_id: Identifier of the correlation. :type correlation_id: str :param message_id: Identifier of the message. @@ -37,6 +39,7 @@ class CorrelationFilter(Model): """ _attribute_map = { + 'properties': {'key': 'properties', 'type': '{str}'}, 'correlation_id': {'key': 'correlationId', 'type': 'str'}, 'message_id': {'key': 'messageId', 'type': 'str'}, 'to': {'key': 'to', 'type': 'str'}, @@ -48,14 +51,15 @@ class CorrelationFilter(Model): 'requires_preprocessing': {'key': 'requiresPreprocessing', 'type': 'bool'}, } - def __init__(self, correlation_id=None, message_id=None, to=None, reply_to=None, label=None, session_id=None, reply_to_session_id=None, content_type=None, requires_preprocessing=True): - super(CorrelationFilter, self).__init__() - self.correlation_id = correlation_id - self.message_id = message_id - self.to = to - self.reply_to = reply_to - self.label = label - self.session_id = session_id - self.reply_to_session_id = reply_to_session_id - self.content_type = content_type - self.requires_preprocessing = requires_preprocessing + def __init__(self, **kwargs): + super(CorrelationFilter, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + self.correlation_id = kwargs.get('correlation_id', None) + self.message_id = kwargs.get('message_id', None) + self.to = kwargs.get('to', None) + self.reply_to = kwargs.get('reply_to', None) + self.label = kwargs.get('label', None) + self.session_id = kwargs.get('session_id', None) + self.reply_to_session_id = kwargs.get('reply_to_session_id', None) + self.content_type = kwargs.get('content_type', None) + self.requires_preprocessing = kwargs.get('requires_preprocessing', True) diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/correlation_filter_py3.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/correlation_filter_py3.py new file mode 100644 index 000000000000..a611bad640f0 --- /dev/null +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/correlation_filter_py3.py @@ -0,0 +1,65 @@ +# 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 msrest.serialization import Model + + +class CorrelationFilter(Model): + """Represents the correlation filter expression. + + :param properties: dictionary object for custom filters + :type properties: dict[str, str] + :param correlation_id: Identifier of the correlation. + :type correlation_id: str + :param message_id: Identifier of the message. + :type message_id: str + :param to: Address to send to. + :type to: str + :param reply_to: Address of the queue to reply to. + :type reply_to: str + :param label: Application specific label. + :type label: str + :param session_id: Session identifier. + :type session_id: str + :param reply_to_session_id: Session identifier to reply to. + :type reply_to_session_id: str + :param content_type: Content type of the message. + :type content_type: str + :param requires_preprocessing: Value that indicates whether the rule + action requires preprocessing. Default value: True . + :type requires_preprocessing: bool + """ + + _attribute_map = { + 'properties': {'key': 'properties', 'type': '{str}'}, + 'correlation_id': {'key': 'correlationId', 'type': 'str'}, + 'message_id': {'key': 'messageId', 'type': 'str'}, + 'to': {'key': 'to', 'type': 'str'}, + 'reply_to': {'key': 'replyTo', 'type': 'str'}, + 'label': {'key': 'label', 'type': 'str'}, + 'session_id': {'key': 'sessionId', 'type': 'str'}, + 'reply_to_session_id': {'key': 'replyToSessionId', 'type': 'str'}, + 'content_type': {'key': 'contentType', 'type': 'str'}, + 'requires_preprocessing': {'key': 'requiresPreprocessing', 'type': 'bool'}, + } + + def __init__(self, *, properties=None, correlation_id: str=None, message_id: str=None, to: str=None, reply_to: str=None, label: str=None, session_id: str=None, reply_to_session_id: str=None, content_type: str=None, requires_preprocessing: bool=True, **kwargs) -> None: + super(CorrelationFilter, self).__init__(**kwargs) + self.properties = properties + self.correlation_id = correlation_id + self.message_id = message_id + self.to = to + self.reply_to = reply_to + self.label = label + self.session_id = session_id + self.reply_to_session_id = reply_to_session_id + self.content_type = content_type + self.requires_preprocessing = requires_preprocessing diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/destination.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/destination.py index c8a56130103d..78eec889d171 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/destination.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/destination.py @@ -36,9 +36,9 @@ class Destination(Model): 'archive_name_format': {'key': 'properties.archiveNameFormat', 'type': 'str'}, } - def __init__(self, name=None, storage_account_resource_id=None, blob_container=None, archive_name_format=None): - super(Destination, self).__init__() - self.name = name - self.storage_account_resource_id = storage_account_resource_id - self.blob_container = blob_container - self.archive_name_format = archive_name_format + def __init__(self, **kwargs): + super(Destination, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.storage_account_resource_id = kwargs.get('storage_account_resource_id', None) + self.blob_container = kwargs.get('blob_container', None) + self.archive_name_format = kwargs.get('archive_name_format', None) diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/destination_py3.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/destination_py3.py new file mode 100644 index 000000000000..c2e3445cbf40 --- /dev/null +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/destination_py3.py @@ -0,0 +1,44 @@ +# 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 msrest.serialization import Model + + +class Destination(Model): + """Capture storage details for capture description. + + :param name: Name for capture destination + :type name: str + :param storage_account_resource_id: Resource id of the storage account to + be used to create the blobs + :type storage_account_resource_id: str + :param blob_container: Blob container Name + :type blob_container: str + :param archive_name_format: Blob naming convention for archive, e.g. + {Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}. + Here all the parameters (Namespace,EventHub .. etc) are mandatory + irrespective of order + :type archive_name_format: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'storage_account_resource_id': {'key': 'properties.storageAccountResourceId', 'type': 'str'}, + 'blob_container': {'key': 'properties.blobContainer', 'type': 'str'}, + 'archive_name_format': {'key': 'properties.archiveNameFormat', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, storage_account_resource_id: str=None, blob_container: str=None, archive_name_format: str=None, **kwargs) -> None: + super(Destination, self).__init__(**kwargs) + self.name = name + self.storage_account_resource_id = storage_account_resource_id + self.blob_container = blob_container + self.archive_name_format = archive_name_format diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/error_response.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/error_response.py index 07bf76a57aac..a303ca9b634a 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/error_response.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/error_response.py @@ -28,10 +28,10 @@ class ErrorResponse(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self, code=None, message=None): - super(ErrorResponse, self).__init__() - self.code = code - self.message = message + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) class ErrorResponseException(HttpOperationError): diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/error_response_py3.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/error_response_py3.py new file mode 100644 index 000000000000..85e198147221 --- /dev/null +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/error_response_py3.py @@ -0,0 +1,46 @@ +# 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 msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class ErrorResponse(Model): + """Error reponse indicates ServiceBus service is not able to process the + incoming request. The reason is provided in the error message. + + :param code: Error code. + :type code: str + :param message: Error message indicating why the operation failed. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, message: str=None, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.code = code + self.message = message + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/eventhub.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/eventhub.py index 0df85eb93ebb..08f0b44a9fac 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/eventhub.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/eventhub.py @@ -70,12 +70,12 @@ class Eventhub(Resource): 'capture_description': {'key': 'properties.captureDescription', 'type': 'CaptureDescription'}, } - def __init__(self, message_retention_in_days=None, partition_count=None, status=None, capture_description=None): - super(Eventhub, self).__init__() + def __init__(self, **kwargs): + super(Eventhub, self).__init__(**kwargs) self.partition_ids = None self.created_at = None self.updated_at = None - self.message_retention_in_days = message_retention_in_days - self.partition_count = partition_count - self.status = status - self.capture_description = capture_description + self.message_retention_in_days = kwargs.get('message_retention_in_days', None) + self.partition_count = kwargs.get('partition_count', None) + self.status = kwargs.get('status', None) + self.capture_description = kwargs.get('capture_description', None) diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/eventhub_py3.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/eventhub_py3.py new file mode 100644 index 000000000000..9d6e8c179ae0 --- /dev/null +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/eventhub_py3.py @@ -0,0 +1,81 @@ +# 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 .resource import Resource + + +class Eventhub(Resource): + """Single item in List or Get Event Hub operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :ivar partition_ids: Current number of shards on the Event Hub. + :vartype partition_ids: list[str] + :ivar created_at: Exact time the Event Hub was created. + :vartype created_at: datetime + :ivar updated_at: The exact time the message was updated. + :vartype updated_at: datetime + :param message_retention_in_days: Number of days to retain the events for + this Event Hub, value should be 1 to 7 days + :type message_retention_in_days: long + :param partition_count: Number of partitions created for the Event Hub, + allowed values are from 1 to 32 partitions. + :type partition_count: long + :param status: Enumerates the possible values for the status of the Event + Hub. Possible values include: 'Active', 'Disabled', 'Restoring', + 'SendDisabled', 'ReceiveDisabled', 'Creating', 'Deleting', 'Renaming', + 'Unknown' + :type status: str or ~azure.mgmt.servicebus.models.EntityStatus + :param capture_description: Properties of capture description + :type capture_description: + ~azure.mgmt.servicebus.models.CaptureDescription + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'partition_ids': {'readonly': True}, + 'created_at': {'readonly': True}, + 'updated_at': {'readonly': True}, + 'message_retention_in_days': {'maximum': 7, 'minimum': 1}, + 'partition_count': {'maximum': 32, 'minimum': 1}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'partition_ids': {'key': 'properties.partitionIds', 'type': '[str]'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'updated_at': {'key': 'properties.updatedAt', 'type': 'iso-8601'}, + 'message_retention_in_days': {'key': 'properties.messageRetentionInDays', 'type': 'long'}, + 'partition_count': {'key': 'properties.partitionCount', 'type': 'long'}, + 'status': {'key': 'properties.status', 'type': 'EntityStatus'}, + 'capture_description': {'key': 'properties.captureDescription', 'type': 'CaptureDescription'}, + } + + def __init__(self, *, message_retention_in_days: int=None, partition_count: int=None, status=None, capture_description=None, **kwargs) -> None: + super(Eventhub, self).__init__(**kwargs) + self.partition_ids = None + self.created_at = None + self.updated_at = None + self.message_retention_in_days = message_retention_in_days + self.partition_count = partition_count + self.status = status + self.capture_description = capture_description diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/message_count_details.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/message_count_details.py index 9909a20c59b0..4ad9a33ceb92 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/message_count_details.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/message_count_details.py @@ -50,8 +50,8 @@ class MessageCountDetails(Model): 'transfer_dead_letter_message_count': {'key': 'transferDeadLetterMessageCount', 'type': 'long'}, } - def __init__(self): - super(MessageCountDetails, self).__init__() + def __init__(self, **kwargs): + super(MessageCountDetails, self).__init__(**kwargs) self.active_message_count = None self.dead_letter_message_count = None self.scheduled_message_count = None diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/message_count_details_py3.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/message_count_details_py3.py new file mode 100644 index 000000000000..b3fdd6072dbf --- /dev/null +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/message_count_details_py3.py @@ -0,0 +1,59 @@ +# 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 msrest.serialization import Model + + +class MessageCountDetails(Model): + """Message Count Details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar active_message_count: Number of active messages in the queue, topic, + or subscription. + :vartype active_message_count: long + :ivar dead_letter_message_count: Number of messages that are dead + lettered. + :vartype dead_letter_message_count: long + :ivar scheduled_message_count: Number of scheduled messages. + :vartype scheduled_message_count: long + :ivar transfer_message_count: Number of messages transferred to another + queue, topic, or subscription. + :vartype transfer_message_count: long + :ivar transfer_dead_letter_message_count: Number of messages transferred + into dead letters. + :vartype transfer_dead_letter_message_count: long + """ + + _validation = { + 'active_message_count': {'readonly': True}, + 'dead_letter_message_count': {'readonly': True}, + 'scheduled_message_count': {'readonly': True}, + 'transfer_message_count': {'readonly': True}, + 'transfer_dead_letter_message_count': {'readonly': True}, + } + + _attribute_map = { + 'active_message_count': {'key': 'activeMessageCount', 'type': 'long'}, + 'dead_letter_message_count': {'key': 'deadLetterMessageCount', 'type': 'long'}, + 'scheduled_message_count': {'key': 'scheduledMessageCount', 'type': 'long'}, + 'transfer_message_count': {'key': 'transferMessageCount', 'type': 'long'}, + 'transfer_dead_letter_message_count': {'key': 'transferDeadLetterMessageCount', 'type': 'long'}, + } + + def __init__(self, **kwargs) -> None: + super(MessageCountDetails, self).__init__(**kwargs) + self.active_message_count = None + self.dead_letter_message_count = None + self.scheduled_message_count = None + self.transfer_message_count = None + self.transfer_dead_letter_message_count = None diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/migration_config_properties.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/migration_config_properties.py new file mode 100644 index 000000000000..41e40e01db75 --- /dev/null +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/migration_config_properties.py @@ -0,0 +1,61 @@ +# 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 .resource import Resource + + +class MigrationConfigProperties(Resource): + """Single item in List or Get Migration Config operation. + + 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 Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :ivar provisioning_state: Provisioning state of Migration Configuration + :vartype provisioning_state: str + :param target_namespace: Required. Existing premium Namespace ARM Id name + which has no entities, will be used for migration + :type target_namespace: str + :param post_migration_name: Required. Name to access Standard Namespace + after migration + :type post_migration_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'target_namespace': {'required': True}, + 'post_migration_name': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'target_namespace': {'key': 'properties.targetNamespace', 'type': 'str'}, + 'post_migration_name': {'key': 'properties.postMigrationName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MigrationConfigProperties, self).__init__(**kwargs) + self.provisioning_state = None + self.target_namespace = kwargs.get('target_namespace', None) + self.post_migration_name = kwargs.get('post_migration_name', None) diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/migration_config_properties_paged.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/migration_config_properties_paged.py new file mode 100644 index 000000000000..2f654c36e371 --- /dev/null +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/migration_config_properties_paged.py @@ -0,0 +1,27 @@ +# 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 msrest.paging import Paged + + +class MigrationConfigPropertiesPaged(Paged): + """ + A paging container for iterating over a list of :class:`MigrationConfigProperties ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[MigrationConfigProperties]'} + } + + def __init__(self, *args, **kwargs): + + super(MigrationConfigPropertiesPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/migration_config_properties_py3.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/migration_config_properties_py3.py new file mode 100644 index 000000000000..69f12b76d433 --- /dev/null +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/migration_config_properties_py3.py @@ -0,0 +1,61 @@ +# 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 .resource import Resource + + +class MigrationConfigProperties(Resource): + """Single item in List or Get Migration Config operation. + + 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 Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :ivar provisioning_state: Provisioning state of Migration Configuration + :vartype provisioning_state: str + :param target_namespace: Required. Existing premium Namespace ARM Id name + which has no entities, will be used for migration + :type target_namespace: str + :param post_migration_name: Required. Name to access Standard Namespace + after migration + :type post_migration_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'target_namespace': {'required': True}, + 'post_migration_name': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'target_namespace': {'key': 'properties.targetNamespace', 'type': 'str'}, + 'post_migration_name': {'key': 'properties.postMigrationName', 'type': 'str'}, + } + + def __init__(self, *, target_namespace: str, post_migration_name: str, **kwargs) -> None: + super(MigrationConfigProperties, self).__init__(**kwargs) + self.provisioning_state = None + self.target_namespace = target_namespace + self.post_migration_name = post_migration_name diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/operation.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/operation.py index ab15fab7f170..7f781b965a44 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/operation.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/operation.py @@ -33,7 +33,7 @@ class Operation(Model): 'display': {'key': 'display', 'type': 'OperationDisplay'}, } - def __init__(self, display=None): - super(Operation, self).__init__() + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) self.name = None - self.display = display + self.display = kwargs.get('display', None) diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/operation_display.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/operation_display.py index 3f38bfbde9e2..8f5292d9eba3 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/operation_display.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/operation_display.py @@ -39,8 +39,8 @@ class OperationDisplay(Model): 'operation': {'key': 'operation', 'type': 'str'}, } - def __init__(self): - super(OperationDisplay, self).__init__() + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) self.provider = None self.resource = None self.operation = None diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/operation_display_py3.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/operation_display_py3.py new file mode 100644 index 000000000000..90b2be66e847 --- /dev/null +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/operation_display_py3.py @@ -0,0 +1,46 @@ +# 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 msrest.serialization import Model + + +class OperationDisplay(Model): + """The object that represents the operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provider: Service provider: Microsoft.ServiceBus + :vartype provider: str + :ivar resource: Resource on which the operation is performed: Invoice, + etc. + :vartype resource: str + :ivar operation: Operation type: Read, write, delete, etc. + :vartype operation: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/operation_py3.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/operation_py3.py new file mode 100644 index 000000000000..726e23280203 --- /dev/null +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/operation_py3.py @@ -0,0 +1,39 @@ +# 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 msrest.serialization import Model + + +class Operation(Model): + """A ServiceBus REST API operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Operation name: {provider}/{resource}/{operation} + :vartype name: str + :param display: The object that represents the operation. + :type display: ~azure.mgmt.servicebus.models.OperationDisplay + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, *, display=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = None + self.display = display diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/premium_messaging_regions.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/premium_messaging_regions.py index 3c57fe09f2fe..52cd2a921b61 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/premium_messaging_regions.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/premium_messaging_regions.py @@ -48,6 +48,6 @@ class PremiumMessagingRegions(ResourceNamespacePatch): 'properties': {'key': 'properties', 'type': 'PremiumMessagingRegionsProperties'}, } - def __init__(self, location=None, tags=None, properties=None): - super(PremiumMessagingRegions, self).__init__(location=location, tags=tags) - self.properties = properties + def __init__(self, **kwargs): + super(PremiumMessagingRegions, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/premium_messaging_regions_properties.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/premium_messaging_regions_properties.py index c7dde29d2e76..1e1a62d670eb 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/premium_messaging_regions_properties.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/premium_messaging_regions_properties.py @@ -34,7 +34,7 @@ class PremiumMessagingRegionsProperties(Model): 'full_name': {'key': 'fullName', 'type': 'str'}, } - def __init__(self): - super(PremiumMessagingRegionsProperties, self).__init__() + def __init__(self, **kwargs): + super(PremiumMessagingRegionsProperties, self).__init__(**kwargs) self.code = None self.full_name = None diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/premium_messaging_regions_properties_py3.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/premium_messaging_regions_properties_py3.py new file mode 100644 index 000000000000..6c9b7f29b787 --- /dev/null +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/premium_messaging_regions_properties_py3.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class PremiumMessagingRegionsProperties(Model): + """PremiumMessagingRegionsProperties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: Region code + :vartype code: str + :ivar full_name: Full name of the region + :vartype full_name: str + """ + + _validation = { + 'code': {'readonly': True}, + 'full_name': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'full_name': {'key': 'fullName', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(PremiumMessagingRegionsProperties, self).__init__(**kwargs) + self.code = None + self.full_name = None diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/premium_messaging_regions_py3.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/premium_messaging_regions_py3.py new file mode 100644 index 000000000000..f15b63b735c5 --- /dev/null +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/premium_messaging_regions_py3.py @@ -0,0 +1,53 @@ +# 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 .resource_namespace_patch import ResourceNamespacePatch + + +class PremiumMessagingRegions(ResourceNamespacePatch): + """Premium Messaging Region. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param properties: + :type properties: + ~azure.mgmt.servicebus.models.PremiumMessagingRegionsProperties + """ + + _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'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'properties': {'key': 'properties', 'type': 'PremiumMessagingRegionsProperties'}, + } + + def __init__(self, *, location: str=None, tags=None, properties=None, **kwargs) -> None: + super(PremiumMessagingRegions, self).__init__(location=location, tags=tags, **kwargs) + self.properties = properties diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/regenerate_access_key_parameters.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/regenerate_access_key_parameters.py index a3239098cd82..c54d0d30b21d 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/regenerate_access_key_parameters.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/regenerate_access_key_parameters.py @@ -16,8 +16,10 @@ class RegenerateAccessKeyParameters(Model): """Parameters supplied to the Regenerate Authorization Rule operation, specifies which key neeeds to be reset. - :param key_type: The access key to regenerate. Possible values include: - 'PrimaryKey', 'SecondaryKey' + All required parameters must be populated in order to send to Azure. + + :param key_type: Required. The access key to regenerate. Possible values + include: 'PrimaryKey', 'SecondaryKey' :type key_type: str or ~azure.mgmt.servicebus.models.KeyType :param key: Optional, if the key value provided, is reset for KeyType value or autogenerate Key value set for keyType @@ -33,7 +35,7 @@ class RegenerateAccessKeyParameters(Model): 'key': {'key': 'key', 'type': 'str'}, } - def __init__(self, key_type, key=None): - super(RegenerateAccessKeyParameters, self).__init__() - self.key_type = key_type - self.key = key + def __init__(self, **kwargs): + super(RegenerateAccessKeyParameters, self).__init__(**kwargs) + self.key_type = kwargs.get('key_type', None) + self.key = kwargs.get('key', None) diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/regenerate_access_key_parameters_py3.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/regenerate_access_key_parameters_py3.py new file mode 100644 index 000000000000..1b51d422ea4c --- /dev/null +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/regenerate_access_key_parameters_py3.py @@ -0,0 +1,41 @@ +# 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 msrest.serialization import Model + + +class RegenerateAccessKeyParameters(Model): + """Parameters supplied to the Regenerate Authorization Rule operation, + specifies which key neeeds to be reset. + + All required parameters must be populated in order to send to Azure. + + :param key_type: Required. The access key to regenerate. Possible values + include: 'PrimaryKey', 'SecondaryKey' + :type key_type: str or ~azure.mgmt.servicebus.models.KeyType + :param key: Optional, if the key value provided, is reset for KeyType + value or autogenerate Key value set for keyType + :type key: str + """ + + _validation = { + 'key_type': {'required': True}, + } + + _attribute_map = { + 'key_type': {'key': 'keyType', 'type': 'KeyType'}, + 'key': {'key': 'key', 'type': 'str'}, + } + + def __init__(self, *, key_type, key: str=None, **kwargs) -> None: + super(RegenerateAccessKeyParameters, self).__init__(**kwargs) + self.key_type = key_type + self.key = key diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/resource.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/resource.py index 30363ca16bdd..f2f4bcd9cd55 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/resource.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/resource.py @@ -38,8 +38,8 @@ class Resource(Model): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self): - super(Resource, self).__init__() + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/resource_namespace_patch.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/resource_namespace_patch.py index 053416e71968..2ac18a403bce 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/resource_namespace_patch.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/resource_namespace_patch.py @@ -44,7 +44,7 @@ class ResourceNamespacePatch(Resource): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, location=None, tags=None): - super(ResourceNamespacePatch, self).__init__() - self.location = location - self.tags = tags + def __init__(self, **kwargs): + super(ResourceNamespacePatch, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/resource_namespace_patch_py3.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/resource_namespace_patch_py3.py new file mode 100644 index 000000000000..b3e16e7aefe3 --- /dev/null +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/resource_namespace_patch_py3.py @@ -0,0 +1,50 @@ +# 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 .resource import Resource + + +class ResourceNamespacePatch(Resource): + """The Resource definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _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'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str=None, tags=None, **kwargs) -> None: + super(ResourceNamespacePatch, self).__init__(**kwargs) + self.location = location + self.tags = tags diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/resource_py3.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/resource_py3.py new file mode 100644 index 000000000000..6a1c6db582ed --- /dev/null +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/resource_py3.py @@ -0,0 +1,45 @@ +# 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 msrest.serialization import Model + + +class Resource(Model): + """The Resource definition for other than namespace. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + """ + + _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'}, + } + + def __init__(self, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/rule.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/rule.py index 7a439128611c..9b3c0e5ca7fa 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/rule.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/rule.py @@ -52,9 +52,9 @@ class Rule(Resource): 'correlation_filter': {'key': 'properties.correlationFilter', 'type': 'CorrelationFilter'}, } - def __init__(self, action=None, filter_type=None, sql_filter=None, correlation_filter=None): - super(Rule, self).__init__() - self.action = action - self.filter_type = filter_type - self.sql_filter = sql_filter - self.correlation_filter = correlation_filter + def __init__(self, **kwargs): + super(Rule, self).__init__(**kwargs) + self.action = kwargs.get('action', None) + self.filter_type = kwargs.get('filter_type', None) + self.sql_filter = kwargs.get('sql_filter', None) + self.correlation_filter = kwargs.get('correlation_filter', None) diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/rule_py3.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/rule_py3.py new file mode 100644 index 000000000000..1d8782b33615 --- /dev/null +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/rule_py3.py @@ -0,0 +1,60 @@ +# 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 .resource import Resource + + +class Rule(Resource): + """Description of Rule Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param action: Represents the filter actions which are allowed for the + transformation of a message that have been matched by a filter expression. + :type action: ~azure.mgmt.servicebus.models.Action + :param filter_type: Filter type that is evaluated against a + BrokeredMessage. Possible values include: 'SqlFilter', 'CorrelationFilter' + :type filter_type: str or ~azure.mgmt.servicebus.models.FilterType + :param sql_filter: Properties of sqlFilter + :type sql_filter: ~azure.mgmt.servicebus.models.SqlFilter + :param correlation_filter: Properties of correlationFilter + :type correlation_filter: ~azure.mgmt.servicebus.models.CorrelationFilter + """ + + _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'}, + 'action': {'key': 'properties.action', 'type': 'Action'}, + 'filter_type': {'key': 'properties.filterType', 'type': 'FilterType'}, + 'sql_filter': {'key': 'properties.sqlFilter', 'type': 'SqlFilter'}, + 'correlation_filter': {'key': 'properties.correlationFilter', 'type': 'CorrelationFilter'}, + } + + def __init__(self, *, action=None, filter_type=None, sql_filter=None, correlation_filter=None, **kwargs) -> None: + super(Rule, self).__init__(**kwargs) + self.action = action + self.filter_type = filter_type + self.sql_filter = sql_filter + self.correlation_filter = correlation_filter diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_authorization_rule.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_authorization_rule.py index b94c5c4a0cbe..13660f930bf8 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_authorization_rule.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_authorization_rule.py @@ -18,13 +18,15 @@ class SBAuthorizationRule(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 Azure. + :ivar id: Resource Id :vartype id: str :ivar name: Resource name :vartype name: str :ivar type: Resource type :vartype type: str - :param rights: The rights associated with the rule. + :param rights: Required. The rights associated with the rule. :type rights: list[str or ~azure.mgmt.servicebus.models.AccessRights] """ @@ -42,6 +44,6 @@ class SBAuthorizationRule(Resource): 'rights': {'key': 'properties.rights', 'type': '[AccessRights]'}, } - def __init__(self, rights): - super(SBAuthorizationRule, self).__init__() - self.rights = rights + def __init__(self, **kwargs): + super(SBAuthorizationRule, self).__init__(**kwargs) + self.rights = kwargs.get('rights', None) diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_authorization_rule_py3.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_authorization_rule_py3.py new file mode 100644 index 000000000000..b19b3f0b6293 --- /dev/null +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_authorization_rule_py3.py @@ -0,0 +1,49 @@ +# 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 .resource import Resource + + +class SBAuthorizationRule(Resource): + """Description of a namespace authorization rule. + + 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 Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param rights: Required. The rights associated with the rule. + :type rights: list[str or ~azure.mgmt.servicebus.models.AccessRights] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'rights': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'rights': {'key': 'properties.rights', 'type': '[AccessRights]'}, + } + + def __init__(self, *, rights, **kwargs) -> None: + super(SBAuthorizationRule, self).__init__(**kwargs) + self.rights = rights diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_namespace.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_namespace.py index 9af8bb55912f..398be39f0412 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_namespace.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_namespace.py @@ -18,13 +18,15 @@ class SBNamespace(TrackedResource): 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 Azure. + :ivar id: Resource Id :vartype id: str :ivar name: Resource name :vartype name: str :ivar type: Resource type :vartype type: str - :param location: The Geo-location where the resource lives + :param location: Required. The Geo-location where the resource lives :type location: str :param tags: Resource tags :type tags: dict[str, str] @@ -69,9 +71,9 @@ class SBNamespace(TrackedResource): 'metric_id': {'key': 'properties.metricId', 'type': 'str'}, } - def __init__(self, location, tags=None, sku=None): - super(SBNamespace, self).__init__(location=location, tags=tags) - self.sku = sku + def __init__(self, **kwargs): + super(SBNamespace, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) self.provisioning_state = None self.created_at = None self.updated_at = None diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_namespace_py3.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_namespace_py3.py new file mode 100644 index 000000000000..4ee417397b37 --- /dev/null +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_namespace_py3.py @@ -0,0 +1,81 @@ +# 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 .tracked_resource import TrackedResource + + +class SBNamespace(TrackedResource): + """Description of a namespace 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 Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. The Geo-location where the resource lives + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param sku: Porperties of Sku + :type sku: ~azure.mgmt.servicebus.models.SBSku + :ivar provisioning_state: Provisioning state of the namespace. + :vartype provisioning_state: str + :ivar created_at: The time the namespace was created. + :vartype created_at: datetime + :ivar updated_at: The time the namespace was updated. + :vartype updated_at: datetime + :ivar service_bus_endpoint: Endpoint you can use to perform Service Bus + operations. + :vartype service_bus_endpoint: str + :ivar metric_id: Identifier for Azure Insights metrics + :vartype metric_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'created_at': {'readonly': True}, + 'updated_at': {'readonly': True}, + 'service_bus_endpoint': {'readonly': True}, + 'metric_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'SBSku'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'updated_at': {'key': 'properties.updatedAt', 'type': 'iso-8601'}, + 'service_bus_endpoint': {'key': 'properties.serviceBusEndpoint', 'type': 'str'}, + 'metric_id': {'key': 'properties.metricId', 'type': 'str'}, + } + + def __init__(self, *, location: str, tags=None, sku=None, **kwargs) -> None: + super(SBNamespace, self).__init__(location=location, tags=tags, **kwargs) + self.sku = sku + self.provisioning_state = None + self.created_at = None + self.updated_at = None + self.service_bus_endpoint = None + self.metric_id = None diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_namespace_update_parameters.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_namespace_update_parameters.py index dd3fde4636db..5b6274272ba3 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_namespace_update_parameters.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_namespace_update_parameters.py @@ -68,9 +68,9 @@ class SBNamespaceUpdateParameters(ResourceNamespacePatch): 'metric_id': {'key': 'properties.metricId', 'type': 'str'}, } - def __init__(self, location=None, tags=None, sku=None): - super(SBNamespaceUpdateParameters, self).__init__(location=location, tags=tags) - self.sku = sku + def __init__(self, **kwargs): + super(SBNamespaceUpdateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) self.provisioning_state = None self.created_at = None self.updated_at = None diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_namespace_update_parameters_py3.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_namespace_update_parameters_py3.py new file mode 100644 index 000000000000..04cadaaeabc7 --- /dev/null +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_namespace_update_parameters_py3.py @@ -0,0 +1,78 @@ +# 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 .resource_namespace_patch import ResourceNamespacePatch + + +class SBNamespaceUpdateParameters(ResourceNamespacePatch): + """Description of a namespace resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param sku: Porperties of Sku + :type sku: ~azure.mgmt.servicebus.models.SBSku + :ivar provisioning_state: Provisioning state of the namespace. + :vartype provisioning_state: str + :ivar created_at: The time the namespace was created. + :vartype created_at: datetime + :ivar updated_at: The time the namespace was updated. + :vartype updated_at: datetime + :ivar service_bus_endpoint: Endpoint you can use to perform Service Bus + operations. + :vartype service_bus_endpoint: str + :ivar metric_id: Identifier for Azure Insights metrics + :vartype metric_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'created_at': {'readonly': True}, + 'updated_at': {'readonly': True}, + 'service_bus_endpoint': {'readonly': True}, + 'metric_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'SBSku'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'updated_at': {'key': 'properties.updatedAt', 'type': 'iso-8601'}, + 'service_bus_endpoint': {'key': 'properties.serviceBusEndpoint', 'type': 'str'}, + 'metric_id': {'key': 'properties.metricId', 'type': 'str'}, + } + + def __init__(self, *, location: str=None, tags=None, sku=None, **kwargs) -> None: + super(SBNamespaceUpdateParameters, self).__init__(location=location, tags=tags, **kwargs) + self.sku = sku + self.provisioning_state = None + self.created_at = None + self.updated_at = None + self.service_bus_endpoint = None + self.metric_id = None diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_queue.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_queue.py index 97ef3c09de1a..41d2a45f277b 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_queue.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_queue.py @@ -72,6 +72,9 @@ class SBQueue(Resource): 'Restoring', 'SendDisabled', 'ReceiveDisabled', 'Creating', 'Deleting', 'Renaming', 'Unknown' :type status: str or ~azure.mgmt.servicebus.models.EntityStatus + :param enable_batched_operations: Value that indicates whether server-side + batched operations are enabled. + :type enable_batched_operations: bool :param auto_delete_on_idle: ISO 8061 timeSpan idle interval after which the queue is automatically deleted. The minimum duration is 5 minutes. :type auto_delete_on_idle: timedelta @@ -120,6 +123,7 @@ class SBQueue(Resource): 'duplicate_detection_history_time_window': {'key': 'properties.duplicateDetectionHistoryTimeWindow', 'type': 'duration'}, 'max_delivery_count': {'key': 'properties.maxDeliveryCount', 'type': 'int'}, 'status': {'key': 'properties.status', 'type': 'EntityStatus'}, + 'enable_batched_operations': {'key': 'properties.enableBatchedOperations', 'type': 'bool'}, 'auto_delete_on_idle': {'key': 'properties.autoDeleteOnIdle', 'type': 'duration'}, 'enable_partitioning': {'key': 'properties.enablePartitioning', 'type': 'bool'}, 'enable_express': {'key': 'properties.enableExpress', 'type': 'bool'}, @@ -127,25 +131,26 @@ class SBQueue(Resource): 'forward_dead_lettered_messages_to': {'key': 'properties.forwardDeadLetteredMessagesTo', 'type': 'str'}, } - def __init__(self, lock_duration=None, max_size_in_megabytes=None, requires_duplicate_detection=None, requires_session=None, default_message_time_to_live=None, dead_lettering_on_message_expiration=None, duplicate_detection_history_time_window=None, max_delivery_count=None, status=None, auto_delete_on_idle=None, enable_partitioning=None, enable_express=None, forward_to=None, forward_dead_lettered_messages_to=None): - super(SBQueue, self).__init__() + def __init__(self, **kwargs): + super(SBQueue, self).__init__(**kwargs) self.count_details = None self.created_at = None self.updated_at = None self.accessed_at = None self.size_in_bytes = None self.message_count = None - self.lock_duration = lock_duration - self.max_size_in_megabytes = max_size_in_megabytes - self.requires_duplicate_detection = requires_duplicate_detection - self.requires_session = requires_session - self.default_message_time_to_live = default_message_time_to_live - self.dead_lettering_on_message_expiration = dead_lettering_on_message_expiration - self.duplicate_detection_history_time_window = duplicate_detection_history_time_window - self.max_delivery_count = max_delivery_count - self.status = status - self.auto_delete_on_idle = auto_delete_on_idle - self.enable_partitioning = enable_partitioning - self.enable_express = enable_express - self.forward_to = forward_to - self.forward_dead_lettered_messages_to = forward_dead_lettered_messages_to + self.lock_duration = kwargs.get('lock_duration', None) + self.max_size_in_megabytes = kwargs.get('max_size_in_megabytes', None) + self.requires_duplicate_detection = kwargs.get('requires_duplicate_detection', None) + self.requires_session = kwargs.get('requires_session', None) + self.default_message_time_to_live = kwargs.get('default_message_time_to_live', None) + self.dead_lettering_on_message_expiration = kwargs.get('dead_lettering_on_message_expiration', None) + self.duplicate_detection_history_time_window = kwargs.get('duplicate_detection_history_time_window', None) + self.max_delivery_count = kwargs.get('max_delivery_count', None) + self.status = kwargs.get('status', None) + self.enable_batched_operations = kwargs.get('enable_batched_operations', None) + self.auto_delete_on_idle = kwargs.get('auto_delete_on_idle', None) + self.enable_partitioning = kwargs.get('enable_partitioning', None) + self.enable_express = kwargs.get('enable_express', None) + self.forward_to = kwargs.get('forward_to', None) + self.forward_dead_lettered_messages_to = kwargs.get('forward_dead_lettered_messages_to', None) diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_queue_py3.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_queue_py3.py new file mode 100644 index 000000000000..dd370f7146ae --- /dev/null +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_queue_py3.py @@ -0,0 +1,156 @@ +# 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 .resource import Resource + + +class SBQueue(Resource): + """Description of queue Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :ivar count_details: Message Count Details. + :vartype count_details: ~azure.mgmt.servicebus.models.MessageCountDetails + :ivar created_at: The exact time the message was created. + :vartype created_at: datetime + :ivar updated_at: The exact time the message was updated. + :vartype updated_at: datetime + :ivar accessed_at: Last time a message was sent, or the last time there + was a receive request to this queue. + :vartype accessed_at: datetime + :ivar size_in_bytes: The size of the queue, in bytes. + :vartype size_in_bytes: long + :ivar message_count: The number of messages in the queue. + :vartype message_count: long + :param lock_duration: ISO 8601 timespan duration of a peek-lock; that is, + the amount of time that the message is locked for other receivers. The + maximum value for LockDuration is 5 minutes; the default value is 1 + minute. + :type lock_duration: timedelta + :param max_size_in_megabytes: The maximum size of the queue in megabytes, + which is the size of memory allocated for the queue. Default is 1024. + :type max_size_in_megabytes: int + :param requires_duplicate_detection: A value indicating if this queue + requires duplicate detection. + :type requires_duplicate_detection: bool + :param requires_session: A value that indicates whether the queue supports + the concept of sessions. + :type requires_session: bool + :param default_message_time_to_live: ISO 8601 default message timespan to + live value. This is the duration after which the message expires, starting + from when the message is sent to Service Bus. This is the default value + used when TimeToLive is not set on a message itself. + :type default_message_time_to_live: timedelta + :param dead_lettering_on_message_expiration: A value that indicates + whether this queue has dead letter support when a message expires. + :type dead_lettering_on_message_expiration: bool + :param duplicate_detection_history_time_window: ISO 8601 timeSpan + structure that defines the duration of the duplicate detection history. + The default value is 10 minutes. + :type duplicate_detection_history_time_window: timedelta + :param max_delivery_count: The maximum delivery count. A message is + automatically deadlettered after this number of deliveries. default value + is 10. + :type max_delivery_count: int + :param status: Enumerates the possible values for the status of a + messaging entity. Possible values include: 'Active', 'Disabled', + 'Restoring', 'SendDisabled', 'ReceiveDisabled', 'Creating', 'Deleting', + 'Renaming', 'Unknown' + :type status: str or ~azure.mgmt.servicebus.models.EntityStatus + :param enable_batched_operations: Value that indicates whether server-side + batched operations are enabled. + :type enable_batched_operations: bool + :param auto_delete_on_idle: ISO 8061 timeSpan idle interval after which + the queue is automatically deleted. The minimum duration is 5 minutes. + :type auto_delete_on_idle: timedelta + :param enable_partitioning: A value that indicates whether the queue is to + be partitioned across multiple message brokers. + :type enable_partitioning: bool + :param enable_express: A value that indicates whether Express Entities are + enabled. An express queue holds a message in memory temporarily before + writing it to persistent storage. + :type enable_express: bool + :param forward_to: Queue/Topic name to forward the messages + :type forward_to: str + :param forward_dead_lettered_messages_to: Queue/Topic name to forward the + Dead Letter message + :type forward_dead_lettered_messages_to: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'count_details': {'readonly': True}, + 'created_at': {'readonly': True}, + 'updated_at': {'readonly': True}, + 'accessed_at': {'readonly': True}, + 'size_in_bytes': {'readonly': True}, + 'message_count': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'count_details': {'key': 'properties.countDetails', 'type': 'MessageCountDetails'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'updated_at': {'key': 'properties.updatedAt', 'type': 'iso-8601'}, + 'accessed_at': {'key': 'properties.accessedAt', 'type': 'iso-8601'}, + 'size_in_bytes': {'key': 'properties.sizeInBytes', 'type': 'long'}, + 'message_count': {'key': 'properties.messageCount', 'type': 'long'}, + 'lock_duration': {'key': 'properties.lockDuration', 'type': 'duration'}, + 'max_size_in_megabytes': {'key': 'properties.maxSizeInMegabytes', 'type': 'int'}, + 'requires_duplicate_detection': {'key': 'properties.requiresDuplicateDetection', 'type': 'bool'}, + 'requires_session': {'key': 'properties.requiresSession', 'type': 'bool'}, + 'default_message_time_to_live': {'key': 'properties.defaultMessageTimeToLive', 'type': 'duration'}, + 'dead_lettering_on_message_expiration': {'key': 'properties.deadLetteringOnMessageExpiration', 'type': 'bool'}, + 'duplicate_detection_history_time_window': {'key': 'properties.duplicateDetectionHistoryTimeWindow', 'type': 'duration'}, + 'max_delivery_count': {'key': 'properties.maxDeliveryCount', 'type': 'int'}, + 'status': {'key': 'properties.status', 'type': 'EntityStatus'}, + 'enable_batched_operations': {'key': 'properties.enableBatchedOperations', 'type': 'bool'}, + 'auto_delete_on_idle': {'key': 'properties.autoDeleteOnIdle', 'type': 'duration'}, + 'enable_partitioning': {'key': 'properties.enablePartitioning', 'type': 'bool'}, + 'enable_express': {'key': 'properties.enableExpress', 'type': 'bool'}, + 'forward_to': {'key': 'properties.forwardTo', 'type': 'str'}, + 'forward_dead_lettered_messages_to': {'key': 'properties.forwardDeadLetteredMessagesTo', 'type': 'str'}, + } + + def __init__(self, *, lock_duration=None, max_size_in_megabytes: int=None, requires_duplicate_detection: bool=None, requires_session: bool=None, default_message_time_to_live=None, dead_lettering_on_message_expiration: bool=None, duplicate_detection_history_time_window=None, max_delivery_count: int=None, status=None, enable_batched_operations: bool=None, auto_delete_on_idle=None, enable_partitioning: bool=None, enable_express: bool=None, forward_to: str=None, forward_dead_lettered_messages_to: str=None, **kwargs) -> None: + super(SBQueue, self).__init__(**kwargs) + self.count_details = None + self.created_at = None + self.updated_at = None + self.accessed_at = None + self.size_in_bytes = None + self.message_count = None + self.lock_duration = lock_duration + self.max_size_in_megabytes = max_size_in_megabytes + self.requires_duplicate_detection = requires_duplicate_detection + self.requires_session = requires_session + self.default_message_time_to_live = default_message_time_to_live + self.dead_lettering_on_message_expiration = dead_lettering_on_message_expiration + self.duplicate_detection_history_time_window = duplicate_detection_history_time_window + self.max_delivery_count = max_delivery_count + self.status = status + self.enable_batched_operations = enable_batched_operations + self.auto_delete_on_idle = auto_delete_on_idle + self.enable_partitioning = enable_partitioning + self.enable_express = enable_express + self.forward_to = forward_to + self.forward_dead_lettered_messages_to = forward_dead_lettered_messages_to diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_sku.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_sku.py index 49170e6cd447..f69f3b5de5fd 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_sku.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_sku.py @@ -15,7 +15,9 @@ class SBSku(Model): """SKU of the namespace. - :param name: Name of this SKU. Possible values include: 'Basic', + All required parameters must be populated in order to send to Azure. + + :param name: Required. Name of this SKU. Possible values include: 'Basic', 'Standard', 'Premium' :type name: str or ~azure.mgmt.servicebus.models.SkuName :param tier: The billing tier of this particular SKU. Possible values @@ -36,8 +38,8 @@ class SBSku(Model): 'capacity': {'key': 'capacity', 'type': 'int'}, } - def __init__(self, name, tier=None, capacity=None): - super(SBSku, self).__init__() - self.name = name - self.tier = tier - self.capacity = capacity + def __init__(self, **kwargs): + super(SBSku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.capacity = kwargs.get('capacity', None) diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_sku_py3.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_sku_py3.py new file mode 100644 index 000000000000..f5adfee20c0a --- /dev/null +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_sku_py3.py @@ -0,0 +1,45 @@ +# 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 msrest.serialization import Model + + +class SBSku(Model): + """SKU of the namespace. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Name of this SKU. Possible values include: 'Basic', + 'Standard', 'Premium' + :type name: str or ~azure.mgmt.servicebus.models.SkuName + :param tier: The billing tier of this particular SKU. Possible values + include: 'Basic', 'Standard', 'Premium' + :type tier: str or ~azure.mgmt.servicebus.models.SkuTier + :param capacity: The specified messaging units for the tier. For Premium + tier, capacity are 1,2 and 4. + :type capacity: int + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'SkuName'}, + 'tier': {'key': 'tier', 'type': 'SkuTier'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, *, name, tier=None, capacity: int=None, **kwargs) -> None: + super(SBSku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.capacity = capacity diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_subscription.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_subscription.py index 73f667da65f0..426c99bcfd7c 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_subscription.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_subscription.py @@ -111,22 +111,22 @@ class SBSubscription(Resource): 'forward_dead_lettered_messages_to': {'key': 'properties.forwardDeadLetteredMessagesTo', 'type': 'str'}, } - def __init__(self, lock_duration=None, requires_session=None, default_message_time_to_live=None, dead_lettering_on_filter_evaluation_exceptions=None, dead_lettering_on_message_expiration=None, duplicate_detection_history_time_window=None, max_delivery_count=None, status=None, enable_batched_operations=None, auto_delete_on_idle=None, forward_to=None, forward_dead_lettered_messages_to=None): - super(SBSubscription, self).__init__() + def __init__(self, **kwargs): + super(SBSubscription, self).__init__(**kwargs) self.message_count = None self.created_at = None self.accessed_at = None self.updated_at = None self.count_details = None - self.lock_duration = lock_duration - self.requires_session = requires_session - self.default_message_time_to_live = default_message_time_to_live - self.dead_lettering_on_filter_evaluation_exceptions = dead_lettering_on_filter_evaluation_exceptions - self.dead_lettering_on_message_expiration = dead_lettering_on_message_expiration - self.duplicate_detection_history_time_window = duplicate_detection_history_time_window - self.max_delivery_count = max_delivery_count - self.status = status - self.enable_batched_operations = enable_batched_operations - self.auto_delete_on_idle = auto_delete_on_idle - self.forward_to = forward_to - self.forward_dead_lettered_messages_to = forward_dead_lettered_messages_to + self.lock_duration = kwargs.get('lock_duration', None) + self.requires_session = kwargs.get('requires_session', None) + self.default_message_time_to_live = kwargs.get('default_message_time_to_live', None) + self.dead_lettering_on_filter_evaluation_exceptions = kwargs.get('dead_lettering_on_filter_evaluation_exceptions', None) + self.dead_lettering_on_message_expiration = kwargs.get('dead_lettering_on_message_expiration', None) + self.duplicate_detection_history_time_window = kwargs.get('duplicate_detection_history_time_window', None) + self.max_delivery_count = kwargs.get('max_delivery_count', None) + self.status = kwargs.get('status', None) + self.enable_batched_operations = kwargs.get('enable_batched_operations', None) + self.auto_delete_on_idle = kwargs.get('auto_delete_on_idle', None) + self.forward_to = kwargs.get('forward_to', None) + self.forward_dead_lettered_messages_to = kwargs.get('forward_dead_lettered_messages_to', None) diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_subscription_py3.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_subscription_py3.py new file mode 100644 index 000000000000..2c730d0bdd68 --- /dev/null +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_subscription_py3.py @@ -0,0 +1,132 @@ +# 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 .resource import Resource + + +class SBSubscription(Resource): + """Description of subscription resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :ivar message_count: Number of messages. + :vartype message_count: long + :ivar created_at: Exact time the message was created. + :vartype created_at: datetime + :ivar accessed_at: Last time there was a receive request to this + subscription. + :vartype accessed_at: datetime + :ivar updated_at: The exact time the message was updated. + :vartype updated_at: datetime + :ivar count_details: Message count details + :vartype count_details: ~azure.mgmt.servicebus.models.MessageCountDetails + :param lock_duration: ISO 8061 lock duration timespan for the + subscription. The default value is 1 minute. + :type lock_duration: timedelta + :param requires_session: Value indicating if a subscription supports the + concept of sessions. + :type requires_session: bool + :param default_message_time_to_live: ISO 8061 Default message timespan to + live value. This is the duration after which the message expires, starting + from when the message is sent to Service Bus. This is the default value + used when TimeToLive is not set on a message itself. + :type default_message_time_to_live: timedelta + :param dead_lettering_on_filter_evaluation_exceptions: Value that + indicates whether a subscription has dead letter support on filter + evaluation exceptions. + :type dead_lettering_on_filter_evaluation_exceptions: bool + :param dead_lettering_on_message_expiration: Value that indicates whether + a subscription has dead letter support when a message expires. + :type dead_lettering_on_message_expiration: bool + :param duplicate_detection_history_time_window: ISO 8601 timeSpan + structure that defines the duration of the duplicate detection history. + The default value is 10 minutes. + :type duplicate_detection_history_time_window: timedelta + :param max_delivery_count: Number of maximum deliveries. + :type max_delivery_count: int + :param status: Enumerates the possible values for the status of a + messaging entity. Possible values include: 'Active', 'Disabled', + 'Restoring', 'SendDisabled', 'ReceiveDisabled', 'Creating', 'Deleting', + 'Renaming', 'Unknown' + :type status: str or ~azure.mgmt.servicebus.models.EntityStatus + :param enable_batched_operations: Value that indicates whether server-side + batched operations are enabled. + :type enable_batched_operations: bool + :param auto_delete_on_idle: ISO 8061 timeSpan idle interval after which + the topic is automatically deleted. The minimum duration is 5 minutes. + :type auto_delete_on_idle: timedelta + :param forward_to: Queue/Topic name to forward the messages + :type forward_to: str + :param forward_dead_lettered_messages_to: Queue/Topic name to forward the + Dead Letter message + :type forward_dead_lettered_messages_to: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'message_count': {'readonly': True}, + 'created_at': {'readonly': True}, + 'accessed_at': {'readonly': True}, + 'updated_at': {'readonly': True}, + 'count_details': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'message_count': {'key': 'properties.messageCount', 'type': 'long'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'accessed_at': {'key': 'properties.accessedAt', 'type': 'iso-8601'}, + 'updated_at': {'key': 'properties.updatedAt', 'type': 'iso-8601'}, + 'count_details': {'key': 'properties.countDetails', 'type': 'MessageCountDetails'}, + 'lock_duration': {'key': 'properties.lockDuration', 'type': 'duration'}, + 'requires_session': {'key': 'properties.requiresSession', 'type': 'bool'}, + 'default_message_time_to_live': {'key': 'properties.defaultMessageTimeToLive', 'type': 'duration'}, + 'dead_lettering_on_filter_evaluation_exceptions': {'key': 'properties.deadLetteringOnFilterEvaluationExceptions', 'type': 'bool'}, + 'dead_lettering_on_message_expiration': {'key': 'properties.deadLetteringOnMessageExpiration', 'type': 'bool'}, + 'duplicate_detection_history_time_window': {'key': 'properties.duplicateDetectionHistoryTimeWindow', 'type': 'duration'}, + 'max_delivery_count': {'key': 'properties.maxDeliveryCount', 'type': 'int'}, + 'status': {'key': 'properties.status', 'type': 'EntityStatus'}, + 'enable_batched_operations': {'key': 'properties.enableBatchedOperations', 'type': 'bool'}, + 'auto_delete_on_idle': {'key': 'properties.autoDeleteOnIdle', 'type': 'duration'}, + 'forward_to': {'key': 'properties.forwardTo', 'type': 'str'}, + 'forward_dead_lettered_messages_to': {'key': 'properties.forwardDeadLetteredMessagesTo', 'type': 'str'}, + } + + def __init__(self, *, lock_duration=None, requires_session: bool=None, default_message_time_to_live=None, dead_lettering_on_filter_evaluation_exceptions: bool=None, dead_lettering_on_message_expiration: bool=None, duplicate_detection_history_time_window=None, max_delivery_count: int=None, status=None, enable_batched_operations: bool=None, auto_delete_on_idle=None, forward_to: str=None, forward_dead_lettered_messages_to: str=None, **kwargs) -> None: + super(SBSubscription, self).__init__(**kwargs) + self.message_count = None + self.created_at = None + self.accessed_at = None + self.updated_at = None + self.count_details = None + self.lock_duration = lock_duration + self.requires_session = requires_session + self.default_message_time_to_live = default_message_time_to_live + self.dead_lettering_on_filter_evaluation_exceptions = dead_lettering_on_filter_evaluation_exceptions + self.dead_lettering_on_message_expiration = dead_lettering_on_message_expiration + self.duplicate_detection_history_time_window = duplicate_detection_history_time_window + self.max_delivery_count = max_delivery_count + self.status = status + self.enable_batched_operations = enable_batched_operations + self.auto_delete_on_idle = auto_delete_on_idle + self.forward_to = forward_to + self.forward_dead_lettered_messages_to = forward_dead_lettered_messages_to diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_topic.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_topic.py index 5f0b806bed30..ce92872562e1 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_topic.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_topic.py @@ -109,21 +109,21 @@ class SBTopic(Resource): 'enable_express': {'key': 'properties.enableExpress', 'type': 'bool'}, } - def __init__(self, default_message_time_to_live=None, max_size_in_megabytes=None, requires_duplicate_detection=None, duplicate_detection_history_time_window=None, enable_batched_operations=None, status=None, support_ordering=None, auto_delete_on_idle=None, enable_partitioning=None, enable_express=None): - super(SBTopic, self).__init__() + def __init__(self, **kwargs): + super(SBTopic, self).__init__(**kwargs) self.size_in_bytes = None self.created_at = None self.updated_at = None self.accessed_at = None self.subscription_count = None self.count_details = None - self.default_message_time_to_live = default_message_time_to_live - self.max_size_in_megabytes = max_size_in_megabytes - self.requires_duplicate_detection = requires_duplicate_detection - self.duplicate_detection_history_time_window = duplicate_detection_history_time_window - self.enable_batched_operations = enable_batched_operations - self.status = status - self.support_ordering = support_ordering - self.auto_delete_on_idle = auto_delete_on_idle - self.enable_partitioning = enable_partitioning - self.enable_express = enable_express + self.default_message_time_to_live = kwargs.get('default_message_time_to_live', None) + self.max_size_in_megabytes = kwargs.get('max_size_in_megabytes', None) + self.requires_duplicate_detection = kwargs.get('requires_duplicate_detection', None) + self.duplicate_detection_history_time_window = kwargs.get('duplicate_detection_history_time_window', None) + self.enable_batched_operations = kwargs.get('enable_batched_operations', None) + self.status = kwargs.get('status', None) + self.support_ordering = kwargs.get('support_ordering', None) + self.auto_delete_on_idle = kwargs.get('auto_delete_on_idle', None) + self.enable_partitioning = kwargs.get('enable_partitioning', None) + self.enable_express = kwargs.get('enable_express', None) diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_topic_py3.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_topic_py3.py new file mode 100644 index 000000000000..36087b83451d --- /dev/null +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_topic_py3.py @@ -0,0 +1,129 @@ +# 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 .resource import Resource + + +class SBTopic(Resource): + """Description of topic resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :ivar size_in_bytes: Size of the topic, in bytes. + :vartype size_in_bytes: long + :ivar created_at: Exact time the message was created. + :vartype created_at: datetime + :ivar updated_at: The exact time the message was updated. + :vartype updated_at: datetime + :ivar accessed_at: Last time the message was sent, or a request was + received, for this topic. + :vartype accessed_at: datetime + :ivar subscription_count: Number of subscriptions. + :vartype subscription_count: int + :ivar count_details: Message count deatils + :vartype count_details: ~azure.mgmt.servicebus.models.MessageCountDetails + :param default_message_time_to_live: ISO 8601 Default message timespan to + live value. This is the duration after which the message expires, starting + from when the message is sent to Service Bus. This is the default value + used when TimeToLive is not set on a message itself. + :type default_message_time_to_live: timedelta + :param max_size_in_megabytes: Maximum size of the topic in megabytes, + which is the size of the memory allocated for the topic. Default is 1024. + :type max_size_in_megabytes: int + :param requires_duplicate_detection: Value indicating if this topic + requires duplicate detection. + :type requires_duplicate_detection: bool + :param duplicate_detection_history_time_window: ISO8601 timespan structure + that defines the duration of the duplicate detection history. The default + value is 10 minutes. + :type duplicate_detection_history_time_window: timedelta + :param enable_batched_operations: Value that indicates whether server-side + batched operations are enabled. + :type enable_batched_operations: bool + :param status: Enumerates the possible values for the status of a + messaging entity. Possible values include: 'Active', 'Disabled', + 'Restoring', 'SendDisabled', 'ReceiveDisabled', 'Creating', 'Deleting', + 'Renaming', 'Unknown' + :type status: str or ~azure.mgmt.servicebus.models.EntityStatus + :param support_ordering: Value that indicates whether the topic supports + ordering. + :type support_ordering: bool + :param auto_delete_on_idle: ISO 8601 timespan idle interval after which + the topic is automatically deleted. The minimum duration is 5 minutes. + :type auto_delete_on_idle: timedelta + :param enable_partitioning: Value that indicates whether the topic to be + partitioned across multiple message brokers is enabled. + :type enable_partitioning: bool + :param enable_express: Value that indicates whether Express Entities are + enabled. An express topic holds a message in memory temporarily before + writing it to persistent storage. + :type enable_express: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'size_in_bytes': {'readonly': True}, + 'created_at': {'readonly': True}, + 'updated_at': {'readonly': True}, + 'accessed_at': {'readonly': True}, + 'subscription_count': {'readonly': True}, + 'count_details': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'size_in_bytes': {'key': 'properties.sizeInBytes', 'type': 'long'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'updated_at': {'key': 'properties.updatedAt', 'type': 'iso-8601'}, + 'accessed_at': {'key': 'properties.accessedAt', 'type': 'iso-8601'}, + 'subscription_count': {'key': 'properties.subscriptionCount', 'type': 'int'}, + 'count_details': {'key': 'properties.countDetails', 'type': 'MessageCountDetails'}, + 'default_message_time_to_live': {'key': 'properties.defaultMessageTimeToLive', 'type': 'duration'}, + 'max_size_in_megabytes': {'key': 'properties.maxSizeInMegabytes', 'type': 'int'}, + 'requires_duplicate_detection': {'key': 'properties.requiresDuplicateDetection', 'type': 'bool'}, + 'duplicate_detection_history_time_window': {'key': 'properties.duplicateDetectionHistoryTimeWindow', 'type': 'duration'}, + 'enable_batched_operations': {'key': 'properties.enableBatchedOperations', 'type': 'bool'}, + 'status': {'key': 'properties.status', 'type': 'EntityStatus'}, + 'support_ordering': {'key': 'properties.supportOrdering', 'type': 'bool'}, + 'auto_delete_on_idle': {'key': 'properties.autoDeleteOnIdle', 'type': 'duration'}, + 'enable_partitioning': {'key': 'properties.enablePartitioning', 'type': 'bool'}, + 'enable_express': {'key': 'properties.enableExpress', 'type': 'bool'}, + } + + def __init__(self, *, default_message_time_to_live=None, max_size_in_megabytes: int=None, requires_duplicate_detection: bool=None, duplicate_detection_history_time_window=None, enable_batched_operations: bool=None, status=None, support_ordering: bool=None, auto_delete_on_idle=None, enable_partitioning: bool=None, enable_express: bool=None, **kwargs) -> None: + super(SBTopic, self).__init__(**kwargs) + self.size_in_bytes = None + self.created_at = None + self.updated_at = None + self.accessed_at = None + self.subscription_count = None + self.count_details = None + self.default_message_time_to_live = default_message_time_to_live + self.max_size_in_megabytes = max_size_in_megabytes + self.requires_duplicate_detection = requires_duplicate_detection + self.duplicate_detection_history_time_window = duplicate_detection_history_time_window + self.enable_batched_operations = enable_batched_operations + self.status = status + self.support_ordering = support_ordering + self.auto_delete_on_idle = auto_delete_on_idle + self.enable_partitioning = enable_partitioning + self.enable_express = enable_express diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/service_bus_management_client_enums.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/service_bus_management_client_enums.py index 52f86b7f900b..a313fa144d3b 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/service_bus_management_client_enums.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/service_bus_management_client_enums.py @@ -12,34 +12,34 @@ from enum import Enum -class SkuName(Enum): +class SkuName(str, Enum): basic = "Basic" standard = "Standard" premium = "Premium" -class SkuTier(Enum): +class SkuTier(str, Enum): basic = "Basic" standard = "Standard" premium = "Premium" -class AccessRights(Enum): +class AccessRights(str, Enum): manage = "Manage" send = "Send" listen = "Listen" -class KeyType(Enum): +class KeyType(str, Enum): primary_key = "PrimaryKey" secondary_key = "SecondaryKey" -class EntityStatus(Enum): +class EntityStatus(str, Enum): active = "Active" disabled = "Disabled" @@ -52,7 +52,7 @@ class EntityStatus(Enum): unknown = "Unknown" -class UnavailableReason(Enum): +class UnavailableReason(str, Enum): none = "None" invalid_name = "InvalidName" @@ -62,26 +62,26 @@ class UnavailableReason(Enum): too_many_namespace_in_current_subscription = "TooManyNamespaceInCurrentSubscription" -class FilterType(Enum): +class FilterType(str, Enum): sql_filter = "SqlFilter" correlation_filter = "CorrelationFilter" -class EncodingCaptureDescription(Enum): +class EncodingCaptureDescription(str, Enum): avro = "Avro" avro_deflate = "AvroDeflate" -class ProvisioningStateDR(Enum): +class ProvisioningStateDR(str, Enum): accepted = "Accepted" succeeded = "Succeeded" failed = "Failed" -class RoleDisasterRecovery(Enum): +class RoleDisasterRecovery(str, Enum): primary = "Primary" primary_not_replicating = "PrimaryNotReplicating" diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sql_filter.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sql_filter.py index 2b59a37f752f..b8dd211d6bee 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sql_filter.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sql_filter.py @@ -40,8 +40,8 @@ class SqlFilter(Model): 'requires_preprocessing': {'key': 'requiresPreprocessing', 'type': 'bool'}, } - def __init__(self, sql_expression=None, requires_preprocessing=True): - super(SqlFilter, self).__init__() - self.sql_expression = sql_expression + def __init__(self, **kwargs): + super(SqlFilter, self).__init__(**kwargs) + self.sql_expression = kwargs.get('sql_expression', None) self.compatibility_level = None - self.requires_preprocessing = requires_preprocessing + self.requires_preprocessing = kwargs.get('requires_preprocessing', True) diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sql_filter_py3.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sql_filter_py3.py new file mode 100644 index 000000000000..d6de31b2536b --- /dev/null +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sql_filter_py3.py @@ -0,0 +1,47 @@ +# 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 msrest.serialization import Model + + +class SqlFilter(Model): + """Represents a filter which is a composition of an expression and an action + that is executed in the pub/sub pipeline. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param sql_expression: The SQL expression. e.g. MyProperty='ABC' + :type sql_expression: str + :ivar compatibility_level: This property is reserved for future use. An + integer value showing the compatibility level, currently hard-coded to 20. + Default value: 20 . + :vartype compatibility_level: int + :param requires_preprocessing: Value that indicates whether the rule + action requires preprocessing. Default value: True . + :type requires_preprocessing: bool + """ + + _validation = { + 'compatibility_level': {'readonly': True}, + } + + _attribute_map = { + 'sql_expression': {'key': 'sqlExpression', 'type': 'str'}, + 'compatibility_level': {'key': 'compatibilityLevel', 'type': 'int'}, + 'requires_preprocessing': {'key': 'requiresPreprocessing', 'type': 'bool'}, + } + + def __init__(self, *, sql_expression: str=None, requires_preprocessing: bool=True, **kwargs) -> None: + super(SqlFilter, self).__init__(**kwargs) + self.sql_expression = sql_expression + self.compatibility_level = None + self.requires_preprocessing = requires_preprocessing diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sql_rule_action.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sql_rule_action.py index 0150ca05ae2c..e6ef4d1fdb4e 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sql_rule_action.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sql_rule_action.py @@ -26,5 +26,11 @@ class SqlRuleAction(Action): :type requires_preprocessing: bool """ - def __init__(self, sql_expression=None, compatibility_level=None, requires_preprocessing=True): - super(SqlRuleAction, self).__init__(sql_expression=sql_expression, compatibility_level=compatibility_level, requires_preprocessing=requires_preprocessing) + _attribute_map = { + 'sql_expression': {'key': 'sqlExpression', 'type': 'str'}, + 'compatibility_level': {'key': 'compatibilityLevel', 'type': 'int'}, + 'requires_preprocessing': {'key': 'requiresPreprocessing', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(SqlRuleAction, self).__init__(**kwargs) diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sql_rule_action_py3.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sql_rule_action_py3.py new file mode 100644 index 000000000000..94786ea833d5 --- /dev/null +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sql_rule_action_py3.py @@ -0,0 +1,36 @@ +# 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 .action import Action + + +class SqlRuleAction(Action): + """Represents set of actions written in SQL language-based syntax that is + performed against a ServiceBus.Messaging.BrokeredMessage . + + :param sql_expression: SQL expression. e.g. MyProperty='ABC' + :type sql_expression: str + :param compatibility_level: This property is reserved for future use. An + integer value showing the compatibility level, currently hard-coded to 20. + :type compatibility_level: int + :param requires_preprocessing: Value that indicates whether the rule + action requires preprocessing. Default value: True . + :type requires_preprocessing: bool + """ + + _attribute_map = { + 'sql_expression': {'key': 'sqlExpression', 'type': 'str'}, + 'compatibility_level': {'key': 'compatibilityLevel', 'type': 'int'}, + 'requires_preprocessing': {'key': 'requiresPreprocessing', 'type': 'bool'}, + } + + def __init__(self, *, sql_expression: str=None, compatibility_level: int=None, requires_preprocessing: bool=True, **kwargs) -> None: + super(SqlRuleAction, self).__init__(sql_expression=sql_expression, compatibility_level=compatibility_level, requires_preprocessing=requires_preprocessing, **kwargs) diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/tracked_resource.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/tracked_resource.py index 192adcc84b2c..dcd13ff085ec 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/tracked_resource.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/tracked_resource.py @@ -18,13 +18,15 @@ class TrackedResource(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 Azure. + :ivar id: Resource Id :vartype id: str :ivar name: Resource name :vartype name: str :ivar type: Resource type :vartype type: str - :param location: The Geo-location where the resource lives + :param location: Required. The Geo-location where the resource lives :type location: str :param tags: Resource tags :type tags: dict[str, str] @@ -45,7 +47,7 @@ class TrackedResource(Resource): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, location, tags=None): - super(TrackedResource, self).__init__() - self.location = location - self.tags = tags + def __init__(self, **kwargs): + super(TrackedResource, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/tracked_resource_py3.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/tracked_resource_py3.py new file mode 100644 index 000000000000..2caa0475de57 --- /dev/null +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/tracked_resource_py3.py @@ -0,0 +1,53 @@ +# 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 .resource import Resource + + +class TrackedResource(Resource): + """The Resource definition. + + 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 Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. The Geo-location where the resource lives + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(TrackedResource, self).__init__(**kwargs) + self.location = location + self.tags = tags diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/__init__.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/__init__.py index a6b1de616461..581b76b7eba4 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/__init__.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/__init__.py @@ -12,6 +12,7 @@ from .operations import Operations from .namespaces_operations import NamespacesOperations from .disaster_recovery_configs_operations import DisasterRecoveryConfigsOperations +from .migration_configs_operations import MigrationConfigsOperations from .queues_operations import QueuesOperations from .topics_operations import TopicsOperations from .subscriptions_operations import SubscriptionsOperations @@ -24,6 +25,7 @@ 'Operations', 'NamespacesOperations', 'DisasterRecoveryConfigsOperations', + 'MigrationConfigsOperations', 'QueuesOperations', 'TopicsOperations', 'SubscriptionsOperations', diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/disaster_recovery_configs_operations.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/disaster_recovery_configs_operations.py index 38f955c54c86..07bbb40c5db5 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/disaster_recovery_configs_operations.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/disaster_recovery_configs_operations.py @@ -21,7 +21,7 @@ class DisasterRecoveryConfigsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-04-01". """ @@ -64,7 +64,7 @@ def check_name_availability_method( parameters = models.CheckNameAvailability(name=name) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/CheckNameAvailability' + url = self.check_name_availability_method.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), @@ -107,6 +107,7 @@ def check_name_availability_method( return client_raw_response return deserialized + check_name_availability_method.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/CheckNameAvailability'} def list( self, resource_group_name, namespace_name, custom_headers=None, raw=False, **operation_config): @@ -132,7 +133,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), @@ -177,6 +178,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs'} def create_or_update( self, resource_group_name, namespace_name, alias, partner_namespace=None, alternate_name=None, custom_headers=None, raw=False, **operation_config): @@ -209,7 +211,7 @@ def create_or_update( parameters = models.ArmDisasterRecovery(partner_namespace=partner_namespace, alternate_name=alternate_name) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), @@ -253,6 +255,7 @@ def create_or_update( return client_raw_response return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}'} def delete( self, resource_group_name, namespace_name, alias, custom_headers=None, raw=False, **operation_config): @@ -276,7 +279,7 @@ def delete( :class:`ErrorResponseException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), @@ -309,6 +312,7 @@ def delete( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}'} def get( self, resource_group_name, namespace_name, alias, custom_headers=None, raw=False, **operation_config): @@ -334,7 +338,7 @@ def get( :class:`ErrorResponseException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), @@ -374,6 +378,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}'} def break_pairing( self, resource_group_name, namespace_name, alias, custom_headers=None, raw=False, **operation_config): @@ -398,7 +403,7 @@ def break_pairing( :class:`ErrorResponseException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/breakPairing' + url = self.break_pairing.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), @@ -431,6 +436,7 @@ def break_pairing( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response + break_pairing.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/breakPairing'} def fail_over( self, resource_group_name, namespace_name, alias, custom_headers=None, raw=False, **operation_config): @@ -455,7 +461,7 @@ def fail_over( :class:`ErrorResponseException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/failover' + url = self.fail_over.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), @@ -488,6 +494,7 @@ def fail_over( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response + fail_over.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/failover'} def list_authorization_rules( self, resource_group_name, namespace_name, alias, custom_headers=None, raw=False, **operation_config): @@ -515,7 +522,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/AuthorizationRules' + url = self.list_authorization_rules.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), @@ -561,6 +568,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_authorization_rules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/AuthorizationRules'} def get_authorization_rule( self, resource_group_name, namespace_name, alias, authorization_rule_name, custom_headers=None, raw=False, **operation_config): @@ -587,7 +595,7 @@ def get_authorization_rule( :class:`ErrorResponseException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/AuthorizationRules/{authorizationRuleName}' + url = self.get_authorization_rule.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), @@ -628,6 +636,7 @@ def get_authorization_rule( return client_raw_response return deserialized + get_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/AuthorizationRules/{authorizationRuleName}'} def list_keys( self, resource_group_name, namespace_name, alias, authorization_rule_name, custom_headers=None, raw=False, **operation_config): @@ -654,7 +663,7 @@ def list_keys( :class:`ErrorResponseException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/AuthorizationRules/{authorizationRuleName}/listKeys' + url = self.list_keys.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), @@ -695,3 +704,4 @@ def list_keys( return client_raw_response return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/AuthorizationRules/{authorizationRuleName}/listKeys'} diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/event_hubs_operations.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/event_hubs_operations.py index 4f2c515aca00..efe2322dde90 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/event_hubs_operations.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/event_hubs_operations.py @@ -21,7 +21,7 @@ class EventHubsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-04-01". """ @@ -60,7 +60,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/eventhubs' + url = self.list_by_namespace.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), @@ -105,3 +105,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_namespace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/eventhubs'} diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/migration_configs_operations.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/migration_configs_operations.py new file mode 100644 index 000000000000..1e41c3ed0093 --- /dev/null +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/migration_configs_operations.py @@ -0,0 +1,453 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class MigrationConfigsOperations(object): + """MigrationConfigsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API version. Constant value: "2017-04-01". + :ivar config_name: The configuration name. Should always be "$default". Constant value: "$default". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-04-01" + self.config_name = "$default" + + self.config = config + + def list( + self, resource_group_name, namespace_name, custom_headers=None, raw=False, **operation_config): + """Gets all migrationConfigurations. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name + :type namespace_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of MigrationConfigProperties + :rtype: + ~azure.mgmt.servicebus.models.MigrationConfigPropertiesPaged[~azure.mgmt.servicebus.models.MigrationConfigProperties] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.MigrationConfigPropertiesPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.MigrationConfigPropertiesPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/migrationConfigurations'} + + + def _create_and_start_migration_initial( + self, resource_group_name, namespace_name, target_namespace, post_migration_name, custom_headers=None, raw=False, **operation_config): + parameters = models.MigrationConfigProperties(target_namespace=target_namespace, post_migration_name=post_migration_name) + + # Construct URL + url = self.create_and_start_migration.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'configName': self._serialize.url("self.config_name", self.config_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'MigrationConfigProperties') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('MigrationConfigProperties', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_and_start_migration( + self, resource_group_name, namespace_name, target_namespace, post_migration_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates Migration configuration and starts migration of enties from + Standard to Premium namespace. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name + :type namespace_name: str + :param target_namespace: Existing premium Namespace ARM Id name which + has no entities, will be used for migration + :type target_namespace: str + :param post_migration_name: Name to access Standard Namespace after + migration + :type post_migration_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + MigrationConfigProperties or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.servicebus.models.MigrationConfigProperties] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.servicebus.models.MigrationConfigProperties]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._create_and_start_migration_initial( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + target_namespace=target_namespace, + post_migration_name=post_migration_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('MigrationConfigProperties', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_and_start_migration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/migrationConfigurations/{configName}'} + + def delete( + self, resource_group_name, namespace_name, custom_headers=None, raw=False, **operation_config): + """Deletes a MigrationConfiguration. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name + :type namespace_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'configName': self._serialize.url("self.config_name", self.config_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/migrationConfigurations/{configName}'} + + def get( + self, resource_group_name, namespace_name, custom_headers=None, raw=False, **operation_config): + """Retrieves Migration Config. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name + :type namespace_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: MigrationConfigProperties or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.servicebus.models.MigrationConfigProperties or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'configName': self._serialize.url("self.config_name", self.config_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('MigrationConfigProperties', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/migrationConfigurations/{configName}'} + + def complete_migration( + self, resource_group_name, namespace_name, custom_headers=None, raw=False, **operation_config): + """This operation Completes Migration of entities by pointing the + connection strings to Premium namespace and any enties created after + the operation will be under Premium Namespace. CompleteMigration + operation will fail when entity migration is in-progress. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name + :type namespace_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.complete_migration.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'configName': self._serialize.url("self.config_name", self.config_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + complete_migration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/migrationConfigurations/{configName}/upgrade'} + + def revert( + self, resource_group_name, namespace_name, custom_headers=None, raw=False, **operation_config): + """This operation reverts Migration. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name + :type namespace_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.revert.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'configName': self._serialize.url("self.config_name", self.config_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + revert.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/migrationConfigurations/{configName}/revert'} diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/namespaces_operations.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/namespaces_operations.py index 33f7ad5f255d..bd43b157b35e 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/namespaces_operations.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/namespaces_operations.py @@ -11,8 +11,8 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -23,7 +23,7 @@ class NamespacesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-04-01". """ @@ -61,7 +61,7 @@ def check_name_availability_method( parameters = models.CheckNameAvailability(name=name) # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.ServiceBus/CheckNameAvailability' + url = self.check_name_availability_method.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -102,6 +102,7 @@ def check_name_availability_method( return client_raw_response return deserialized + check_name_availability_method.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ServiceBus/CheckNameAvailability'} def list( self, custom_headers=None, raw=False, **operation_config): @@ -123,7 +124,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.ServiceBus/namespaces' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -166,6 +167,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ServiceBus/namespaces'} def list_by_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -189,7 +191,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces' + url = self.list_by_resource_group.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -233,12 +235,13 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces'} def _create_or_update_initial( self, resource_group_name, namespace_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), @@ -285,7 +288,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, namespace_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, namespace_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. @@ -297,13 +300,16 @@ def create_or_update( :param parameters: Parameters supplied to create a namespace resource. :type parameters: ~azure.mgmt.servicebus.models.SBNamespace :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns SBNamespace - or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns SBNamespace or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.servicebus.models.SBNamespace] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.servicebus.models.SBNamespace]] :raises: :class:`ErrorResponseException` """ @@ -315,28 +321,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 201, 202]: - raise models.ErrorResponseException(self._deserialize, response) - deserialized = self._deserialize('SBNamespace', response) if raw: @@ -345,18 +331,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}'} def _delete_initial( self, resource_group_name, namespace_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), @@ -390,7 +378,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, namespace_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, namespace_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes an existing namespace. This operation also removes all associated resources under the namespace. @@ -400,12 +388,14 @@ def delete( :param namespace_name: The namespace name :type namespace_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`ErrorResponseException` """ @@ -416,38 +406,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - raise models.ErrorResponseException(self._deserialize, response) - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}'} def get( self, resource_group_name, namespace_name, custom_headers=None, raw=False, **operation_config): @@ -470,7 +442,7 @@ def get( :class:`ErrorResponseException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), @@ -509,6 +481,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}'} def update( self, resource_group_name, namespace_name, parameters, custom_headers=None, raw=False, **operation_config): @@ -535,7 +508,7 @@ def update( :class:`ErrorResponseException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}' + url = self.update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), @@ -580,6 +553,7 @@ def update( return client_raw_response return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}'} def list_authorization_rules( self, resource_group_name, namespace_name, custom_headers=None, raw=False, **operation_config): @@ -605,7 +579,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/AuthorizationRules' + url = self.list_authorization_rules.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), @@ -650,6 +624,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_authorization_rules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/AuthorizationRules'} def create_or_update_authorization_rule( self, resource_group_name, namespace_name, authorization_rule_name, rights, custom_headers=None, raw=False, **operation_config): @@ -678,7 +653,7 @@ def create_or_update_authorization_rule( parameters = models.SBAuthorizationRule(rights=rights) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}' + url = self.create_or_update_authorization_rule.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), @@ -722,6 +697,7 @@ def create_or_update_authorization_rule( return client_raw_response return deserialized + create_or_update_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}'} def delete_authorization_rule( self, resource_group_name, namespace_name, authorization_rule_name, custom_headers=None, raw=False, **operation_config): @@ -745,7 +721,7 @@ def delete_authorization_rule( :class:`ErrorResponseException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}' + url = self.delete_authorization_rule.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), @@ -778,6 +754,7 @@ def delete_authorization_rule( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response + delete_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}'} def get_authorization_rule( self, resource_group_name, namespace_name, authorization_rule_name, custom_headers=None, raw=False, **operation_config): @@ -802,7 +779,7 @@ def get_authorization_rule( :class:`ErrorResponseException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}' + url = self.get_authorization_rule.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), @@ -842,6 +819,7 @@ def get_authorization_rule( return client_raw_response return deserialized + get_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}'} def list_keys( self, resource_group_name, namespace_name, authorization_rule_name, custom_headers=None, raw=False, **operation_config): @@ -866,7 +844,7 @@ def list_keys( :class:`ErrorResponseException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/listKeys' + url = self.list_keys.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), @@ -906,6 +884,7 @@ def list_keys( return client_raw_response return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/listKeys'} def regenerate_keys( self, resource_group_name, namespace_name, authorization_rule_name, key_type, key=None, custom_headers=None, raw=False, **operation_config): @@ -939,7 +918,7 @@ def regenerate_keys( parameters = models.RegenerateAccessKeyParameters(key_type=key_type, key=key) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/regenerateKeys' + url = self.regenerate_keys.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), @@ -983,3 +962,4 @@ def regenerate_keys( return client_raw_response return deserialized + regenerate_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/regenerateKeys'} diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/operations.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/operations.py index 336115a508b4..596460ca5adb 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/operations.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/operations.py @@ -21,7 +21,7 @@ class Operations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-04-01". """ @@ -55,7 +55,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/providers/Microsoft.ServiceBus/operations' + url = self.list.metadata['url'] # Construct parameters query_parameters = {} @@ -94,3 +94,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/providers/Microsoft.ServiceBus/operations'} diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/premium_messaging_regions_operations.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/premium_messaging_regions_operations.py index 6eba6b4b08a7..f725c8ca4f1e 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/premium_messaging_regions_operations.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/premium_messaging_regions_operations.py @@ -21,7 +21,7 @@ class PremiumMessagingRegionsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-04-01". """ @@ -55,7 +55,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.ServiceBus/premiumMessagingRegions' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -98,3 +98,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ServiceBus/premiumMessagingRegions'} diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/queues_operations.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/queues_operations.py index 98450f44456f..fa780e4abee1 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/queues_operations.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/queues_operations.py @@ -21,7 +21,7 @@ class QueuesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-04-01". """ @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self.config = config def list_by_namespace( - self, resource_group_name, namespace_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, namespace_name, skip=None, top=None, custom_headers=None, raw=False, **operation_config): """Gets the queues within a namespace. :param resource_group_name: Name of the Resource group within the @@ -45,6 +45,14 @@ def list_by_namespace( :type resource_group_name: str :param namespace_name: The namespace name :type namespace_name: str + :param skip: Skip is only used if a previous operation returned a + partial result. If a previous response contains a nextLink element, + the value of the nextLink element will include a skip parameter that + specifies a starting point to use for subsequent calls. + :type skip: int + :param top: May be used to limit the number of results to the most + recent N usageDetails. + :type top: int :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -60,7 +68,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues' + url = self.list_by_namespace.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), @@ -71,6 +79,10 @@ def internal_paging(next_link=None, raw=False): # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', maximum=1000, minimum=0) + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) else: url = next_link @@ -105,6 +117,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_namespace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues'} def create_or_update( self, resource_group_name, namespace_name, queue_name, parameters, custom_headers=None, raw=False, **operation_config): @@ -132,7 +145,7 @@ def create_or_update( :class:`ErrorResponseException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), @@ -176,6 +189,7 @@ def create_or_update( return client_raw_response return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}'} def delete( self, resource_group_name, namespace_name, queue_name, custom_headers=None, raw=False, **operation_config): @@ -199,7 +213,7 @@ def delete( :class:`ErrorResponseException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), @@ -232,6 +246,7 @@ def delete( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}'} def get( self, resource_group_name, namespace_name, queue_name, custom_headers=None, raw=False, **operation_config): @@ -256,7 +271,7 @@ def get( :class:`ErrorResponseException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), @@ -296,6 +311,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}'} def list_authorization_rules( self, resource_group_name, namespace_name, queue_name, custom_headers=None, raw=False, **operation_config): @@ -323,7 +339,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules' + url = self.list_authorization_rules.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), @@ -369,6 +385,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_authorization_rules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules'} def create_or_update_authorization_rule( self, resource_group_name, namespace_name, queue_name, authorization_rule_name, rights, custom_headers=None, raw=False, **operation_config): @@ -399,7 +416,7 @@ def create_or_update_authorization_rule( parameters = models.SBAuthorizationRule(rights=rights) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}' + url = self.create_or_update_authorization_rule.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), @@ -444,6 +461,7 @@ def create_or_update_authorization_rule( return client_raw_response return deserialized + create_or_update_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}'} def delete_authorization_rule( self, resource_group_name, namespace_name, queue_name, authorization_rule_name, custom_headers=None, raw=False, **operation_config): @@ -469,7 +487,7 @@ def delete_authorization_rule( :class:`ErrorResponseException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}' + url = self.delete_authorization_rule.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), @@ -503,6 +521,7 @@ def delete_authorization_rule( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response + delete_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}'} def get_authorization_rule( self, resource_group_name, namespace_name, queue_name, authorization_rule_name, custom_headers=None, raw=False, **operation_config): @@ -529,7 +548,7 @@ def get_authorization_rule( :class:`ErrorResponseException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}' + url = self.get_authorization_rule.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), @@ -570,6 +589,7 @@ def get_authorization_rule( return client_raw_response return deserialized + get_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}'} def list_keys( self, resource_group_name, namespace_name, queue_name, authorization_rule_name, custom_headers=None, raw=False, **operation_config): @@ -596,7 +616,7 @@ def list_keys( :class:`ErrorResponseException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}/ListKeys' + url = self.list_keys.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), @@ -637,6 +657,7 @@ def list_keys( return client_raw_response return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}/ListKeys'} def regenerate_keys( self, resource_group_name, namespace_name, queue_name, authorization_rule_name, key_type, key=None, custom_headers=None, raw=False, **operation_config): @@ -671,7 +692,7 @@ def regenerate_keys( parameters = models.RegenerateAccessKeyParameters(key_type=key_type, key=key) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}/regenerateKeys' + url = self.regenerate_keys.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), @@ -716,3 +737,4 @@ def regenerate_keys( return client_raw_response return deserialized + regenerate_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}/regenerateKeys'} diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/regions_operations.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/regions_operations.py index 76cff97e9bb7..3e4e57c03f06 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/regions_operations.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/regions_operations.py @@ -21,7 +21,7 @@ class RegionsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-04-01". """ @@ -57,7 +57,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.ServiceBus/sku/{sku}/regions' + url = self.list_by_sku.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'sku': self._serialize.url("sku", sku, 'str', max_length=50, min_length=1) @@ -101,3 +101,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_sku.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ServiceBus/sku/{sku}/regions'} diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/rules_operations.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/rules_operations.py index faba23f2cb7e..6d462efbf1a4 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/rules_operations.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/rules_operations.py @@ -21,7 +21,7 @@ class RulesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-04-01". """ @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self.config = config def list_by_subscriptions( - self, resource_group_name, namespace_name, topic_name, subscription_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, namespace_name, topic_name, subscription_name, skip=None, top=None, custom_headers=None, raw=False, **operation_config): """List all the rules within given topic-subscription. :param resource_group_name: Name of the Resource group within the @@ -49,6 +49,14 @@ def list_by_subscriptions( :type topic_name: str :param subscription_name: The subscription name. :type subscription_name: str + :param skip: Skip is only used if a previous operation returned a + partial result. If a previous response contains a nextLink element, + the value of the nextLink element will include a skip parameter that + specifies a starting point to use for subsequent calls. + :type skip: int + :param top: May be used to limit the number of results to the most + recent N usageDetails. + :type top: int :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -64,7 +72,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}/rules' + url = self.list_by_subscriptions.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), @@ -77,6 +85,10 @@ def internal_paging(next_link=None, raw=False): # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', maximum=1000, minimum=0) + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) else: url = next_link @@ -111,6 +123,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_subscriptions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}/rules'} def create_or_update( self, resource_group_name, namespace_name, topic_name, subscription_name, rule_name, parameters, custom_headers=None, raw=False, **operation_config): @@ -141,7 +154,7 @@ def create_or_update( :class:`ErrorResponseException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}/rules/{ruleName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), @@ -187,6 +200,7 @@ def create_or_update( return client_raw_response return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}/rules/{ruleName}'} def delete( self, resource_group_name, namespace_name, topic_name, subscription_name, rule_name, custom_headers=None, raw=False, **operation_config): @@ -214,7 +228,7 @@ def delete( :class:`ErrorResponseException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}/rules/{ruleName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), @@ -249,6 +263,7 @@ def delete( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}/rules/{ruleName}'} def get( self, resource_group_name, namespace_name, topic_name, subscription_name, rule_name, custom_headers=None, raw=False, **operation_config): @@ -277,7 +292,7 @@ def get( :class:`ErrorResponseException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}/rules/{ruleName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), @@ -319,3 +334,4 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}/rules/{ruleName}'} diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/subscriptions_operations.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/subscriptions_operations.py index 2def7d357e7a..5b9c8eefb42f 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/subscriptions_operations.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/subscriptions_operations.py @@ -21,7 +21,7 @@ class SubscriptionsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-04-01". """ @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self.config = config def list_by_topic( - self, resource_group_name, namespace_name, topic_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, namespace_name, topic_name, skip=None, top=None, custom_headers=None, raw=False, **operation_config): """List all the subscriptions under a specified topic. :param resource_group_name: Name of the Resource group within the @@ -47,6 +47,14 @@ def list_by_topic( :type namespace_name: str :param topic_name: The topic name. :type topic_name: str + :param skip: Skip is only used if a previous operation returned a + partial result. If a previous response contains a nextLink element, + the value of the nextLink element will include a skip parameter that + specifies a starting point to use for subsequent calls. + :type skip: int + :param top: May be used to limit the number of results to the most + recent N usageDetails. + :type top: int :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -62,7 +70,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions' + url = self.list_by_topic.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), @@ -74,6 +82,10 @@ def internal_paging(next_link=None, raw=False): # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', maximum=1000, minimum=0) + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) else: url = next_link @@ -108,6 +120,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_topic.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions'} def create_or_update( self, resource_group_name, namespace_name, topic_name, subscription_name, parameters, custom_headers=None, raw=False, **operation_config): @@ -137,7 +150,7 @@ def create_or_update( :class:`ErrorResponseException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), @@ -182,6 +195,7 @@ def create_or_update( return client_raw_response return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}'} def delete( self, resource_group_name, namespace_name, topic_name, subscription_name, custom_headers=None, raw=False, **operation_config): @@ -207,7 +221,7 @@ def delete( :class:`ErrorResponseException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), @@ -241,6 +255,7 @@ def delete( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}'} def get( self, resource_group_name, namespace_name, topic_name, subscription_name, custom_headers=None, raw=False, **operation_config): @@ -267,7 +282,7 @@ def get( :class:`ErrorResponseException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), @@ -308,3 +323,4 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}'} diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/topics_operations.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/topics_operations.py index 32454369fdab..40b3c5260a76 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/topics_operations.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/topics_operations.py @@ -21,7 +21,7 @@ class TopicsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-04-01". """ @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self.config = config def list_by_namespace( - self, resource_group_name, namespace_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, namespace_name, skip=None, top=None, custom_headers=None, raw=False, **operation_config): """Gets all the topics in a namespace. :param resource_group_name: Name of the Resource group within the @@ -45,6 +45,14 @@ def list_by_namespace( :type resource_group_name: str :param namespace_name: The namespace name :type namespace_name: str + :param skip: Skip is only used if a previous operation returned a + partial result. If a previous response contains a nextLink element, + the value of the nextLink element will include a skip parameter that + specifies a starting point to use for subsequent calls. + :type skip: int + :param top: May be used to limit the number of results to the most + recent N usageDetails. + :type top: int :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -60,7 +68,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics' + url = self.list_by_namespace.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), @@ -71,6 +79,10 @@ def internal_paging(next_link=None, raw=False): # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', maximum=1000, minimum=0) + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) else: url = next_link @@ -105,6 +117,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_namespace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics'} def create_or_update( self, resource_group_name, namespace_name, topic_name, parameters, custom_headers=None, raw=False, **operation_config): @@ -131,7 +144,7 @@ def create_or_update( :class:`ErrorResponseException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), @@ -175,6 +188,7 @@ def create_or_update( return client_raw_response return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}'} def delete( self, resource_group_name, namespace_name, topic_name, custom_headers=None, raw=False, **operation_config): @@ -198,7 +212,7 @@ def delete( :class:`ErrorResponseException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), @@ -231,6 +245,7 @@ def delete( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}'} def get( self, resource_group_name, namespace_name, topic_name, custom_headers=None, raw=False, **operation_config): @@ -255,7 +270,7 @@ def get( :class:`ErrorResponseException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), @@ -295,6 +310,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}'} def list_authorization_rules( self, resource_group_name, namespace_name, topic_name, custom_headers=None, raw=False, **operation_config): @@ -322,7 +338,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules' + url = self.list_authorization_rules.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), @@ -368,6 +384,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_authorization_rules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules'} def create_or_update_authorization_rule( self, resource_group_name, namespace_name, topic_name, authorization_rule_name, rights, custom_headers=None, raw=False, **operation_config): @@ -398,7 +415,7 @@ def create_or_update_authorization_rule( parameters = models.SBAuthorizationRule(rights=rights) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}' + url = self.create_or_update_authorization_rule.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), @@ -443,6 +460,7 @@ def create_or_update_authorization_rule( return client_raw_response return deserialized + create_or_update_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}'} def get_authorization_rule( self, resource_group_name, namespace_name, topic_name, authorization_rule_name, custom_headers=None, raw=False, **operation_config): @@ -469,7 +487,7 @@ def get_authorization_rule( :class:`ErrorResponseException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}' + url = self.get_authorization_rule.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), @@ -510,6 +528,7 @@ def get_authorization_rule( return client_raw_response return deserialized + get_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}'} def delete_authorization_rule( self, resource_group_name, namespace_name, topic_name, authorization_rule_name, custom_headers=None, raw=False, **operation_config): @@ -535,7 +554,7 @@ def delete_authorization_rule( :class:`ErrorResponseException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}' + url = self.delete_authorization_rule.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), @@ -569,6 +588,7 @@ def delete_authorization_rule( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response + delete_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}'} def list_keys( self, resource_group_name, namespace_name, topic_name, authorization_rule_name, custom_headers=None, raw=False, **operation_config): @@ -595,7 +615,7 @@ def list_keys( :class:`ErrorResponseException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}/ListKeys' + url = self.list_keys.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), @@ -636,6 +656,7 @@ def list_keys( return client_raw_response return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}/ListKeys'} def regenerate_keys( self, resource_group_name, namespace_name, topic_name, authorization_rule_name, key_type, key=None, custom_headers=None, raw=False, **operation_config): @@ -670,7 +691,7 @@ def regenerate_keys( parameters = models.RegenerateAccessKeyParameters(key_type=key_type, key=key) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}/regenerateKeys' + url = self.regenerate_keys.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), @@ -715,3 +736,4 @@ def regenerate_keys( return client_raw_response return deserialized + regenerate_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}/regenerateKeys'} diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/service_bus_management_client.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/service_bus_management_client.py index 8f6fb7cea887..2eb08c7d4baf 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/service_bus_management_client.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/service_bus_management_client.py @@ -9,13 +9,14 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import ServiceClient +from msrest.service_client import SDKClient from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION from .operations.operations import Operations from .operations.namespaces_operations import NamespacesOperations from .operations.disaster_recovery_configs_operations import DisasterRecoveryConfigsOperations +from .operations.migration_configs_operations import MigrationConfigsOperations from .operations.queues_operations import QueuesOperations from .operations.topics_operations import TopicsOperations from .operations.subscriptions_operations import SubscriptionsOperations @@ -60,7 +61,7 @@ def __init__( self.subscription_id = subscription_id -class ServiceBusManagementClient(object): +class ServiceBusManagementClient(SDKClient): """Azure Service Bus client :ivar config: Configuration for client. @@ -72,6 +73,8 @@ class ServiceBusManagementClient(object): :vartype namespaces: azure.mgmt.servicebus.operations.NamespacesOperations :ivar disaster_recovery_configs: DisasterRecoveryConfigs operations :vartype disaster_recovery_configs: azure.mgmt.servicebus.operations.DisasterRecoveryConfigsOperations + :ivar migration_configs: MigrationConfigs operations + :vartype migration_configs: azure.mgmt.servicebus.operations.MigrationConfigsOperations :ivar queues: Queues operations :vartype queues: azure.mgmt.servicebus.operations.QueuesOperations :ivar topics: Topics operations @@ -101,7 +104,7 @@ def __init__( self, credentials, subscription_id, base_url=None): self.config = ServiceBusManagementClientConfiguration(credentials, subscription_id, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + super(ServiceBusManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self.api_version = '2017-04-01' @@ -114,6 +117,8 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.disaster_recovery_configs = DisasterRecoveryConfigsOperations( self._client, self.config, self._serialize, self._deserialize) + self.migration_configs = MigrationConfigsOperations( + self._client, self.config, self._serialize, self._deserialize) self.queues = QueuesOperations( self._client, self.config, self._serialize, self._deserialize) self.topics = TopicsOperations( diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/version.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/version.py index e9983c0d8c01..266f5a486d79 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/version.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.4.1" +VERSION = "0.5.0" diff --git a/azure-mgmt-storage/azure/mgmt/storage/storage_management_client.py b/azure-mgmt-storage/azure/mgmt/storage/storage_management_client.py index 73de573d1aa2..85212d33086a 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/storage_management_client.py +++ b/azure-mgmt-storage/azure/mgmt/storage/storage_management_client.py @@ -116,6 +116,7 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2016-12-01: :mod:`v2016_12_01.models` * 2017-06-01: :mod:`v2017_06_01.models` * 2017-10-01: :mod:`v2017_10_01.models` + * 2018-02-01: :mod:`v2018_02_01.models` """ if api_version == '2015-06-15': from .v2015_06_15 import models @@ -132,20 +133,39 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2017-10-01': from .v2017_10_01 import models return models + elif api_version == '2018-02-01': + from .v2018_02_01 import models + return models raise NotImplementedError("APIVersion {} is not available".format(api_version)) + @property + def blob_containers(self): + """Instance depends on the API version: + + * 2018-02-01: :class:`BlobContainersOperations` + """ + api_version = self._get_api_version('blob_containers') + if api_version == '2018-02-01': + from .v2018_02_01.operations import BlobContainersOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property def operations(self): """Instance depends on the API version: * 2017-06-01: :class:`Operations` * 2017-10-01: :class:`Operations` + * 2018-02-01: :class:`Operations` """ api_version = self._get_api_version('operations') if api_version == '2017-06-01': from .v2017_06_01.operations import Operations as OperationClass elif api_version == '2017-10-01': from .v2017_10_01.operations import Operations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import Operations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -156,12 +176,15 @@ def skus(self): * 2017-06-01: :class:`SkusOperations` * 2017-10-01: :class:`SkusOperations` + * 2018-02-01: :class:`SkusOperations` """ api_version = self._get_api_version('skus') if api_version == '2017-06-01': from .v2017_06_01.operations import SkusOperations as OperationClass elif api_version == '2017-10-01': from .v2017_10_01.operations import SkusOperations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import SkusOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -175,6 +198,7 @@ def storage_accounts(self): * 2016-12-01: :class:`StorageAccountsOperations` * 2017-06-01: :class:`StorageAccountsOperations` * 2017-10-01: :class:`StorageAccountsOperations` + * 2018-02-01: :class:`StorageAccountsOperations` """ api_version = self._get_api_version('storage_accounts') if api_version == '2015-06-15': @@ -187,6 +211,8 @@ def storage_accounts(self): from .v2017_06_01.operations import StorageAccountsOperations as OperationClass elif api_version == '2017-10-01': from .v2017_10_01.operations import StorageAccountsOperations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import StorageAccountsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -200,6 +226,7 @@ def usage(self): * 2016-12-01: :class:`UsageOperations` * 2017-06-01: :class:`UsageOperations` * 2017-10-01: :class:`UsageOperations` + * 2018-02-01: :class:`UsageOperations` """ api_version = self._get_api_version('usage') if api_version == '2015-06-15': @@ -212,6 +239,8 @@ def usage(self): from .v2017_06_01.operations import UsageOperations as OperationClass elif api_version == '2017-10-01': from .v2017_10_01.operations import UsageOperations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import UsageOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/__init__.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/__init__.py index b5c48a6c0b8d..c3427e9e6690 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/__init__.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/__init__.py @@ -9,18 +9,32 @@ # regenerated. # -------------------------------------------------------------------------- -from .storage_account_check_name_availability_parameters import StorageAccountCheckNameAvailabilityParameters -from .check_name_availability_result import CheckNameAvailabilityResult -from .storage_account_create_parameters import StorageAccountCreateParameters -from .endpoints import Endpoints -from .custom_domain import CustomDomain -from .storage_account import StorageAccount -from .storage_account_keys import StorageAccountKeys -from .storage_account_update_parameters import StorageAccountUpdateParameters -from .storage_account_regenerate_key_parameters import StorageAccountRegenerateKeyParameters -from .usage_name import UsageName -from .usage import Usage -from .resource import Resource +try: + from .storage_account_check_name_availability_parameters_py3 import StorageAccountCheckNameAvailabilityParameters + from .check_name_availability_result_py3 import CheckNameAvailabilityResult + from .storage_account_create_parameters_py3 import StorageAccountCreateParameters + from .endpoints_py3 import Endpoints + from .custom_domain_py3 import CustomDomain + from .storage_account_py3 import StorageAccount + from .storage_account_keys_py3 import StorageAccountKeys + from .storage_account_update_parameters_py3 import StorageAccountUpdateParameters + from .storage_account_regenerate_key_parameters_py3 import StorageAccountRegenerateKeyParameters + from .usage_name_py3 import UsageName + from .usage_py3 import Usage + from .resource_py3 import Resource +except (SyntaxError, ImportError): + from .storage_account_check_name_availability_parameters import StorageAccountCheckNameAvailabilityParameters + from .check_name_availability_result import CheckNameAvailabilityResult + from .storage_account_create_parameters import StorageAccountCreateParameters + from .endpoints import Endpoints + from .custom_domain import CustomDomain + from .storage_account import StorageAccount + from .storage_account_keys import StorageAccountKeys + from .storage_account_update_parameters import StorageAccountUpdateParameters + from .storage_account_regenerate_key_parameters import StorageAccountRegenerateKeyParameters + from .usage_name import UsageName + from .usage import Usage + from .resource import Resource from .storage_account_paged import StorageAccountPaged from .usage_paged import UsagePaged from .storage_management_client_enums import ( diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/check_name_availability_result.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/check_name_availability_result.py index c838caff1250..1548dba81ccc 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/check_name_availability_result.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/check_name_availability_result.py @@ -34,8 +34,8 @@ class CheckNameAvailabilityResult(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self, name_available=None, reason=None, message=None): - super(CheckNameAvailabilityResult, self).__init__() - self.name_available = name_available - self.reason = reason - self.message = message + def __init__(self, **kwargs): + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = kwargs.get('name_available', None) + self.reason = kwargs.get('reason', None) + self.message = kwargs.get('message', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/check_name_availability_result_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/check_name_availability_result_py3.py new file mode 100644 index 000000000000..807be8e571c9 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/check_name_availability_result_py3.py @@ -0,0 +1,41 @@ +# 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 msrest.serialization import Model + + +class CheckNameAvailabilityResult(Model): + """The CheckNameAvailability operation response. + + :param name_available: Boolean value that indicates whether the name is + available for you to use. If true, the name is available. If false, the + name has already been taken or is invalid and cannot be used. + :type name_available: bool + :param reason: The reason that a storage account name could not be used. + The Reason element is only returned if NameAvailable is false. Possible + values include: 'AccountNameInvalid', 'AlreadyExists' + :type reason: str or ~azure.mgmt.storage.v2015_06_15.models.Reason + :param message: The error message explaining the Reason value in more + detail. + :type message: str + """ + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'Reason'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, name_available: bool=None, reason=None, message: str=None, **kwargs) -> None: + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = name_available + self.reason = reason + self.message = message diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/custom_domain.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/custom_domain.py index 539722b6bd8a..e3a9f56d4b47 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/custom_domain.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/custom_domain.py @@ -16,7 +16,9 @@ class CustomDomain(Model): """The custom domain assigned to this storage account. This can be set via Update. - :param name: The custom domain name. Name is the CNAME source. + All required parameters must be populated in order to send to Azure. + + :param name: Required. The custom domain name. Name is the CNAME source. :type name: str :param use_sub_domain: Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates @@ -32,7 +34,7 @@ class CustomDomain(Model): 'use_sub_domain': {'key': 'useSubDomain', 'type': 'bool'}, } - def __init__(self, name, use_sub_domain=None): - super(CustomDomain, self).__init__() - self.name = name - self.use_sub_domain = use_sub_domain + def __init__(self, **kwargs): + super(CustomDomain, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.use_sub_domain = kwargs.get('use_sub_domain', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/custom_domain_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/custom_domain_py3.py new file mode 100644 index 000000000000..c3fd9f4f47c3 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/custom_domain_py3.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class CustomDomain(Model): + """The custom domain assigned to this storage account. This can be set via + Update. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The custom domain name. Name is the CNAME source. + :type name: str + :param use_sub_domain: Indicates whether indirect CName validation is + enabled. Default value is false. This should only be set on updates + :type use_sub_domain: bool + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'use_sub_domain': {'key': 'useSubDomain', 'type': 'bool'}, + } + + def __init__(self, *, name: str, use_sub_domain: bool=None, **kwargs) -> None: + super(CustomDomain, self).__init__(**kwargs) + self.name = name + self.use_sub_domain = use_sub_domain diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/endpoints.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/endpoints.py index 551f4dbe241f..a79d2687f891 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/endpoints.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/endpoints.py @@ -33,9 +33,9 @@ class Endpoints(Model): 'file': {'key': 'file', 'type': 'str'}, } - def __init__(self, blob=None, queue=None, table=None, file=None): - super(Endpoints, self).__init__() - self.blob = blob - self.queue = queue - self.table = table - self.file = file + def __init__(self, **kwargs): + super(Endpoints, self).__init__(**kwargs) + self.blob = kwargs.get('blob', None) + self.queue = kwargs.get('queue', None) + self.table = kwargs.get('table', None) + self.file = kwargs.get('file', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/endpoints_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/endpoints_py3.py new file mode 100644 index 000000000000..f05bb4b0aec3 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/endpoints_py3.py @@ -0,0 +1,41 @@ +# 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 msrest.serialization import Model + + +class Endpoints(Model): + """The URIs that are used to perform a retrieval of a public blob, queue or + table object. + + :param blob: The blob endpoint. + :type blob: str + :param queue: The queue endpoint. + :type queue: str + :param table: The table endpoint. + :type table: str + :param file: The file endpoint. + :type file: str + """ + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'str'}, + 'queue': {'key': 'queue', 'type': 'str'}, + 'table': {'key': 'table', 'type': 'str'}, + 'file': {'key': 'file', 'type': 'str'}, + } + + def __init__(self, *, blob: str=None, queue: str=None, table: str=None, file: str=None, **kwargs) -> None: + super(Endpoints, self).__init__(**kwargs) + self.blob = blob + self.queue = queue + self.table = table + self.file = file diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/resource.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/resource.py index a07a187cbcd1..00300c71662b 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/resource.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/resource.py @@ -44,10 +44,10 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, location=None, tags=None): - super(Resource, self).__init__() + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.location = location - self.tags = tags + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/resource_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/resource_py3.py new file mode 100644 index 000000000000..bcd12774c0c9 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/resource_py3.py @@ -0,0 +1,53 @@ +# 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 msrest.serialization import Model + + +class Resource(Model): + """Describes a storage resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _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'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str=None, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account.py index fa1274d98042..93989a1a1871 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account.py @@ -104,16 +104,16 @@ class StorageAccount(Resource): 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, } - def __init__(self, location=None, tags=None, provisioning_state=None, account_type=None, primary_endpoints=None, primary_location=None, status_of_primary=None, last_geo_failover_time=None, secondary_location=None, status_of_secondary=None, creation_time=None, custom_domain=None, secondary_endpoints=None): - super(StorageAccount, self).__init__(location=location, tags=tags) - self.provisioning_state = provisioning_state - self.account_type = account_type - self.primary_endpoints = primary_endpoints - self.primary_location = primary_location - self.status_of_primary = status_of_primary - self.last_geo_failover_time = last_geo_failover_time - self.secondary_location = secondary_location - self.status_of_secondary = status_of_secondary - self.creation_time = creation_time - self.custom_domain = custom_domain - self.secondary_endpoints = secondary_endpoints + def __init__(self, **kwargs): + super(StorageAccount, self).__init__(**kwargs) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.account_type = kwargs.get('account_type', None) + self.primary_endpoints = kwargs.get('primary_endpoints', None) + self.primary_location = kwargs.get('primary_location', None) + self.status_of_primary = kwargs.get('status_of_primary', None) + self.last_geo_failover_time = kwargs.get('last_geo_failover_time', None) + self.secondary_location = kwargs.get('secondary_location', None) + self.status_of_secondary = kwargs.get('status_of_secondary', None) + self.creation_time = kwargs.get('creation_time', None) + self.custom_domain = kwargs.get('custom_domain', None) + self.secondary_endpoints = kwargs.get('secondary_endpoints', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_check_name_availability_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_check_name_availability_parameters.py index 545941f7142b..298a405533fe 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_check_name_availability_parameters.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_check_name_availability_parameters.py @@ -15,7 +15,9 @@ class StorageAccountCheckNameAvailabilityParameters(Model): """The parameters used to check the availabity of the storage account name. - :param name: + All required parameters must be populated in order to send to Azure. + + :param name: Required. :type name: str :param type: Default value: "Microsoft.Storage/storageAccounts" . :type type: str @@ -30,7 +32,7 @@ class StorageAccountCheckNameAvailabilityParameters(Model): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, name, type="Microsoft.Storage/storageAccounts"): - super(StorageAccountCheckNameAvailabilityParameters, self).__init__() - self.name = name - self.type = type + def __init__(self, **kwargs): + super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', "Microsoft.Storage/storageAccounts") diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_check_name_availability_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_check_name_availability_parameters_py3.py new file mode 100644 index 000000000000..db7cbf7521d5 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_check_name_availability_parameters_py3.py @@ -0,0 +1,38 @@ +# 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 msrest.serialization import Model + + +class StorageAccountCheckNameAvailabilityParameters(Model): + """The parameters used to check the availabity of the storage account name. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. + :type name: str + :param type: Default value: "Microsoft.Storage/storageAccounts" . + :type type: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, name: str, type: str="Microsoft.Storage/storageAccounts", **kwargs) -> None: + super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = name + self.type = type diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_create_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_create_parameters.py index 0a06e592b9ad..852d51b76294 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_create_parameters.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_create_parameters.py @@ -15,8 +15,10 @@ class StorageAccountCreateParameters(Model): """The parameters to provide for the account. - :param location: The location of the resource. This will be one of the - supported and registered Azure Geo Regions (e.g. West US, East US, + All required parameters must be populated in order to send to Azure. + + :param location: Required. The location of the resource. This will be one + of the supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource cannot be changed once it is created, but if an identical geo region is specified on update, the request will succeed. @@ -27,10 +29,10 @@ class StorageAccountCreateParameters(Model): must have a key with a length no greater than 128 characters and a value with a length no greater than 256 characters. :type tags: dict[str, str] - :param account_type: The sku name. Required for account creation; optional - for update. Note that in older versions, sku name was called accountType. - Possible values include: 'Standard_LRS', 'Standard_ZRS', 'Standard_GRS', - 'Standard_RAGRS', 'Premium_LRS' + :param account_type: Required. The sku name. Required for account + creation; optional for update. Note that in older versions, sku name was + called accountType. Possible values include: 'Standard_LRS', + 'Standard_ZRS', 'Standard_GRS', 'Standard_RAGRS', 'Premium_LRS' :type account_type: str or ~azure.mgmt.storage.v2015_06_15.models.AccountType """ @@ -46,8 +48,8 @@ class StorageAccountCreateParameters(Model): 'account_type': {'key': 'properties.accountType', 'type': 'AccountType'}, } - def __init__(self, location, account_type, tags=None): - super(StorageAccountCreateParameters, self).__init__() - self.location = location - self.tags = tags - self.account_type = account_type + def __init__(self, **kwargs): + super(StorageAccountCreateParameters, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.account_type = kwargs.get('account_type', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_create_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_create_parameters_py3.py new file mode 100644 index 000000000000..e90af5ec5564 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_create_parameters_py3.py @@ -0,0 +1,55 @@ +# 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 msrest.serialization import Model + + +class StorageAccountCreateParameters(Model): + """The parameters to provide for the account. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The location of the resource. This will be one + of the supported and registered Azure Geo Regions (e.g. West US, East US, + Southeast Asia, etc.). The geo region of a resource cannot be changed once + it is created, but if an identical geo region is specified on update, the + request will succeed. + :type location: str + :param tags: A list of key value pairs that describe the resource. These + tags can be used for viewing and grouping this resource (across resource + groups). A maximum of 15 tags can be provided for a resource. Each tag + must have a key with a length no greater than 128 characters and a value + with a length no greater than 256 characters. + :type tags: dict[str, str] + :param account_type: Required. The sku name. Required for account + creation; optional for update. Note that in older versions, sku name was + called accountType. Possible values include: 'Standard_LRS', + 'Standard_ZRS', 'Standard_GRS', 'Standard_RAGRS', 'Premium_LRS' + :type account_type: str or + ~azure.mgmt.storage.v2015_06_15.models.AccountType + """ + + _validation = { + 'location': {'required': True}, + 'account_type': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'account_type': {'key': 'properties.accountType', 'type': 'AccountType'}, + } + + def __init__(self, *, location: str, account_type, tags=None, **kwargs) -> None: + super(StorageAccountCreateParameters, self).__init__(**kwargs) + self.location = location + self.tags = tags + self.account_type = account_type diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_keys.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_keys.py index bfe8dec89d80..8bf214b2625a 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_keys.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_keys.py @@ -26,7 +26,7 @@ class StorageAccountKeys(Model): 'key2': {'key': 'key2', 'type': 'str'}, } - def __init__(self, key1=None, key2=None): - super(StorageAccountKeys, self).__init__() - self.key1 = key1 - self.key2 = key2 + def __init__(self, **kwargs): + super(StorageAccountKeys, self).__init__(**kwargs) + self.key1 = kwargs.get('key1', None) + self.key2 = kwargs.get('key2', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_keys_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_keys_py3.py new file mode 100644 index 000000000000..34d336be577d --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_keys_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class StorageAccountKeys(Model): + """The access keys for the storage account. + + :param key1: The value of key 1. + :type key1: str + :param key2: The value of key 2. + :type key2: str + """ + + _attribute_map = { + 'key1': {'key': 'key1', 'type': 'str'}, + 'key2': {'key': 'key2', 'type': 'str'}, + } + + def __init__(self, *, key1: str=None, key2: str=None, **kwargs) -> None: + super(StorageAccountKeys, self).__init__(**kwargs) + self.key1 = key1 + self.key2 = key2 diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_py3.py new file mode 100644 index 000000000000..d36495a29fc7 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_py3.py @@ -0,0 +1,119 @@ +# 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 .resource import Resource + + +class StorageAccount(Resource): + """The storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param provisioning_state: The status of the storage account at the time + the operation was called. Possible values include: 'Creating', + 'ResolvingDNS', 'Succeeded' + :type provisioning_state: str or + ~azure.mgmt.storage.v2015_06_15.models.ProvisioningState + :param account_type: The type of the storage account. Possible values + include: 'Standard_LRS', 'Standard_ZRS', 'Standard_GRS', 'Standard_RAGRS', + 'Premium_LRS' + :type account_type: str or + ~azure.mgmt.storage.v2015_06_15.models.AccountType + :param primary_endpoints: The URLs that are used to perform a retrieval of + a public blob, queue, or table object. Note that Standard_ZRS and + Premium_LRS accounts only return the blob endpoint. + :type primary_endpoints: ~azure.mgmt.storage.v2015_06_15.models.Endpoints + :param primary_location: The location of the primary data center for the + storage account. + :type primary_location: str + :param status_of_primary: The status indicating whether the primary + location of the storage account is available or unavailable. Possible + values include: 'Available', 'Unavailable' + :type status_of_primary: str or + ~azure.mgmt.storage.v2015_06_15.models.AccountStatus + :param last_geo_failover_time: The timestamp of the most recent instance + of a failover to the secondary location. Only the most recent timestamp is + retained. This element is not returned if there has never been a failover + instance. Only available if the accountType is Standard_GRS or + Standard_RAGRS. + :type last_geo_failover_time: datetime + :param secondary_location: The location of the geo-replicated secondary + for the storage account. Only available if the accountType is Standard_GRS + or Standard_RAGRS. + :type secondary_location: str + :param status_of_secondary: The status indicating whether the secondary + location of the storage account is available or unavailable. Only + available if the SKU name is Standard_GRS or Standard_RAGRS. Possible + values include: 'Available', 'Unavailable' + :type status_of_secondary: str or + ~azure.mgmt.storage.v2015_06_15.models.AccountStatus + :param creation_time: The creation date and time of the storage account in + UTC. + :type creation_time: datetime + :param custom_domain: The custom domain the user assigned to this storage + account. + :type custom_domain: ~azure.mgmt.storage.v2015_06_15.models.CustomDomain + :param secondary_endpoints: The URLs that are used to perform a retrieval + of a public blob, queue, or table object from the secondary location of + the storage account. Only available if the SKU name is Standard_RAGRS. + :type secondary_endpoints: + ~azure.mgmt.storage.v2015_06_15.models.Endpoints + """ + + _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'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, + 'account_type': {'key': 'properties.accountType', 'type': 'AccountType'}, + 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, + 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, + 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'AccountStatus'}, + 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, + 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, + 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'AccountStatus'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, + } + + def __init__(self, *, location: str=None, tags=None, provisioning_state=None, account_type=None, primary_endpoints=None, primary_location: str=None, status_of_primary=None, last_geo_failover_time=None, secondary_location: str=None, status_of_secondary=None, creation_time=None, custom_domain=None, secondary_endpoints=None, **kwargs) -> None: + super(StorageAccount, self).__init__(location=location, tags=tags, **kwargs) + self.provisioning_state = provisioning_state + self.account_type = account_type + self.primary_endpoints = primary_endpoints + self.primary_location = primary_location + self.status_of_primary = status_of_primary + self.last_geo_failover_time = last_geo_failover_time + self.secondary_location = secondary_location + self.status_of_secondary = status_of_secondary + self.creation_time = creation_time + self.custom_domain = custom_domain + self.secondary_endpoints = secondary_endpoints diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_regenerate_key_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_regenerate_key_parameters.py index 84c9188dc0a6..2c7a28c67fcb 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_regenerate_key_parameters.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_regenerate_key_parameters.py @@ -15,7 +15,9 @@ class StorageAccountRegenerateKeyParameters(Model): """The parameters used to regenerate the storage account key. - :param key_name: + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. :type key_name: str """ @@ -27,6 +29,6 @@ class StorageAccountRegenerateKeyParameters(Model): 'key_name': {'key': 'keyName', 'type': 'str'}, } - def __init__(self, key_name): - super(StorageAccountRegenerateKeyParameters, self).__init__() - self.key_name = key_name + def __init__(self, **kwargs): + super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) + self.key_name = kwargs.get('key_name', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_regenerate_key_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_regenerate_key_parameters_py3.py new file mode 100644 index 000000000000..7db8cb2a22c8 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_regenerate_key_parameters_py3.py @@ -0,0 +1,34 @@ +# 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 msrest.serialization import Model + + +class StorageAccountRegenerateKeyParameters(Model): + """The parameters used to regenerate the storage account key. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. + :type key_name: str + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, *, key_name: str, **kwargs) -> None: + super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) + self.key_name = key_name diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_update_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_update_parameters.py index dd7c07a3e7c7..fe75ca2c19d7 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_update_parameters.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_update_parameters.py @@ -37,8 +37,8 @@ class StorageAccountUpdateParameters(Model): 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, } - def __init__(self, tags=None, account_type=None, custom_domain=None): - super(StorageAccountUpdateParameters, self).__init__() - self.tags = tags - self.account_type = account_type - self.custom_domain = custom_domain + def __init__(self, **kwargs): + super(StorageAccountUpdateParameters, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.account_type = kwargs.get('account_type', None) + self.custom_domain = kwargs.get('custom_domain', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_update_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_update_parameters_py3.py new file mode 100644 index 000000000000..209bbe72a289 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_update_parameters_py3.py @@ -0,0 +1,44 @@ +# 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 msrest.serialization import Model + + +class StorageAccountUpdateParameters(Model): + """The parameters to update on the account. + + :param tags: Resource tags + :type tags: dict[str, str] + :param account_type: The account type. Note that StandardZRS and + PremiumLRS accounts cannot be changed to other account types, and other + account types cannot be changed to StandardZRS or PremiumLRS. Possible + values include: 'Standard_LRS', 'Standard_ZRS', 'Standard_GRS', + 'Standard_RAGRS', 'Premium_LRS' + :type account_type: str or + ~azure.mgmt.storage.v2015_06_15.models.AccountType + :param custom_domain: User domain assigned to the storage account. Name is + the CNAME source. Only one custom domain is supported per storage account + at this time. To clear the existing custom domain, use an empty string for + the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2015_06_15.models.CustomDomain + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'account_type': {'key': 'properties.accountType', 'type': 'AccountType'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + } + + def __init__(self, *, tags=None, account_type=None, custom_domain=None, **kwargs) -> None: + super(StorageAccountUpdateParameters, self).__init__(**kwargs) + self.tags = tags + self.account_type = account_type + self.custom_domain = custom_domain diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_management_client_enums.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_management_client_enums.py index 658b97b944f0..1dcc79636a1c 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_management_client_enums.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_management_client_enums.py @@ -12,13 +12,13 @@ from enum import Enum -class Reason(Enum): +class Reason(str, Enum): account_name_invalid = "AccountNameInvalid" already_exists = "AlreadyExists" -class AccountType(Enum): +class AccountType(str, Enum): standard_lrs = "Standard_LRS" standard_zrs = "Standard_ZRS" @@ -27,20 +27,20 @@ class AccountType(Enum): premium_lrs = "Premium_LRS" -class ProvisioningState(Enum): +class ProvisioningState(str, Enum): creating = "Creating" resolving_dns = "ResolvingDNS" succeeded = "Succeeded" -class AccountStatus(Enum): +class AccountStatus(str, Enum): available = "Available" unavailable = "Unavailable" -class UsageUnit(Enum): +class UsageUnit(str, Enum): count = "Count" bytes = "Bytes" diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/usage.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/usage.py index 20fce4915404..ccf7c87a712a 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/usage.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/usage.py @@ -15,16 +15,19 @@ class Usage(Model): """Describes Storage Resource Usage. - :param unit: The unit of measurement. Possible values include: 'Count', - 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', 'BytesPerSecond' + All required parameters must be populated in order to send to Azure. + + :param unit: Required. The unit of measurement. Possible values include: + 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', + 'BytesPerSecond' :type unit: str or ~azure.mgmt.storage.v2015_06_15.models.UsageUnit - :param current_value: The current count of the allocated resources in the - subscription. + :param current_value: Required. The current count of the allocated + resources in the subscription. :type current_value: int - :param limit: The maximum count of the resources that can be allocated in - the subscription. + :param limit: Required. The maximum count of the resources that can be + allocated in the subscription. :type limit: int - :param name: The name of the type of usage. + :param name: Required. The name of the type of usage. :type name: ~azure.mgmt.storage.v2015_06_15.models.UsageName """ @@ -42,9 +45,9 @@ class Usage(Model): 'name': {'key': 'name', 'type': 'UsageName'}, } - def __init__(self, unit, current_value, limit, name): - super(Usage, self).__init__() - self.unit = unit - self.current_value = current_value - self.limit = limit - self.name = name + def __init__(self, **kwargs): + super(Usage, self).__init__(**kwargs) + self.unit = kwargs.get('unit', None) + self.current_value = kwargs.get('current_value', None) + self.limit = kwargs.get('limit', None) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/usage_name.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/usage_name.py index 4349a2459bd0..1c1c30fcd44f 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/usage_name.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/usage_name.py @@ -26,7 +26,7 @@ class UsageName(Model): 'localized_value': {'key': 'localizedValue', 'type': 'str'}, } - def __init__(self, value=None, localized_value=None): - super(UsageName, self).__init__() - self.value = value - self.localized_value = localized_value + def __init__(self, **kwargs): + super(UsageName, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.localized_value = kwargs.get('localized_value', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/usage_name_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/usage_name_py3.py new file mode 100644 index 000000000000..f6177205032b --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/usage_name_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class UsageName(Model): + """The Usage Names. + + :param value: A string describing the resource name. + :type value: str + :param localized_value: A localized string describing the resource name. + :type localized_value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, *, value: str=None, localized_value: str=None, **kwargs) -> None: + super(UsageName, self).__init__(**kwargs) + self.value = value + self.localized_value = localized_value diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/usage_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/usage_py3.py new file mode 100644 index 000000000000..2f833b9c55bb --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/usage_py3.py @@ -0,0 +1,53 @@ +# 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 msrest.serialization import Model + + +class Usage(Model): + """Describes Storage Resource Usage. + + All required parameters must be populated in order to send to Azure. + + :param unit: Required. The unit of measurement. Possible values include: + 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', + 'BytesPerSecond' + :type unit: str or ~azure.mgmt.storage.v2015_06_15.models.UsageUnit + :param current_value: Required. The current count of the allocated + resources in the subscription. + :type current_value: int + :param limit: Required. The maximum count of the resources that can be + allocated in the subscription. + :type limit: int + :param name: Required. The name of the type of usage. + :type name: ~azure.mgmt.storage.v2015_06_15.models.UsageName + """ + + _validation = { + 'unit': {'required': True}, + 'current_value': {'required': True}, + 'limit': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'UsageUnit'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + def __init__(self, *, unit, current_value: int, limit: int, name, **kwargs) -> None: + super(Usage, self).__init__(**kwargs) + self.unit = unit + self.current_value = current_value + self.limit = limit + self.name = name diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/operations/storage_accounts_operations.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/operations/storage_accounts_operations.py index b28840ee5972..b74fb3f18808 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/operations/storage_accounts_operations.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/operations/storage_accounts_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class StorageAccountsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2015-06-15". """ @@ -62,7 +62,7 @@ def check_name_availability( account_name = models.StorageAccountCheckNameAvailabilityParameters(name=name, type=type) # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability' + url = self.check_name_availability.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -105,12 +105,13 @@ def check_name_availability( return client_raw_response return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability'} def _create_initial( self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}' + url = self.create.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -157,7 +158,7 @@ def _create_initial( return deserialized def create( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties @@ -176,13 +177,16 @@ def create( :type parameters: ~azure.mgmt.storage.v2015_06_15.models.StorageAccountCreateParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - StorageAccount or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns StorageAccount or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.storage.v2015_06_15.models.StorageAccount] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.storage.v2015_06_15.models.StorageAccount]] :raises: :class:`CloudError` """ raw_result = self._create_initial( @@ -193,30 +197,8 @@ def create( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('StorageAccount', response) if raw: @@ -225,12 +207,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} def delete( self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): @@ -253,7 +237,7 @@ def delete( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -287,6 +271,7 @@ def delete( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} def get_properties( self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): @@ -312,7 +297,7 @@ def get_properties( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}' + url = self.get_properties.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -353,6 +338,7 @@ def get_properties( return client_raw_response return deserialized + get_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} def update( self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): @@ -388,7 +374,7 @@ def update( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}' + url = self.update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -433,6 +419,7 @@ def update( return client_raw_response return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} def list( self, custom_headers=None, raw=False, **operation_config): @@ -454,7 +441,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -499,6 +486,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts'} def list_by_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -523,7 +511,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts' + url = self.list_by_resource_group.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -569,6 +557,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts'} def list_keys( self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): @@ -592,7 +581,7 @@ def list_keys( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys' + url = self.list_keys.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -633,6 +622,7 @@ def list_keys( return client_raw_response return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys'} def regenerate_key( self, resource_group_name, account_name, key_name, custom_headers=None, raw=False, **operation_config): @@ -660,7 +650,7 @@ def regenerate_key( regenerate_key1 = models.StorageAccountRegenerateKeyParameters(key_name=key_name) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey' + url = self.regenerate_key.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -705,3 +695,4 @@ def regenerate_key( return client_raw_response return deserialized + regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey'} diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/operations/usage_operations.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/operations/usage_operations.py index d48030dca417..06a094462479 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/operations/usage_operations.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/operations/usage_operations.py @@ -22,7 +22,7 @@ class UsageOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2015-06-15". """ @@ -56,7 +56,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -101,3 +101,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages'} diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/storage_management_client.py b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/storage_management_client.py index 05158a4b7e37..650b2da7afd5 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/storage_management_client.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/storage_management_client.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import ServiceClient +from msrest.service_client import SDKClient from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION @@ -52,7 +52,7 @@ def __init__( self.subscription_id = subscription_id -class StorageManagementClient(object): +class StorageManagementClient(SDKClient): """The Azure Storage Management API. :ivar config: Configuration for client. @@ -77,7 +77,7 @@ def __init__( self, credentials, subscription_id, base_url=None): self.config = StorageManagementClientConfiguration(credentials, subscription_id, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + super(StorageManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self.api_version = '2015-06-15' diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/__init__.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/__init__.py index 52e83798962c..75c1e72f7e5a 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/__init__.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/__init__.py @@ -9,23 +9,42 @@ # regenerated. # -------------------------------------------------------------------------- -from .storage_account_check_name_availability_parameters import StorageAccountCheckNameAvailabilityParameters -from .check_name_availability_result import CheckNameAvailabilityResult -from .sku import Sku -from .custom_domain import CustomDomain -from .encryption_service import EncryptionService -from .encryption_services import EncryptionServices -from .encryption import Encryption -from .storage_account_create_parameters import StorageAccountCreateParameters -from .endpoints import Endpoints -from .storage_account import StorageAccount -from .storage_account_key import StorageAccountKey -from .storage_account_list_keys_result import StorageAccountListKeysResult -from .storage_account_regenerate_key_parameters import StorageAccountRegenerateKeyParameters -from .storage_account_update_parameters import StorageAccountUpdateParameters -from .usage_name import UsageName -from .usage import Usage -from .resource import Resource +try: + from .storage_account_check_name_availability_parameters_py3 import StorageAccountCheckNameAvailabilityParameters + from .check_name_availability_result_py3 import CheckNameAvailabilityResult + from .sku_py3 import Sku + from .custom_domain_py3 import CustomDomain + from .encryption_service_py3 import EncryptionService + from .encryption_services_py3 import EncryptionServices + from .encryption_py3 import Encryption + from .storage_account_create_parameters_py3 import StorageAccountCreateParameters + from .endpoints_py3 import Endpoints + from .storage_account_py3 import StorageAccount + from .storage_account_key_py3 import StorageAccountKey + from .storage_account_list_keys_result_py3 import StorageAccountListKeysResult + from .storage_account_regenerate_key_parameters_py3 import StorageAccountRegenerateKeyParameters + from .storage_account_update_parameters_py3 import StorageAccountUpdateParameters + from .usage_name_py3 import UsageName + from .usage_py3 import Usage + from .resource_py3 import Resource +except (SyntaxError, ImportError): + from .storage_account_check_name_availability_parameters import StorageAccountCheckNameAvailabilityParameters + from .check_name_availability_result import CheckNameAvailabilityResult + from .sku import Sku + from .custom_domain import CustomDomain + from .encryption_service import EncryptionService + from .encryption_services import EncryptionServices + from .encryption import Encryption + from .storage_account_create_parameters import StorageAccountCreateParameters + from .endpoints import Endpoints + from .storage_account import StorageAccount + from .storage_account_key import StorageAccountKey + from .storage_account_list_keys_result import StorageAccountListKeysResult + from .storage_account_regenerate_key_parameters import StorageAccountRegenerateKeyParameters + from .storage_account_update_parameters import StorageAccountUpdateParameters + from .usage_name import UsageName + from .usage import Usage + from .resource import Resource from .storage_account_paged import StorageAccountPaged from .usage_paged import UsagePaged from .storage_management_client_enums import ( diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/check_name_availability_result.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/check_name_availability_result.py index 209d08f2b4fa..607746dcc9c6 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/check_name_availability_result.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/check_name_availability_result.py @@ -43,8 +43,8 @@ class CheckNameAvailabilityResult(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self): - super(CheckNameAvailabilityResult, self).__init__() + def __init__(self, **kwargs): + super(CheckNameAvailabilityResult, self).__init__(**kwargs) self.name_available = None self.reason = None self.message = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/check_name_availability_result_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/check_name_availability_result_py3.py new file mode 100644 index 000000000000..1097df019f89 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/check_name_availability_result_py3.py @@ -0,0 +1,50 @@ +# 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 msrest.serialization import Model + + +class CheckNameAvailabilityResult(Model): + """The CheckNameAvailability operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name_available: Gets a boolean value that indicates whether the name + is available for you to use. If true, the name is available. If false, the + name has already been taken or is invalid and cannot be used. + :vartype name_available: bool + :ivar reason: Gets the reason that a storage account name could not be + used. The Reason element is only returned if NameAvailable is false. + Possible values include: 'AccountNameInvalid', 'AlreadyExists' + :vartype reason: str or ~azure.mgmt.storage.v2016_01_01.models.Reason + :ivar message: Gets an error message explaining the Reason value in more + detail. + :vartype message: str + """ + + _validation = { + 'name_available': {'readonly': True}, + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'Reason'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = None + self.reason = None + self.message = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/custom_domain.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/custom_domain.py index 12b0f7691888..585480d7321a 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/custom_domain.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/custom_domain.py @@ -16,8 +16,10 @@ class CustomDomain(Model): """The custom domain assigned to this storage account. This can be set via Update. - :param name: Gets or sets the custom domain name assigned to the storage - account. Name is the CNAME source. + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the custom domain name assigned to the + storage account. Name is the CNAME source. :type name: str :param use_sub_domain: Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. @@ -33,7 +35,7 @@ class CustomDomain(Model): 'use_sub_domain': {'key': 'useSubDomain', 'type': 'bool'}, } - def __init__(self, name, use_sub_domain=None): - super(CustomDomain, self).__init__() - self.name = name - self.use_sub_domain = use_sub_domain + def __init__(self, **kwargs): + super(CustomDomain, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.use_sub_domain = kwargs.get('use_sub_domain', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/custom_domain_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/custom_domain_py3.py new file mode 100644 index 000000000000..4c6fe3f83e35 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/custom_domain_py3.py @@ -0,0 +1,41 @@ +# 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 msrest.serialization import Model + + +class CustomDomain(Model): + """The custom domain assigned to this storage account. This can be set via + Update. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the custom domain name assigned to the + storage account. Name is the CNAME source. + :type name: str + :param use_sub_domain: Indicates whether indirect CName validation is + enabled. Default value is false. This should only be set on updates. + :type use_sub_domain: bool + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'use_sub_domain': {'key': 'useSubDomain', 'type': 'bool'}, + } + + def __init__(self, *, name: str, use_sub_domain: bool=None, **kwargs) -> None: + super(CustomDomain, self).__init__(**kwargs) + self.name = name + self.use_sub_domain = use_sub_domain diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption.py index cae23af7bca8..c46481adbbc4 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption.py @@ -18,11 +18,13 @@ class Encryption(Model): 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 Azure. + :param services: List of services which support encryption. :type services: ~azure.mgmt.storage.v2016_01_01.models.EncryptionServices - :ivar key_source: The encryption keySource (provider). Possible values - (case-insensitive): Microsoft.Storage. Default value: "Microsoft.Storage" - . + :ivar key_source: Required. The encryption keySource (provider). Possible + values (case-insensitive): Microsoft.Storage. Default value: + "Microsoft.Storage" . :vartype key_source: str """ @@ -37,6 +39,6 @@ class Encryption(Model): key_source = "Microsoft.Storage" - def __init__(self, services=None): - super(Encryption, self).__init__() - self.services = services + def __init__(self, **kwargs): + super(Encryption, self).__init__(**kwargs) + self.services = kwargs.get('services', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption_py3.py new file mode 100644 index 000000000000..383fa5043505 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption_py3.py @@ -0,0 +1,44 @@ +# 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 msrest.serialization import Model + + +class Encryption(Model): + """The encryption settings on the storage account. + + 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 Azure. + + :param services: List of services which support encryption. + :type services: ~azure.mgmt.storage.v2016_01_01.models.EncryptionServices + :ivar key_source: Required. The encryption keySource (provider). Possible + values (case-insensitive): Microsoft.Storage. Default value: + "Microsoft.Storage" . + :vartype key_source: str + """ + + _validation = { + 'key_source': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'services': {'key': 'services', 'type': 'EncryptionServices'}, + 'key_source': {'key': 'keySource', 'type': 'str'}, + } + + key_source = "Microsoft.Storage" + + def __init__(self, *, services=None, **kwargs) -> None: + super(Encryption, self).__init__(**kwargs) + self.services = services diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption_service.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption_service.py index 0e033e9fe4a8..3a020c468f64 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption_service.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption_service.py @@ -37,7 +37,7 @@ class EncryptionService(Model): 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, } - def __init__(self, enabled=None): - super(EncryptionService, self).__init__() - self.enabled = enabled + def __init__(self, **kwargs): + super(EncryptionService, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) self.last_enabled_time = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption_service_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption_service_py3.py new file mode 100644 index 000000000000..0566050c6155 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption_service_py3.py @@ -0,0 +1,43 @@ +# 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 msrest.serialization import Model + + +class EncryptionService(Model): + """A service that allows server-side encryption to be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param enabled: A boolean indicating whether or not the service encrypts + the data as it is stored. + :type enabled: bool + :ivar last_enabled_time: Gets a rough estimate of the date/time when the + encryption was last enabled by the user. Only returned when encryption is + enabled. There might be some unencrypted blobs which were written after + this time, as it is just a rough estimate. + :vartype last_enabled_time: datetime + """ + + _validation = { + 'last_enabled_time': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, + } + + def __init__(self, *, enabled: bool=None, **kwargs) -> None: + super(EncryptionService, self).__init__(**kwargs) + self.enabled = enabled + self.last_enabled_time = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption_services.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption_services.py index a8a53be357fd..3a4b4220b30c 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption_services.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption_services.py @@ -23,6 +23,6 @@ class EncryptionServices(Model): 'blob': {'key': 'blob', 'type': 'EncryptionService'}, } - def __init__(self, blob=None): - super(EncryptionServices, self).__init__() - self.blob = blob + def __init__(self, **kwargs): + super(EncryptionServices, self).__init__(**kwargs) + self.blob = kwargs.get('blob', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption_services_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption_services_py3.py new file mode 100644 index 000000000000..f532ee943c44 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption_services_py3.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class EncryptionServices(Model): + """A list of services that support encryption. + + :param blob: The encryption function of the blob storage service. + :type blob: ~azure.mgmt.storage.v2016_01_01.models.EncryptionService + """ + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'EncryptionService'}, + } + + def __init__(self, *, blob=None, **kwargs) -> None: + super(EncryptionServices, self).__init__(**kwargs) + self.blob = blob diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/endpoints.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/endpoints.py index 2524757f961f..ec345fceac47 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/endpoints.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/endpoints.py @@ -43,8 +43,8 @@ class Endpoints(Model): 'file': {'key': 'file', 'type': 'str'}, } - def __init__(self): - super(Endpoints, self).__init__() + def __init__(self, **kwargs): + super(Endpoints, self).__init__(**kwargs) self.blob = None self.queue = None self.table = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/endpoints_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/endpoints_py3.py new file mode 100644 index 000000000000..a186e9c8d6a9 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/endpoints_py3.py @@ -0,0 +1,51 @@ +# 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 msrest.serialization import Model + + +class Endpoints(Model): + """The URIs that are used to perform a retrieval of a public blob, queue, or + table object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar blob: Gets the blob endpoint. + :vartype blob: str + :ivar queue: Gets the queue endpoint. + :vartype queue: str + :ivar table: Gets the table endpoint. + :vartype table: str + :ivar file: Gets the file endpoint. + :vartype file: str + """ + + _validation = { + 'blob': {'readonly': True}, + 'queue': {'readonly': True}, + 'table': {'readonly': True}, + 'file': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'str'}, + 'queue': {'key': 'queue', 'type': 'str'}, + 'table': {'key': 'table', 'type': 'str'}, + 'file': {'key': 'file', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Endpoints, self).__init__(**kwargs) + self.blob = None + self.queue = None + self.table = None + self.file = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/resource.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/resource.py index 3902a130aaa3..507c1d65d1f1 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/resource.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/resource.py @@ -45,10 +45,10 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, location=None, tags=None): - super(Resource, self).__init__() + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.location = location - self.tags = tags + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/resource_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/resource_py3.py new file mode 100644 index 000000000000..5ac41076732b --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/resource_py3.py @@ -0,0 +1,54 @@ +# 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 msrest.serialization import Model + + +class Resource(Model): + """Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Tags assigned to a resource; can be used for viewing and + grouping a resource (across resource groups). + :type tags: dict[str, str] + """ + + _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'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str=None, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/sku.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/sku.py index a2a9dd517afa..7c56ee2a4425 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/sku.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/sku.py @@ -18,10 +18,12 @@ class Sku(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param name: Gets or sets the sku name. Required for account creation; - optional for update. Note that in older versions, sku name was called - accountType. Possible values include: 'Standard_LRS', 'Standard_GRS', - 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the sku name. Required for account + creation; optional for update. Note that in older versions, sku name was + called accountType. Possible values include: 'Standard_LRS', + 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' :type name: str or ~azure.mgmt.storage.v2016_01_01.models.SkuName :ivar tier: Gets the sku tier. This is based on the SKU name. Possible values include: 'Standard', 'Premium' @@ -38,7 +40,7 @@ class Sku(Model): 'tier': {'key': 'tier', 'type': 'SkuTier'}, } - def __init__(self, name): - super(Sku, self).__init__() - self.name = name + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) self.tier = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/sku_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/sku_py3.py new file mode 100644 index 000000000000..af05828327a9 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/sku_py3.py @@ -0,0 +1,46 @@ +# 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 msrest.serialization import Model + + +class Sku(Model): + """The SKU of the storage account. + + 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 Azure. + + :param name: Required. Gets or sets the sku name. Required for account + creation; optional for update. Note that in older versions, sku name was + called accountType. Possible values include: 'Standard_LRS', + 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' + :type name: str or ~azure.mgmt.storage.v2016_01_01.models.SkuName + :ivar tier: Gets the sku tier. This is based on the SKU name. Possible + values include: 'Standard', 'Premium' + :vartype tier: str or ~azure.mgmt.storage.v2016_01_01.models.SkuTier + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'SkuName'}, + 'tier': {'key': 'tier', 'type': 'SkuTier'}, + } + + def __init__(self, *, name, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account.py index 221371702832..12960dd593c2 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account.py @@ -132,8 +132,8 @@ class StorageAccount(Resource): 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, } - def __init__(self, location=None, tags=None): - super(StorageAccount, self).__init__(location=location, tags=tags) + def __init__(self, **kwargs): + super(StorageAccount, self).__init__(**kwargs) self.sku = None self.kind = None self.provisioning_state = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_check_name_availability_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_check_name_availability_parameters.py index 407c69e144c1..9a2d8ca2606d 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_check_name_availability_parameters.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_check_name_availability_parameters.py @@ -18,9 +18,12 @@ class StorageAccountCheckNameAvailabilityParameters(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param name: + All required parameters must be populated in order to send to Azure. + + :param name: Required. :type name: str - :ivar type: Default value: "Microsoft.Storage/storageAccounts" . + :ivar type: Required. Default value: "Microsoft.Storage/storageAccounts" + . :vartype type: str """ @@ -36,6 +39,6 @@ class StorageAccountCheckNameAvailabilityParameters(Model): type = "Microsoft.Storage/storageAccounts" - def __init__(self, name): - super(StorageAccountCheckNameAvailabilityParameters, self).__init__() - self.name = name + def __init__(self, **kwargs): + super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_check_name_availability_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_check_name_availability_parameters_py3.py new file mode 100644 index 000000000000..18b651d829cf --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_check_name_availability_parameters_py3.py @@ -0,0 +1,44 @@ +# 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 msrest.serialization import Model + + +class StorageAccountCheckNameAvailabilityParameters(Model): + """StorageAccountCheckNameAvailabilityParameters. + + 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 Azure. + + :param name: Required. + :type name: str + :ivar type: Required. Default value: "Microsoft.Storage/storageAccounts" + . + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.Storage/storageAccounts" + + def __init__(self, *, name: str, **kwargs) -> None: + super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = name diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_create_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_create_parameters.py index ab1ce4ea064d..288c7841a3e4 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_create_parameters.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_create_parameters.py @@ -15,16 +15,18 @@ class StorageAccountCreateParameters(Model): """The parameters used when creating a storage account. - :param sku: Required. Gets or sets the sku name. + All required parameters must be populated in order to send to Azure. + + :param sku: Required. Required. Gets or sets the sku name. :type sku: ~azure.mgmt.storage.v2016_01_01.models.Sku - :param kind: Required. Indicates the type of storage account. Possible - values include: 'Storage', 'BlobStorage' + :param kind: Required. Required. Indicates the type of storage account. + Possible values include: 'Storage', 'BlobStorage' :type kind: str or ~azure.mgmt.storage.v2016_01_01.models.Kind - :param location: Required. Gets or sets the location of the resource. This - will be one of the supported and registered Azure Geo Regions (e.g. West - US, East US, Southeast Asia, etc.). The geo region of a resource cannot be - changed once it is created, but if an identical geo region is specified on - update, the request will succeed. + :param location: Required. Required. Gets or sets the location of the + resource. This will be one of the supported and registered Azure Geo + Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a + resource cannot be changed once it is created, but if an identical geo + region is specified on update, the request will succeed. :type location: str :param tags: Gets or sets a list of key value pairs that describe the resource. These tags can be used for viewing and grouping this resource @@ -64,12 +66,12 @@ class StorageAccountCreateParameters(Model): 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, } - def __init__(self, sku, kind, location, tags=None, custom_domain=None, encryption=None, access_tier=None): - super(StorageAccountCreateParameters, self).__init__() - self.sku = sku - self.kind = kind - self.location = location - self.tags = tags - self.custom_domain = custom_domain - self.encryption = encryption - self.access_tier = access_tier + def __init__(self, **kwargs): + super(StorageAccountCreateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.kind = kwargs.get('kind', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.custom_domain = kwargs.get('custom_domain', None) + self.encryption = kwargs.get('encryption', None) + self.access_tier = kwargs.get('access_tier', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_create_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_create_parameters_py3.py new file mode 100644 index 000000000000..e97e1a0118bc --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_create_parameters_py3.py @@ -0,0 +1,77 @@ +# 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 msrest.serialization import Model + + +class StorageAccountCreateParameters(Model): + """The parameters used when creating a storage account. + + All required parameters must be populated in order to send to Azure. + + :param sku: Required. Required. Gets or sets the sku name. + :type sku: ~azure.mgmt.storage.v2016_01_01.models.Sku + :param kind: Required. Required. Indicates the type of storage account. + Possible values include: 'Storage', 'BlobStorage' + :type kind: str or ~azure.mgmt.storage.v2016_01_01.models.Kind + :param location: Required. Required. Gets or sets the location of the + resource. This will be one of the supported and registered Azure Geo + Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a + resource cannot be changed once it is created, but if an identical geo + region is specified on update, the request will succeed. + :type location: str + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used for viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key with a length no greater than 128 + characters and a value with a length no greater than 256 characters. + :type tags: dict[str, str] + :param custom_domain: User domain assigned to the storage account. Name is + the CNAME source. Only one custom domain is supported per storage account + at this time. To clear the existing custom domain, use an empty string for + the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2016_01_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. If + left unspecified the account encryption settings will remain the same. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2016_01_01.models.Encryption + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2016_01_01.models.AccessTier + """ + + _validation = { + 'sku': {'required': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + } + + def __init__(self, *, sku, kind, location: str, tags=None, custom_domain=None, encryption=None, access_tier=None, **kwargs) -> None: + super(StorageAccountCreateParameters, self).__init__(**kwargs) + self.sku = sku + self.kind = kind + self.location = location + self.tags = tags + self.custom_domain = custom_domain + self.encryption = encryption + self.access_tier = access_tier diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_key.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_key.py index 8b727e4791b5..b1ffbda9be4d 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_key.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_key.py @@ -40,8 +40,8 @@ class StorageAccountKey(Model): 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, } - def __init__(self): - super(StorageAccountKey, self).__init__() + def __init__(self, **kwargs): + super(StorageAccountKey, self).__init__(**kwargs) self.key_name = None self.value = None self.permissions = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_key_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_key_py3.py new file mode 100644 index 000000000000..85b307d1ca63 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_key_py3.py @@ -0,0 +1,47 @@ +# 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 msrest.serialization import Model + + +class StorageAccountKey(Model): + """An access key for the storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar key_name: Name of the key. + :vartype key_name: str + :ivar value: Base 64-encoded value of the key. + :vartype value: str + :ivar permissions: Permissions for the key -- read-only or full + permissions. Possible values include: 'READ', 'FULL' + :vartype permissions: str or + ~azure.mgmt.storage.v2016_01_01.models.KeyPermission + """ + + _validation = { + 'key_name': {'readonly': True}, + 'value': {'readonly': True}, + 'permissions': {'readonly': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, + } + + def __init__(self, **kwargs) -> None: + super(StorageAccountKey, self).__init__(**kwargs) + self.key_name = None + self.value = None + self.permissions = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_list_keys_result.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_list_keys_result.py index 7a9420bfcaa3..4112d1bb62eb 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_list_keys_result.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_list_keys_result.py @@ -32,6 +32,6 @@ class StorageAccountListKeysResult(Model): 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, } - def __init__(self): - super(StorageAccountListKeysResult, self).__init__() + def __init__(self, **kwargs): + super(StorageAccountListKeysResult, self).__init__(**kwargs) self.keys = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_list_keys_result_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_list_keys_result_py3.py new file mode 100644 index 000000000000..877ab0fe34f2 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_list_keys_result_py3.py @@ -0,0 +1,37 @@ +# 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 msrest.serialization import Model + + +class StorageAccountListKeysResult(Model): + """The response from the ListKeys operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar keys: Gets the list of storage account keys and their properties for + the specified storage account. + :vartype keys: + list[~azure.mgmt.storage.v2016_01_01.models.StorageAccountKey] + """ + + _validation = { + 'keys': {'readonly': True}, + } + + _attribute_map = { + 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, + } + + def __init__(self, **kwargs) -> None: + super(StorageAccountListKeysResult, self).__init__(**kwargs) + self.keys = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_py3.py new file mode 100644 index 000000000000..df821e3ca0bf --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_py3.py @@ -0,0 +1,150 @@ +# 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 .resource import Resource + + +class StorageAccount(Resource): + """The storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Tags assigned to a resource; can be used for viewing and + grouping a resource (across resource groups). + :type tags: dict[str, str] + :ivar sku: Gets the SKU. + :vartype sku: ~azure.mgmt.storage.v2016_01_01.models.Sku + :ivar kind: Gets the Kind. Possible values include: 'Storage', + 'BlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2016_01_01.models.Kind + :ivar provisioning_state: Gets the status of the storage account at the + time the operation was called. Possible values include: 'Creating', + 'ResolvingDNS', 'Succeeded' + :vartype provisioning_state: str or + ~azure.mgmt.storage.v2016_01_01.models.ProvisioningState + :ivar primary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object. Note that Standard_ZRS + and Premium_LRS accounts only return the blob endpoint. + :vartype primary_endpoints: + ~azure.mgmt.storage.v2016_01_01.models.Endpoints + :ivar primary_location: Gets the location of the primary data center for + the storage account. + :vartype primary_location: str + :ivar status_of_primary: Gets the status indicating whether the primary + location of the storage account is available or unavailable. Possible + values include: 'Available', 'Unavailable' + :vartype status_of_primary: str or + ~azure.mgmt.storage.v2016_01_01.models.AccountStatus + :ivar last_geo_failover_time: Gets the timestamp of the most recent + instance of a failover to the secondary location. Only the most recent + timestamp is retained. This element is not returned if there has never + been a failover instance. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype last_geo_failover_time: datetime + :ivar secondary_location: Gets the location of the geo-replicated + secondary for the storage account. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype secondary_location: str + :ivar status_of_secondary: Gets the status indicating whether the + secondary location of the storage account is available or unavailable. + Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible + values include: 'Available', 'Unavailable' + :vartype status_of_secondary: str or + ~azure.mgmt.storage.v2016_01_01.models.AccountStatus + :ivar creation_time: Gets the creation date and time of the storage + account in UTC. + :vartype creation_time: datetime + :ivar custom_domain: Gets the custom domain the user assigned to this + storage account. + :vartype custom_domain: + ~azure.mgmt.storage.v2016_01_01.models.CustomDomain + :ivar secondary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object from the secondary + location of the storage account. Only available if the SKU name is + Standard_RAGRS. + :vartype secondary_endpoints: + ~azure.mgmt.storage.v2016_01_01.models.Endpoints + :ivar encryption: Gets the encryption settings on the account. If + unspecified, the account is unencrypted. + :vartype encryption: ~azure.mgmt.storage.v2016_01_01.models.Encryption + :ivar access_tier: Required for storage accounts where kind = BlobStorage. + The access tier used for billing. Possible values include: 'Hot', 'Cool' + :vartype access_tier: str or + ~azure.mgmt.storage.v2016_01_01.models.AccessTier + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'sku': {'readonly': True}, + 'kind': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'primary_endpoints': {'readonly': True}, + 'primary_location': {'readonly': True}, + 'status_of_primary': {'readonly': True}, + 'last_geo_failover_time': {'readonly': True}, + 'secondary_location': {'readonly': True}, + 'status_of_secondary': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'custom_domain': {'readonly': True}, + 'secondary_endpoints': {'readonly': True}, + 'encryption': {'readonly': True}, + 'access_tier': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, + 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, + 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, + 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'AccountStatus'}, + 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, + 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, + 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'AccountStatus'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + } + + def __init__(self, *, location: str=None, tags=None, **kwargs) -> None: + super(StorageAccount, self).__init__(location=location, tags=tags, **kwargs) + self.sku = None + self.kind = None + self.provisioning_state = None + self.primary_endpoints = None + self.primary_location = None + self.status_of_primary = None + self.last_geo_failover_time = None + self.secondary_location = None + self.status_of_secondary = None + self.creation_time = None + self.custom_domain = None + self.secondary_endpoints = None + self.encryption = None + self.access_tier = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_regenerate_key_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_regenerate_key_parameters.py index 2a5a3636bdc4..594bb550c5da 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_regenerate_key_parameters.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_regenerate_key_parameters.py @@ -15,7 +15,9 @@ class StorageAccountRegenerateKeyParameters(Model): """StorageAccountRegenerateKeyParameters. - :param key_name: + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. :type key_name: str """ @@ -27,6 +29,6 @@ class StorageAccountRegenerateKeyParameters(Model): 'key_name': {'key': 'keyName', 'type': 'str'}, } - def __init__(self, key_name): - super(StorageAccountRegenerateKeyParameters, self).__init__() - self.key_name = key_name + def __init__(self, **kwargs): + super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) + self.key_name = kwargs.get('key_name', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_regenerate_key_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_regenerate_key_parameters_py3.py new file mode 100644 index 000000000000..30cb1c6f312b --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_regenerate_key_parameters_py3.py @@ -0,0 +1,34 @@ +# 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 msrest.serialization import Model + + +class StorageAccountRegenerateKeyParameters(Model): + """StorageAccountRegenerateKeyParameters. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. + :type key_name: str + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, *, key_name: str, **kwargs) -> None: + super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) + self.key_name = key_name diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_update_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_update_parameters.py index ee038b085fb7..705ccbf2421f 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_update_parameters.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_update_parameters.py @@ -49,10 +49,10 @@ class StorageAccountUpdateParameters(Model): 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, } - def __init__(self, sku=None, tags=None, custom_domain=None, encryption=None, access_tier=None): - super(StorageAccountUpdateParameters, self).__init__() - self.sku = sku - self.tags = tags - self.custom_domain = custom_domain - self.encryption = encryption - self.access_tier = access_tier + def __init__(self, **kwargs): + super(StorageAccountUpdateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.tags = kwargs.get('tags', None) + self.custom_domain = kwargs.get('custom_domain', None) + self.encryption = kwargs.get('encryption', None) + self.access_tier = kwargs.get('access_tier', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_update_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_update_parameters_py3.py new file mode 100644 index 000000000000..377e7f343884 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_update_parameters_py3.py @@ -0,0 +1,58 @@ +# 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 msrest.serialization import Model + + +class StorageAccountUpdateParameters(Model): + """The parameters that can be provided when updating the storage account + properties. + + :param sku: Gets or sets the SKU name. Note that the SKU name cannot be + updated to Standard_ZRS or Premium_LRS, nor can accounts of those sku + names be updated to any other value. + :type sku: ~azure.mgmt.storage.v2016_01_01.models.Sku + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used in viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key no greater in length than 128 + characters and a value no greater in length than 256 characters. + :type tags: dict[str, str] + :param custom_domain: Custom domain assigned to the storage account by the + user. Name is the CNAME source. Only one custom domain is supported per + storage account at this time. To clear the existing custom domain, use an + empty string for the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2016_01_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2016_01_01.models.Encryption + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2016_01_01.models.AccessTier + """ + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + } + + def __init__(self, *, sku=None, tags=None, custom_domain=None, encryption=None, access_tier=None, **kwargs) -> None: + super(StorageAccountUpdateParameters, self).__init__(**kwargs) + self.sku = sku + self.tags = tags + self.custom_domain = custom_domain + self.encryption = encryption + self.access_tier = access_tier diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_management_client_enums.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_management_client_enums.py index 417c2ade8def..3bf3c6dc52d8 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_management_client_enums.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_management_client_enums.py @@ -12,13 +12,13 @@ from enum import Enum -class Reason(Enum): +class Reason(str, Enum): account_name_invalid = "AccountNameInvalid" already_exists = "AlreadyExists" -class SkuName(Enum): +class SkuName(str, Enum): standard_lrs = "Standard_LRS" standard_grs = "Standard_GRS" @@ -27,44 +27,44 @@ class SkuName(Enum): premium_lrs = "Premium_LRS" -class SkuTier(Enum): +class SkuTier(str, Enum): standard = "Standard" premium = "Premium" -class AccessTier(Enum): +class AccessTier(str, Enum): hot = "Hot" cool = "Cool" -class Kind(Enum): +class Kind(str, Enum): storage = "Storage" blob_storage = "BlobStorage" -class ProvisioningState(Enum): +class ProvisioningState(str, Enum): creating = "Creating" resolving_dns = "ResolvingDNS" succeeded = "Succeeded" -class AccountStatus(Enum): +class AccountStatus(str, Enum): available = "Available" unavailable = "Unavailable" -class KeyPermission(Enum): +class KeyPermission(str, Enum): read = "READ" full = "FULL" -class UsageUnit(Enum): +class UsageUnit(str, Enum): count = "Count" bytes = "Bytes" diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/usage.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/usage.py index c6187d094c1c..bf3ddefc1e62 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/usage.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/usage.py @@ -46,8 +46,8 @@ class Usage(Model): 'name': {'key': 'name', 'type': 'UsageName'}, } - def __init__(self): - super(Usage, self).__init__() + def __init__(self, **kwargs): + super(Usage, self).__init__(**kwargs) self.unit = None self.current_value = None self.limit = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/usage_name.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/usage_name.py index c09f75b38c9a..e4082bf52384 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/usage_name.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/usage_name.py @@ -35,7 +35,7 @@ class UsageName(Model): 'localized_value': {'key': 'localizedValue', 'type': 'str'}, } - def __init__(self): - super(UsageName, self).__init__() + def __init__(self, **kwargs): + super(UsageName, self).__init__(**kwargs) self.value = None self.localized_value = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/usage_name_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/usage_name_py3.py new file mode 100644 index 000000000000..f519bb5072b1 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/usage_name_py3.py @@ -0,0 +1,41 @@ +# 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 msrest.serialization import Model + + +class UsageName(Model): + """The usage names that can be used; currently limited to StorageAccount. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: Gets a string describing the resource name. + :vartype value: str + :ivar localized_value: Gets a localized string describing the resource + name. + :vartype localized_value: str + """ + + _validation = { + 'value': {'readonly': True}, + 'localized_value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(UsageName, self).__init__(**kwargs) + self.value = None + self.localized_value = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/usage_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/usage_py3.py new file mode 100644 index 000000000000..a0bbc747199c --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/usage_py3.py @@ -0,0 +1,54 @@ +# 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 msrest.serialization import Model + + +class Usage(Model): + """Describes Storage Resource Usage. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar unit: Gets the unit of measurement. Possible values include: + 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', + 'BytesPerSecond' + :vartype unit: str or ~azure.mgmt.storage.v2016_01_01.models.UsageUnit + :ivar current_value: Gets the current count of the allocated resources in + the subscription. + :vartype current_value: int + :ivar limit: Gets the maximum count of the resources that can be allocated + in the subscription. + :vartype limit: int + :ivar name: Gets the name of the type of usage. + :vartype name: ~azure.mgmt.storage.v2016_01_01.models.UsageName + """ + + _validation = { + 'unit': {'readonly': True}, + 'current_value': {'readonly': True}, + 'limit': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'UsageUnit'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + def __init__(self, **kwargs) -> None: + super(Usage, self).__init__(**kwargs) + self.unit = None + self.current_value = None + self.limit = None + self.name = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/operations/storage_accounts_operations.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/operations/storage_accounts_operations.py index 6e219e1fb6bf..19bdbef3c91d 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/operations/storage_accounts_operations.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/operations/storage_accounts_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class StorageAccountsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2016-01-01". """ @@ -60,7 +60,7 @@ def check_name_availability( account_name = models.StorageAccountCheckNameAvailabilityParameters(name=name) # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability' + url = self.check_name_availability.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -103,12 +103,13 @@ def check_name_availability( return client_raw_response return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability'} def _create_initial( self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}' + url = self.create.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -155,7 +156,7 @@ def _create_initial( return deserialized def create( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties @@ -174,13 +175,16 @@ def create( :type parameters: ~azure.mgmt.storage.v2016_01_01.models.StorageAccountCreateParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - StorageAccount or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns StorageAccount or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.storage.v2016_01_01.models.StorageAccount] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.storage.v2016_01_01.models.StorageAccount]] :raises: :class:`CloudError` """ raw_result = self._create_initial( @@ -191,30 +195,8 @@ def create( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('StorageAccount', response) if raw: @@ -223,12 +205,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} def delete( self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): @@ -251,7 +235,7 @@ def delete( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -285,6 +269,7 @@ def delete( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} def get_properties( self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): @@ -310,7 +295,7 @@ def get_properties( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}' + url = self.get_properties.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -351,6 +336,7 @@ def get_properties( return client_raw_response return deserialized + get_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} def update( self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): @@ -386,7 +372,7 @@ def update( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}' + url = self.update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -431,6 +417,7 @@ def update( return client_raw_response return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} def list( self, custom_headers=None, raw=False, **operation_config): @@ -452,7 +439,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -497,6 +484,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts'} def list_by_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -521,7 +509,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts' + url = self.list_by_resource_group.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -567,6 +555,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts'} def list_keys( self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): @@ -591,7 +580,7 @@ def list_keys( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys' + url = self.list_keys.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -632,6 +621,7 @@ def list_keys( return client_raw_response return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys'} def regenerate_key( self, resource_group_name, account_name, key_name, custom_headers=None, raw=False, **operation_config): @@ -660,7 +650,7 @@ def regenerate_key( regenerate_key1 = models.StorageAccountRegenerateKeyParameters(key_name=key_name) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey' + url = self.regenerate_key.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -705,3 +695,4 @@ def regenerate_key( return client_raw_response return deserialized + regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey'} diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/operations/usage_operations.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/operations/usage_operations.py index 4f4d971bc9b5..d8caf7c34ffb 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/operations/usage_operations.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/operations/usage_operations.py @@ -22,7 +22,7 @@ class UsageOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2016-01-01". """ @@ -56,7 +56,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -101,3 +101,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages'} diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/storage_management_client.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/storage_management_client.py index b4c588c1f98d..cd8690faf72d 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/storage_management_client.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/storage_management_client.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import ServiceClient +from msrest.service_client import SDKClient from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION @@ -52,7 +52,7 @@ def __init__( self.subscription_id = subscription_id -class StorageManagementClient(object): +class StorageManagementClient(SDKClient): """The Storage Management Client. :ivar config: Configuration for client. @@ -77,7 +77,7 @@ def __init__( self, credentials, subscription_id, base_url=None): self.config = StorageManagementClientConfiguration(credentials, subscription_id, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + super(StorageManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self.api_version = '2016-01-01' diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/__init__.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/__init__.py index 96aa43044b35..17649f574f30 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/__init__.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/__init__.py @@ -9,27 +9,50 @@ # regenerated. # -------------------------------------------------------------------------- -from .storage_account_check_name_availability_parameters import StorageAccountCheckNameAvailabilityParameters -from .check_name_availability_result import CheckNameAvailabilityResult -from .sku import Sku -from .custom_domain import CustomDomain -from .encryption_service import EncryptionService -from .encryption_services import EncryptionServices -from .encryption import Encryption -from .storage_account_create_parameters import StorageAccountCreateParameters -from .endpoints import Endpoints -from .storage_account import StorageAccount -from .storage_account_key import StorageAccountKey -from .storage_account_list_keys_result import StorageAccountListKeysResult -from .storage_account_regenerate_key_parameters import StorageAccountRegenerateKeyParameters -from .storage_account_update_parameters import StorageAccountUpdateParameters -from .usage_name import UsageName -from .usage import Usage -from .resource import Resource -from .account_sas_parameters import AccountSasParameters -from .list_account_sas_response import ListAccountSasResponse -from .service_sas_parameters import ServiceSasParameters -from .list_service_sas_response import ListServiceSasResponse +try: + from .storage_account_check_name_availability_parameters_py3 import StorageAccountCheckNameAvailabilityParameters + from .check_name_availability_result_py3 import CheckNameAvailabilityResult + from .sku_py3 import Sku + from .custom_domain_py3 import CustomDomain + from .encryption_service_py3 import EncryptionService + from .encryption_services_py3 import EncryptionServices + from .encryption_py3 import Encryption + from .storage_account_create_parameters_py3 import StorageAccountCreateParameters + from .endpoints_py3 import Endpoints + from .storage_account_py3 import StorageAccount + from .storage_account_key_py3 import StorageAccountKey + from .storage_account_list_keys_result_py3 import StorageAccountListKeysResult + from .storage_account_regenerate_key_parameters_py3 import StorageAccountRegenerateKeyParameters + from .storage_account_update_parameters_py3 import StorageAccountUpdateParameters + from .usage_name_py3 import UsageName + from .usage_py3 import Usage + from .resource_py3 import Resource + from .account_sas_parameters_py3 import AccountSasParameters + from .list_account_sas_response_py3 import ListAccountSasResponse + from .service_sas_parameters_py3 import ServiceSasParameters + from .list_service_sas_response_py3 import ListServiceSasResponse +except (SyntaxError, ImportError): + from .storage_account_check_name_availability_parameters import StorageAccountCheckNameAvailabilityParameters + from .check_name_availability_result import CheckNameAvailabilityResult + from .sku import Sku + from .custom_domain import CustomDomain + from .encryption_service import EncryptionService + from .encryption_services import EncryptionServices + from .encryption import Encryption + from .storage_account_create_parameters import StorageAccountCreateParameters + from .endpoints import Endpoints + from .storage_account import StorageAccount + from .storage_account_key import StorageAccountKey + from .storage_account_list_keys_result import StorageAccountListKeysResult + from .storage_account_regenerate_key_parameters import StorageAccountRegenerateKeyParameters + from .storage_account_update_parameters import StorageAccountUpdateParameters + from .usage_name import UsageName + from .usage import Usage + from .resource import Resource + from .account_sas_parameters import AccountSasParameters + from .list_account_sas_response import ListAccountSasResponse + from .service_sas_parameters import ServiceSasParameters + from .list_service_sas_response import ListServiceSasResponse from .storage_account_paged import StorageAccountPaged from .usage_paged import UsagePaged from .storage_management_client_enums import ( diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/account_sas_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/account_sas_parameters.py index e1661f150230..2d017cd9b398 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/account_sas_parameters.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/account_sas_parameters.py @@ -15,20 +15,22 @@ class AccountSasParameters(Model): """The parameters to list SAS credentials of a storage account. - :param services: The signed services accessible with the account SAS. - Possible values include: Blob (b), Queue (q), Table (t), File (f). + All required parameters must be populated in order to send to Azure. + + :param services: Required. The signed services accessible with the account + SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). Possible values include: 'b', 'q', 't', 'f' :type services: str or ~azure.mgmt.storage.v2016_12_01.models.enum - :param resource_types: The signed resource types that are accessible with - the account SAS. Service (s): Access to service-level APIs; Container (c): - Access to container-level APIs; Object (o): Access to object-level APIs - for blobs, queue messages, table entities, and files. Possible values - include: 's', 'c', 'o' + :param resource_types: Required. The signed resource types that are + accessible with the account SAS. Service (s): Access to service-level + APIs; Container (c): Access to container-level APIs; Object (o): Access to + object-level APIs for blobs, queue messages, table entities, and files. + Possible values include: 's', 'c', 'o' :type resource_types: str or ~azure.mgmt.storage.v2016_12_01.models.enum - :param permissions: The signed permissions for the account SAS. Possible - values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create - (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', - 'l', 'a', 'c', 'u', 'p' + :param permissions: Required. The signed permissions for the account SAS. + Possible values include: Read (r), Write (w), Delete (d), List (l), Add + (a), Create (c), Update (u) and Process (p). Possible values include: 'r', + 'd', 'w', 'l', 'a', 'c', 'u', 'p' :type permissions: str or ~azure.mgmt.storage.v2016_12_01.models.enum :param ip_address_or_range: An IP address or a range of IP addresses from which to accept requests. @@ -39,8 +41,8 @@ class AccountSasParameters(Model): ~azure.mgmt.storage.v2016_12_01.models.HttpProtocol :param shared_access_start_time: The time at which the SAS becomes valid. :type shared_access_start_time: datetime - :param shared_access_expiry_time: The time at which the shared access - signature becomes invalid. + :param shared_access_expiry_time: Required. The time at which the shared + access signature becomes invalid. :type shared_access_expiry_time: datetime :param key_to_sign: The key to sign the account SAS token with. :type key_to_sign: str @@ -64,13 +66,13 @@ class AccountSasParameters(Model): 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, } - def __init__(self, services, resource_types, permissions, shared_access_expiry_time, ip_address_or_range=None, protocols=None, shared_access_start_time=None, key_to_sign=None): - super(AccountSasParameters, self).__init__() - self.services = services - self.resource_types = resource_types - self.permissions = permissions - self.ip_address_or_range = ip_address_or_range - self.protocols = protocols - self.shared_access_start_time = shared_access_start_time - self.shared_access_expiry_time = shared_access_expiry_time - self.key_to_sign = key_to_sign + def __init__(self, **kwargs): + super(AccountSasParameters, self).__init__(**kwargs) + self.services = kwargs.get('services', None) + self.resource_types = kwargs.get('resource_types', None) + self.permissions = kwargs.get('permissions', None) + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + self.protocols = kwargs.get('protocols', None) + self.shared_access_start_time = kwargs.get('shared_access_start_time', None) + self.shared_access_expiry_time = kwargs.get('shared_access_expiry_time', None) + self.key_to_sign = kwargs.get('key_to_sign', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/account_sas_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/account_sas_parameters_py3.py new file mode 100644 index 000000000000..c8475408c008 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/account_sas_parameters_py3.py @@ -0,0 +1,78 @@ +# 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 msrest.serialization import Model + + +class AccountSasParameters(Model): + """The parameters to list SAS credentials of a storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: Required. The signed services accessible with the account + SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). + Possible values include: 'b', 'q', 't', 'f' + :type services: str or ~azure.mgmt.storage.v2016_12_01.models.enum + :param resource_types: Required. The signed resource types that are + accessible with the account SAS. Service (s): Access to service-level + APIs; Container (c): Access to container-level APIs; Object (o): Access to + object-level APIs for blobs, queue messages, table entities, and files. + Possible values include: 's', 'c', 'o' + :type resource_types: str or ~azure.mgmt.storage.v2016_12_01.models.enum + :param permissions: Required. The signed permissions for the account SAS. + Possible values include: Read (r), Write (w), Delete (d), List (l), Add + (a), Create (c), Update (u) and Process (p). Possible values include: 'r', + 'd', 'w', 'l', 'a', 'c', 'u', 'p' + :type permissions: str or ~azure.mgmt.storage.v2016_12_01.models.enum + :param ip_address_or_range: An IP address or a range of IP addresses from + which to accept requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the + account SAS. Possible values include: 'https,http', 'https' + :type protocols: str or + ~azure.mgmt.storage.v2016_12_01.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: datetime + :param shared_access_expiry_time: Required. The time at which the shared + access signature becomes invalid. + :type shared_access_expiry_time: datetime + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + """ + + _validation = { + 'services': {'required': True}, + 'resource_types': {'required': True}, + 'permissions': {'required': True}, + 'shared_access_expiry_time': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'signedServices', 'type': 'str'}, + 'resource_types': {'key': 'signedResourceTypes', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + } + + def __init__(self, *, services, resource_types, permissions, shared_access_expiry_time, ip_address_or_range: str=None, protocols=None, shared_access_start_time=None, key_to_sign: str=None, **kwargs) -> None: + super(AccountSasParameters, self).__init__(**kwargs) + self.services = services + self.resource_types = resource_types + self.permissions = permissions + self.ip_address_or_range = ip_address_or_range + self.protocols = protocols + self.shared_access_start_time = shared_access_start_time + self.shared_access_expiry_time = shared_access_expiry_time + self.key_to_sign = key_to_sign diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/check_name_availability_result.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/check_name_availability_result.py index d1db8ad1e04a..af912f7c3b07 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/check_name_availability_result.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/check_name_availability_result.py @@ -43,8 +43,8 @@ class CheckNameAvailabilityResult(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self): - super(CheckNameAvailabilityResult, self).__init__() + def __init__(self, **kwargs): + super(CheckNameAvailabilityResult, self).__init__(**kwargs) self.name_available = None self.reason = None self.message = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/check_name_availability_result_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/check_name_availability_result_py3.py new file mode 100644 index 000000000000..144a9164dd8b --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/check_name_availability_result_py3.py @@ -0,0 +1,50 @@ +# 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 msrest.serialization import Model + + +class CheckNameAvailabilityResult(Model): + """The CheckNameAvailability operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name_available: Gets a boolean value that indicates whether the name + is available for you to use. If true, the name is available. If false, the + name has already been taken or is invalid and cannot be used. + :vartype name_available: bool + :ivar reason: Gets the reason that a storage account name could not be + used. The Reason element is only returned if NameAvailable is false. + Possible values include: 'AccountNameInvalid', 'AlreadyExists' + :vartype reason: str or ~azure.mgmt.storage.v2016_12_01.models.Reason + :ivar message: Gets an error message explaining the Reason value in more + detail. + :vartype message: str + """ + + _validation = { + 'name_available': {'readonly': True}, + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'Reason'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = None + self.reason = None + self.message = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/custom_domain.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/custom_domain.py index 12b0f7691888..585480d7321a 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/custom_domain.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/custom_domain.py @@ -16,8 +16,10 @@ class CustomDomain(Model): """The custom domain assigned to this storage account. This can be set via Update. - :param name: Gets or sets the custom domain name assigned to the storage - account. Name is the CNAME source. + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the custom domain name assigned to the + storage account. Name is the CNAME source. :type name: str :param use_sub_domain: Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. @@ -33,7 +35,7 @@ class CustomDomain(Model): 'use_sub_domain': {'key': 'useSubDomain', 'type': 'bool'}, } - def __init__(self, name, use_sub_domain=None): - super(CustomDomain, self).__init__() - self.name = name - self.use_sub_domain = use_sub_domain + def __init__(self, **kwargs): + super(CustomDomain, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.use_sub_domain = kwargs.get('use_sub_domain', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/custom_domain_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/custom_domain_py3.py new file mode 100644 index 000000000000..4c6fe3f83e35 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/custom_domain_py3.py @@ -0,0 +1,41 @@ +# 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 msrest.serialization import Model + + +class CustomDomain(Model): + """The custom domain assigned to this storage account. This can be set via + Update. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the custom domain name assigned to the + storage account. Name is the CNAME source. + :type name: str + :param use_sub_domain: Indicates whether indirect CName validation is + enabled. Default value is false. This should only be set on updates. + :type use_sub_domain: bool + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'use_sub_domain': {'key': 'useSubDomain', 'type': 'bool'}, + } + + def __init__(self, *, name: str, use_sub_domain: bool=None, **kwargs) -> None: + super(CustomDomain, self).__init__(**kwargs) + self.name = name + self.use_sub_domain = use_sub_domain diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption.py index eeea7426d2b5..dbc7f6963178 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption.py @@ -18,11 +18,13 @@ class Encryption(Model): 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 Azure. + :param services: List of services which support encryption. :type services: ~azure.mgmt.storage.v2016_12_01.models.EncryptionServices - :ivar key_source: The encryption keySource (provider). Possible values - (case-insensitive): Microsoft.Storage. Default value: "Microsoft.Storage" - . + :ivar key_source: Required. The encryption keySource (provider). Possible + values (case-insensitive): Microsoft.Storage. Default value: + "Microsoft.Storage" . :vartype key_source: str """ @@ -37,6 +39,6 @@ class Encryption(Model): key_source = "Microsoft.Storage" - def __init__(self, services=None): - super(Encryption, self).__init__() - self.services = services + def __init__(self, **kwargs): + super(Encryption, self).__init__(**kwargs) + self.services = kwargs.get('services', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption_py3.py new file mode 100644 index 000000000000..8ebcceb015b8 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption_py3.py @@ -0,0 +1,44 @@ +# 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 msrest.serialization import Model + + +class Encryption(Model): + """The encryption settings on the storage account. + + 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 Azure. + + :param services: List of services which support encryption. + :type services: ~azure.mgmt.storage.v2016_12_01.models.EncryptionServices + :ivar key_source: Required. The encryption keySource (provider). Possible + values (case-insensitive): Microsoft.Storage. Default value: + "Microsoft.Storage" . + :vartype key_source: str + """ + + _validation = { + 'key_source': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'services': {'key': 'services', 'type': 'EncryptionServices'}, + 'key_source': {'key': 'keySource', 'type': 'str'}, + } + + key_source = "Microsoft.Storage" + + def __init__(self, *, services=None, **kwargs) -> None: + super(Encryption, self).__init__(**kwargs) + self.services = services diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption_service.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption_service.py index 0e033e9fe4a8..3a020c468f64 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption_service.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption_service.py @@ -37,7 +37,7 @@ class EncryptionService(Model): 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, } - def __init__(self, enabled=None): - super(EncryptionService, self).__init__() - self.enabled = enabled + def __init__(self, **kwargs): + super(EncryptionService, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) self.last_enabled_time = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption_service_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption_service_py3.py new file mode 100644 index 000000000000..0566050c6155 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption_service_py3.py @@ -0,0 +1,43 @@ +# 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 msrest.serialization import Model + + +class EncryptionService(Model): + """A service that allows server-side encryption to be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param enabled: A boolean indicating whether or not the service encrypts + the data as it is stored. + :type enabled: bool + :ivar last_enabled_time: Gets a rough estimate of the date/time when the + encryption was last enabled by the user. Only returned when encryption is + enabled. There might be some unencrypted blobs which were written after + this time, as it is just a rough estimate. + :vartype last_enabled_time: datetime + """ + + _validation = { + 'last_enabled_time': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, + } + + def __init__(self, *, enabled: bool=None, **kwargs) -> None: + super(EncryptionService, self).__init__(**kwargs) + self.enabled = enabled + self.last_enabled_time = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption_services.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption_services.py index 561e4eb812d1..47fdda835f1e 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption_services.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption_services.py @@ -40,9 +40,9 @@ class EncryptionServices(Model): 'queue': {'key': 'queue', 'type': 'EncryptionService'}, } - def __init__(self, blob=None, file=None): - super(EncryptionServices, self).__init__() - self.blob = blob - self.file = file + def __init__(self, **kwargs): + super(EncryptionServices, self).__init__(**kwargs) + self.blob = kwargs.get('blob', None) + self.file = kwargs.get('file', None) self.table = None self.queue = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption_services_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption_services_py3.py new file mode 100644 index 000000000000..9bb0c2c5928a --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption_services_py3.py @@ -0,0 +1,48 @@ +# 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 msrest.serialization import Model + + +class EncryptionServices(Model): + """A list of services that support encryption. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param blob: The encryption function of the blob storage service. + :type blob: ~azure.mgmt.storage.v2016_12_01.models.EncryptionService + :param file: The encryption function of the file storage service. + :type file: ~azure.mgmt.storage.v2016_12_01.models.EncryptionService + :ivar table: The encryption function of the table storage service. + :vartype table: ~azure.mgmt.storage.v2016_12_01.models.EncryptionService + :ivar queue: The encryption function of the queue storage service. + :vartype queue: ~azure.mgmt.storage.v2016_12_01.models.EncryptionService + """ + + _validation = { + 'table': {'readonly': True}, + 'queue': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'EncryptionService'}, + 'file': {'key': 'file', 'type': 'EncryptionService'}, + 'table': {'key': 'table', 'type': 'EncryptionService'}, + 'queue': {'key': 'queue', 'type': 'EncryptionService'}, + } + + def __init__(self, *, blob=None, file=None, **kwargs) -> None: + super(EncryptionServices, self).__init__(**kwargs) + self.blob = blob + self.file = file + self.table = None + self.queue = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/endpoints.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/endpoints.py index 2524757f961f..ec345fceac47 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/endpoints.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/endpoints.py @@ -43,8 +43,8 @@ class Endpoints(Model): 'file': {'key': 'file', 'type': 'str'}, } - def __init__(self): - super(Endpoints, self).__init__() + def __init__(self, **kwargs): + super(Endpoints, self).__init__(**kwargs) self.blob = None self.queue = None self.table = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/endpoints_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/endpoints_py3.py new file mode 100644 index 000000000000..a186e9c8d6a9 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/endpoints_py3.py @@ -0,0 +1,51 @@ +# 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 msrest.serialization import Model + + +class Endpoints(Model): + """The URIs that are used to perform a retrieval of a public blob, queue, or + table object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar blob: Gets the blob endpoint. + :vartype blob: str + :ivar queue: Gets the queue endpoint. + :vartype queue: str + :ivar table: Gets the table endpoint. + :vartype table: str + :ivar file: Gets the file endpoint. + :vartype file: str + """ + + _validation = { + 'blob': {'readonly': True}, + 'queue': {'readonly': True}, + 'table': {'readonly': True}, + 'file': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'str'}, + 'queue': {'key': 'queue', 'type': 'str'}, + 'table': {'key': 'table', 'type': 'str'}, + 'file': {'key': 'file', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Endpoints, self).__init__(**kwargs) + self.blob = None + self.queue = None + self.table = None + self.file = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/list_account_sas_response.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/list_account_sas_response.py index 5d8b8c53cd6f..a56e959a34bd 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/list_account_sas_response.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/list_account_sas_response.py @@ -30,6 +30,6 @@ class ListAccountSasResponse(Model): 'account_sas_token': {'key': 'accountSasToken', 'type': 'str'}, } - def __init__(self): - super(ListAccountSasResponse, self).__init__() + def __init__(self, **kwargs): + super(ListAccountSasResponse, self).__init__(**kwargs) self.account_sas_token = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/list_account_sas_response_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/list_account_sas_response_py3.py new file mode 100644 index 000000000000..b8b9a314d9f6 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/list_account_sas_response_py3.py @@ -0,0 +1,35 @@ +# 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 msrest.serialization import Model + + +class ListAccountSasResponse(Model): + """The List SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar account_sas_token: List SAS credentials of storage account. + :vartype account_sas_token: str + """ + + _validation = { + 'account_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'account_sas_token': {'key': 'accountSasToken', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ListAccountSasResponse, self).__init__(**kwargs) + self.account_sas_token = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/list_service_sas_response.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/list_service_sas_response.py index e3c12854fe67..800c0298af61 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/list_service_sas_response.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/list_service_sas_response.py @@ -31,6 +31,6 @@ class ListServiceSasResponse(Model): 'service_sas_token': {'key': 'serviceSasToken', 'type': 'str'}, } - def __init__(self): - super(ListServiceSasResponse, self).__init__() + def __init__(self, **kwargs): + super(ListServiceSasResponse, self).__init__(**kwargs) self.service_sas_token = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/list_service_sas_response_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/list_service_sas_response_py3.py new file mode 100644 index 000000000000..cffd962e2041 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/list_service_sas_response_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class ListServiceSasResponse(Model): + """The List service SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar service_sas_token: List service SAS credentials of speicific + resource. + :vartype service_sas_token: str + """ + + _validation = { + 'service_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'service_sas_token': {'key': 'serviceSasToken', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ListServiceSasResponse, self).__init__(**kwargs) + self.service_sas_token = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/resource.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/resource.py index dda2316a332f..125d6e4790b9 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/resource.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/resource.py @@ -45,10 +45,10 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, location=None, tags=None): - super(Resource, self).__init__() + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.location = location - self.tags = tags + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/resource_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/resource_py3.py new file mode 100644 index 000000000000..7c1ccbf3aae1 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/resource_py3.py @@ -0,0 +1,54 @@ +# 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 msrest.serialization import Model + + +class Resource(Model): + """Describes a storage resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Tags assigned to a resource; can be used for viewing and + grouping a resource (across resource groups). + :type tags: dict[str, str] + """ + + _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'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str=None, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/service_sas_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/service_sas_parameters.py index baa726e85535..409165cad585 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/service_sas_parameters.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/service_sas_parameters.py @@ -15,11 +15,14 @@ class ServiceSasParameters(Model): """The parameters to list service SAS credentials of a speicific resource. - :param canonicalized_resource: The canonical path to the signed resource. + All required parameters must be populated in order to send to Azure. + + :param canonicalized_resource: Required. The canonical path to the signed + resource. :type canonicalized_resource: str - :param resource: The signed services accessible with the service SAS. - Possible values include: Blob (b), Container (c), File (f), Share (s). - Possible values include: 'b', 'c', 'f', 's' + :param resource: Required. The signed services accessible with the service + SAS. Possible values include: Blob (b), Container (c), File (f), Share + (s). Possible values include: 'b', 'c', 'f', 's' :type resource: str or ~azure.mgmt.storage.v2016_12_01.models.enum :param permissions: The signed permissions for the service SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create @@ -94,23 +97,23 @@ class ServiceSasParameters(Model): 'content_type': {'key': 'rsct', 'type': 'str'}, } - def __init__(self, canonicalized_resource, resource, permissions=None, ip_address_or_range=None, protocols=None, shared_access_start_time=None, shared_access_expiry_time=None, identifier=None, partition_key_start=None, partition_key_end=None, row_key_start=None, row_key_end=None, key_to_sign=None, cache_control=None, content_disposition=None, content_encoding=None, content_language=None, content_type=None): - super(ServiceSasParameters, self).__init__() - self.canonicalized_resource = canonicalized_resource - self.resource = resource - self.permissions = permissions - self.ip_address_or_range = ip_address_or_range - self.protocols = protocols - self.shared_access_start_time = shared_access_start_time - self.shared_access_expiry_time = shared_access_expiry_time - self.identifier = identifier - self.partition_key_start = partition_key_start - self.partition_key_end = partition_key_end - self.row_key_start = row_key_start - self.row_key_end = row_key_end - self.key_to_sign = key_to_sign - self.cache_control = cache_control - self.content_disposition = content_disposition - self.content_encoding = content_encoding - self.content_language = content_language - self.content_type = content_type + def __init__(self, **kwargs): + super(ServiceSasParameters, self).__init__(**kwargs) + self.canonicalized_resource = kwargs.get('canonicalized_resource', None) + self.resource = kwargs.get('resource', None) + self.permissions = kwargs.get('permissions', None) + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + self.protocols = kwargs.get('protocols', None) + self.shared_access_start_time = kwargs.get('shared_access_start_time', None) + self.shared_access_expiry_time = kwargs.get('shared_access_expiry_time', None) + self.identifier = kwargs.get('identifier', None) + self.partition_key_start = kwargs.get('partition_key_start', None) + self.partition_key_end = kwargs.get('partition_key_end', None) + self.row_key_start = kwargs.get('row_key_start', None) + self.row_key_end = kwargs.get('row_key_end', None) + self.key_to_sign = kwargs.get('key_to_sign', None) + self.cache_control = kwargs.get('cache_control', None) + self.content_disposition = kwargs.get('content_disposition', None) + self.content_encoding = kwargs.get('content_encoding', None) + self.content_language = kwargs.get('content_language', None) + self.content_type = kwargs.get('content_type', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/service_sas_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/service_sas_parameters_py3.py new file mode 100644 index 000000000000..f5692795d7c6 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/service_sas_parameters_py3.py @@ -0,0 +1,119 @@ +# 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 msrest.serialization import Model + + +class ServiceSasParameters(Model): + """The parameters to list service SAS credentials of a speicific resource. + + All required parameters must be populated in order to send to Azure. + + :param canonicalized_resource: Required. The canonical path to the signed + resource. + :type canonicalized_resource: str + :param resource: Required. The signed services accessible with the service + SAS. Possible values include: Blob (b), Container (c), File (f), Share + (s). Possible values include: 'b', 'c', 'f', 's' + :type resource: str or ~azure.mgmt.storage.v2016_12_01.models.enum + :param permissions: The signed permissions for the service SAS. Possible + values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create + (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', + 'l', 'a', 'c', 'u', 'p' + :type permissions: str or ~azure.mgmt.storage.v2016_12_01.models.enum + :param ip_address_or_range: An IP address or a range of IP addresses from + which to accept requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the + account SAS. Possible values include: 'https,http', 'https' + :type protocols: str or + ~azure.mgmt.storage.v2016_12_01.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: datetime + :param shared_access_expiry_time: The time at which the shared access + signature becomes invalid. + :type shared_access_expiry_time: datetime + :param identifier: A unique value up to 64 characters in length that + correlates to an access policy specified for the container, queue, or + table. + :type identifier: str + :param partition_key_start: The start of partition key. + :type partition_key_start: str + :param partition_key_end: The end of partition key. + :type partition_key_end: str + :param row_key_start: The start of row key. + :type row_key_start: str + :param row_key_end: The end of row key. + :type row_key_end: str + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + :param cache_control: The response header override for cache control. + :type cache_control: str + :param content_disposition: The response header override for content + disposition. + :type content_disposition: str + :param content_encoding: The response header override for content + encoding. + :type content_encoding: str + :param content_language: The response header override for content + language. + :type content_language: str + :param content_type: The response header override for content type. + :type content_type: str + """ + + _validation = { + 'canonicalized_resource': {'required': True}, + 'resource': {'required': True}, + 'identifier': {'max_length': 64}, + } + + _attribute_map = { + 'canonicalized_resource': {'key': 'canonicalizedResource', 'type': 'str'}, + 'resource': {'key': 'signedResource', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'identifier': {'key': 'signedIdentifier', 'type': 'str'}, + 'partition_key_start': {'key': 'startPk', 'type': 'str'}, + 'partition_key_end': {'key': 'endPk', 'type': 'str'}, + 'row_key_start': {'key': 'startRk', 'type': 'str'}, + 'row_key_end': {'key': 'endRk', 'type': 'str'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + 'cache_control': {'key': 'rscc', 'type': 'str'}, + 'content_disposition': {'key': 'rscd', 'type': 'str'}, + 'content_encoding': {'key': 'rsce', 'type': 'str'}, + 'content_language': {'key': 'rscl', 'type': 'str'}, + 'content_type': {'key': 'rsct', 'type': 'str'}, + } + + def __init__(self, *, canonicalized_resource: str, resource, permissions=None, ip_address_or_range: str=None, protocols=None, shared_access_start_time=None, shared_access_expiry_time=None, identifier: str=None, partition_key_start: str=None, partition_key_end: str=None, row_key_start: str=None, row_key_end: str=None, key_to_sign: str=None, cache_control: str=None, content_disposition: str=None, content_encoding: str=None, content_language: str=None, content_type: str=None, **kwargs) -> None: + super(ServiceSasParameters, self).__init__(**kwargs) + self.canonicalized_resource = canonicalized_resource + self.resource = resource + self.permissions = permissions + self.ip_address_or_range = ip_address_or_range + self.protocols = protocols + self.shared_access_start_time = shared_access_start_time + self.shared_access_expiry_time = shared_access_expiry_time + self.identifier = identifier + self.partition_key_start = partition_key_start + self.partition_key_end = partition_key_end + self.row_key_start = row_key_start + self.row_key_end = row_key_end + self.key_to_sign = key_to_sign + self.cache_control = cache_control + self.content_disposition = content_disposition + self.content_encoding = content_encoding + self.content_language = content_language + self.content_type = content_type diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/sku.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/sku.py index 15a2d3ff4178..82fc001bf07b 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/sku.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/sku.py @@ -18,10 +18,12 @@ class Sku(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param name: Gets or sets the sku name. Required for account creation; - optional for update. Note that in older versions, sku name was called - accountType. Possible values include: 'Standard_LRS', 'Standard_GRS', - 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the sku name. Required for account + creation; optional for update. Note that in older versions, sku name was + called accountType. Possible values include: 'Standard_LRS', + 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' :type name: str or ~azure.mgmt.storage.v2016_12_01.models.SkuName :ivar tier: Gets the sku tier. This is based on the SKU name. Possible values include: 'Standard', 'Premium' @@ -38,7 +40,7 @@ class Sku(Model): 'tier': {'key': 'tier', 'type': 'SkuTier'}, } - def __init__(self, name): - super(Sku, self).__init__() - self.name = name + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) self.tier = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/sku_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/sku_py3.py new file mode 100644 index 000000000000..62eb64d55d00 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/sku_py3.py @@ -0,0 +1,46 @@ +# 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 msrest.serialization import Model + + +class Sku(Model): + """The SKU of the storage account. + + 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 Azure. + + :param name: Required. Gets or sets the sku name. Required for account + creation; optional for update. Note that in older versions, sku name was + called accountType. Possible values include: 'Standard_LRS', + 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' + :type name: str or ~azure.mgmt.storage.v2016_12_01.models.SkuName + :ivar tier: Gets the sku tier. This is based on the SKU name. Possible + values include: 'Standard', 'Premium' + :vartype tier: str or ~azure.mgmt.storage.v2016_12_01.models.SkuTier + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'SkuName'}, + 'tier': {'key': 'tier', 'type': 'SkuTier'}, + } + + def __init__(self, *, name, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account.py index 560774035ce3..95621cc3b8de 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account.py @@ -136,8 +136,8 @@ class StorageAccount(Resource): 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, } - def __init__(self, location=None, tags=None, enable_https_traffic_only=False): - super(StorageAccount, self).__init__(location=location, tags=tags) + def __init__(self, **kwargs): + super(StorageAccount, self).__init__(**kwargs) self.sku = None self.kind = None self.provisioning_state = None @@ -152,4 +152,4 @@ def __init__(self, location=None, tags=None, enable_https_traffic_only=False): self.secondary_endpoints = None self.encryption = None self.access_tier = None - self.enable_https_traffic_only = enable_https_traffic_only + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_check_name_availability_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_check_name_availability_parameters.py index 93dbd18c6f51..ffc402741b90 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_check_name_availability_parameters.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_check_name_availability_parameters.py @@ -18,9 +18,12 @@ class StorageAccountCheckNameAvailabilityParameters(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param name: + All required parameters must be populated in order to send to Azure. + + :param name: Required. :type name: str - :ivar type: Default value: "Microsoft.Storage/storageAccounts" . + :ivar type: Required. Default value: "Microsoft.Storage/storageAccounts" + . :vartype type: str """ @@ -36,6 +39,6 @@ class StorageAccountCheckNameAvailabilityParameters(Model): type = "Microsoft.Storage/storageAccounts" - def __init__(self, name): - super(StorageAccountCheckNameAvailabilityParameters, self).__init__() - self.name = name + def __init__(self, **kwargs): + super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_check_name_availability_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_check_name_availability_parameters_py3.py new file mode 100644 index 000000000000..e877df0e7854 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_check_name_availability_parameters_py3.py @@ -0,0 +1,44 @@ +# 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 msrest.serialization import Model + + +class StorageAccountCheckNameAvailabilityParameters(Model): + """The parameters used to check the availabity of the storage account name. + + 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 Azure. + + :param name: Required. + :type name: str + :ivar type: Required. Default value: "Microsoft.Storage/storageAccounts" + . + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.Storage/storageAccounts" + + def __init__(self, *, name: str, **kwargs) -> None: + super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = name diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_create_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_create_parameters.py index 190aa4cbff25..24bcdd36975d 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_create_parameters.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_create_parameters.py @@ -15,16 +15,18 @@ class StorageAccountCreateParameters(Model): """The parameters used when creating a storage account. - :param sku: Required. Gets or sets the sku name. + All required parameters must be populated in order to send to Azure. + + :param sku: Required. Required. Gets or sets the sku name. :type sku: ~azure.mgmt.storage.v2016_12_01.models.Sku - :param kind: Required. Indicates the type of storage account. Possible - values include: 'Storage', 'BlobStorage' + :param kind: Required. Required. Indicates the type of storage account. + Possible values include: 'Storage', 'BlobStorage' :type kind: str or ~azure.mgmt.storage.v2016_12_01.models.Kind - :param location: Required. Gets or sets the location of the resource. This - will be one of the supported and registered Azure Geo Regions (e.g. West - US, East US, Southeast Asia, etc.). The geo region of a resource cannot be - changed once it is created, but if an identical geo region is specified on - update, the request will succeed. + :param location: Required. Required. Gets or sets the location of the + resource. This will be one of the supported and registered Azure Geo + Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a + resource cannot be changed once it is created, but if an identical geo + region is specified on update, the request will succeed. :type location: str :param tags: Gets or sets a list of key value pairs that describe the resource. These tags can be used for viewing and grouping this resource @@ -68,13 +70,13 @@ class StorageAccountCreateParameters(Model): 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, } - def __init__(self, sku, kind, location, tags=None, custom_domain=None, encryption=None, access_tier=None, enable_https_traffic_only=False): - super(StorageAccountCreateParameters, self).__init__() - self.sku = sku - self.kind = kind - self.location = location - self.tags = tags - self.custom_domain = custom_domain - self.encryption = encryption - self.access_tier = access_tier - self.enable_https_traffic_only = enable_https_traffic_only + def __init__(self, **kwargs): + super(StorageAccountCreateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.kind = kwargs.get('kind', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.custom_domain = kwargs.get('custom_domain', None) + self.encryption = kwargs.get('encryption', None) + self.access_tier = kwargs.get('access_tier', None) + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_create_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_create_parameters_py3.py new file mode 100644 index 000000000000..c6132db9c30c --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_create_parameters_py3.py @@ -0,0 +1,82 @@ +# 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 msrest.serialization import Model + + +class StorageAccountCreateParameters(Model): + """The parameters used when creating a storage account. + + All required parameters must be populated in order to send to Azure. + + :param sku: Required. Required. Gets or sets the sku name. + :type sku: ~azure.mgmt.storage.v2016_12_01.models.Sku + :param kind: Required. Required. Indicates the type of storage account. + Possible values include: 'Storage', 'BlobStorage' + :type kind: str or ~azure.mgmt.storage.v2016_12_01.models.Kind + :param location: Required. Required. Gets or sets the location of the + resource. This will be one of the supported and registered Azure Geo + Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a + resource cannot be changed once it is created, but if an identical geo + region is specified on update, the request will succeed. + :type location: str + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used for viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key with a length no greater than 128 + characters and a value with a length no greater than 256 characters. + :type tags: dict[str, str] + :param custom_domain: User domain assigned to the storage account. Name is + the CNAME source. Only one custom domain is supported per storage account + at this time. To clear the existing custom domain, use an empty string for + the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2016_12_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. If + left unspecified the account encryption settings will remain the same. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2016_12_01.models.Encryption + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2016_12_01.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + """ + + _validation = { + 'sku': {'required': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + } + + def __init__(self, *, sku, kind, location: str, tags=None, custom_domain=None, encryption=None, access_tier=None, enable_https_traffic_only: bool=False, **kwargs) -> None: + super(StorageAccountCreateParameters, self).__init__(**kwargs) + self.sku = sku + self.kind = kind + self.location = location + self.tags = tags + self.custom_domain = custom_domain + self.encryption = encryption + self.access_tier = access_tier + self.enable_https_traffic_only = enable_https_traffic_only diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_key.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_key.py index cd3af6e71ca1..8d9349326908 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_key.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_key.py @@ -40,8 +40,8 @@ class StorageAccountKey(Model): 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, } - def __init__(self): - super(StorageAccountKey, self).__init__() + def __init__(self, **kwargs): + super(StorageAccountKey, self).__init__(**kwargs) self.key_name = None self.value = None self.permissions = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_key_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_key_py3.py new file mode 100644 index 000000000000..cb0ab68d14e9 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_key_py3.py @@ -0,0 +1,47 @@ +# 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 msrest.serialization import Model + + +class StorageAccountKey(Model): + """An access key for the storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar key_name: Name of the key. + :vartype key_name: str + :ivar value: Base 64-encoded value of the key. + :vartype value: str + :ivar permissions: Permissions for the key -- read-only or full + permissions. Possible values include: 'Read', 'Full' + :vartype permissions: str or + ~azure.mgmt.storage.v2016_12_01.models.KeyPermission + """ + + _validation = { + 'key_name': {'readonly': True}, + 'value': {'readonly': True}, + 'permissions': {'readonly': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, + } + + def __init__(self, **kwargs) -> None: + super(StorageAccountKey, self).__init__(**kwargs) + self.key_name = None + self.value = None + self.permissions = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_list_keys_result.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_list_keys_result.py index 603e822c624c..cbe3092f67cd 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_list_keys_result.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_list_keys_result.py @@ -32,6 +32,6 @@ class StorageAccountListKeysResult(Model): 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, } - def __init__(self): - super(StorageAccountListKeysResult, self).__init__() + def __init__(self, **kwargs): + super(StorageAccountListKeysResult, self).__init__(**kwargs) self.keys = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_list_keys_result_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_list_keys_result_py3.py new file mode 100644 index 000000000000..e87482fcd087 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_list_keys_result_py3.py @@ -0,0 +1,37 @@ +# 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 msrest.serialization import Model + + +class StorageAccountListKeysResult(Model): + """The response from the ListKeys operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar keys: Gets the list of storage account keys and their properties for + the specified storage account. + :vartype keys: + list[~azure.mgmt.storage.v2016_12_01.models.StorageAccountKey] + """ + + _validation = { + 'keys': {'readonly': True}, + } + + _attribute_map = { + 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, + } + + def __init__(self, **kwargs) -> None: + super(StorageAccountListKeysResult, self).__init__(**kwargs) + self.keys = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_py3.py new file mode 100644 index 000000000000..b1eeeb04bd55 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_py3.py @@ -0,0 +1,155 @@ +# 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 .resource import Resource + + +class StorageAccount(Resource): + """The storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Tags assigned to a resource; can be used for viewing and + grouping a resource (across resource groups). + :type tags: dict[str, str] + :ivar sku: Gets the SKU. + :vartype sku: ~azure.mgmt.storage.v2016_12_01.models.Sku + :ivar kind: Gets the Kind. Possible values include: 'Storage', + 'BlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2016_12_01.models.Kind + :ivar provisioning_state: Gets the status of the storage account at the + time the operation was called. Possible values include: 'Creating', + 'ResolvingDNS', 'Succeeded' + :vartype provisioning_state: str or + ~azure.mgmt.storage.v2016_12_01.models.ProvisioningState + :ivar primary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object. Note that Standard_ZRS + and Premium_LRS accounts only return the blob endpoint. + :vartype primary_endpoints: + ~azure.mgmt.storage.v2016_12_01.models.Endpoints + :ivar primary_location: Gets the location of the primary data center for + the storage account. + :vartype primary_location: str + :ivar status_of_primary: Gets the status indicating whether the primary + location of the storage account is available or unavailable. Possible + values include: 'available', 'unavailable' + :vartype status_of_primary: str or + ~azure.mgmt.storage.v2016_12_01.models.AccountStatus + :ivar last_geo_failover_time: Gets the timestamp of the most recent + instance of a failover to the secondary location. Only the most recent + timestamp is retained. This element is not returned if there has never + been a failover instance. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype last_geo_failover_time: datetime + :ivar secondary_location: Gets the location of the geo-replicated + secondary for the storage account. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype secondary_location: str + :ivar status_of_secondary: Gets the status indicating whether the + secondary location of the storage account is available or unavailable. + Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible + values include: 'available', 'unavailable' + :vartype status_of_secondary: str or + ~azure.mgmt.storage.v2016_12_01.models.AccountStatus + :ivar creation_time: Gets the creation date and time of the storage + account in UTC. + :vartype creation_time: datetime + :ivar custom_domain: Gets the custom domain the user assigned to this + storage account. + :vartype custom_domain: + ~azure.mgmt.storage.v2016_12_01.models.CustomDomain + :ivar secondary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object from the secondary + location of the storage account. Only available if the SKU name is + Standard_RAGRS. + :vartype secondary_endpoints: + ~azure.mgmt.storage.v2016_12_01.models.Endpoints + :ivar encryption: Gets the encryption settings on the account. If + unspecified, the account is unencrypted. + :vartype encryption: ~azure.mgmt.storage.v2016_12_01.models.Encryption + :ivar access_tier: Required for storage accounts where kind = BlobStorage. + The access tier used for billing. Possible values include: 'Hot', 'Cool' + :vartype access_tier: str or + ~azure.mgmt.storage.v2016_12_01.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'sku': {'readonly': True}, + 'kind': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'primary_endpoints': {'readonly': True}, + 'primary_location': {'readonly': True}, + 'status_of_primary': {'readonly': True}, + 'last_geo_failover_time': {'readonly': True}, + 'secondary_location': {'readonly': True}, + 'status_of_secondary': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'custom_domain': {'readonly': True}, + 'secondary_endpoints': {'readonly': True}, + 'encryption': {'readonly': True}, + 'access_tier': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, + 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, + 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, + 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'AccountStatus'}, + 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, + 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, + 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'AccountStatus'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + } + + def __init__(self, *, location: str=None, tags=None, enable_https_traffic_only: bool=False, **kwargs) -> None: + super(StorageAccount, self).__init__(location=location, tags=tags, **kwargs) + self.sku = None + self.kind = None + self.provisioning_state = None + self.primary_endpoints = None + self.primary_location = None + self.status_of_primary = None + self.last_geo_failover_time = None + self.secondary_location = None + self.status_of_secondary = None + self.creation_time = None + self.custom_domain = None + self.secondary_endpoints = None + self.encryption = None + self.access_tier = None + self.enable_https_traffic_only = enable_https_traffic_only diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_regenerate_key_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_regenerate_key_parameters.py index 84c9188dc0a6..2c7a28c67fcb 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_regenerate_key_parameters.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_regenerate_key_parameters.py @@ -15,7 +15,9 @@ class StorageAccountRegenerateKeyParameters(Model): """The parameters used to regenerate the storage account key. - :param key_name: + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. :type key_name: str """ @@ -27,6 +29,6 @@ class StorageAccountRegenerateKeyParameters(Model): 'key_name': {'key': 'keyName', 'type': 'str'}, } - def __init__(self, key_name): - super(StorageAccountRegenerateKeyParameters, self).__init__() - self.key_name = key_name + def __init__(self, **kwargs): + super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) + self.key_name = kwargs.get('key_name', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_regenerate_key_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_regenerate_key_parameters_py3.py new file mode 100644 index 000000000000..7db8cb2a22c8 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_regenerate_key_parameters_py3.py @@ -0,0 +1,34 @@ +# 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 msrest.serialization import Model + + +class StorageAccountRegenerateKeyParameters(Model): + """The parameters used to regenerate the storage account key. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. + :type key_name: str + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, *, key_name: str, **kwargs) -> None: + super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) + self.key_name = key_name diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_update_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_update_parameters.py index 9b97bf82101d..f48e0ae87161 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_update_parameters.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_update_parameters.py @@ -53,11 +53,11 @@ class StorageAccountUpdateParameters(Model): 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, } - def __init__(self, sku=None, tags=None, custom_domain=None, encryption=None, access_tier=None, enable_https_traffic_only=False): - super(StorageAccountUpdateParameters, self).__init__() - self.sku = sku - self.tags = tags - self.custom_domain = custom_domain - self.encryption = encryption - self.access_tier = access_tier - self.enable_https_traffic_only = enable_https_traffic_only + def __init__(self, **kwargs): + super(StorageAccountUpdateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.tags = kwargs.get('tags', None) + self.custom_domain = kwargs.get('custom_domain', None) + self.encryption = kwargs.get('encryption', None) + self.access_tier = kwargs.get('access_tier', None) + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_update_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_update_parameters_py3.py new file mode 100644 index 000000000000..9642815c7436 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_update_parameters_py3.py @@ -0,0 +1,63 @@ +# 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 msrest.serialization import Model + + +class StorageAccountUpdateParameters(Model): + """The parameters that can be provided when updating the storage account + properties. + + :param sku: Gets or sets the SKU name. Note that the SKU name cannot be + updated to Standard_ZRS or Premium_LRS, nor can accounts of those sku + names be updated to any other value. + :type sku: ~azure.mgmt.storage.v2016_12_01.models.Sku + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used in viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key no greater in length than 128 + characters and a value no greater in length than 256 characters. + :type tags: dict[str, str] + :param custom_domain: Custom domain assigned to the storage account by the + user. Name is the CNAME source. Only one custom domain is supported per + storage account at this time. To clear the existing custom domain, use an + empty string for the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2016_12_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2016_12_01.models.Encryption + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2016_12_01.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + """ + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + } + + def __init__(self, *, sku=None, tags=None, custom_domain=None, encryption=None, access_tier=None, enable_https_traffic_only: bool=False, **kwargs) -> None: + super(StorageAccountUpdateParameters, self).__init__(**kwargs) + self.sku = sku + self.tags = tags + self.custom_domain = custom_domain + self.encryption = encryption + self.access_tier = access_tier + self.enable_https_traffic_only = enable_https_traffic_only diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_management_client_enums.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_management_client_enums.py index 00f533d896f7..c5fff72ced34 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_management_client_enums.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_management_client_enums.py @@ -12,13 +12,13 @@ from enum import Enum -class Reason(Enum): +class Reason(str, Enum): account_name_invalid = "AccountNameInvalid" already_exists = "AlreadyExists" -class SkuName(Enum): +class SkuName(str, Enum): standard_lrs = "Standard_LRS" standard_grs = "Standard_GRS" @@ -27,44 +27,44 @@ class SkuName(Enum): premium_lrs = "Premium_LRS" -class SkuTier(Enum): +class SkuTier(str, Enum): standard = "Standard" premium = "Premium" -class AccessTier(Enum): +class AccessTier(str, Enum): hot = "Hot" cool = "Cool" -class Kind(Enum): +class Kind(str, Enum): storage = "Storage" blob_storage = "BlobStorage" -class ProvisioningState(Enum): +class ProvisioningState(str, Enum): creating = "Creating" resolving_dns = "ResolvingDNS" succeeded = "Succeeded" -class AccountStatus(Enum): +class AccountStatus(str, Enum): available = "available" unavailable = "unavailable" -class KeyPermission(Enum): +class KeyPermission(str, Enum): read = "Read" full = "Full" -class UsageUnit(Enum): +class UsageUnit(str, Enum): count = "Count" bytes = "Bytes" @@ -74,7 +74,7 @@ class UsageUnit(Enum): bytes_per_second = "BytesPerSecond" -class HttpProtocol(Enum): +class HttpProtocol(str, Enum): httpshttp = "https,http" https = "https" diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/usage.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/usage.py index 3917db7540ad..6aad2888dbca 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/usage.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/usage.py @@ -46,8 +46,8 @@ class Usage(Model): 'name': {'key': 'name', 'type': 'UsageName'}, } - def __init__(self): - super(Usage, self).__init__() + def __init__(self, **kwargs): + super(Usage, self).__init__(**kwargs) self.unit = None self.current_value = None self.limit = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/usage_name.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/usage_name.py index c09f75b38c9a..e4082bf52384 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/usage_name.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/usage_name.py @@ -35,7 +35,7 @@ class UsageName(Model): 'localized_value': {'key': 'localizedValue', 'type': 'str'}, } - def __init__(self): - super(UsageName, self).__init__() + def __init__(self, **kwargs): + super(UsageName, self).__init__(**kwargs) self.value = None self.localized_value = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/usage_name_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/usage_name_py3.py new file mode 100644 index 000000000000..f519bb5072b1 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/usage_name_py3.py @@ -0,0 +1,41 @@ +# 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 msrest.serialization import Model + + +class UsageName(Model): + """The usage names that can be used; currently limited to StorageAccount. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: Gets a string describing the resource name. + :vartype value: str + :ivar localized_value: Gets a localized string describing the resource + name. + :vartype localized_value: str + """ + + _validation = { + 'value': {'readonly': True}, + 'localized_value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(UsageName, self).__init__(**kwargs) + self.value = None + self.localized_value = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/usage_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/usage_py3.py new file mode 100644 index 000000000000..26928cf23d85 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/usage_py3.py @@ -0,0 +1,54 @@ +# 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 msrest.serialization import Model + + +class Usage(Model): + """Describes Storage Resource Usage. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar unit: Gets the unit of measurement. Possible values include: + 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', + 'BytesPerSecond' + :vartype unit: str or ~azure.mgmt.storage.v2016_12_01.models.UsageUnit + :ivar current_value: Gets the current count of the allocated resources in + the subscription. + :vartype current_value: int + :ivar limit: Gets the maximum count of the resources that can be allocated + in the subscription. + :vartype limit: int + :ivar name: Gets the name of the type of usage. + :vartype name: ~azure.mgmt.storage.v2016_12_01.models.UsageName + """ + + _validation = { + 'unit': {'readonly': True}, + 'current_value': {'readonly': True}, + 'limit': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'UsageUnit'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + def __init__(self, **kwargs) -> None: + super(Usage, self).__init__(**kwargs) + self.unit = None + self.current_value = None + self.limit = None + self.name = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/operations/storage_accounts_operations.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/operations/storage_accounts_operations.py index ed6df8302580..eb337be00bc8 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/operations/storage_accounts_operations.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/operations/storage_accounts_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class StorageAccountsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2016-12-01". """ @@ -60,7 +60,7 @@ def check_name_availability( account_name = models.StorageAccountCheckNameAvailabilityParameters(name=name) # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability' + url = self.check_name_availability.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -103,12 +103,13 @@ def check_name_availability( return client_raw_response return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability'} def _create_initial( self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}' + url = self.create.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -155,7 +156,7 @@ def _create_initial( return deserialized def create( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties @@ -174,13 +175,16 @@ def create( :type parameters: ~azure.mgmt.storage.v2016_12_01.models.StorageAccountCreateParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - StorageAccount or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns StorageAccount or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.storage.v2016_12_01.models.StorageAccount] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.storage.v2016_12_01.models.StorageAccount]] :raises: :class:`CloudError` """ raw_result = self._create_initial( @@ -191,30 +195,8 @@ def create( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('StorageAccount', response) if raw: @@ -223,12 +205,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} def delete( self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): @@ -251,7 +235,7 @@ def delete( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -285,6 +269,7 @@ def delete( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} def get_properties( self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): @@ -310,7 +295,7 @@ def get_properties( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}' + url = self.get_properties.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -351,6 +336,7 @@ def get_properties( return client_raw_response return deserialized + get_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} def update( self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): @@ -386,7 +372,7 @@ def update( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}' + url = self.update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -431,6 +417,7 @@ def update( return client_raw_response return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} def list( self, custom_headers=None, raw=False, **operation_config): @@ -452,7 +439,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -497,6 +484,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts'} def list_by_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -521,7 +509,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts' + url = self.list_by_resource_group.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -567,6 +555,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts'} def list_keys( self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): @@ -591,7 +580,7 @@ def list_keys( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys' + url = self.list_keys.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -632,6 +621,7 @@ def list_keys( return client_raw_response return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys'} def regenerate_key( self, resource_group_name, account_name, key_name, custom_headers=None, raw=False, **operation_config): @@ -660,7 +650,7 @@ def regenerate_key( regenerate_key1 = models.StorageAccountRegenerateKeyParameters(key_name=key_name) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey' + url = self.regenerate_key.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -705,6 +695,7 @@ def regenerate_key( return client_raw_response return deserialized + regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey'} def list_account_sas( self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): @@ -732,7 +723,7 @@ def list_account_sas( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas' + url = self.list_account_sas.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -777,6 +768,7 @@ def list_account_sas( return client_raw_response return deserialized + list_account_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas'} def list_service_sas( self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): @@ -804,7 +796,7 @@ def list_service_sas( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas' + url = self.list_service_sas.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -849,3 +841,4 @@ def list_service_sas( return client_raw_response return deserialized + list_service_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas'} diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/operations/usage_operations.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/operations/usage_operations.py index 236baad51d92..5ea32cd89d82 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/operations/usage_operations.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/operations/usage_operations.py @@ -22,7 +22,7 @@ class UsageOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2016-12-01". """ @@ -56,7 +56,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -101,3 +101,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages'} diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/storage_management_client.py b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/storage_management_client.py index 105967b9c7f7..0f668eb0225e 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/storage_management_client.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/storage_management_client.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import ServiceClient +from msrest.service_client import SDKClient from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION @@ -52,7 +52,7 @@ def __init__( self.subscription_id = subscription_id -class StorageManagementClient(object): +class StorageManagementClient(SDKClient): """The Azure Storage Management API. :ivar config: Configuration for client. @@ -77,7 +77,7 @@ def __init__( self, credentials, subscription_id, base_url=None): self.config = StorageManagementClientConfiguration(credentials, subscription_id, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + super(StorageManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self.api_version = '2016-12-01' diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/__init__.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/__init__.py index 8e493a3a2641..d3d602c0775b 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/__init__.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/__init__.py @@ -9,39 +9,74 @@ # regenerated. # -------------------------------------------------------------------------- -from .operation_display import OperationDisplay -from .dimension import Dimension -from .metric_specification import MetricSpecification -from .service_specification import ServiceSpecification -from .operation import Operation -from .storage_account_check_name_availability_parameters import StorageAccountCheckNameAvailabilityParameters -from .sku_capability import SKUCapability -from .restriction import Restriction -from .sku import Sku -from .check_name_availability_result import CheckNameAvailabilityResult -from .custom_domain import CustomDomain -from .encryption_service import EncryptionService -from .encryption_services import EncryptionServices -from .key_vault_properties import KeyVaultProperties -from .encryption import Encryption -from .virtual_network_rule import VirtualNetworkRule -from .ip_rule import IPRule -from .network_rule_set import NetworkRuleSet -from .identity import Identity -from .storage_account_create_parameters import StorageAccountCreateParameters -from .endpoints import Endpoints -from .storage_account import StorageAccount -from .storage_account_key import StorageAccountKey -from .storage_account_list_keys_result import StorageAccountListKeysResult -from .storage_account_regenerate_key_parameters import StorageAccountRegenerateKeyParameters -from .storage_account_update_parameters import StorageAccountUpdateParameters -from .usage_name import UsageName -from .usage import Usage -from .resource import Resource -from .account_sas_parameters import AccountSasParameters -from .list_account_sas_response import ListAccountSasResponse -from .service_sas_parameters import ServiceSasParameters -from .list_service_sas_response import ListServiceSasResponse +try: + from .operation_display_py3 import OperationDisplay + from .dimension_py3 import Dimension + from .metric_specification_py3 import MetricSpecification + from .service_specification_py3 import ServiceSpecification + from .operation_py3 import Operation + from .storage_account_check_name_availability_parameters_py3 import StorageAccountCheckNameAvailabilityParameters + from .sku_capability_py3 import SKUCapability + from .restriction_py3 import Restriction + from .sku_py3 import Sku + from .check_name_availability_result_py3 import CheckNameAvailabilityResult + from .custom_domain_py3 import CustomDomain + from .encryption_service_py3 import EncryptionService + from .encryption_services_py3 import EncryptionServices + from .key_vault_properties_py3 import KeyVaultProperties + from .encryption_py3 import Encryption + from .virtual_network_rule_py3 import VirtualNetworkRule + from .ip_rule_py3 import IPRule + from .network_rule_set_py3 import NetworkRuleSet + from .identity_py3 import Identity + from .storage_account_create_parameters_py3 import StorageAccountCreateParameters + from .endpoints_py3 import Endpoints + from .storage_account_py3 import StorageAccount + from .storage_account_key_py3 import StorageAccountKey + from .storage_account_list_keys_result_py3 import StorageAccountListKeysResult + from .storage_account_regenerate_key_parameters_py3 import StorageAccountRegenerateKeyParameters + from .storage_account_update_parameters_py3 import StorageAccountUpdateParameters + from .usage_name_py3 import UsageName + from .usage_py3 import Usage + from .resource_py3 import Resource + from .account_sas_parameters_py3 import AccountSasParameters + from .list_account_sas_response_py3 import ListAccountSasResponse + from .service_sas_parameters_py3 import ServiceSasParameters + from .list_service_sas_response_py3 import ListServiceSasResponse +except (SyntaxError, ImportError): + from .operation_display import OperationDisplay + from .dimension import Dimension + from .metric_specification import MetricSpecification + from .service_specification import ServiceSpecification + from .operation import Operation + from .storage_account_check_name_availability_parameters import StorageAccountCheckNameAvailabilityParameters + from .sku_capability import SKUCapability + from .restriction import Restriction + from .sku import Sku + from .check_name_availability_result import CheckNameAvailabilityResult + from .custom_domain import CustomDomain + from .encryption_service import EncryptionService + from .encryption_services import EncryptionServices + from .key_vault_properties import KeyVaultProperties + from .encryption import Encryption + from .virtual_network_rule import VirtualNetworkRule + from .ip_rule import IPRule + from .network_rule_set import NetworkRuleSet + from .identity import Identity + from .storage_account_create_parameters import StorageAccountCreateParameters + from .endpoints import Endpoints + from .storage_account import StorageAccount + from .storage_account_key import StorageAccountKey + from .storage_account_list_keys_result import StorageAccountListKeysResult + from .storage_account_regenerate_key_parameters import StorageAccountRegenerateKeyParameters + from .storage_account_update_parameters import StorageAccountUpdateParameters + from .usage_name import UsageName + from .usage import Usage + from .resource import Resource + from .account_sas_parameters import AccountSasParameters + from .list_account_sas_response import ListAccountSasResponse + from .service_sas_parameters import ServiceSasParameters + from .list_service_sas_response import ListServiceSasResponse from .operation_paged import OperationPaged from .sku_paged import SkuPaged from .storage_account_paged import StorageAccountPaged diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/account_sas_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/account_sas_parameters.py index 7f79a82412fb..754adb2c7441 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/account_sas_parameters.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/account_sas_parameters.py @@ -15,21 +15,23 @@ class AccountSasParameters(Model): """The parameters to list SAS credentials of a storage account. - :param services: The signed services accessible with the account SAS. - Possible values include: Blob (b), Queue (q), Table (t), File (f). + All required parameters must be populated in order to send to Azure. + + :param services: Required. The signed services accessible with the account + SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). Possible values include: 'b', 'q', 't', 'f' :type services: str or ~azure.mgmt.storage.v2017_06_01.models.Services - :param resource_types: The signed resource types that are accessible with - the account SAS. Service (s): Access to service-level APIs; Container (c): - Access to container-level APIs; Object (o): Access to object-level APIs - for blobs, queue messages, table entities, and files. Possible values - include: 's', 'c', 'o' + :param resource_types: Required. The signed resource types that are + accessible with the account SAS. Service (s): Access to service-level + APIs; Container (c): Access to container-level APIs; Object (o): Access to + object-level APIs for blobs, queue messages, table entities, and files. + Possible values include: 's', 'c', 'o' :type resource_types: str or ~azure.mgmt.storage.v2017_06_01.models.SignedResourceTypes - :param permissions: The signed permissions for the account SAS. Possible - values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create - (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', - 'l', 'a', 'c', 'u', 'p' + :param permissions: Required. The signed permissions for the account SAS. + Possible values include: Read (r), Write (w), Delete (d), List (l), Add + (a), Create (c), Update (u) and Process (p). Possible values include: 'r', + 'd', 'w', 'l', 'a', 'c', 'u', 'p' :type permissions: str or ~azure.mgmt.storage.v2017_06_01.models.Permissions :param ip_address_or_range: An IP address or a range of IP addresses from @@ -41,8 +43,8 @@ class AccountSasParameters(Model): ~azure.mgmt.storage.v2017_06_01.models.HttpProtocol :param shared_access_start_time: The time at which the SAS becomes valid. :type shared_access_start_time: datetime - :param shared_access_expiry_time: The time at which the shared access - signature becomes invalid. + :param shared_access_expiry_time: Required. The time at which the shared + access signature becomes invalid. :type shared_access_expiry_time: datetime :param key_to_sign: The key to sign the account SAS token with. :type key_to_sign: str @@ -66,13 +68,13 @@ class AccountSasParameters(Model): 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, } - def __init__(self, services, resource_types, permissions, shared_access_expiry_time, ip_address_or_range=None, protocols=None, shared_access_start_time=None, key_to_sign=None): - super(AccountSasParameters, self).__init__() - self.services = services - self.resource_types = resource_types - self.permissions = permissions - self.ip_address_or_range = ip_address_or_range - self.protocols = protocols - self.shared_access_start_time = shared_access_start_time - self.shared_access_expiry_time = shared_access_expiry_time - self.key_to_sign = key_to_sign + def __init__(self, **kwargs): + super(AccountSasParameters, self).__init__(**kwargs) + self.services = kwargs.get('services', None) + self.resource_types = kwargs.get('resource_types', None) + self.permissions = kwargs.get('permissions', None) + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + self.protocols = kwargs.get('protocols', None) + self.shared_access_start_time = kwargs.get('shared_access_start_time', None) + self.shared_access_expiry_time = kwargs.get('shared_access_expiry_time', None) + self.key_to_sign = kwargs.get('key_to_sign', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/account_sas_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/account_sas_parameters_py3.py new file mode 100644 index 000000000000..3fc320834ec4 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/account_sas_parameters_py3.py @@ -0,0 +1,80 @@ +# 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 msrest.serialization import Model + + +class AccountSasParameters(Model): + """The parameters to list SAS credentials of a storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: Required. The signed services accessible with the account + SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). + Possible values include: 'b', 'q', 't', 'f' + :type services: str or ~azure.mgmt.storage.v2017_06_01.models.Services + :param resource_types: Required. The signed resource types that are + accessible with the account SAS. Service (s): Access to service-level + APIs; Container (c): Access to container-level APIs; Object (o): Access to + object-level APIs for blobs, queue messages, table entities, and files. + Possible values include: 's', 'c', 'o' + :type resource_types: str or + ~azure.mgmt.storage.v2017_06_01.models.SignedResourceTypes + :param permissions: Required. The signed permissions for the account SAS. + Possible values include: Read (r), Write (w), Delete (d), List (l), Add + (a), Create (c), Update (u) and Process (p). Possible values include: 'r', + 'd', 'w', 'l', 'a', 'c', 'u', 'p' + :type permissions: str or + ~azure.mgmt.storage.v2017_06_01.models.Permissions + :param ip_address_or_range: An IP address or a range of IP addresses from + which to accept requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the + account SAS. Possible values include: 'https,http', 'https' + :type protocols: str or + ~azure.mgmt.storage.v2017_06_01.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: datetime + :param shared_access_expiry_time: Required. The time at which the shared + access signature becomes invalid. + :type shared_access_expiry_time: datetime + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + """ + + _validation = { + 'services': {'required': True}, + 'resource_types': {'required': True}, + 'permissions': {'required': True}, + 'shared_access_expiry_time': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'signedServices', 'type': 'str'}, + 'resource_types': {'key': 'signedResourceTypes', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + } + + def __init__(self, *, services, resource_types, permissions, shared_access_expiry_time, ip_address_or_range: str=None, protocols=None, shared_access_start_time=None, key_to_sign: str=None, **kwargs) -> None: + super(AccountSasParameters, self).__init__(**kwargs) + self.services = services + self.resource_types = resource_types + self.permissions = permissions + self.ip_address_or_range = ip_address_or_range + self.protocols = protocols + self.shared_access_start_time = shared_access_start_time + self.shared_access_expiry_time = shared_access_expiry_time + self.key_to_sign = key_to_sign diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/check_name_availability_result.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/check_name_availability_result.py index 40ff88b90d63..22058e79e7ee 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/check_name_availability_result.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/check_name_availability_result.py @@ -43,8 +43,8 @@ class CheckNameAvailabilityResult(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self): - super(CheckNameAvailabilityResult, self).__init__() + def __init__(self, **kwargs): + super(CheckNameAvailabilityResult, self).__init__(**kwargs) self.name_available = None self.reason = None self.message = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/check_name_availability_result_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/check_name_availability_result_py3.py new file mode 100644 index 000000000000..5b5ce7c34f2a --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/check_name_availability_result_py3.py @@ -0,0 +1,50 @@ +# 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 msrest.serialization import Model + + +class CheckNameAvailabilityResult(Model): + """The CheckNameAvailability operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name_available: Gets a boolean value that indicates whether the name + is available for you to use. If true, the name is available. If false, the + name has already been taken or is invalid and cannot be used. + :vartype name_available: bool + :ivar reason: Gets the reason that a storage account name could not be + used. The Reason element is only returned if NameAvailable is false. + Possible values include: 'AccountNameInvalid', 'AlreadyExists' + :vartype reason: str or ~azure.mgmt.storage.v2017_06_01.models.Reason + :ivar message: Gets an error message explaining the Reason value in more + detail. + :vartype message: str + """ + + _validation = { + 'name_available': {'readonly': True}, + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'Reason'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = None + self.reason = None + self.message = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/custom_domain.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/custom_domain.py index 12b0f7691888..585480d7321a 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/custom_domain.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/custom_domain.py @@ -16,8 +16,10 @@ class CustomDomain(Model): """The custom domain assigned to this storage account. This can be set via Update. - :param name: Gets or sets the custom domain name assigned to the storage - account. Name is the CNAME source. + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the custom domain name assigned to the + storage account. Name is the CNAME source. :type name: str :param use_sub_domain: Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. @@ -33,7 +35,7 @@ class CustomDomain(Model): 'use_sub_domain': {'key': 'useSubDomain', 'type': 'bool'}, } - def __init__(self, name, use_sub_domain=None): - super(CustomDomain, self).__init__() - self.name = name - self.use_sub_domain = use_sub_domain + def __init__(self, **kwargs): + super(CustomDomain, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.use_sub_domain = kwargs.get('use_sub_domain', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/custom_domain_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/custom_domain_py3.py new file mode 100644 index 000000000000..4c6fe3f83e35 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/custom_domain_py3.py @@ -0,0 +1,41 @@ +# 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 msrest.serialization import Model + + +class CustomDomain(Model): + """The custom domain assigned to this storage account. This can be set via + Update. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the custom domain name assigned to the + storage account. Name is the CNAME source. + :type name: str + :param use_sub_domain: Indicates whether indirect CName validation is + enabled. Default value is false. This should only be set on updates. + :type use_sub_domain: bool + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'use_sub_domain': {'key': 'useSubDomain', 'type': 'bool'}, + } + + def __init__(self, *, name: str, use_sub_domain: bool=None, **kwargs) -> None: + super(CustomDomain, self).__init__(**kwargs) + self.name = name + self.use_sub_domain = use_sub_domain diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/dimension.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/dimension.py index bf7b9383880f..0a0cdaf75da7 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/dimension.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/dimension.py @@ -26,7 +26,7 @@ class Dimension(Model): 'display_name': {'key': 'displayName', 'type': 'str'}, } - def __init__(self, name=None, display_name=None): - super(Dimension, self).__init__() - self.name = name - self.display_name = display_name + def __init__(self, **kwargs): + super(Dimension, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/dimension_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/dimension_py3.py new file mode 100644 index 000000000000..6845aa528b4b --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/dimension_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class Dimension(Model): + """Dimension of blobs, possiblly be blob type or access tier. + + :param name: Display name of dimension. + :type name: str + :param display_name: Display name of dimension. + :type display_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, **kwargs) -> None: + super(Dimension, self).__init__(**kwargs) + self.name = name + self.display_name = display_name diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption.py index e870314ca8c4..63e35db813c6 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption.py @@ -15,12 +15,14 @@ class Encryption(Model): """The encryption settings on the storage account. + All required parameters must be populated in order to send to Azure. + :param services: List of services which support encryption. :type services: ~azure.mgmt.storage.v2017_06_01.models.EncryptionServices - :param key_source: The encryption keySource (provider). Possible values - (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. Possible - values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. Default value: - "Microsoft.Storage" . + :param key_source: Required. The encryption keySource (provider). Possible + values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. + Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. + Default value: "Microsoft.Storage" . :type key_source: str or ~azure.mgmt.storage.v2017_06_01.models.KeySource :param key_vault_properties: Properties provided by key vault. :type key_vault_properties: @@ -37,8 +39,8 @@ class Encryption(Model): 'key_vault_properties': {'key': 'keyvaultproperties', 'type': 'KeyVaultProperties'}, } - def __init__(self, services=None, key_source="Microsoft.Storage", key_vault_properties=None): - super(Encryption, self).__init__() - self.services = services - self.key_source = key_source - self.key_vault_properties = key_vault_properties + def __init__(self, **kwargs): + super(Encryption, self).__init__(**kwargs) + self.services = kwargs.get('services', None) + self.key_source = kwargs.get('key_source', "Microsoft.Storage") + self.key_vault_properties = kwargs.get('key_vault_properties', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption_py3.py new file mode 100644 index 000000000000..20c4c4c51120 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption_py3.py @@ -0,0 +1,46 @@ +# 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 msrest.serialization import Model + + +class Encryption(Model): + """The encryption settings on the storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: List of services which support encryption. + :type services: ~azure.mgmt.storage.v2017_06_01.models.EncryptionServices + :param key_source: Required. The encryption keySource (provider). Possible + values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. + Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. + Default value: "Microsoft.Storage" . + :type key_source: str or ~azure.mgmt.storage.v2017_06_01.models.KeySource + :param key_vault_properties: Properties provided by key vault. + :type key_vault_properties: + ~azure.mgmt.storage.v2017_06_01.models.KeyVaultProperties + """ + + _validation = { + 'key_source': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'services', 'type': 'EncryptionServices'}, + 'key_source': {'key': 'keySource', 'type': 'str'}, + 'key_vault_properties': {'key': 'keyvaultproperties', 'type': 'KeyVaultProperties'}, + } + + def __init__(self, *, services=None, key_source="Microsoft.Storage", key_vault_properties=None, **kwargs) -> None: + super(Encryption, self).__init__(**kwargs) + self.services = services + self.key_source = key_source + self.key_vault_properties = key_vault_properties diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption_service.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption_service.py index 0e033e9fe4a8..3a020c468f64 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption_service.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption_service.py @@ -37,7 +37,7 @@ class EncryptionService(Model): 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, } - def __init__(self, enabled=None): - super(EncryptionService, self).__init__() - self.enabled = enabled + def __init__(self, **kwargs): + super(EncryptionService, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) self.last_enabled_time = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption_service_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption_service_py3.py new file mode 100644 index 000000000000..0566050c6155 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption_service_py3.py @@ -0,0 +1,43 @@ +# 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 msrest.serialization import Model + + +class EncryptionService(Model): + """A service that allows server-side encryption to be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param enabled: A boolean indicating whether or not the service encrypts + the data as it is stored. + :type enabled: bool + :ivar last_enabled_time: Gets a rough estimate of the date/time when the + encryption was last enabled by the user. Only returned when encryption is + enabled. There might be some unencrypted blobs which were written after + this time, as it is just a rough estimate. + :vartype last_enabled_time: datetime + """ + + _validation = { + 'last_enabled_time': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, + } + + def __init__(self, *, enabled: bool=None, **kwargs) -> None: + super(EncryptionService, self).__init__(**kwargs) + self.enabled = enabled + self.last_enabled_time = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption_services.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption_services.py index bb24ea11bb3d..4eaebd087b08 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption_services.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption_services.py @@ -40,9 +40,9 @@ class EncryptionServices(Model): 'queue': {'key': 'queue', 'type': 'EncryptionService'}, } - def __init__(self, blob=None, file=None): - super(EncryptionServices, self).__init__() - self.blob = blob - self.file = file + def __init__(self, **kwargs): + super(EncryptionServices, self).__init__(**kwargs) + self.blob = kwargs.get('blob', None) + self.file = kwargs.get('file', None) self.table = None self.queue = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption_services_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption_services_py3.py new file mode 100644 index 000000000000..eb0e237af96a --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption_services_py3.py @@ -0,0 +1,48 @@ +# 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 msrest.serialization import Model + + +class EncryptionServices(Model): + """A list of services that support encryption. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param blob: The encryption function of the blob storage service. + :type blob: ~azure.mgmt.storage.v2017_06_01.models.EncryptionService + :param file: The encryption function of the file storage service. + :type file: ~azure.mgmt.storage.v2017_06_01.models.EncryptionService + :ivar table: The encryption function of the table storage service. + :vartype table: ~azure.mgmt.storage.v2017_06_01.models.EncryptionService + :ivar queue: The encryption function of the queue storage service. + :vartype queue: ~azure.mgmt.storage.v2017_06_01.models.EncryptionService + """ + + _validation = { + 'table': {'readonly': True}, + 'queue': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'EncryptionService'}, + 'file': {'key': 'file', 'type': 'EncryptionService'}, + 'table': {'key': 'table', 'type': 'EncryptionService'}, + 'queue': {'key': 'queue', 'type': 'EncryptionService'}, + } + + def __init__(self, *, blob=None, file=None, **kwargs) -> None: + super(EncryptionServices, self).__init__(**kwargs) + self.blob = blob + self.file = file + self.table = None + self.queue = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/endpoints.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/endpoints.py index 2524757f961f..ec345fceac47 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/endpoints.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/endpoints.py @@ -43,8 +43,8 @@ class Endpoints(Model): 'file': {'key': 'file', 'type': 'str'}, } - def __init__(self): - super(Endpoints, self).__init__() + def __init__(self, **kwargs): + super(Endpoints, self).__init__(**kwargs) self.blob = None self.queue = None self.table = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/endpoints_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/endpoints_py3.py new file mode 100644 index 000000000000..a186e9c8d6a9 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/endpoints_py3.py @@ -0,0 +1,51 @@ +# 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 msrest.serialization import Model + + +class Endpoints(Model): + """The URIs that are used to perform a retrieval of a public blob, queue, or + table object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar blob: Gets the blob endpoint. + :vartype blob: str + :ivar queue: Gets the queue endpoint. + :vartype queue: str + :ivar table: Gets the table endpoint. + :vartype table: str + :ivar file: Gets the file endpoint. + :vartype file: str + """ + + _validation = { + 'blob': {'readonly': True}, + 'queue': {'readonly': True}, + 'table': {'readonly': True}, + 'file': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'str'}, + 'queue': {'key': 'queue', 'type': 'str'}, + 'table': {'key': 'table', 'type': 'str'}, + 'file': {'key': 'file', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Endpoints, self).__init__(**kwargs) + self.blob = None + self.queue = None + self.table = None + self.file = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/identity.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/identity.py index 5e7bac70c5e2..f526b986fc70 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/identity.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/identity.py @@ -18,11 +18,13 @@ class Identity(Model): 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 Azure. + :ivar principal_id: The principal ID of resource identity. :vartype principal_id: str :ivar tenant_id: The tenant ID of resource. :vartype tenant_id: str - :ivar type: The identity type. Default value: "SystemAssigned" . + :ivar type: Required. The identity type. Default value: "SystemAssigned" . :vartype type: str """ @@ -40,7 +42,7 @@ class Identity(Model): type = "SystemAssigned" - def __init__(self): - super(Identity, self).__init__() + def __init__(self, **kwargs): + super(Identity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/identity_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/identity_py3.py new file mode 100644 index 000000000000..22d25fdd85b7 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/identity_py3.py @@ -0,0 +1,48 @@ +# 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 msrest.serialization import Model + + +class Identity(Model): + """Identity for the 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 Azure. + + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :ivar type: Required. The identity type. Default value: "SystemAssigned" . + :vartype type: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "SystemAssigned" + + def __init__(self, **kwargs) -> None: + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/ip_rule.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/ip_rule.py index e0a36cd8e0cd..6dbbc87301f6 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/ip_rule.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/ip_rule.py @@ -15,8 +15,10 @@ class IPRule(Model): """IP rule with specific IP or IP range in CIDR format. - :param ip_address_or_range: Specifies the IP or IP range in CIDR format. - Only IPV4 address is allowed. + All required parameters must be populated in order to send to Azure. + + :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR + format. Only IPV4 address is allowed. :type ip_address_or_range: str :param action: The action of IP ACL rule. Possible values include: 'Allow'. Default value: "Allow" . @@ -32,7 +34,7 @@ class IPRule(Model): 'action': {'key': 'action', 'type': 'Action'}, } - def __init__(self, ip_address_or_range, action="Allow"): - super(IPRule, self).__init__() - self.ip_address_or_range = ip_address_or_range - self.action = action + def __init__(self, **kwargs): + super(IPRule, self).__init__(**kwargs) + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + self.action = kwargs.get('action', "Allow") diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/ip_rule_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/ip_rule_py3.py new file mode 100644 index 000000000000..3224cab4d7c1 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/ip_rule_py3.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class IPRule(Model): + """IP rule with specific IP or IP range in CIDR format. + + All required parameters must be populated in order to send to Azure. + + :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR + format. Only IPV4 address is allowed. + :type ip_address_or_range: str + :param action: The action of IP ACL rule. Possible values include: + 'Allow'. Default value: "Allow" . + :type action: str or ~azure.mgmt.storage.v2017_06_01.models.Action + """ + + _validation = { + 'ip_address_or_range': {'required': True}, + } + + _attribute_map = { + 'ip_address_or_range': {'key': 'value', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'Action'}, + } + + def __init__(self, *, ip_address_or_range: str, action="Allow", **kwargs) -> None: + super(IPRule, self).__init__(**kwargs) + self.ip_address_or_range = ip_address_or_range + self.action = action diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/key_vault_properties.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/key_vault_properties.py index 59657c3071b7..44eaf379f6f2 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/key_vault_properties.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/key_vault_properties.py @@ -29,8 +29,8 @@ class KeyVaultProperties(Model): 'key_vault_uri': {'key': 'keyvaulturi', 'type': 'str'}, } - def __init__(self, key_name=None, key_version=None, key_vault_uri=None): - super(KeyVaultProperties, self).__init__() - self.key_name = key_name - self.key_version = key_version - self.key_vault_uri = key_vault_uri + def __init__(self, **kwargs): + super(KeyVaultProperties, self).__init__(**kwargs) + self.key_name = kwargs.get('key_name', None) + self.key_version = kwargs.get('key_version', None) + self.key_vault_uri = kwargs.get('key_vault_uri', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/key_vault_properties_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/key_vault_properties_py3.py new file mode 100644 index 000000000000..9e6350eec898 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/key_vault_properties_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class KeyVaultProperties(Model): + """Properties of key vault. + + :param key_name: The name of KeyVault key. + :type key_name: str + :param key_version: The version of KeyVault key. + :type key_version: str + :param key_vault_uri: The Uri of KeyVault. + :type key_vault_uri: str + """ + + _attribute_map = { + 'key_name': {'key': 'keyname', 'type': 'str'}, + 'key_version': {'key': 'keyversion', 'type': 'str'}, + 'key_vault_uri': {'key': 'keyvaulturi', 'type': 'str'}, + } + + def __init__(self, *, key_name: str=None, key_version: str=None, key_vault_uri: str=None, **kwargs) -> None: + super(KeyVaultProperties, self).__init__(**kwargs) + self.key_name = key_name + self.key_version = key_version + self.key_vault_uri = key_vault_uri diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/list_account_sas_response.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/list_account_sas_response.py index 5d8b8c53cd6f..a56e959a34bd 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/list_account_sas_response.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/list_account_sas_response.py @@ -30,6 +30,6 @@ class ListAccountSasResponse(Model): 'account_sas_token': {'key': 'accountSasToken', 'type': 'str'}, } - def __init__(self): - super(ListAccountSasResponse, self).__init__() + def __init__(self, **kwargs): + super(ListAccountSasResponse, self).__init__(**kwargs) self.account_sas_token = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/list_account_sas_response_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/list_account_sas_response_py3.py new file mode 100644 index 000000000000..b8b9a314d9f6 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/list_account_sas_response_py3.py @@ -0,0 +1,35 @@ +# 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 msrest.serialization import Model + + +class ListAccountSasResponse(Model): + """The List SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar account_sas_token: List SAS credentials of storage account. + :vartype account_sas_token: str + """ + + _validation = { + 'account_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'account_sas_token': {'key': 'accountSasToken', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ListAccountSasResponse, self).__init__(**kwargs) + self.account_sas_token = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/list_service_sas_response.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/list_service_sas_response.py index e3c12854fe67..800c0298af61 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/list_service_sas_response.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/list_service_sas_response.py @@ -31,6 +31,6 @@ class ListServiceSasResponse(Model): 'service_sas_token': {'key': 'serviceSasToken', 'type': 'str'}, } - def __init__(self): - super(ListServiceSasResponse, self).__init__() + def __init__(self, **kwargs): + super(ListServiceSasResponse, self).__init__(**kwargs) self.service_sas_token = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/list_service_sas_response_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/list_service_sas_response_py3.py new file mode 100644 index 000000000000..cffd962e2041 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/list_service_sas_response_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class ListServiceSasResponse(Model): + """The List service SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar service_sas_token: List service SAS credentials of speicific + resource. + :vartype service_sas_token: str + """ + + _validation = { + 'service_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'service_sas_token': {'key': 'serviceSasToken', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ListServiceSasResponse, self).__init__(**kwargs) + self.service_sas_token = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/metric_specification.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/metric_specification.py index 82441f44e82a..b186b5d354e5 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/metric_specification.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/metric_specification.py @@ -50,14 +50,14 @@ class MetricSpecification(Model): 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, } - def __init__(self, name=None, display_name=None, display_description=None, unit=None, dimensions=None, aggregation_type=None, fill_gap_with_zero=None, category=None, resource_id_dimension_name_override=None): - super(MetricSpecification, self).__init__() - self.name = name - self.display_name = display_name - self.display_description = display_description - self.unit = unit - self.dimensions = dimensions - self.aggregation_type = aggregation_type - self.fill_gap_with_zero = fill_gap_with_zero - self.category = category - self.resource_id_dimension_name_override = resource_id_dimension_name_override + def __init__(self, **kwargs): + super(MetricSpecification, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.display_description = kwargs.get('display_description', None) + self.unit = kwargs.get('unit', None) + self.dimensions = kwargs.get('dimensions', None) + self.aggregation_type = kwargs.get('aggregation_type', None) + self.fill_gap_with_zero = kwargs.get('fill_gap_with_zero', None) + self.category = kwargs.get('category', None) + self.resource_id_dimension_name_override = kwargs.get('resource_id_dimension_name_override', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/metric_specification_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/metric_specification_py3.py new file mode 100644 index 000000000000..0e8d1989c9f5 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/metric_specification_py3.py @@ -0,0 +1,63 @@ +# 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 msrest.serialization import Model + + +class MetricSpecification(Model): + """Metric specification of operation. + + :param name: Name of metric specification. + :type name: str + :param display_name: Display name of metric specification. + :type display_name: str + :param display_description: Display description of metric specification. + :type display_description: str + :param unit: Unit could be Bytes or Count. + :type unit: str + :param dimensions: Dimensions of blobs, including blob type and access + tier. + :type dimensions: list[~azure.mgmt.storage.v2017_06_01.models.Dimension] + :param aggregation_type: Aggregation type could be Average. + :type aggregation_type: str + :param fill_gap_with_zero: The property to decide fill gap with zero or + not. + :type fill_gap_with_zero: bool + :param category: The category this metric specification belong to, could + be Capacity. + :type category: str + :param resource_id_dimension_name_override: Account Resource Id. + :type resource_id_dimension_name_override: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'category': {'key': 'category', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, display_description: str=None, unit: str=None, dimensions=None, aggregation_type: str=None, fill_gap_with_zero: bool=None, category: str=None, resource_id_dimension_name_override: str=None, **kwargs) -> None: + super(MetricSpecification, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.display_description = display_description + self.unit = unit + self.dimensions = dimensions + self.aggregation_type = aggregation_type + self.fill_gap_with_zero = fill_gap_with_zero + self.category = category + self.resource_id_dimension_name_override = resource_id_dimension_name_override diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/network_rule_set.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/network_rule_set.py index 8ead92c80897..1f8226c1ccf1 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/network_rule_set.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/network_rule_set.py @@ -15,6 +15,8 @@ class NetworkRuleSet(Model): """Network rule set. + All required parameters must be populated in order to send to Azure. + :param bypass: Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None @@ -26,9 +28,9 @@ class NetworkRuleSet(Model): list[~azure.mgmt.storage.v2017_06_01.models.VirtualNetworkRule] :param ip_rules: Sets the IP ACL rules :type ip_rules: list[~azure.mgmt.storage.v2017_06_01.models.IPRule] - :param default_action: Specifies the default action of allow or deny when - no other rules match. Possible values include: 'Allow', 'Deny'. Default - value: "Allow" . + :param default_action: Required. Specifies the default action of allow or + deny when no other rules match. Possible values include: 'Allow', 'Deny'. + Default value: "Allow" . :type default_action: str or ~azure.mgmt.storage.v2017_06_01.models.DefaultAction """ @@ -44,9 +46,9 @@ class NetworkRuleSet(Model): 'default_action': {'key': 'defaultAction', 'type': 'DefaultAction'}, } - def __init__(self, bypass="AzureServices", virtual_network_rules=None, ip_rules=None, default_action="Allow"): - super(NetworkRuleSet, self).__init__() - self.bypass = bypass - self.virtual_network_rules = virtual_network_rules - self.ip_rules = ip_rules - self.default_action = default_action + def __init__(self, **kwargs): + super(NetworkRuleSet, self).__init__(**kwargs) + self.bypass = kwargs.get('bypass', "AzureServices") + self.virtual_network_rules = kwargs.get('virtual_network_rules', None) + self.ip_rules = kwargs.get('ip_rules', None) + self.default_action = kwargs.get('default_action', "Allow") diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/network_rule_set_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/network_rule_set_py3.py new file mode 100644 index 000000000000..8380cbe38c6f --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/network_rule_set_py3.py @@ -0,0 +1,54 @@ +# 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 msrest.serialization import Model + + +class NetworkRuleSet(Model): + """Network rule set. + + All required parameters must be populated in order to send to Azure. + + :param bypass: Specifies whether traffic is bypassed for + Logging/Metrics/AzureServices. Possible values are any combination of + Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None + to bypass none of those traffics. Possible values include: 'None', + 'Logging', 'Metrics', 'AzureServices'. Default value: "AzureServices" . + :type bypass: str or ~azure.mgmt.storage.v2017_06_01.models.Bypass + :param virtual_network_rules: Sets the virtual network rules + :type virtual_network_rules: + list[~azure.mgmt.storage.v2017_06_01.models.VirtualNetworkRule] + :param ip_rules: Sets the IP ACL rules + :type ip_rules: list[~azure.mgmt.storage.v2017_06_01.models.IPRule] + :param default_action: Required. Specifies the default action of allow or + deny when no other rules match. Possible values include: 'Allow', 'Deny'. + Default value: "Allow" . + :type default_action: str or + ~azure.mgmt.storage.v2017_06_01.models.DefaultAction + """ + + _validation = { + 'default_action': {'required': True}, + } + + _attribute_map = { + 'bypass': {'key': 'bypass', 'type': 'str'}, + 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, + 'default_action': {'key': 'defaultAction', 'type': 'DefaultAction'}, + } + + def __init__(self, *, bypass="AzureServices", virtual_network_rules=None, ip_rules=None, default_action="Allow", **kwargs) -> None: + super(NetworkRuleSet, self).__init__(**kwargs) + self.bypass = bypass + self.virtual_network_rules = virtual_network_rules + self.ip_rules = ip_rules + self.default_action = default_action diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/operation.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/operation.py index c82f8deeca38..4dc334ae71b8 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/operation.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/operation.py @@ -34,9 +34,9 @@ class Operation(Model): 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, } - def __init__(self, name=None, display=None, origin=None, service_specification=None): - super(Operation, self).__init__() - self.name = name - self.display = display - self.origin = origin - self.service_specification = service_specification + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) + self.service_specification = kwargs.get('service_specification', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/operation_display.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/operation_display.py index d31779b2891c..12d72186c4f2 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/operation_display.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/operation_display.py @@ -29,8 +29,8 @@ class OperationDisplay(Model): 'operation': {'key': 'operation', 'type': 'str'}, } - def __init__(self, provider=None, resource=None, operation=None): - super(OperationDisplay, self).__init__() - self.provider = provider - self.resource = resource - self.operation = operation + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/operation_display_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/operation_display_py3.py new file mode 100644 index 000000000000..632a6393c99f --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/operation_display_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class OperationDisplay(Model): + """Display metadata associated with the operation. + + :param provider: Service provider: Microsoft Storage. + :type provider: str + :param resource: Resource on which the operation is performed etc. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/operation_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/operation_py3.py new file mode 100644 index 000000000000..e78c4fa89bcd --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/operation_py3.py @@ -0,0 +1,42 @@ +# 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 msrest.serialization import Model + + +class Operation(Model): + """Storage REST API operation definition. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: Display metadata associated with the operation. + :type display: ~azure.mgmt.storage.v2017_06_01.models.OperationDisplay + :param origin: The origin of operations. + :type origin: str + :param service_specification: One property of operation, include metric + specifications. + :type service_specification: + ~azure.mgmt.storage.v2017_06_01.models.ServiceSpecification + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__(self, *, name: str=None, display=None, origin: str=None, service_specification=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display + self.origin = origin + self.service_specification = service_specification diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/resource.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/resource.py index dda2316a332f..125d6e4790b9 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/resource.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/resource.py @@ -45,10 +45,10 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, location=None, tags=None): - super(Resource, self).__init__() + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.location = location - self.tags = tags + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/resource_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/resource_py3.py new file mode 100644 index 000000000000..7c1ccbf3aae1 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/resource_py3.py @@ -0,0 +1,54 @@ +# 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 msrest.serialization import Model + + +class Resource(Model): + """Describes a storage resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Tags assigned to a resource; can be used for viewing and + grouping a resource (across resource groups). + :type tags: dict[str, str] + """ + + _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'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str=None, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/restriction.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/restriction.py index 68480a936ad4..fbbca74ff6a1 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/restriction.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/restriction.py @@ -44,8 +44,8 @@ class Restriction(Model): 'reason_code': {'key': 'reasonCode', 'type': 'str'}, } - def __init__(self, reason_code=None): - super(Restriction, self).__init__() + def __init__(self, **kwargs): + super(Restriction, self).__init__(**kwargs) self.type = None self.values = None - self.reason_code = reason_code + self.reason_code = kwargs.get('reason_code', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/restriction_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/restriction_py3.py new file mode 100644 index 000000000000..762ae8e58374 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/restriction_py3.py @@ -0,0 +1,51 @@ +# 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 msrest.serialization import Model + + +class Restriction(Model): + """The restriction because of which SKU cannot be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The type of restrictions. As of now only possible value for + this is location. + :vartype type: str + :ivar values: The value of restrictions. If the restriction type is set to + location. This would be different locations where the SKU is restricted. + :vartype values: list[str] + :param reason_code: The reason for the restriction. As of now this can be + “QuotaId” or “NotAvailableForSubscription”. Quota Id is set when the SKU + has requiredQuotas parameter as the subscription does not belong to that + quota. The “NotAvailableForSubscription” is related to capacity at DC. + Possible values include: 'QuotaId', 'NotAvailableForSubscription' + :type reason_code: str or + ~azure.mgmt.storage.v2017_06_01.models.ReasonCode + """ + + _validation = { + 'type': {'readonly': True}, + 'values': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'reason_code': {'key': 'reasonCode', 'type': 'str'}, + } + + def __init__(self, *, reason_code=None, **kwargs) -> None: + super(Restriction, self).__init__(**kwargs) + self.type = None + self.values = None + self.reason_code = reason_code diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/service_sas_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/service_sas_parameters.py index e9e4b615799c..82ee97e72f43 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/service_sas_parameters.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/service_sas_parameters.py @@ -15,11 +15,14 @@ class ServiceSasParameters(Model): """The parameters to list service SAS credentials of a speicific resource. - :param canonicalized_resource: The canonical path to the signed resource. + All required parameters must be populated in order to send to Azure. + + :param canonicalized_resource: Required. The canonical path to the signed + resource. :type canonicalized_resource: str - :param resource: The signed services accessible with the service SAS. - Possible values include: Blob (b), Container (c), File (f), Share (s). - Possible values include: 'b', 'c', 'f', 's' + :param resource: Required. The signed services accessible with the service + SAS. Possible values include: Blob (b), Container (c), File (f), Share + (s). Possible values include: 'b', 'c', 'f', 's' :type resource: str or ~azure.mgmt.storage.v2017_06_01.models.SignedResource :param permissions: The signed permissions for the service SAS. Possible @@ -96,23 +99,23 @@ class ServiceSasParameters(Model): 'content_type': {'key': 'rsct', 'type': 'str'}, } - def __init__(self, canonicalized_resource, resource, permissions=None, ip_address_or_range=None, protocols=None, shared_access_start_time=None, shared_access_expiry_time=None, identifier=None, partition_key_start=None, partition_key_end=None, row_key_start=None, row_key_end=None, key_to_sign=None, cache_control=None, content_disposition=None, content_encoding=None, content_language=None, content_type=None): - super(ServiceSasParameters, self).__init__() - self.canonicalized_resource = canonicalized_resource - self.resource = resource - self.permissions = permissions - self.ip_address_or_range = ip_address_or_range - self.protocols = protocols - self.shared_access_start_time = shared_access_start_time - self.shared_access_expiry_time = shared_access_expiry_time - self.identifier = identifier - self.partition_key_start = partition_key_start - self.partition_key_end = partition_key_end - self.row_key_start = row_key_start - self.row_key_end = row_key_end - self.key_to_sign = key_to_sign - self.cache_control = cache_control - self.content_disposition = content_disposition - self.content_encoding = content_encoding - self.content_language = content_language - self.content_type = content_type + def __init__(self, **kwargs): + super(ServiceSasParameters, self).__init__(**kwargs) + self.canonicalized_resource = kwargs.get('canonicalized_resource', None) + self.resource = kwargs.get('resource', None) + self.permissions = kwargs.get('permissions', None) + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + self.protocols = kwargs.get('protocols', None) + self.shared_access_start_time = kwargs.get('shared_access_start_time', None) + self.shared_access_expiry_time = kwargs.get('shared_access_expiry_time', None) + self.identifier = kwargs.get('identifier', None) + self.partition_key_start = kwargs.get('partition_key_start', None) + self.partition_key_end = kwargs.get('partition_key_end', None) + self.row_key_start = kwargs.get('row_key_start', None) + self.row_key_end = kwargs.get('row_key_end', None) + self.key_to_sign = kwargs.get('key_to_sign', None) + self.cache_control = kwargs.get('cache_control', None) + self.content_disposition = kwargs.get('content_disposition', None) + self.content_encoding = kwargs.get('content_encoding', None) + self.content_language = kwargs.get('content_language', None) + self.content_type = kwargs.get('content_type', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/service_sas_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/service_sas_parameters_py3.py new file mode 100644 index 000000000000..eefd8c8308dc --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/service_sas_parameters_py3.py @@ -0,0 +1,121 @@ +# 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 msrest.serialization import Model + + +class ServiceSasParameters(Model): + """The parameters to list service SAS credentials of a speicific resource. + + All required parameters must be populated in order to send to Azure. + + :param canonicalized_resource: Required. The canonical path to the signed + resource. + :type canonicalized_resource: str + :param resource: Required. The signed services accessible with the service + SAS. Possible values include: Blob (b), Container (c), File (f), Share + (s). Possible values include: 'b', 'c', 'f', 's' + :type resource: str or + ~azure.mgmt.storage.v2017_06_01.models.SignedResource + :param permissions: The signed permissions for the service SAS. Possible + values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create + (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', + 'l', 'a', 'c', 'u', 'p' + :type permissions: str or + ~azure.mgmt.storage.v2017_06_01.models.Permissions + :param ip_address_or_range: An IP address or a range of IP addresses from + which to accept requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the + account SAS. Possible values include: 'https,http', 'https' + :type protocols: str or + ~azure.mgmt.storage.v2017_06_01.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: datetime + :param shared_access_expiry_time: The time at which the shared access + signature becomes invalid. + :type shared_access_expiry_time: datetime + :param identifier: A unique value up to 64 characters in length that + correlates to an access policy specified for the container, queue, or + table. + :type identifier: str + :param partition_key_start: The start of partition key. + :type partition_key_start: str + :param partition_key_end: The end of partition key. + :type partition_key_end: str + :param row_key_start: The start of row key. + :type row_key_start: str + :param row_key_end: The end of row key. + :type row_key_end: str + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + :param cache_control: The response header override for cache control. + :type cache_control: str + :param content_disposition: The response header override for content + disposition. + :type content_disposition: str + :param content_encoding: The response header override for content + encoding. + :type content_encoding: str + :param content_language: The response header override for content + language. + :type content_language: str + :param content_type: The response header override for content type. + :type content_type: str + """ + + _validation = { + 'canonicalized_resource': {'required': True}, + 'resource': {'required': True}, + 'identifier': {'max_length': 64}, + } + + _attribute_map = { + 'canonicalized_resource': {'key': 'canonicalizedResource', 'type': 'str'}, + 'resource': {'key': 'signedResource', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'identifier': {'key': 'signedIdentifier', 'type': 'str'}, + 'partition_key_start': {'key': 'startPk', 'type': 'str'}, + 'partition_key_end': {'key': 'endPk', 'type': 'str'}, + 'row_key_start': {'key': 'startRk', 'type': 'str'}, + 'row_key_end': {'key': 'endRk', 'type': 'str'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + 'cache_control': {'key': 'rscc', 'type': 'str'}, + 'content_disposition': {'key': 'rscd', 'type': 'str'}, + 'content_encoding': {'key': 'rsce', 'type': 'str'}, + 'content_language': {'key': 'rscl', 'type': 'str'}, + 'content_type': {'key': 'rsct', 'type': 'str'}, + } + + def __init__(self, *, canonicalized_resource: str, resource, permissions=None, ip_address_or_range: str=None, protocols=None, shared_access_start_time=None, shared_access_expiry_time=None, identifier: str=None, partition_key_start: str=None, partition_key_end: str=None, row_key_start: str=None, row_key_end: str=None, key_to_sign: str=None, cache_control: str=None, content_disposition: str=None, content_encoding: str=None, content_language: str=None, content_type: str=None, **kwargs) -> None: + super(ServiceSasParameters, self).__init__(**kwargs) + self.canonicalized_resource = canonicalized_resource + self.resource = resource + self.permissions = permissions + self.ip_address_or_range = ip_address_or_range + self.protocols = protocols + self.shared_access_start_time = shared_access_start_time + self.shared_access_expiry_time = shared_access_expiry_time + self.identifier = identifier + self.partition_key_start = partition_key_start + self.partition_key_end = partition_key_end + self.row_key_start = row_key_start + self.row_key_end = row_key_end + self.key_to_sign = key_to_sign + self.cache_control = cache_control + self.content_disposition = content_disposition + self.content_encoding = content_encoding + self.content_language = content_language + self.content_type = content_type diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/service_specification.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/service_specification.py index a13689cd2dfd..56a5310b2b54 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/service_specification.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/service_specification.py @@ -24,6 +24,6 @@ class ServiceSpecification(Model): 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, } - def __init__(self, metric_specifications=None): - super(ServiceSpecification, self).__init__() - self.metric_specifications = metric_specifications + def __init__(self, **kwargs): + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = kwargs.get('metric_specifications', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/service_specification_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/service_specification_py3.py new file mode 100644 index 000000000000..3887c105db26 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/service_specification_py3.py @@ -0,0 +1,29 @@ +# 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 msrest.serialization import Model + + +class ServiceSpecification(Model): + """One property of operation, include metric specifications. + + :param metric_specifications: Metric specifications of operation. + :type metric_specifications: + list[~azure.mgmt.storage.v2017_06_01.models.MetricSpecification] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + } + + def __init__(self, *, metric_specifications=None, **kwargs) -> None: + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = metric_specifications diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/sku.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/sku.py index e766e2f40d2f..36a138ff7a3e 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/sku.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/sku.py @@ -18,10 +18,12 @@ class Sku(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param name: Gets or sets the sku name. Required for account creation; - optional for update. Note that in older versions, sku name was called - accountType. Possible values include: 'Standard_LRS', 'Standard_GRS', - 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the sku name. Required for account + creation; optional for update. Note that in older versions, sku name was + called accountType. Possible values include: 'Standard_LRS', + 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' :type name: str or ~azure.mgmt.storage.v2017_06_01.models.SkuName :ivar tier: Gets the sku tier. This is based on the SKU name. Possible values include: 'Standard', 'Premium' @@ -65,12 +67,12 @@ class Sku(Model): 'restrictions': {'key': 'restrictions', 'type': '[Restriction]'}, } - def __init__(self, name, restrictions=None): - super(Sku, self).__init__() - self.name = name + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) self.tier = None self.resource_type = None self.kind = None self.locations = None self.capabilities = None - self.restrictions = restrictions + self.restrictions = kwargs.get('restrictions', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/sku_capability.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/sku_capability.py index 70ee58e9fe89..b8fa68ce7778 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/sku_capability.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/sku_capability.py @@ -38,7 +38,7 @@ class SKUCapability(Model): 'value': {'key': 'value', 'type': 'str'}, } - def __init__(self): - super(SKUCapability, self).__init__() + def __init__(self, **kwargs): + super(SKUCapability, self).__init__(**kwargs) self.name = None self.value = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/sku_capability_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/sku_capability_py3.py new file mode 100644 index 000000000000..f349a08eda21 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/sku_capability_py3.py @@ -0,0 +1,44 @@ +# 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 msrest.serialization import Model + + +class SKUCapability(Model): + """The capability information in the specified sku, including file encryption, + network acls, change notification, etc. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of capability, The capability information in the + specified sku, including file encryption, network acls, change + notification, etc. + :vartype name: str + :ivar value: A string value to indicate states of given capability. + Possibly 'true' or 'false'. + :vartype value: str + """ + + _validation = { + 'name': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(SKUCapability, self).__init__(**kwargs) + self.name = None + self.value = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/sku_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/sku_py3.py new file mode 100644 index 000000000000..8bb382d64810 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/sku_py3.py @@ -0,0 +1,78 @@ +# 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 msrest.serialization import Model + + +class Sku(Model): + """The SKU of the storage account. + + 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 Azure. + + :param name: Required. Gets or sets the sku name. Required for account + creation; optional for update. Note that in older versions, sku name was + called accountType. Possible values include: 'Standard_LRS', + 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' + :type name: str or ~azure.mgmt.storage.v2017_06_01.models.SkuName + :ivar tier: Gets the sku tier. This is based on the SKU name. Possible + values include: 'Standard', 'Premium' + :vartype tier: str or ~azure.mgmt.storage.v2017_06_01.models.SkuTier + :ivar resource_type: The type of the resource, usually it is + 'storageAccounts'. + :vartype resource_type: str + :ivar kind: Indicates the type of storage account. Possible values + include: 'Storage', 'BlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2017_06_01.models.Kind + :ivar locations: The set of locations that the SKU is available. This will + be supported and registered Azure Geo Regions (e.g. West US, East US, + Southeast Asia, etc.). + :vartype locations: list[str] + :ivar capabilities: The capability information in the specified sku, + including file encryption, network acls, change notification, etc. + :vartype capabilities: + list[~azure.mgmt.storage.v2017_06_01.models.SKUCapability] + :param restrictions: The restrictions because of which SKU cannot be used. + This is empty if there are no restrictions. + :type restrictions: + list[~azure.mgmt.storage.v2017_06_01.models.Restriction] + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'readonly': True}, + 'resource_type': {'readonly': True}, + 'kind': {'readonly': True}, + 'locations': {'readonly': True}, + 'capabilities': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'SkuName'}, + 'tier': {'key': 'tier', 'type': 'SkuTier'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[SKUCapability]'}, + 'restrictions': {'key': 'restrictions', 'type': '[Restriction]'}, + } + + def __init__(self, *, name, restrictions=None, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = None + self.resource_type = None + self.kind = None + self.locations = None + self.capabilities = None + self.restrictions = restrictions diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account.py index 067ab49e28d4..b0efd1ae89e6 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account.py @@ -144,11 +144,11 @@ class StorageAccount(Resource): 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, } - def __init__(self, location=None, tags=None, identity=None, enable_https_traffic_only=False): - super(StorageAccount, self).__init__(location=location, tags=tags) + def __init__(self, **kwargs): + super(StorageAccount, self).__init__(**kwargs) self.sku = None self.kind = None - self.identity = identity + self.identity = kwargs.get('identity', None) self.provisioning_state = None self.primary_endpoints = None self.primary_location = None @@ -161,5 +161,5 @@ def __init__(self, location=None, tags=None, identity=None, enable_https_traffic self.secondary_endpoints = None self.encryption = None self.access_tier = None - self.enable_https_traffic_only = enable_https_traffic_only + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False) self.network_rule_set = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_check_name_availability_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_check_name_availability_parameters.py index c67c674db438..42cf88a074a0 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_check_name_availability_parameters.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_check_name_availability_parameters.py @@ -18,10 +18,13 @@ class StorageAccountCheckNameAvailabilityParameters(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param name: The storage account name. + All required parameters must be populated in order to send to Azure. + + :param name: Required. The storage account name. :type name: str - :ivar type: The type of resource, Microsoft.Storage/storageAccounts. - Default value: "Microsoft.Storage/storageAccounts" . + :ivar type: Required. The type of resource, + Microsoft.Storage/storageAccounts. Default value: + "Microsoft.Storage/storageAccounts" . :vartype type: str """ @@ -37,6 +40,6 @@ class StorageAccountCheckNameAvailabilityParameters(Model): type = "Microsoft.Storage/storageAccounts" - def __init__(self, name): - super(StorageAccountCheckNameAvailabilityParameters, self).__init__() - self.name = name + def __init__(self, **kwargs): + super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_check_name_availability_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_check_name_availability_parameters_py3.py new file mode 100644 index 000000000000..e6f50a456902 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_check_name_availability_parameters_py3.py @@ -0,0 +1,45 @@ +# 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 msrest.serialization import Model + + +class StorageAccountCheckNameAvailabilityParameters(Model): + """The parameters used to check the availabity of the storage account name. + + 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 Azure. + + :param name: Required. The storage account name. + :type name: str + :ivar type: Required. The type of resource, + Microsoft.Storage/storageAccounts. Default value: + "Microsoft.Storage/storageAccounts" . + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.Storage/storageAccounts" + + def __init__(self, *, name: str, **kwargs) -> None: + super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = name diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_create_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_create_parameters.py index bcc49a503a6b..0ec87bb649c5 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_create_parameters.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_create_parameters.py @@ -15,16 +15,18 @@ class StorageAccountCreateParameters(Model): """The parameters used when creating a storage account. - :param sku: Required. Gets or sets the sku name. + All required parameters must be populated in order to send to Azure. + + :param sku: Required. Required. Gets or sets the sku name. :type sku: ~azure.mgmt.storage.v2017_06_01.models.Sku - :param kind: Required. Indicates the type of storage account. Possible - values include: 'Storage', 'BlobStorage' + :param kind: Required. Required. Indicates the type of storage account. + Possible values include: 'Storage', 'BlobStorage' :type kind: str or ~azure.mgmt.storage.v2017_06_01.models.Kind - :param location: Required. Gets or sets the location of the resource. This - will be one of the supported and registered Azure Geo Regions (e.g. West - US, East US, Southeast Asia, etc.). The geo region of a resource cannot be - changed once it is created, but if an identical geo region is specified on - update, the request will succeed. + :param location: Required. Required. Gets or sets the location of the + resource. This will be one of the supported and registered Azure Geo + Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a + resource cannot be changed once it is created, but if an identical geo + region is specified on update, the request will succeed. :type location: str :param tags: Gets or sets a list of key value pairs that describe the resource. These tags can be used for viewing and grouping this resource @@ -75,15 +77,15 @@ class StorageAccountCreateParameters(Model): 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, } - def __init__(self, sku, kind, location, tags=None, identity=None, custom_domain=None, encryption=None, network_rule_set=None, access_tier=None, enable_https_traffic_only=False): - super(StorageAccountCreateParameters, self).__init__() - self.sku = sku - self.kind = kind - self.location = location - self.tags = tags - self.identity = identity - self.custom_domain = custom_domain - self.encryption = encryption - self.network_rule_set = network_rule_set - self.access_tier = access_tier - self.enable_https_traffic_only = enable_https_traffic_only + def __init__(self, **kwargs): + super(StorageAccountCreateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.kind = kwargs.get('kind', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.identity = kwargs.get('identity', None) + self.custom_domain = kwargs.get('custom_domain', None) + self.encryption = kwargs.get('encryption', None) + self.network_rule_set = kwargs.get('network_rule_set', None) + self.access_tier = kwargs.get('access_tier', None) + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_create_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_create_parameters_py3.py new file mode 100644 index 000000000000..77ecca9ce28e --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_create_parameters_py3.py @@ -0,0 +1,91 @@ +# 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 msrest.serialization import Model + + +class StorageAccountCreateParameters(Model): + """The parameters used when creating a storage account. + + All required parameters must be populated in order to send to Azure. + + :param sku: Required. Required. Gets or sets the sku name. + :type sku: ~azure.mgmt.storage.v2017_06_01.models.Sku + :param kind: Required. Required. Indicates the type of storage account. + Possible values include: 'Storage', 'BlobStorage' + :type kind: str or ~azure.mgmt.storage.v2017_06_01.models.Kind + :param location: Required. Required. Gets or sets the location of the + resource. This will be one of the supported and registered Azure Geo + Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a + resource cannot be changed once it is created, but if an identical geo + region is specified on update, the request will succeed. + :type location: str + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used for viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key with a length no greater than 128 + characters and a value with a length no greater than 256 characters. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2017_06_01.models.Identity + :param custom_domain: User domain assigned to the storage account. Name is + the CNAME source. Only one custom domain is supported per storage account + at this time. To clear the existing custom domain, use an empty string for + the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2017_06_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. If + left unspecified the account encryption settings will remain the same. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2017_06_01.models.Encryption + :param network_rule_set: Network rule set + :type network_rule_set: + ~azure.mgmt.storage.v2017_06_01.models.NetworkRuleSet + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2017_06_01.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + """ + + _validation = { + 'sku': {'required': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + } + + def __init__(self, *, sku, kind, location: str, tags=None, identity=None, custom_domain=None, encryption=None, network_rule_set=None, access_tier=None, enable_https_traffic_only: bool=False, **kwargs) -> None: + super(StorageAccountCreateParameters, self).__init__(**kwargs) + self.sku = sku + self.kind = kind + self.location = location + self.tags = tags + self.identity = identity + self.custom_domain = custom_domain + self.encryption = encryption + self.network_rule_set = network_rule_set + self.access_tier = access_tier + self.enable_https_traffic_only = enable_https_traffic_only diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_key.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_key.py index 2a5afd51b165..55028b0d3fef 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_key.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_key.py @@ -40,8 +40,8 @@ class StorageAccountKey(Model): 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, } - def __init__(self): - super(StorageAccountKey, self).__init__() + def __init__(self, **kwargs): + super(StorageAccountKey, self).__init__(**kwargs) self.key_name = None self.value = None self.permissions = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_key_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_key_py3.py new file mode 100644 index 000000000000..ba59047babc0 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_key_py3.py @@ -0,0 +1,47 @@ +# 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 msrest.serialization import Model + + +class StorageAccountKey(Model): + """An access key for the storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar key_name: Name of the key. + :vartype key_name: str + :ivar value: Base 64-encoded value of the key. + :vartype value: str + :ivar permissions: Permissions for the key -- read-only or full + permissions. Possible values include: 'Read', 'Full' + :vartype permissions: str or + ~azure.mgmt.storage.v2017_06_01.models.KeyPermission + """ + + _validation = { + 'key_name': {'readonly': True}, + 'value': {'readonly': True}, + 'permissions': {'readonly': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, + } + + def __init__(self, **kwargs) -> None: + super(StorageAccountKey, self).__init__(**kwargs) + self.key_name = None + self.value = None + self.permissions = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_list_keys_result.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_list_keys_result.py index 778728e930e2..67ac8d362f13 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_list_keys_result.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_list_keys_result.py @@ -32,6 +32,6 @@ class StorageAccountListKeysResult(Model): 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, } - def __init__(self): - super(StorageAccountListKeysResult, self).__init__() + def __init__(self, **kwargs): + super(StorageAccountListKeysResult, self).__init__(**kwargs) self.keys = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_list_keys_result_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_list_keys_result_py3.py new file mode 100644 index 000000000000..8bc6439d5974 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_list_keys_result_py3.py @@ -0,0 +1,37 @@ +# 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 msrest.serialization import Model + + +class StorageAccountListKeysResult(Model): + """The response from the ListKeys operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar keys: Gets the list of storage account keys and their properties for + the specified storage account. + :vartype keys: + list[~azure.mgmt.storage.v2017_06_01.models.StorageAccountKey] + """ + + _validation = { + 'keys': {'readonly': True}, + } + + _attribute_map = { + 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, + } + + def __init__(self, **kwargs) -> None: + super(StorageAccountListKeysResult, self).__init__(**kwargs) + self.keys = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_py3.py new file mode 100644 index 000000000000..d8714125411f --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_py3.py @@ -0,0 +1,165 @@ +# 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 .resource import Resource + + +class StorageAccount(Resource): + """The storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Tags assigned to a resource; can be used for viewing and + grouping a resource (across resource groups). + :type tags: dict[str, str] + :ivar sku: Gets the SKU. + :vartype sku: ~azure.mgmt.storage.v2017_06_01.models.Sku + :ivar kind: Gets the Kind. Possible values include: 'Storage', + 'BlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2017_06_01.models.Kind + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2017_06_01.models.Identity + :ivar provisioning_state: Gets the status of the storage account at the + time the operation was called. Possible values include: 'Creating', + 'ResolvingDNS', 'Succeeded' + :vartype provisioning_state: str or + ~azure.mgmt.storage.v2017_06_01.models.ProvisioningState + :ivar primary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object. Note that Standard_ZRS + and Premium_LRS accounts only return the blob endpoint. + :vartype primary_endpoints: + ~azure.mgmt.storage.v2017_06_01.models.Endpoints + :ivar primary_location: Gets the location of the primary data center for + the storage account. + :vartype primary_location: str + :ivar status_of_primary: Gets the status indicating whether the primary + location of the storage account is available or unavailable. Possible + values include: 'available', 'unavailable' + :vartype status_of_primary: str or + ~azure.mgmt.storage.v2017_06_01.models.AccountStatus + :ivar last_geo_failover_time: Gets the timestamp of the most recent + instance of a failover to the secondary location. Only the most recent + timestamp is retained. This element is not returned if there has never + been a failover instance. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype last_geo_failover_time: datetime + :ivar secondary_location: Gets the location of the geo-replicated + secondary for the storage account. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype secondary_location: str + :ivar status_of_secondary: Gets the status indicating whether the + secondary location of the storage account is available or unavailable. + Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible + values include: 'available', 'unavailable' + :vartype status_of_secondary: str or + ~azure.mgmt.storage.v2017_06_01.models.AccountStatus + :ivar creation_time: Gets the creation date and time of the storage + account in UTC. + :vartype creation_time: datetime + :ivar custom_domain: Gets the custom domain the user assigned to this + storage account. + :vartype custom_domain: + ~azure.mgmt.storage.v2017_06_01.models.CustomDomain + :ivar secondary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object from the secondary + location of the storage account. Only available if the SKU name is + Standard_RAGRS. + :vartype secondary_endpoints: + ~azure.mgmt.storage.v2017_06_01.models.Endpoints + :ivar encryption: Gets the encryption settings on the account. If + unspecified, the account is unencrypted. + :vartype encryption: ~azure.mgmt.storage.v2017_06_01.models.Encryption + :ivar access_tier: Required for storage accounts where kind = BlobStorage. + The access tier used for billing. Possible values include: 'Hot', 'Cool' + :vartype access_tier: str or + ~azure.mgmt.storage.v2017_06_01.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + :ivar network_rule_set: Network rule set + :vartype network_rule_set: + ~azure.mgmt.storage.v2017_06_01.models.NetworkRuleSet + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'sku': {'readonly': True}, + 'kind': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'primary_endpoints': {'readonly': True}, + 'primary_location': {'readonly': True}, + 'status_of_primary': {'readonly': True}, + 'last_geo_failover_time': {'readonly': True}, + 'secondary_location': {'readonly': True}, + 'status_of_secondary': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'custom_domain': {'readonly': True}, + 'secondary_endpoints': {'readonly': True}, + 'encryption': {'readonly': True}, + 'access_tier': {'readonly': True}, + 'network_rule_set': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, + 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, + 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, + 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'AccountStatus'}, + 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, + 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, + 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'AccountStatus'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + } + + def __init__(self, *, location: str=None, tags=None, identity=None, enable_https_traffic_only: bool=False, **kwargs) -> None: + super(StorageAccount, self).__init__(location=location, tags=tags, **kwargs) + self.sku = None + self.kind = None + self.identity = identity + self.provisioning_state = None + self.primary_endpoints = None + self.primary_location = None + self.status_of_primary = None + self.last_geo_failover_time = None + self.secondary_location = None + self.status_of_secondary = None + self.creation_time = None + self.custom_domain = None + self.secondary_endpoints = None + self.encryption = None + self.access_tier = None + self.enable_https_traffic_only = enable_https_traffic_only + self.network_rule_set = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_regenerate_key_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_regenerate_key_parameters.py index 0665efaf0a1b..ca7f33b25112 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_regenerate_key_parameters.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_regenerate_key_parameters.py @@ -15,8 +15,10 @@ class StorageAccountRegenerateKeyParameters(Model): """The parameters used to regenerate the storage account key. - :param key_name: The name of storage keys that want to be regenerated, - possible vaules are key1, key2. + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. The name of storage keys that want to be + regenerated, possible vaules are key1, key2. :type key_name: str """ @@ -28,6 +30,6 @@ class StorageAccountRegenerateKeyParameters(Model): 'key_name': {'key': 'keyName', 'type': 'str'}, } - def __init__(self, key_name): - super(StorageAccountRegenerateKeyParameters, self).__init__() - self.key_name = key_name + def __init__(self, **kwargs): + super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) + self.key_name = kwargs.get('key_name', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_regenerate_key_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_regenerate_key_parameters_py3.py new file mode 100644 index 000000000000..42f3c0b2e94a --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_regenerate_key_parameters_py3.py @@ -0,0 +1,35 @@ +# 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 msrest.serialization import Model + + +class StorageAccountRegenerateKeyParameters(Model): + """The parameters used to regenerate the storage account key. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. The name of storage keys that want to be + regenerated, possible vaules are key1, key2. + :type key_name: str + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, *, key_name: str, **kwargs) -> None: + super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) + self.key_name = key_name diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_update_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_update_parameters.py index 05d9de5210f3..6bfa979c2622 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_update_parameters.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_update_parameters.py @@ -60,13 +60,13 @@ class StorageAccountUpdateParameters(Model): 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, } - def __init__(self, sku=None, tags=None, identity=None, custom_domain=None, encryption=None, access_tier=None, enable_https_traffic_only=False, network_rule_set=None): - super(StorageAccountUpdateParameters, self).__init__() - self.sku = sku - self.tags = tags - self.identity = identity - self.custom_domain = custom_domain - self.encryption = encryption - self.access_tier = access_tier - self.enable_https_traffic_only = enable_https_traffic_only - self.network_rule_set = network_rule_set + def __init__(self, **kwargs): + super(StorageAccountUpdateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.tags = kwargs.get('tags', None) + self.identity = kwargs.get('identity', None) + self.custom_domain = kwargs.get('custom_domain', None) + self.encryption = kwargs.get('encryption', None) + self.access_tier = kwargs.get('access_tier', None) + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False) + self.network_rule_set = kwargs.get('network_rule_set', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_update_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_update_parameters_py3.py new file mode 100644 index 000000000000..9b331731d561 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_update_parameters_py3.py @@ -0,0 +1,72 @@ +# 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 msrest.serialization import Model + + +class StorageAccountUpdateParameters(Model): + """The parameters that can be provided when updating the storage account + properties. + + :param sku: Gets or sets the SKU name. Note that the SKU name cannot be + updated to Standard_ZRS or Premium_LRS, nor can accounts of those sku + names be updated to any other value. + :type sku: ~azure.mgmt.storage.v2017_06_01.models.Sku + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used in viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key no greater in length than 128 + characters and a value no greater in length than 256 characters. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2017_06_01.models.Identity + :param custom_domain: Custom domain assigned to the storage account by the + user. Name is the CNAME source. Only one custom domain is supported per + storage account at this time. To clear the existing custom domain, use an + empty string for the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2017_06_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2017_06_01.models.Encryption + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2017_06_01.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + :param network_rule_set: Network rule set + :type network_rule_set: + ~azure.mgmt.storage.v2017_06_01.models.NetworkRuleSet + """ + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + } + + def __init__(self, *, sku=None, tags=None, identity=None, custom_domain=None, encryption=None, access_tier=None, enable_https_traffic_only: bool=False, network_rule_set=None, **kwargs) -> None: + super(StorageAccountUpdateParameters, self).__init__(**kwargs) + self.sku = sku + self.tags = tags + self.identity = identity + self.custom_domain = custom_domain + self.encryption = encryption + self.access_tier = access_tier + self.enable_https_traffic_only = enable_https_traffic_only + self.network_rule_set = network_rule_set diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_management_client_enums.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_management_client_enums.py index b0070a6dd4e3..1153f7913492 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_management_client_enums.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_management_client_enums.py @@ -12,13 +12,13 @@ from enum import Enum -class ReasonCode(Enum): +class ReasonCode(str, Enum): quota_id = "QuotaId" not_available_for_subscription = "NotAvailableForSubscription" -class SkuName(Enum): +class SkuName(str, Enum): standard_lrs = "Standard_LRS" standard_grs = "Standard_GRS" @@ -27,36 +27,36 @@ class SkuName(Enum): premium_lrs = "Premium_LRS" -class SkuTier(Enum): +class SkuTier(str, Enum): standard = "Standard" premium = "Premium" -class Kind(Enum): +class Kind(str, Enum): storage = "Storage" blob_storage = "BlobStorage" -class Reason(Enum): +class Reason(str, Enum): account_name_invalid = "AccountNameInvalid" already_exists = "AlreadyExists" -class KeySource(Enum): +class KeySource(str, Enum): microsoft_storage = "Microsoft.Storage" microsoft_keyvault = "Microsoft.Keyvault" -class Action(Enum): +class Action(str, Enum): allow = "Allow" -class State(Enum): +class State(str, Enum): provisioning = "provisioning" deprovisioning = "deprovisioning" @@ -65,7 +65,7 @@ class State(Enum): network_source_deleted = "networkSourceDeleted" -class Bypass(Enum): +class Bypass(str, Enum): none = "None" logging = "Logging" @@ -73,38 +73,38 @@ class Bypass(Enum): azure_services = "AzureServices" -class DefaultAction(Enum): +class DefaultAction(str, Enum): allow = "Allow" deny = "Deny" -class AccessTier(Enum): +class AccessTier(str, Enum): hot = "Hot" cool = "Cool" -class ProvisioningState(Enum): +class ProvisioningState(str, Enum): creating = "Creating" resolving_dns = "ResolvingDNS" succeeded = "Succeeded" -class AccountStatus(Enum): +class AccountStatus(str, Enum): available = "available" unavailable = "unavailable" -class KeyPermission(Enum): +class KeyPermission(str, Enum): read = "Read" full = "Full" -class UsageUnit(Enum): +class UsageUnit(str, Enum): count = "Count" bytes = "Bytes" @@ -114,7 +114,7 @@ class UsageUnit(Enum): bytes_per_second = "BytesPerSecond" -class Services(Enum): +class Services(str, Enum): b = "b" q = "q" @@ -122,14 +122,14 @@ class Services(Enum): f = "f" -class SignedResourceTypes(Enum): +class SignedResourceTypes(str, Enum): s = "s" c = "c" o = "o" -class Permissions(Enum): +class Permissions(str, Enum): r = "r" d = "d" @@ -141,13 +141,13 @@ class Permissions(Enum): p = "p" -class HttpProtocol(Enum): +class HttpProtocol(str, Enum): httpshttp = "https,http" https = "https" -class SignedResource(Enum): +class SignedResource(str, Enum): b = "b" c = "c" diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/usage.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/usage.py index 926878d01e79..c9bf28ceb25a 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/usage.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/usage.py @@ -46,8 +46,8 @@ class Usage(Model): 'name': {'key': 'name', 'type': 'UsageName'}, } - def __init__(self): - super(Usage, self).__init__() + def __init__(self, **kwargs): + super(Usage, self).__init__(**kwargs) self.unit = None self.current_value = None self.limit = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/usage_name.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/usage_name.py index c09f75b38c9a..e4082bf52384 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/usage_name.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/usage_name.py @@ -35,7 +35,7 @@ class UsageName(Model): 'localized_value': {'key': 'localizedValue', 'type': 'str'}, } - def __init__(self): - super(UsageName, self).__init__() + def __init__(self, **kwargs): + super(UsageName, self).__init__(**kwargs) self.value = None self.localized_value = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/usage_name_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/usage_name_py3.py new file mode 100644 index 000000000000..f519bb5072b1 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/usage_name_py3.py @@ -0,0 +1,41 @@ +# 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 msrest.serialization import Model + + +class UsageName(Model): + """The usage names that can be used; currently limited to StorageAccount. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: Gets a string describing the resource name. + :vartype value: str + :ivar localized_value: Gets a localized string describing the resource + name. + :vartype localized_value: str + """ + + _validation = { + 'value': {'readonly': True}, + 'localized_value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(UsageName, self).__init__(**kwargs) + self.value = None + self.localized_value = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/usage_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/usage_py3.py new file mode 100644 index 000000000000..d96ce4fe8177 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/usage_py3.py @@ -0,0 +1,54 @@ +# 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 msrest.serialization import Model + + +class Usage(Model): + """Describes Storage Resource Usage. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar unit: Gets the unit of measurement. Possible values include: + 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', + 'BytesPerSecond' + :vartype unit: str or ~azure.mgmt.storage.v2017_06_01.models.UsageUnit + :ivar current_value: Gets the current count of the allocated resources in + the subscription. + :vartype current_value: int + :ivar limit: Gets the maximum count of the resources that can be allocated + in the subscription. + :vartype limit: int + :ivar name: Gets the name of the type of usage. + :vartype name: ~azure.mgmt.storage.v2017_06_01.models.UsageName + """ + + _validation = { + 'unit': {'readonly': True}, + 'current_value': {'readonly': True}, + 'limit': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'UsageUnit'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + def __init__(self, **kwargs) -> None: + super(Usage, self).__init__(**kwargs) + self.unit = None + self.current_value = None + self.limit = None + self.name = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/virtual_network_rule.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/virtual_network_rule.py index d7b4e274ea7f..0724a4bae9ae 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/virtual_network_rule.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/virtual_network_rule.py @@ -15,7 +15,10 @@ class VirtualNetworkRule(Model): """Virtual Network rule. - :param virtual_network_resource_id: Resource ID of a subnet, for example: + All required parameters must be populated in order to send to Azure. + + :param virtual_network_resource_id: Required. Resource ID of a subnet, for + example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. :type virtual_network_resource_id: str :param action: The action of virtual network rule. Possible values @@ -37,8 +40,8 @@ class VirtualNetworkRule(Model): 'state': {'key': 'state', 'type': 'State'}, } - def __init__(self, virtual_network_resource_id, action="Allow", state=None): - super(VirtualNetworkRule, self).__init__() - self.virtual_network_resource_id = virtual_network_resource_id - self.action = action - self.state = state + def __init__(self, **kwargs): + super(VirtualNetworkRule, self).__init__(**kwargs) + self.virtual_network_resource_id = kwargs.get('virtual_network_resource_id', None) + self.action = kwargs.get('action', "Allow") + self.state = kwargs.get('state', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/virtual_network_rule_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/virtual_network_rule_py3.py new file mode 100644 index 000000000000..b0bf9e282280 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/virtual_network_rule_py3.py @@ -0,0 +1,47 @@ +# 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 msrest.serialization import Model + + +class VirtualNetworkRule(Model): + """Virtual Network rule. + + All required parameters must be populated in order to send to Azure. + + :param virtual_network_resource_id: Required. Resource ID of a subnet, for + example: + /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + :type virtual_network_resource_id: str + :param action: The action of virtual network rule. Possible values + include: 'Allow'. Default value: "Allow" . + :type action: str or ~azure.mgmt.storage.v2017_06_01.models.Action + :param state: Gets the state of virtual network rule. Possible values + include: 'provisioning', 'deprovisioning', 'succeeded', 'failed', + 'networkSourceDeleted' + :type state: str or ~azure.mgmt.storage.v2017_06_01.models.State + """ + + _validation = { + 'virtual_network_resource_id': {'required': True}, + } + + _attribute_map = { + 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'Action'}, + 'state': {'key': 'state', 'type': 'State'}, + } + + def __init__(self, *, virtual_network_resource_id: str, action="Allow", state=None, **kwargs) -> None: + super(VirtualNetworkRule, self).__init__(**kwargs) + self.virtual_network_resource_id = virtual_network_resource_id + self.action = action + self.state = state diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/operations.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/operations.py index ab88503d8bb5..acf3fd6834e4 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/operations.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/operations.py @@ -22,7 +22,7 @@ class Operations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2017-06-01". """ @@ -55,7 +55,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/providers/Microsoft.Storage/operations' + url = self.list.metadata['url'] # Construct parameters query_parameters = {} @@ -96,3 +96,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/providers/Microsoft.Storage/operations'} diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/skus_operations.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/skus_operations.py index 4ce7bf72863f..ace3b7af30fe 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/skus_operations.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/skus_operations.py @@ -22,7 +22,7 @@ class SkusOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2017-06-01". """ @@ -56,7 +56,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/skus' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -101,3 +101,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/skus'} diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/storage_accounts_operations.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/storage_accounts_operations.py index 30acaec4ca09..06f4b0681273 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/storage_accounts_operations.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/storage_accounts_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class StorageAccountsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2017-06-01". """ @@ -60,7 +60,7 @@ def check_name_availability( account_name = models.StorageAccountCheckNameAvailabilityParameters(name=name) # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability' + url = self.check_name_availability.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -103,12 +103,13 @@ def check_name_availability( return client_raw_response return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability'} def _create_initial( self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}' + url = self.create.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -155,7 +156,7 @@ def _create_initial( return deserialized def create( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties @@ -174,13 +175,16 @@ def create( :type parameters: ~azure.mgmt.storage.v2017_06_01.models.StorageAccountCreateParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - StorageAccount or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns StorageAccount or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.storage.v2017_06_01.models.StorageAccount] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.storage.v2017_06_01.models.StorageAccount]] :raises: :class:`CloudError` """ raw_result = self._create_initial( @@ -191,30 +195,8 @@ def create( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('StorageAccount', response) if raw: @@ -223,12 +205,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} def delete( self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): @@ -251,7 +235,7 @@ def delete( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -285,6 +269,7 @@ def delete( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} def get_properties( self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): @@ -310,7 +295,7 @@ def get_properties( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}' + url = self.get_properties.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -351,6 +336,7 @@ def get_properties( return client_raw_response return deserialized + get_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} def update( self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): @@ -386,7 +372,7 @@ def update( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}' + url = self.update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -431,6 +417,7 @@ def update( return client_raw_response return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} def list( self, custom_headers=None, raw=False, **operation_config): @@ -452,7 +439,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -497,6 +484,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts'} def list_by_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -521,7 +509,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts' + url = self.list_by_resource_group.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -567,6 +555,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts'} def list_keys( self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): @@ -591,7 +580,7 @@ def list_keys( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys' + url = self.list_keys.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -632,6 +621,7 @@ def list_keys( return client_raw_response return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys'} def regenerate_key( self, resource_group_name, account_name, key_name, custom_headers=None, raw=False, **operation_config): @@ -661,7 +651,7 @@ def regenerate_key( regenerate_key1 = models.StorageAccountRegenerateKeyParameters(key_name=key_name) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey' + url = self.regenerate_key.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -706,6 +696,7 @@ def regenerate_key( return client_raw_response return deserialized + regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey'} def list_account_sas( self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): @@ -733,7 +724,7 @@ def list_account_sas( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas' + url = self.list_account_sas.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -778,6 +769,7 @@ def list_account_sas( return client_raw_response return deserialized + list_account_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas'} def list_service_sas( self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): @@ -805,7 +797,7 @@ def list_service_sas( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas' + url = self.list_service_sas.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -850,3 +842,4 @@ def list_service_sas( return client_raw_response return deserialized + list_service_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas'} diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/usage_operations.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/usage_operations.py index da88c394e36d..b67b64336173 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/usage_operations.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/usage_operations.py @@ -22,7 +22,7 @@ class UsageOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2017-06-01". """ @@ -56,7 +56,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -101,3 +101,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages'} diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/storage_management_client.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/storage_management_client.py index 836bdc60aa25..db90f97ed22f 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/storage_management_client.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/storage_management_client.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import ServiceClient +from msrest.service_client import SDKClient from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION @@ -54,7 +54,7 @@ def __init__( self.subscription_id = subscription_id -class StorageManagementClient(object): +class StorageManagementClient(SDKClient): """The Azure Storage Management API. :ivar config: Configuration for client. @@ -83,7 +83,7 @@ def __init__( self, credentials, subscription_id, base_url=None): self.config = StorageManagementClientConfiguration(credentials, subscription_id, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + super(StorageManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self.api_version = '2017-06-01' diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/__init__.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/__init__.py index 8e493a3a2641..d3d602c0775b 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/__init__.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/__init__.py @@ -9,39 +9,74 @@ # regenerated. # -------------------------------------------------------------------------- -from .operation_display import OperationDisplay -from .dimension import Dimension -from .metric_specification import MetricSpecification -from .service_specification import ServiceSpecification -from .operation import Operation -from .storage_account_check_name_availability_parameters import StorageAccountCheckNameAvailabilityParameters -from .sku_capability import SKUCapability -from .restriction import Restriction -from .sku import Sku -from .check_name_availability_result import CheckNameAvailabilityResult -from .custom_domain import CustomDomain -from .encryption_service import EncryptionService -from .encryption_services import EncryptionServices -from .key_vault_properties import KeyVaultProperties -from .encryption import Encryption -from .virtual_network_rule import VirtualNetworkRule -from .ip_rule import IPRule -from .network_rule_set import NetworkRuleSet -from .identity import Identity -from .storage_account_create_parameters import StorageAccountCreateParameters -from .endpoints import Endpoints -from .storage_account import StorageAccount -from .storage_account_key import StorageAccountKey -from .storage_account_list_keys_result import StorageAccountListKeysResult -from .storage_account_regenerate_key_parameters import StorageAccountRegenerateKeyParameters -from .storage_account_update_parameters import StorageAccountUpdateParameters -from .usage_name import UsageName -from .usage import Usage -from .resource import Resource -from .account_sas_parameters import AccountSasParameters -from .list_account_sas_response import ListAccountSasResponse -from .service_sas_parameters import ServiceSasParameters -from .list_service_sas_response import ListServiceSasResponse +try: + from .operation_display_py3 import OperationDisplay + from .dimension_py3 import Dimension + from .metric_specification_py3 import MetricSpecification + from .service_specification_py3 import ServiceSpecification + from .operation_py3 import Operation + from .storage_account_check_name_availability_parameters_py3 import StorageAccountCheckNameAvailabilityParameters + from .sku_capability_py3 import SKUCapability + from .restriction_py3 import Restriction + from .sku_py3 import Sku + from .check_name_availability_result_py3 import CheckNameAvailabilityResult + from .custom_domain_py3 import CustomDomain + from .encryption_service_py3 import EncryptionService + from .encryption_services_py3 import EncryptionServices + from .key_vault_properties_py3 import KeyVaultProperties + from .encryption_py3 import Encryption + from .virtual_network_rule_py3 import VirtualNetworkRule + from .ip_rule_py3 import IPRule + from .network_rule_set_py3 import NetworkRuleSet + from .identity_py3 import Identity + from .storage_account_create_parameters_py3 import StorageAccountCreateParameters + from .endpoints_py3 import Endpoints + from .storage_account_py3 import StorageAccount + from .storage_account_key_py3 import StorageAccountKey + from .storage_account_list_keys_result_py3 import StorageAccountListKeysResult + from .storage_account_regenerate_key_parameters_py3 import StorageAccountRegenerateKeyParameters + from .storage_account_update_parameters_py3 import StorageAccountUpdateParameters + from .usage_name_py3 import UsageName + from .usage_py3 import Usage + from .resource_py3 import Resource + from .account_sas_parameters_py3 import AccountSasParameters + from .list_account_sas_response_py3 import ListAccountSasResponse + from .service_sas_parameters_py3 import ServiceSasParameters + from .list_service_sas_response_py3 import ListServiceSasResponse +except (SyntaxError, ImportError): + from .operation_display import OperationDisplay + from .dimension import Dimension + from .metric_specification import MetricSpecification + from .service_specification import ServiceSpecification + from .operation import Operation + from .storage_account_check_name_availability_parameters import StorageAccountCheckNameAvailabilityParameters + from .sku_capability import SKUCapability + from .restriction import Restriction + from .sku import Sku + from .check_name_availability_result import CheckNameAvailabilityResult + from .custom_domain import CustomDomain + from .encryption_service import EncryptionService + from .encryption_services import EncryptionServices + from .key_vault_properties import KeyVaultProperties + from .encryption import Encryption + from .virtual_network_rule import VirtualNetworkRule + from .ip_rule import IPRule + from .network_rule_set import NetworkRuleSet + from .identity import Identity + from .storage_account_create_parameters import StorageAccountCreateParameters + from .endpoints import Endpoints + from .storage_account import StorageAccount + from .storage_account_key import StorageAccountKey + from .storage_account_list_keys_result import StorageAccountListKeysResult + from .storage_account_regenerate_key_parameters import StorageAccountRegenerateKeyParameters + from .storage_account_update_parameters import StorageAccountUpdateParameters + from .usage_name import UsageName + from .usage import Usage + from .resource import Resource + from .account_sas_parameters import AccountSasParameters + from .list_account_sas_response import ListAccountSasResponse + from .service_sas_parameters import ServiceSasParameters + from .list_service_sas_response import ListServiceSasResponse from .operation_paged import OperationPaged from .sku_paged import SkuPaged from .storage_account_paged import StorageAccountPaged diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/account_sas_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/account_sas_parameters.py index 0a7e746852a9..3fff0b8de573 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/account_sas_parameters.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/account_sas_parameters.py @@ -15,21 +15,23 @@ class AccountSasParameters(Model): """The parameters to list SAS credentials of a storage account. - :param services: The signed services accessible with the account SAS. - Possible values include: Blob (b), Queue (q), Table (t), File (f). + All required parameters must be populated in order to send to Azure. + + :param services: Required. The signed services accessible with the account + SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). Possible values include: 'b', 'q', 't', 'f' :type services: str or ~azure.mgmt.storage.v2017_10_01.models.Services - :param resource_types: The signed resource types that are accessible with - the account SAS. Service (s): Access to service-level APIs; Container (c): - Access to container-level APIs; Object (o): Access to object-level APIs - for blobs, queue messages, table entities, and files. Possible values - include: 's', 'c', 'o' + :param resource_types: Required. The signed resource types that are + accessible with the account SAS. Service (s): Access to service-level + APIs; Container (c): Access to container-level APIs; Object (o): Access to + object-level APIs for blobs, queue messages, table entities, and files. + Possible values include: 's', 'c', 'o' :type resource_types: str or ~azure.mgmt.storage.v2017_10_01.models.SignedResourceTypes - :param permissions: The signed permissions for the account SAS. Possible - values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create - (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', - 'l', 'a', 'c', 'u', 'p' + :param permissions: Required. The signed permissions for the account SAS. + Possible values include: Read (r), Write (w), Delete (d), List (l), Add + (a), Create (c), Update (u) and Process (p). Possible values include: 'r', + 'd', 'w', 'l', 'a', 'c', 'u', 'p' :type permissions: str or ~azure.mgmt.storage.v2017_10_01.models.Permissions :param ip_address_or_range: An IP address or a range of IP addresses from @@ -41,8 +43,8 @@ class AccountSasParameters(Model): ~azure.mgmt.storage.v2017_10_01.models.HttpProtocol :param shared_access_start_time: The time at which the SAS becomes valid. :type shared_access_start_time: datetime - :param shared_access_expiry_time: The time at which the shared access - signature becomes invalid. + :param shared_access_expiry_time: Required. The time at which the shared + access signature becomes invalid. :type shared_access_expiry_time: datetime :param key_to_sign: The key to sign the account SAS token with. :type key_to_sign: str @@ -66,13 +68,13 @@ class AccountSasParameters(Model): 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, } - def __init__(self, services, resource_types, permissions, shared_access_expiry_time, ip_address_or_range=None, protocols=None, shared_access_start_time=None, key_to_sign=None): - super(AccountSasParameters, self).__init__() - self.services = services - self.resource_types = resource_types - self.permissions = permissions - self.ip_address_or_range = ip_address_or_range - self.protocols = protocols - self.shared_access_start_time = shared_access_start_time - self.shared_access_expiry_time = shared_access_expiry_time - self.key_to_sign = key_to_sign + def __init__(self, **kwargs): + super(AccountSasParameters, self).__init__(**kwargs) + self.services = kwargs.get('services', None) + self.resource_types = kwargs.get('resource_types', None) + self.permissions = kwargs.get('permissions', None) + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + self.protocols = kwargs.get('protocols', None) + self.shared_access_start_time = kwargs.get('shared_access_start_time', None) + self.shared_access_expiry_time = kwargs.get('shared_access_expiry_time', None) + self.key_to_sign = kwargs.get('key_to_sign', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/account_sas_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/account_sas_parameters_py3.py new file mode 100644 index 000000000000..5bae2b318f48 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/account_sas_parameters_py3.py @@ -0,0 +1,80 @@ +# 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 msrest.serialization import Model + + +class AccountSasParameters(Model): + """The parameters to list SAS credentials of a storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: Required. The signed services accessible with the account + SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). + Possible values include: 'b', 'q', 't', 'f' + :type services: str or ~azure.mgmt.storage.v2017_10_01.models.Services + :param resource_types: Required. The signed resource types that are + accessible with the account SAS. Service (s): Access to service-level + APIs; Container (c): Access to container-level APIs; Object (o): Access to + object-level APIs for blobs, queue messages, table entities, and files. + Possible values include: 's', 'c', 'o' + :type resource_types: str or + ~azure.mgmt.storage.v2017_10_01.models.SignedResourceTypes + :param permissions: Required. The signed permissions for the account SAS. + Possible values include: Read (r), Write (w), Delete (d), List (l), Add + (a), Create (c), Update (u) and Process (p). Possible values include: 'r', + 'd', 'w', 'l', 'a', 'c', 'u', 'p' + :type permissions: str or + ~azure.mgmt.storage.v2017_10_01.models.Permissions + :param ip_address_or_range: An IP address or a range of IP addresses from + which to accept requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the + account SAS. Possible values include: 'https,http', 'https' + :type protocols: str or + ~azure.mgmt.storage.v2017_10_01.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: datetime + :param shared_access_expiry_time: Required. The time at which the shared + access signature becomes invalid. + :type shared_access_expiry_time: datetime + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + """ + + _validation = { + 'services': {'required': True}, + 'resource_types': {'required': True}, + 'permissions': {'required': True}, + 'shared_access_expiry_time': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'signedServices', 'type': 'str'}, + 'resource_types': {'key': 'signedResourceTypes', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + } + + def __init__(self, *, services, resource_types, permissions, shared_access_expiry_time, ip_address_or_range: str=None, protocols=None, shared_access_start_time=None, key_to_sign: str=None, **kwargs) -> None: + super(AccountSasParameters, self).__init__(**kwargs) + self.services = services + self.resource_types = resource_types + self.permissions = permissions + self.ip_address_or_range = ip_address_or_range + self.protocols = protocols + self.shared_access_start_time = shared_access_start_time + self.shared_access_expiry_time = shared_access_expiry_time + self.key_to_sign = key_to_sign diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/check_name_availability_result.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/check_name_availability_result.py index c39b4becabe9..f2bfb36e391c 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/check_name_availability_result.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/check_name_availability_result.py @@ -43,8 +43,8 @@ class CheckNameAvailabilityResult(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self): - super(CheckNameAvailabilityResult, self).__init__() + def __init__(self, **kwargs): + super(CheckNameAvailabilityResult, self).__init__(**kwargs) self.name_available = None self.reason = None self.message = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/check_name_availability_result_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/check_name_availability_result_py3.py new file mode 100644 index 000000000000..e2a8b2937c91 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/check_name_availability_result_py3.py @@ -0,0 +1,50 @@ +# 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 msrest.serialization import Model + + +class CheckNameAvailabilityResult(Model): + """The CheckNameAvailability operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name_available: Gets a boolean value that indicates whether the name + is available for you to use. If true, the name is available. If false, the + name has already been taken or is invalid and cannot be used. + :vartype name_available: bool + :ivar reason: Gets the reason that a storage account name could not be + used. The Reason element is only returned if NameAvailable is false. + Possible values include: 'AccountNameInvalid', 'AlreadyExists' + :vartype reason: str or ~azure.mgmt.storage.v2017_10_01.models.Reason + :ivar message: Gets an error message explaining the Reason value in more + detail. + :vartype message: str + """ + + _validation = { + 'name_available': {'readonly': True}, + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'Reason'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = None + self.reason = None + self.message = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/custom_domain.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/custom_domain.py index 12b0f7691888..585480d7321a 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/custom_domain.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/custom_domain.py @@ -16,8 +16,10 @@ class CustomDomain(Model): """The custom domain assigned to this storage account. This can be set via Update. - :param name: Gets or sets the custom domain name assigned to the storage - account. Name is the CNAME source. + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the custom domain name assigned to the + storage account. Name is the CNAME source. :type name: str :param use_sub_domain: Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. @@ -33,7 +35,7 @@ class CustomDomain(Model): 'use_sub_domain': {'key': 'useSubDomain', 'type': 'bool'}, } - def __init__(self, name, use_sub_domain=None): - super(CustomDomain, self).__init__() - self.name = name - self.use_sub_domain = use_sub_domain + def __init__(self, **kwargs): + super(CustomDomain, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.use_sub_domain = kwargs.get('use_sub_domain', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/custom_domain_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/custom_domain_py3.py new file mode 100644 index 000000000000..4c6fe3f83e35 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/custom_domain_py3.py @@ -0,0 +1,41 @@ +# 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 msrest.serialization import Model + + +class CustomDomain(Model): + """The custom domain assigned to this storage account. This can be set via + Update. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the custom domain name assigned to the + storage account. Name is the CNAME source. + :type name: str + :param use_sub_domain: Indicates whether indirect CName validation is + enabled. Default value is false. This should only be set on updates. + :type use_sub_domain: bool + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'use_sub_domain': {'key': 'useSubDomain', 'type': 'bool'}, + } + + def __init__(self, *, name: str, use_sub_domain: bool=None, **kwargs) -> None: + super(CustomDomain, self).__init__(**kwargs) + self.name = name + self.use_sub_domain = use_sub_domain diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/dimension.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/dimension.py index bf7b9383880f..0a0cdaf75da7 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/dimension.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/dimension.py @@ -26,7 +26,7 @@ class Dimension(Model): 'display_name': {'key': 'displayName', 'type': 'str'}, } - def __init__(self, name=None, display_name=None): - super(Dimension, self).__init__() - self.name = name - self.display_name = display_name + def __init__(self, **kwargs): + super(Dimension, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/dimension_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/dimension_py3.py new file mode 100644 index 000000000000..6845aa528b4b --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/dimension_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class Dimension(Model): + """Dimension of blobs, possiblly be blob type or access tier. + + :param name: Display name of dimension. + :type name: str + :param display_name: Display name of dimension. + :type display_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, **kwargs) -> None: + super(Dimension, self).__init__(**kwargs) + self.name = name + self.display_name = display_name diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption.py index d8b6c6977444..34ad6bac386d 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption.py @@ -15,12 +15,14 @@ class Encryption(Model): """The encryption settings on the storage account. + All required parameters must be populated in order to send to Azure. + :param services: List of services which support encryption. :type services: ~azure.mgmt.storage.v2017_10_01.models.EncryptionServices - :param key_source: The encryption keySource (provider). Possible values - (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. Possible - values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. Default value: - "Microsoft.Storage" . + :param key_source: Required. The encryption keySource (provider). Possible + values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. + Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. + Default value: "Microsoft.Storage" . :type key_source: str or ~azure.mgmt.storage.v2017_10_01.models.KeySource :param key_vault_properties: Properties provided by key vault. :type key_vault_properties: @@ -37,8 +39,8 @@ class Encryption(Model): 'key_vault_properties': {'key': 'keyvaultproperties', 'type': 'KeyVaultProperties'}, } - def __init__(self, services=None, key_source="Microsoft.Storage", key_vault_properties=None): - super(Encryption, self).__init__() - self.services = services - self.key_source = key_source - self.key_vault_properties = key_vault_properties + def __init__(self, **kwargs): + super(Encryption, self).__init__(**kwargs) + self.services = kwargs.get('services', None) + self.key_source = kwargs.get('key_source', "Microsoft.Storage") + self.key_vault_properties = kwargs.get('key_vault_properties', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption_py3.py new file mode 100644 index 000000000000..d819a127105d --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption_py3.py @@ -0,0 +1,46 @@ +# 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 msrest.serialization import Model + + +class Encryption(Model): + """The encryption settings on the storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: List of services which support encryption. + :type services: ~azure.mgmt.storage.v2017_10_01.models.EncryptionServices + :param key_source: Required. The encryption keySource (provider). Possible + values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. + Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. + Default value: "Microsoft.Storage" . + :type key_source: str or ~azure.mgmt.storage.v2017_10_01.models.KeySource + :param key_vault_properties: Properties provided by key vault. + :type key_vault_properties: + ~azure.mgmt.storage.v2017_10_01.models.KeyVaultProperties + """ + + _validation = { + 'key_source': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'services', 'type': 'EncryptionServices'}, + 'key_source': {'key': 'keySource', 'type': 'str'}, + 'key_vault_properties': {'key': 'keyvaultproperties', 'type': 'KeyVaultProperties'}, + } + + def __init__(self, *, services=None, key_source="Microsoft.Storage", key_vault_properties=None, **kwargs) -> None: + super(Encryption, self).__init__(**kwargs) + self.services = services + self.key_source = key_source + self.key_vault_properties = key_vault_properties diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption_service.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption_service.py index 0e033e9fe4a8..3a020c468f64 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption_service.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption_service.py @@ -37,7 +37,7 @@ class EncryptionService(Model): 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, } - def __init__(self, enabled=None): - super(EncryptionService, self).__init__() - self.enabled = enabled + def __init__(self, **kwargs): + super(EncryptionService, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) self.last_enabled_time = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption_service_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption_service_py3.py new file mode 100644 index 000000000000..0566050c6155 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption_service_py3.py @@ -0,0 +1,43 @@ +# 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 msrest.serialization import Model + + +class EncryptionService(Model): + """A service that allows server-side encryption to be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param enabled: A boolean indicating whether or not the service encrypts + the data as it is stored. + :type enabled: bool + :ivar last_enabled_time: Gets a rough estimate of the date/time when the + encryption was last enabled by the user. Only returned when encryption is + enabled. There might be some unencrypted blobs which were written after + this time, as it is just a rough estimate. + :vartype last_enabled_time: datetime + """ + + _validation = { + 'last_enabled_time': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, + } + + def __init__(self, *, enabled: bool=None, **kwargs) -> None: + super(EncryptionService, self).__init__(**kwargs) + self.enabled = enabled + self.last_enabled_time = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption_services.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption_services.py index 84d82e2b7875..0b47a300149f 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption_services.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption_services.py @@ -40,9 +40,9 @@ class EncryptionServices(Model): 'queue': {'key': 'queue', 'type': 'EncryptionService'}, } - def __init__(self, blob=None, file=None): - super(EncryptionServices, self).__init__() - self.blob = blob - self.file = file + def __init__(self, **kwargs): + super(EncryptionServices, self).__init__(**kwargs) + self.blob = kwargs.get('blob', None) + self.file = kwargs.get('file', None) self.table = None self.queue = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption_services_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption_services_py3.py new file mode 100644 index 000000000000..f9efae41c782 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption_services_py3.py @@ -0,0 +1,48 @@ +# 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 msrest.serialization import Model + + +class EncryptionServices(Model): + """A list of services that support encryption. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param blob: The encryption function of the blob storage service. + :type blob: ~azure.mgmt.storage.v2017_10_01.models.EncryptionService + :param file: The encryption function of the file storage service. + :type file: ~azure.mgmt.storage.v2017_10_01.models.EncryptionService + :ivar table: The encryption function of the table storage service. + :vartype table: ~azure.mgmt.storage.v2017_10_01.models.EncryptionService + :ivar queue: The encryption function of the queue storage service. + :vartype queue: ~azure.mgmt.storage.v2017_10_01.models.EncryptionService + """ + + _validation = { + 'table': {'readonly': True}, + 'queue': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'EncryptionService'}, + 'file': {'key': 'file', 'type': 'EncryptionService'}, + 'table': {'key': 'table', 'type': 'EncryptionService'}, + 'queue': {'key': 'queue', 'type': 'EncryptionService'}, + } + + def __init__(self, *, blob=None, file=None, **kwargs) -> None: + super(EncryptionServices, self).__init__(**kwargs) + self.blob = blob + self.file = file + self.table = None + self.queue = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/endpoints.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/endpoints.py index 2524757f961f..ec345fceac47 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/endpoints.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/endpoints.py @@ -43,8 +43,8 @@ class Endpoints(Model): 'file': {'key': 'file', 'type': 'str'}, } - def __init__(self): - super(Endpoints, self).__init__() + def __init__(self, **kwargs): + super(Endpoints, self).__init__(**kwargs) self.blob = None self.queue = None self.table = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/endpoints_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/endpoints_py3.py new file mode 100644 index 000000000000..a186e9c8d6a9 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/endpoints_py3.py @@ -0,0 +1,51 @@ +# 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 msrest.serialization import Model + + +class Endpoints(Model): + """The URIs that are used to perform a retrieval of a public blob, queue, or + table object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar blob: Gets the blob endpoint. + :vartype blob: str + :ivar queue: Gets the queue endpoint. + :vartype queue: str + :ivar table: Gets the table endpoint. + :vartype table: str + :ivar file: Gets the file endpoint. + :vartype file: str + """ + + _validation = { + 'blob': {'readonly': True}, + 'queue': {'readonly': True}, + 'table': {'readonly': True}, + 'file': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'str'}, + 'queue': {'key': 'queue', 'type': 'str'}, + 'table': {'key': 'table', 'type': 'str'}, + 'file': {'key': 'file', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Endpoints, self).__init__(**kwargs) + self.blob = None + self.queue = None + self.table = None + self.file = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/identity.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/identity.py index 5e7bac70c5e2..f526b986fc70 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/identity.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/identity.py @@ -18,11 +18,13 @@ class Identity(Model): 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 Azure. + :ivar principal_id: The principal ID of resource identity. :vartype principal_id: str :ivar tenant_id: The tenant ID of resource. :vartype tenant_id: str - :ivar type: The identity type. Default value: "SystemAssigned" . + :ivar type: Required. The identity type. Default value: "SystemAssigned" . :vartype type: str """ @@ -40,7 +42,7 @@ class Identity(Model): type = "SystemAssigned" - def __init__(self): - super(Identity, self).__init__() + def __init__(self, **kwargs): + super(Identity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/identity_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/identity_py3.py new file mode 100644 index 000000000000..22d25fdd85b7 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/identity_py3.py @@ -0,0 +1,48 @@ +# 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 msrest.serialization import Model + + +class Identity(Model): + """Identity for the 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 Azure. + + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :ivar type: Required. The identity type. Default value: "SystemAssigned" . + :vartype type: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "SystemAssigned" + + def __init__(self, **kwargs) -> None: + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/ip_rule.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/ip_rule.py index b5d51e370909..fba0ad0623d3 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/ip_rule.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/ip_rule.py @@ -15,8 +15,10 @@ class IPRule(Model): """IP rule with specific IP or IP range in CIDR format. - :param ip_address_or_range: Specifies the IP or IP range in CIDR format. - Only IPV4 address is allowed. + All required parameters must be populated in order to send to Azure. + + :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR + format. Only IPV4 address is allowed. :type ip_address_or_range: str :param action: The action of IP ACL rule. Possible values include: 'Allow'. Default value: "Allow" . @@ -32,7 +34,7 @@ class IPRule(Model): 'action': {'key': 'action', 'type': 'Action'}, } - def __init__(self, ip_address_or_range, action="Allow"): - super(IPRule, self).__init__() - self.ip_address_or_range = ip_address_or_range - self.action = action + def __init__(self, **kwargs): + super(IPRule, self).__init__(**kwargs) + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + self.action = kwargs.get('action', "Allow") diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/ip_rule_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/ip_rule_py3.py new file mode 100644 index 000000000000..bd3688ccc8dd --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/ip_rule_py3.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class IPRule(Model): + """IP rule with specific IP or IP range in CIDR format. + + All required parameters must be populated in order to send to Azure. + + :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR + format. Only IPV4 address is allowed. + :type ip_address_or_range: str + :param action: The action of IP ACL rule. Possible values include: + 'Allow'. Default value: "Allow" . + :type action: str or ~azure.mgmt.storage.v2017_10_01.models.Action + """ + + _validation = { + 'ip_address_or_range': {'required': True}, + } + + _attribute_map = { + 'ip_address_or_range': {'key': 'value', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'Action'}, + } + + def __init__(self, *, ip_address_or_range: str, action="Allow", **kwargs) -> None: + super(IPRule, self).__init__(**kwargs) + self.ip_address_or_range = ip_address_or_range + self.action = action diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/key_vault_properties.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/key_vault_properties.py index 59657c3071b7..44eaf379f6f2 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/key_vault_properties.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/key_vault_properties.py @@ -29,8 +29,8 @@ class KeyVaultProperties(Model): 'key_vault_uri': {'key': 'keyvaulturi', 'type': 'str'}, } - def __init__(self, key_name=None, key_version=None, key_vault_uri=None): - super(KeyVaultProperties, self).__init__() - self.key_name = key_name - self.key_version = key_version - self.key_vault_uri = key_vault_uri + def __init__(self, **kwargs): + super(KeyVaultProperties, self).__init__(**kwargs) + self.key_name = kwargs.get('key_name', None) + self.key_version = kwargs.get('key_version', None) + self.key_vault_uri = kwargs.get('key_vault_uri', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/key_vault_properties_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/key_vault_properties_py3.py new file mode 100644 index 000000000000..9e6350eec898 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/key_vault_properties_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class KeyVaultProperties(Model): + """Properties of key vault. + + :param key_name: The name of KeyVault key. + :type key_name: str + :param key_version: The version of KeyVault key. + :type key_version: str + :param key_vault_uri: The Uri of KeyVault. + :type key_vault_uri: str + """ + + _attribute_map = { + 'key_name': {'key': 'keyname', 'type': 'str'}, + 'key_version': {'key': 'keyversion', 'type': 'str'}, + 'key_vault_uri': {'key': 'keyvaulturi', 'type': 'str'}, + } + + def __init__(self, *, key_name: str=None, key_version: str=None, key_vault_uri: str=None, **kwargs) -> None: + super(KeyVaultProperties, self).__init__(**kwargs) + self.key_name = key_name + self.key_version = key_version + self.key_vault_uri = key_vault_uri diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/list_account_sas_response.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/list_account_sas_response.py index 5d8b8c53cd6f..a56e959a34bd 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/list_account_sas_response.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/list_account_sas_response.py @@ -30,6 +30,6 @@ class ListAccountSasResponse(Model): 'account_sas_token': {'key': 'accountSasToken', 'type': 'str'}, } - def __init__(self): - super(ListAccountSasResponse, self).__init__() + def __init__(self, **kwargs): + super(ListAccountSasResponse, self).__init__(**kwargs) self.account_sas_token = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/list_account_sas_response_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/list_account_sas_response_py3.py new file mode 100644 index 000000000000..b8b9a314d9f6 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/list_account_sas_response_py3.py @@ -0,0 +1,35 @@ +# 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 msrest.serialization import Model + + +class ListAccountSasResponse(Model): + """The List SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar account_sas_token: List SAS credentials of storage account. + :vartype account_sas_token: str + """ + + _validation = { + 'account_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'account_sas_token': {'key': 'accountSasToken', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ListAccountSasResponse, self).__init__(**kwargs) + self.account_sas_token = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/list_service_sas_response.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/list_service_sas_response.py index e3c12854fe67..800c0298af61 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/list_service_sas_response.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/list_service_sas_response.py @@ -31,6 +31,6 @@ class ListServiceSasResponse(Model): 'service_sas_token': {'key': 'serviceSasToken', 'type': 'str'}, } - def __init__(self): - super(ListServiceSasResponse, self).__init__() + def __init__(self, **kwargs): + super(ListServiceSasResponse, self).__init__(**kwargs) self.service_sas_token = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/list_service_sas_response_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/list_service_sas_response_py3.py new file mode 100644 index 000000000000..cffd962e2041 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/list_service_sas_response_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class ListServiceSasResponse(Model): + """The List service SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar service_sas_token: List service SAS credentials of speicific + resource. + :vartype service_sas_token: str + """ + + _validation = { + 'service_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'service_sas_token': {'key': 'serviceSasToken', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ListServiceSasResponse, self).__init__(**kwargs) + self.service_sas_token = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/metric_specification.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/metric_specification.py index 57d491b9c886..ccc70beb4672 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/metric_specification.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/metric_specification.py @@ -50,14 +50,14 @@ class MetricSpecification(Model): 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, } - def __init__(self, name=None, display_name=None, display_description=None, unit=None, dimensions=None, aggregation_type=None, fill_gap_with_zero=None, category=None, resource_id_dimension_name_override=None): - super(MetricSpecification, self).__init__() - self.name = name - self.display_name = display_name - self.display_description = display_description - self.unit = unit - self.dimensions = dimensions - self.aggregation_type = aggregation_type - self.fill_gap_with_zero = fill_gap_with_zero - self.category = category - self.resource_id_dimension_name_override = resource_id_dimension_name_override + def __init__(self, **kwargs): + super(MetricSpecification, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.display_description = kwargs.get('display_description', None) + self.unit = kwargs.get('unit', None) + self.dimensions = kwargs.get('dimensions', None) + self.aggregation_type = kwargs.get('aggregation_type', None) + self.fill_gap_with_zero = kwargs.get('fill_gap_with_zero', None) + self.category = kwargs.get('category', None) + self.resource_id_dimension_name_override = kwargs.get('resource_id_dimension_name_override', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/metric_specification_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/metric_specification_py3.py new file mode 100644 index 000000000000..c6bffaa6d061 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/metric_specification_py3.py @@ -0,0 +1,63 @@ +# 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 msrest.serialization import Model + + +class MetricSpecification(Model): + """Metric specification of operation. + + :param name: Name of metric specification. + :type name: str + :param display_name: Display name of metric specification. + :type display_name: str + :param display_description: Display description of metric specification. + :type display_description: str + :param unit: Unit could be Bytes or Count. + :type unit: str + :param dimensions: Dimensions of blobs, including blob type and access + tier. + :type dimensions: list[~azure.mgmt.storage.v2017_10_01.models.Dimension] + :param aggregation_type: Aggregation type could be Average. + :type aggregation_type: str + :param fill_gap_with_zero: The property to decide fill gap with zero or + not. + :type fill_gap_with_zero: bool + :param category: The category this metric specification belong to, could + be Capacity. + :type category: str + :param resource_id_dimension_name_override: Account Resource Id. + :type resource_id_dimension_name_override: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'category': {'key': 'category', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, display_description: str=None, unit: str=None, dimensions=None, aggregation_type: str=None, fill_gap_with_zero: bool=None, category: str=None, resource_id_dimension_name_override: str=None, **kwargs) -> None: + super(MetricSpecification, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.display_description = display_description + self.unit = unit + self.dimensions = dimensions + self.aggregation_type = aggregation_type + self.fill_gap_with_zero = fill_gap_with_zero + self.category = category + self.resource_id_dimension_name_override = resource_id_dimension_name_override diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/network_rule_set.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/network_rule_set.py index ca391cfe337f..0ccf88552835 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/network_rule_set.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/network_rule_set.py @@ -15,6 +15,8 @@ class NetworkRuleSet(Model): """Network rule set. + All required parameters must be populated in order to send to Azure. + :param bypass: Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None @@ -26,9 +28,9 @@ class NetworkRuleSet(Model): list[~azure.mgmt.storage.v2017_10_01.models.VirtualNetworkRule] :param ip_rules: Sets the IP ACL rules :type ip_rules: list[~azure.mgmt.storage.v2017_10_01.models.IPRule] - :param default_action: Specifies the default action of allow or deny when - no other rules match. Possible values include: 'Allow', 'Deny'. Default - value: "Allow" . + :param default_action: Required. Specifies the default action of allow or + deny when no other rules match. Possible values include: 'Allow', 'Deny'. + Default value: "Allow" . :type default_action: str or ~azure.mgmt.storage.v2017_10_01.models.DefaultAction """ @@ -44,9 +46,9 @@ class NetworkRuleSet(Model): 'default_action': {'key': 'defaultAction', 'type': 'DefaultAction'}, } - def __init__(self, bypass="AzureServices", virtual_network_rules=None, ip_rules=None, default_action="Allow"): - super(NetworkRuleSet, self).__init__() - self.bypass = bypass - self.virtual_network_rules = virtual_network_rules - self.ip_rules = ip_rules - self.default_action = default_action + def __init__(self, **kwargs): + super(NetworkRuleSet, self).__init__(**kwargs) + self.bypass = kwargs.get('bypass', "AzureServices") + self.virtual_network_rules = kwargs.get('virtual_network_rules', None) + self.ip_rules = kwargs.get('ip_rules', None) + self.default_action = kwargs.get('default_action', "Allow") diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/network_rule_set_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/network_rule_set_py3.py new file mode 100644 index 000000000000..ac8fb83a6a69 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/network_rule_set_py3.py @@ -0,0 +1,54 @@ +# 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 msrest.serialization import Model + + +class NetworkRuleSet(Model): + """Network rule set. + + All required parameters must be populated in order to send to Azure. + + :param bypass: Specifies whether traffic is bypassed for + Logging/Metrics/AzureServices. Possible values are any combination of + Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None + to bypass none of those traffics. Possible values include: 'None', + 'Logging', 'Metrics', 'AzureServices'. Default value: "AzureServices" . + :type bypass: str or ~azure.mgmt.storage.v2017_10_01.models.Bypass + :param virtual_network_rules: Sets the virtual network rules + :type virtual_network_rules: + list[~azure.mgmt.storage.v2017_10_01.models.VirtualNetworkRule] + :param ip_rules: Sets the IP ACL rules + :type ip_rules: list[~azure.mgmt.storage.v2017_10_01.models.IPRule] + :param default_action: Required. Specifies the default action of allow or + deny when no other rules match. Possible values include: 'Allow', 'Deny'. + Default value: "Allow" . + :type default_action: str or + ~azure.mgmt.storage.v2017_10_01.models.DefaultAction + """ + + _validation = { + 'default_action': {'required': True}, + } + + _attribute_map = { + 'bypass': {'key': 'bypass', 'type': 'str'}, + 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, + 'default_action': {'key': 'defaultAction', 'type': 'DefaultAction'}, + } + + def __init__(self, *, bypass="AzureServices", virtual_network_rules=None, ip_rules=None, default_action="Allow", **kwargs) -> None: + super(NetworkRuleSet, self).__init__(**kwargs) + self.bypass = bypass + self.virtual_network_rules = virtual_network_rules + self.ip_rules = ip_rules + self.default_action = default_action diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/operation.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/operation.py index beda90ab4602..20ccef7197b1 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/operation.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/operation.py @@ -34,9 +34,9 @@ class Operation(Model): 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, } - def __init__(self, name=None, display=None, origin=None, service_specification=None): - super(Operation, self).__init__() - self.name = name - self.display = display - self.origin = origin - self.service_specification = service_specification + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) + self.service_specification = kwargs.get('service_specification', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/operation_display.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/operation_display.py index d31779b2891c..12d72186c4f2 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/operation_display.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/operation_display.py @@ -29,8 +29,8 @@ class OperationDisplay(Model): 'operation': {'key': 'operation', 'type': 'str'}, } - def __init__(self, provider=None, resource=None, operation=None): - super(OperationDisplay, self).__init__() - self.provider = provider - self.resource = resource - self.operation = operation + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/operation_display_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/operation_display_py3.py new file mode 100644 index 000000000000..632a6393c99f --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/operation_display_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class OperationDisplay(Model): + """Display metadata associated with the operation. + + :param provider: Service provider: Microsoft Storage. + :type provider: str + :param resource: Resource on which the operation is performed etc. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/operation_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/operation_py3.py new file mode 100644 index 000000000000..f7c827b4d135 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/operation_py3.py @@ -0,0 +1,42 @@ +# 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 msrest.serialization import Model + + +class Operation(Model): + """Storage REST API operation definition. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: Display metadata associated with the operation. + :type display: ~azure.mgmt.storage.v2017_10_01.models.OperationDisplay + :param origin: The origin of operations. + :type origin: str + :param service_specification: One property of operation, include metric + specifications. + :type service_specification: + ~azure.mgmt.storage.v2017_10_01.models.ServiceSpecification + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__(self, *, name: str=None, display=None, origin: str=None, service_specification=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display + self.origin = origin + self.service_specification = service_specification diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/resource.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/resource.py index dda2316a332f..125d6e4790b9 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/resource.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/resource.py @@ -45,10 +45,10 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, location=None, tags=None): - super(Resource, self).__init__() + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.location = location - self.tags = tags + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/resource_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/resource_py3.py new file mode 100644 index 000000000000..7c1ccbf3aae1 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/resource_py3.py @@ -0,0 +1,54 @@ +# 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 msrest.serialization import Model + + +class Resource(Model): + """Describes a storage resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Tags assigned to a resource; can be used for viewing and + grouping a resource (across resource groups). + :type tags: dict[str, str] + """ + + _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'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str=None, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/restriction.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/restriction.py index d5fd7fd912d9..8379a99eeab3 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/restriction.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/restriction.py @@ -44,8 +44,8 @@ class Restriction(Model): 'reason_code': {'key': 'reasonCode', 'type': 'str'}, } - def __init__(self, reason_code=None): - super(Restriction, self).__init__() + def __init__(self, **kwargs): + super(Restriction, self).__init__(**kwargs) self.type = None self.values = None - self.reason_code = reason_code + self.reason_code = kwargs.get('reason_code', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/restriction_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/restriction_py3.py new file mode 100644 index 000000000000..6ce9d0560adc --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/restriction_py3.py @@ -0,0 +1,51 @@ +# 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 msrest.serialization import Model + + +class Restriction(Model): + """The restriction because of which SKU cannot be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The type of restrictions. As of now only possible value for + this is location. + :vartype type: str + :ivar values: The value of restrictions. If the restriction type is set to + location. This would be different locations where the SKU is restricted. + :vartype values: list[str] + :param reason_code: The reason for the restriction. As of now this can be + “QuotaId” or “NotAvailableForSubscription”. Quota Id is set when the SKU + has requiredQuotas parameter as the subscription does not belong to that + quota. The “NotAvailableForSubscription” is related to capacity at DC. + Possible values include: 'QuotaId', 'NotAvailableForSubscription' + :type reason_code: str or + ~azure.mgmt.storage.v2017_10_01.models.ReasonCode + """ + + _validation = { + 'type': {'readonly': True}, + 'values': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'reason_code': {'key': 'reasonCode', 'type': 'str'}, + } + + def __init__(self, *, reason_code=None, **kwargs) -> None: + super(Restriction, self).__init__(**kwargs) + self.type = None + self.values = None + self.reason_code = reason_code diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/service_sas_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/service_sas_parameters.py index 35e39b341a0f..aa9cdb2746da 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/service_sas_parameters.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/service_sas_parameters.py @@ -15,11 +15,14 @@ class ServiceSasParameters(Model): """The parameters to list service SAS credentials of a speicific resource. - :param canonicalized_resource: The canonical path to the signed resource. + All required parameters must be populated in order to send to Azure. + + :param canonicalized_resource: Required. The canonical path to the signed + resource. :type canonicalized_resource: str - :param resource: The signed services accessible with the service SAS. - Possible values include: Blob (b), Container (c), File (f), Share (s). - Possible values include: 'b', 'c', 'f', 's' + :param resource: Required. The signed services accessible with the service + SAS. Possible values include: Blob (b), Container (c), File (f), Share + (s). Possible values include: 'b', 'c', 'f', 's' :type resource: str or ~azure.mgmt.storage.v2017_10_01.models.SignedResource :param permissions: The signed permissions for the service SAS. Possible @@ -96,23 +99,23 @@ class ServiceSasParameters(Model): 'content_type': {'key': 'rsct', 'type': 'str'}, } - def __init__(self, canonicalized_resource, resource, permissions=None, ip_address_or_range=None, protocols=None, shared_access_start_time=None, shared_access_expiry_time=None, identifier=None, partition_key_start=None, partition_key_end=None, row_key_start=None, row_key_end=None, key_to_sign=None, cache_control=None, content_disposition=None, content_encoding=None, content_language=None, content_type=None): - super(ServiceSasParameters, self).__init__() - self.canonicalized_resource = canonicalized_resource - self.resource = resource - self.permissions = permissions - self.ip_address_or_range = ip_address_or_range - self.protocols = protocols - self.shared_access_start_time = shared_access_start_time - self.shared_access_expiry_time = shared_access_expiry_time - self.identifier = identifier - self.partition_key_start = partition_key_start - self.partition_key_end = partition_key_end - self.row_key_start = row_key_start - self.row_key_end = row_key_end - self.key_to_sign = key_to_sign - self.cache_control = cache_control - self.content_disposition = content_disposition - self.content_encoding = content_encoding - self.content_language = content_language - self.content_type = content_type + def __init__(self, **kwargs): + super(ServiceSasParameters, self).__init__(**kwargs) + self.canonicalized_resource = kwargs.get('canonicalized_resource', None) + self.resource = kwargs.get('resource', None) + self.permissions = kwargs.get('permissions', None) + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + self.protocols = kwargs.get('protocols', None) + self.shared_access_start_time = kwargs.get('shared_access_start_time', None) + self.shared_access_expiry_time = kwargs.get('shared_access_expiry_time', None) + self.identifier = kwargs.get('identifier', None) + self.partition_key_start = kwargs.get('partition_key_start', None) + self.partition_key_end = kwargs.get('partition_key_end', None) + self.row_key_start = kwargs.get('row_key_start', None) + self.row_key_end = kwargs.get('row_key_end', None) + self.key_to_sign = kwargs.get('key_to_sign', None) + self.cache_control = kwargs.get('cache_control', None) + self.content_disposition = kwargs.get('content_disposition', None) + self.content_encoding = kwargs.get('content_encoding', None) + self.content_language = kwargs.get('content_language', None) + self.content_type = kwargs.get('content_type', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/service_sas_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/service_sas_parameters_py3.py new file mode 100644 index 000000000000..faef9de59f77 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/service_sas_parameters_py3.py @@ -0,0 +1,121 @@ +# 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 msrest.serialization import Model + + +class ServiceSasParameters(Model): + """The parameters to list service SAS credentials of a speicific resource. + + All required parameters must be populated in order to send to Azure. + + :param canonicalized_resource: Required. The canonical path to the signed + resource. + :type canonicalized_resource: str + :param resource: Required. The signed services accessible with the service + SAS. Possible values include: Blob (b), Container (c), File (f), Share + (s). Possible values include: 'b', 'c', 'f', 's' + :type resource: str or + ~azure.mgmt.storage.v2017_10_01.models.SignedResource + :param permissions: The signed permissions for the service SAS. Possible + values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create + (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', + 'l', 'a', 'c', 'u', 'p' + :type permissions: str or + ~azure.mgmt.storage.v2017_10_01.models.Permissions + :param ip_address_or_range: An IP address or a range of IP addresses from + which to accept requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the + account SAS. Possible values include: 'https,http', 'https' + :type protocols: str or + ~azure.mgmt.storage.v2017_10_01.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: datetime + :param shared_access_expiry_time: The time at which the shared access + signature becomes invalid. + :type shared_access_expiry_time: datetime + :param identifier: A unique value up to 64 characters in length that + correlates to an access policy specified for the container, queue, or + table. + :type identifier: str + :param partition_key_start: The start of partition key. + :type partition_key_start: str + :param partition_key_end: The end of partition key. + :type partition_key_end: str + :param row_key_start: The start of row key. + :type row_key_start: str + :param row_key_end: The end of row key. + :type row_key_end: str + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + :param cache_control: The response header override for cache control. + :type cache_control: str + :param content_disposition: The response header override for content + disposition. + :type content_disposition: str + :param content_encoding: The response header override for content + encoding. + :type content_encoding: str + :param content_language: The response header override for content + language. + :type content_language: str + :param content_type: The response header override for content type. + :type content_type: str + """ + + _validation = { + 'canonicalized_resource': {'required': True}, + 'resource': {'required': True}, + 'identifier': {'max_length': 64}, + } + + _attribute_map = { + 'canonicalized_resource': {'key': 'canonicalizedResource', 'type': 'str'}, + 'resource': {'key': 'signedResource', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'identifier': {'key': 'signedIdentifier', 'type': 'str'}, + 'partition_key_start': {'key': 'startPk', 'type': 'str'}, + 'partition_key_end': {'key': 'endPk', 'type': 'str'}, + 'row_key_start': {'key': 'startRk', 'type': 'str'}, + 'row_key_end': {'key': 'endRk', 'type': 'str'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + 'cache_control': {'key': 'rscc', 'type': 'str'}, + 'content_disposition': {'key': 'rscd', 'type': 'str'}, + 'content_encoding': {'key': 'rsce', 'type': 'str'}, + 'content_language': {'key': 'rscl', 'type': 'str'}, + 'content_type': {'key': 'rsct', 'type': 'str'}, + } + + def __init__(self, *, canonicalized_resource: str, resource, permissions=None, ip_address_or_range: str=None, protocols=None, shared_access_start_time=None, shared_access_expiry_time=None, identifier: str=None, partition_key_start: str=None, partition_key_end: str=None, row_key_start: str=None, row_key_end: str=None, key_to_sign: str=None, cache_control: str=None, content_disposition: str=None, content_encoding: str=None, content_language: str=None, content_type: str=None, **kwargs) -> None: + super(ServiceSasParameters, self).__init__(**kwargs) + self.canonicalized_resource = canonicalized_resource + self.resource = resource + self.permissions = permissions + self.ip_address_or_range = ip_address_or_range + self.protocols = protocols + self.shared_access_start_time = shared_access_start_time + self.shared_access_expiry_time = shared_access_expiry_time + self.identifier = identifier + self.partition_key_start = partition_key_start + self.partition_key_end = partition_key_end + self.row_key_start = row_key_start + self.row_key_end = row_key_end + self.key_to_sign = key_to_sign + self.cache_control = cache_control + self.content_disposition = content_disposition + self.content_encoding = content_encoding + self.content_language = content_language + self.content_type = content_type diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/service_specification.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/service_specification.py index 22a08bc44df4..19ffc2606edf 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/service_specification.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/service_specification.py @@ -24,6 +24,6 @@ class ServiceSpecification(Model): 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, } - def __init__(self, metric_specifications=None): - super(ServiceSpecification, self).__init__() - self.metric_specifications = metric_specifications + def __init__(self, **kwargs): + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = kwargs.get('metric_specifications', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/service_specification_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/service_specification_py3.py new file mode 100644 index 000000000000..e8f5e5d967ba --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/service_specification_py3.py @@ -0,0 +1,29 @@ +# 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 msrest.serialization import Model + + +class ServiceSpecification(Model): + """One property of operation, include metric specifications. + + :param metric_specifications: Metric specifications of operation. + :type metric_specifications: + list[~azure.mgmt.storage.v2017_10_01.models.MetricSpecification] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + } + + def __init__(self, *, metric_specifications=None, **kwargs) -> None: + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = metric_specifications diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/sku.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/sku.py index c995710b515b..e6332d42e439 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/sku.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/sku.py @@ -18,10 +18,12 @@ class Sku(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param name: Gets or sets the sku name. Required for account creation; - optional for update. Note that in older versions, sku name was called - accountType. Possible values include: 'Standard_LRS', 'Standard_GRS', - 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the sku name. Required for account + creation; optional for update. Note that in older versions, sku name was + called accountType. Possible values include: 'Standard_LRS', + 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' :type name: str or ~azure.mgmt.storage.v2017_10_01.models.SkuName :ivar tier: Gets the sku tier. This is based on the SKU name. Possible values include: 'Standard', 'Premium' @@ -65,12 +67,12 @@ class Sku(Model): 'restrictions': {'key': 'restrictions', 'type': '[Restriction]'}, } - def __init__(self, name, restrictions=None): - super(Sku, self).__init__() - self.name = name + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) self.tier = None self.resource_type = None self.kind = None self.locations = None self.capabilities = None - self.restrictions = restrictions + self.restrictions = kwargs.get('restrictions', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/sku_capability.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/sku_capability.py index 70ee58e9fe89..b8fa68ce7778 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/sku_capability.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/sku_capability.py @@ -38,7 +38,7 @@ class SKUCapability(Model): 'value': {'key': 'value', 'type': 'str'}, } - def __init__(self): - super(SKUCapability, self).__init__() + def __init__(self, **kwargs): + super(SKUCapability, self).__init__(**kwargs) self.name = None self.value = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/sku_capability_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/sku_capability_py3.py new file mode 100644 index 000000000000..f349a08eda21 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/sku_capability_py3.py @@ -0,0 +1,44 @@ +# 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 msrest.serialization import Model + + +class SKUCapability(Model): + """The capability information in the specified sku, including file encryption, + network acls, change notification, etc. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of capability, The capability information in the + specified sku, including file encryption, network acls, change + notification, etc. + :vartype name: str + :ivar value: A string value to indicate states of given capability. + Possibly 'true' or 'false'. + :vartype value: str + """ + + _validation = { + 'name': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(SKUCapability, self).__init__(**kwargs) + self.name = None + self.value = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/sku_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/sku_py3.py new file mode 100644 index 000000000000..266d2791b110 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/sku_py3.py @@ -0,0 +1,78 @@ +# 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 msrest.serialization import Model + + +class Sku(Model): + """The SKU of the storage account. + + 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 Azure. + + :param name: Required. Gets or sets the sku name. Required for account + creation; optional for update. Note that in older versions, sku name was + called accountType. Possible values include: 'Standard_LRS', + 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' + :type name: str or ~azure.mgmt.storage.v2017_10_01.models.SkuName + :ivar tier: Gets the sku tier. This is based on the SKU name. Possible + values include: 'Standard', 'Premium' + :vartype tier: str or ~azure.mgmt.storage.v2017_10_01.models.SkuTier + :ivar resource_type: The type of the resource, usually it is + 'storageAccounts'. + :vartype resource_type: str + :ivar kind: Indicates the type of storage account. Possible values + include: 'Storage', 'StorageV2', 'BlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2017_10_01.models.Kind + :ivar locations: The set of locations that the SKU is available. This will + be supported and registered Azure Geo Regions (e.g. West US, East US, + Southeast Asia, etc.). + :vartype locations: list[str] + :ivar capabilities: The capability information in the specified sku, + including file encryption, network acls, change notification, etc. + :vartype capabilities: + list[~azure.mgmt.storage.v2017_10_01.models.SKUCapability] + :param restrictions: The restrictions because of which SKU cannot be used. + This is empty if there are no restrictions. + :type restrictions: + list[~azure.mgmt.storage.v2017_10_01.models.Restriction] + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'readonly': True}, + 'resource_type': {'readonly': True}, + 'kind': {'readonly': True}, + 'locations': {'readonly': True}, + 'capabilities': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'SkuName'}, + 'tier': {'key': 'tier', 'type': 'SkuTier'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[SKUCapability]'}, + 'restrictions': {'key': 'restrictions', 'type': '[Restriction]'}, + } + + def __init__(self, *, name, restrictions=None, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = None + self.resource_type = None + self.kind = None + self.locations = None + self.capabilities = None + self.restrictions = restrictions diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account.py index 68d1bc29af30..59b7dc7c00d4 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account.py @@ -144,11 +144,11 @@ class StorageAccount(Resource): 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, } - def __init__(self, location=None, tags=None, identity=None, enable_https_traffic_only=False): - super(StorageAccount, self).__init__(location=location, tags=tags) + def __init__(self, **kwargs): + super(StorageAccount, self).__init__(**kwargs) self.sku = None self.kind = None - self.identity = identity + self.identity = kwargs.get('identity', None) self.provisioning_state = None self.primary_endpoints = None self.primary_location = None @@ -161,5 +161,5 @@ def __init__(self, location=None, tags=None, identity=None, enable_https_traffic self.secondary_endpoints = None self.encryption = None self.access_tier = None - self.enable_https_traffic_only = enable_https_traffic_only + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False) self.network_rule_set = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_check_name_availability_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_check_name_availability_parameters.py index c67c674db438..42cf88a074a0 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_check_name_availability_parameters.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_check_name_availability_parameters.py @@ -18,10 +18,13 @@ class StorageAccountCheckNameAvailabilityParameters(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param name: The storage account name. + All required parameters must be populated in order to send to Azure. + + :param name: Required. The storage account name. :type name: str - :ivar type: The type of resource, Microsoft.Storage/storageAccounts. - Default value: "Microsoft.Storage/storageAccounts" . + :ivar type: Required. The type of resource, + Microsoft.Storage/storageAccounts. Default value: + "Microsoft.Storage/storageAccounts" . :vartype type: str """ @@ -37,6 +40,6 @@ class StorageAccountCheckNameAvailabilityParameters(Model): type = "Microsoft.Storage/storageAccounts" - def __init__(self, name): - super(StorageAccountCheckNameAvailabilityParameters, self).__init__() - self.name = name + def __init__(self, **kwargs): + super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_check_name_availability_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_check_name_availability_parameters_py3.py new file mode 100644 index 000000000000..e6f50a456902 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_check_name_availability_parameters_py3.py @@ -0,0 +1,45 @@ +# 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 msrest.serialization import Model + + +class StorageAccountCheckNameAvailabilityParameters(Model): + """The parameters used to check the availabity of the storage account name. + + 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 Azure. + + :param name: Required. The storage account name. + :type name: str + :ivar type: Required. The type of resource, + Microsoft.Storage/storageAccounts. Default value: + "Microsoft.Storage/storageAccounts" . + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.Storage/storageAccounts" + + def __init__(self, *, name: str, **kwargs) -> None: + super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = name diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_create_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_create_parameters.py index ad417e190151..37cc4242b6a8 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_create_parameters.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_create_parameters.py @@ -15,16 +15,18 @@ class StorageAccountCreateParameters(Model): """The parameters used when creating a storage account. - :param sku: Required. Gets or sets the sku name. + All required parameters must be populated in order to send to Azure. + + :param sku: Required. Required. Gets or sets the sku name. :type sku: ~azure.mgmt.storage.v2017_10_01.models.Sku - :param kind: Required. Indicates the type of storage account. Possible - values include: 'Storage', 'StorageV2', 'BlobStorage' + :param kind: Required. Required. Indicates the type of storage account. + Possible values include: 'Storage', 'StorageV2', 'BlobStorage' :type kind: str or ~azure.mgmt.storage.v2017_10_01.models.Kind - :param location: Required. Gets or sets the location of the resource. This - will be one of the supported and registered Azure Geo Regions (e.g. West - US, East US, Southeast Asia, etc.). The geo region of a resource cannot be - changed once it is created, but if an identical geo region is specified on - update, the request will succeed. + :param location: Required. Required. Gets or sets the location of the + resource. This will be one of the supported and registered Azure Geo + Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a + resource cannot be changed once it is created, but if an identical geo + region is specified on update, the request will succeed. :type location: str :param tags: Gets or sets a list of key value pairs that describe the resource. These tags can be used for viewing and grouping this resource @@ -75,15 +77,15 @@ class StorageAccountCreateParameters(Model): 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, } - def __init__(self, sku, kind, location, tags=None, identity=None, custom_domain=None, encryption=None, network_rule_set=None, access_tier=None, enable_https_traffic_only=False): - super(StorageAccountCreateParameters, self).__init__() - self.sku = sku - self.kind = kind - self.location = location - self.tags = tags - self.identity = identity - self.custom_domain = custom_domain - self.encryption = encryption - self.network_rule_set = network_rule_set - self.access_tier = access_tier - self.enable_https_traffic_only = enable_https_traffic_only + def __init__(self, **kwargs): + super(StorageAccountCreateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.kind = kwargs.get('kind', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.identity = kwargs.get('identity', None) + self.custom_domain = kwargs.get('custom_domain', None) + self.encryption = kwargs.get('encryption', None) + self.network_rule_set = kwargs.get('network_rule_set', None) + self.access_tier = kwargs.get('access_tier', None) + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_create_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_create_parameters_py3.py new file mode 100644 index 000000000000..4e8178225042 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_create_parameters_py3.py @@ -0,0 +1,91 @@ +# 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 msrest.serialization import Model + + +class StorageAccountCreateParameters(Model): + """The parameters used when creating a storage account. + + All required parameters must be populated in order to send to Azure. + + :param sku: Required. Required. Gets or sets the sku name. + :type sku: ~azure.mgmt.storage.v2017_10_01.models.Sku + :param kind: Required. Required. Indicates the type of storage account. + Possible values include: 'Storage', 'StorageV2', 'BlobStorage' + :type kind: str or ~azure.mgmt.storage.v2017_10_01.models.Kind + :param location: Required. Required. Gets or sets the location of the + resource. This will be one of the supported and registered Azure Geo + Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a + resource cannot be changed once it is created, but if an identical geo + region is specified on update, the request will succeed. + :type location: str + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used for viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key with a length no greater than 128 + characters and a value with a length no greater than 256 characters. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2017_10_01.models.Identity + :param custom_domain: User domain assigned to the storage account. Name is + the CNAME source. Only one custom domain is supported per storage account + at this time. To clear the existing custom domain, use an empty string for + the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2017_10_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. If + left unspecified the account encryption settings will remain the same. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2017_10_01.models.Encryption + :param network_rule_set: Network rule set + :type network_rule_set: + ~azure.mgmt.storage.v2017_10_01.models.NetworkRuleSet + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2017_10_01.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + """ + + _validation = { + 'sku': {'required': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + } + + def __init__(self, *, sku, kind, location: str, tags=None, identity=None, custom_domain=None, encryption=None, network_rule_set=None, access_tier=None, enable_https_traffic_only: bool=False, **kwargs) -> None: + super(StorageAccountCreateParameters, self).__init__(**kwargs) + self.sku = sku + self.kind = kind + self.location = location + self.tags = tags + self.identity = identity + self.custom_domain = custom_domain + self.encryption = encryption + self.network_rule_set = network_rule_set + self.access_tier = access_tier + self.enable_https_traffic_only = enable_https_traffic_only diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_key.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_key.py index 9b2430c41f0a..36c5ff08c17d 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_key.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_key.py @@ -40,8 +40,8 @@ class StorageAccountKey(Model): 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, } - def __init__(self): - super(StorageAccountKey, self).__init__() + def __init__(self, **kwargs): + super(StorageAccountKey, self).__init__(**kwargs) self.key_name = None self.value = None self.permissions = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_key_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_key_py3.py new file mode 100644 index 000000000000..3213397ba2c1 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_key_py3.py @@ -0,0 +1,47 @@ +# 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 msrest.serialization import Model + + +class StorageAccountKey(Model): + """An access key for the storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar key_name: Name of the key. + :vartype key_name: str + :ivar value: Base 64-encoded value of the key. + :vartype value: str + :ivar permissions: Permissions for the key -- read-only or full + permissions. Possible values include: 'Read', 'Full' + :vartype permissions: str or + ~azure.mgmt.storage.v2017_10_01.models.KeyPermission + """ + + _validation = { + 'key_name': {'readonly': True}, + 'value': {'readonly': True}, + 'permissions': {'readonly': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, + } + + def __init__(self, **kwargs) -> None: + super(StorageAccountKey, self).__init__(**kwargs) + self.key_name = None + self.value = None + self.permissions = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_list_keys_result.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_list_keys_result.py index a2519099c3d5..671855ba2ecb 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_list_keys_result.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_list_keys_result.py @@ -32,6 +32,6 @@ class StorageAccountListKeysResult(Model): 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, } - def __init__(self): - super(StorageAccountListKeysResult, self).__init__() + def __init__(self, **kwargs): + super(StorageAccountListKeysResult, self).__init__(**kwargs) self.keys = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_list_keys_result_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_list_keys_result_py3.py new file mode 100644 index 000000000000..663db15e442a --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_list_keys_result_py3.py @@ -0,0 +1,37 @@ +# 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 msrest.serialization import Model + + +class StorageAccountListKeysResult(Model): + """The response from the ListKeys operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar keys: Gets the list of storage account keys and their properties for + the specified storage account. + :vartype keys: + list[~azure.mgmt.storage.v2017_10_01.models.StorageAccountKey] + """ + + _validation = { + 'keys': {'readonly': True}, + } + + _attribute_map = { + 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, + } + + def __init__(self, **kwargs) -> None: + super(StorageAccountListKeysResult, self).__init__(**kwargs) + self.keys = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_py3.py new file mode 100644 index 000000000000..a616177af7a4 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_py3.py @@ -0,0 +1,165 @@ +# 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 .resource import Resource + + +class StorageAccount(Resource): + """The storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Tags assigned to a resource; can be used for viewing and + grouping a resource (across resource groups). + :type tags: dict[str, str] + :ivar sku: Gets the SKU. + :vartype sku: ~azure.mgmt.storage.v2017_10_01.models.Sku + :ivar kind: Gets the Kind. Possible values include: 'Storage', + 'StorageV2', 'BlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2017_10_01.models.Kind + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2017_10_01.models.Identity + :ivar provisioning_state: Gets the status of the storage account at the + time the operation was called. Possible values include: 'Creating', + 'ResolvingDNS', 'Succeeded' + :vartype provisioning_state: str or + ~azure.mgmt.storage.v2017_10_01.models.ProvisioningState + :ivar primary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object. Note that Standard_ZRS + and Premium_LRS accounts only return the blob endpoint. + :vartype primary_endpoints: + ~azure.mgmt.storage.v2017_10_01.models.Endpoints + :ivar primary_location: Gets the location of the primary data center for + the storage account. + :vartype primary_location: str + :ivar status_of_primary: Gets the status indicating whether the primary + location of the storage account is available or unavailable. Possible + values include: 'available', 'unavailable' + :vartype status_of_primary: str or + ~azure.mgmt.storage.v2017_10_01.models.AccountStatus + :ivar last_geo_failover_time: Gets the timestamp of the most recent + instance of a failover to the secondary location. Only the most recent + timestamp is retained. This element is not returned if there has never + been a failover instance. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype last_geo_failover_time: datetime + :ivar secondary_location: Gets the location of the geo-replicated + secondary for the storage account. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype secondary_location: str + :ivar status_of_secondary: Gets the status indicating whether the + secondary location of the storage account is available or unavailable. + Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible + values include: 'available', 'unavailable' + :vartype status_of_secondary: str or + ~azure.mgmt.storage.v2017_10_01.models.AccountStatus + :ivar creation_time: Gets the creation date and time of the storage + account in UTC. + :vartype creation_time: datetime + :ivar custom_domain: Gets the custom domain the user assigned to this + storage account. + :vartype custom_domain: + ~azure.mgmt.storage.v2017_10_01.models.CustomDomain + :ivar secondary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object from the secondary + location of the storage account. Only available if the SKU name is + Standard_RAGRS. + :vartype secondary_endpoints: + ~azure.mgmt.storage.v2017_10_01.models.Endpoints + :ivar encryption: Gets the encryption settings on the account. If + unspecified, the account is unencrypted. + :vartype encryption: ~azure.mgmt.storage.v2017_10_01.models.Encryption + :ivar access_tier: Required for storage accounts where kind = BlobStorage. + The access tier used for billing. Possible values include: 'Hot', 'Cool' + :vartype access_tier: str or + ~azure.mgmt.storage.v2017_10_01.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + :ivar network_rule_set: Network rule set + :vartype network_rule_set: + ~azure.mgmt.storage.v2017_10_01.models.NetworkRuleSet + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'sku': {'readonly': True}, + 'kind': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'primary_endpoints': {'readonly': True}, + 'primary_location': {'readonly': True}, + 'status_of_primary': {'readonly': True}, + 'last_geo_failover_time': {'readonly': True}, + 'secondary_location': {'readonly': True}, + 'status_of_secondary': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'custom_domain': {'readonly': True}, + 'secondary_endpoints': {'readonly': True}, + 'encryption': {'readonly': True}, + 'access_tier': {'readonly': True}, + 'network_rule_set': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, + 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, + 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, + 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'AccountStatus'}, + 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, + 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, + 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'AccountStatus'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + } + + def __init__(self, *, location: str=None, tags=None, identity=None, enable_https_traffic_only: bool=False, **kwargs) -> None: + super(StorageAccount, self).__init__(location=location, tags=tags, **kwargs) + self.sku = None + self.kind = None + self.identity = identity + self.provisioning_state = None + self.primary_endpoints = None + self.primary_location = None + self.status_of_primary = None + self.last_geo_failover_time = None + self.secondary_location = None + self.status_of_secondary = None + self.creation_time = None + self.custom_domain = None + self.secondary_endpoints = None + self.encryption = None + self.access_tier = None + self.enable_https_traffic_only = enable_https_traffic_only + self.network_rule_set = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_regenerate_key_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_regenerate_key_parameters.py index 0665efaf0a1b..ca7f33b25112 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_regenerate_key_parameters.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_regenerate_key_parameters.py @@ -15,8 +15,10 @@ class StorageAccountRegenerateKeyParameters(Model): """The parameters used to regenerate the storage account key. - :param key_name: The name of storage keys that want to be regenerated, - possible vaules are key1, key2. + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. The name of storage keys that want to be + regenerated, possible vaules are key1, key2. :type key_name: str """ @@ -28,6 +30,6 @@ class StorageAccountRegenerateKeyParameters(Model): 'key_name': {'key': 'keyName', 'type': 'str'}, } - def __init__(self, key_name): - super(StorageAccountRegenerateKeyParameters, self).__init__() - self.key_name = key_name + def __init__(self, **kwargs): + super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) + self.key_name = kwargs.get('key_name', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_regenerate_key_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_regenerate_key_parameters_py3.py new file mode 100644 index 000000000000..42f3c0b2e94a --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_regenerate_key_parameters_py3.py @@ -0,0 +1,35 @@ +# 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 msrest.serialization import Model + + +class StorageAccountRegenerateKeyParameters(Model): + """The parameters used to regenerate the storage account key. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. The name of storage keys that want to be + regenerated, possible vaules are key1, key2. + :type key_name: str + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, *, key_name: str, **kwargs) -> None: + super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) + self.key_name = key_name diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_update_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_update_parameters.py index 5f5aed46f831..7e4d7d66f97c 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_update_parameters.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_update_parameters.py @@ -65,14 +65,14 @@ class StorageAccountUpdateParameters(Model): 'kind': {'key': 'kind', 'type': 'Kind'}, } - def __init__(self, sku=None, tags=None, identity=None, custom_domain=None, encryption=None, access_tier=None, enable_https_traffic_only=False, network_rule_set=None, kind=None): - super(StorageAccountUpdateParameters, self).__init__() - self.sku = sku - self.tags = tags - self.identity = identity - self.custom_domain = custom_domain - self.encryption = encryption - self.access_tier = access_tier - self.enable_https_traffic_only = enable_https_traffic_only - self.network_rule_set = network_rule_set - self.kind = kind + def __init__(self, **kwargs): + super(StorageAccountUpdateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.tags = kwargs.get('tags', None) + self.identity = kwargs.get('identity', None) + self.custom_domain = kwargs.get('custom_domain', None) + self.encryption = kwargs.get('encryption', None) + self.access_tier = kwargs.get('access_tier', None) + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False) + self.network_rule_set = kwargs.get('network_rule_set', None) + self.kind = kwargs.get('kind', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_update_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_update_parameters_py3.py new file mode 100644 index 000000000000..757adf362e5b --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_update_parameters_py3.py @@ -0,0 +1,78 @@ +# 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 msrest.serialization import Model + + +class StorageAccountUpdateParameters(Model): + """The parameters that can be provided when updating the storage account + properties. + + :param sku: Gets or sets the SKU name. Note that the SKU name cannot be + updated to Standard_ZRS or Premium_LRS, nor can accounts of those sku + names be updated to any other value. + :type sku: ~azure.mgmt.storage.v2017_10_01.models.Sku + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used in viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key no greater in length than 128 + characters and a value no greater in length than 256 characters. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2017_10_01.models.Identity + :param custom_domain: Custom domain assigned to the storage account by the + user. Name is the CNAME source. Only one custom domain is supported per + storage account at this time. To clear the existing custom domain, use an + empty string for the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2017_10_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2017_10_01.models.Encryption + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2017_10_01.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + :param network_rule_set: Network rule set + :type network_rule_set: + ~azure.mgmt.storage.v2017_10_01.models.NetworkRuleSet + :param kind: Optional. Indicates the type of storage account. Currently + only StorageV2 value supported by server. Possible values include: + 'Storage', 'StorageV2', 'BlobStorage' + :type kind: str or ~azure.mgmt.storage.v2017_10_01.models.Kind + """ + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + } + + def __init__(self, *, sku=None, tags=None, identity=None, custom_domain=None, encryption=None, access_tier=None, enable_https_traffic_only: bool=False, network_rule_set=None, kind=None, **kwargs) -> None: + super(StorageAccountUpdateParameters, self).__init__(**kwargs) + self.sku = sku + self.tags = tags + self.identity = identity + self.custom_domain = custom_domain + self.encryption = encryption + self.access_tier = access_tier + self.enable_https_traffic_only = enable_https_traffic_only + self.network_rule_set = network_rule_set + self.kind = kind diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_management_client_enums.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_management_client_enums.py index 6dc1e5a5bd9b..6322455cd469 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_management_client_enums.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_management_client_enums.py @@ -12,13 +12,13 @@ from enum import Enum -class ReasonCode(Enum): +class ReasonCode(str, Enum): quota_id = "QuotaId" not_available_for_subscription = "NotAvailableForSubscription" -class SkuName(Enum): +class SkuName(str, Enum): standard_lrs = "Standard_LRS" standard_grs = "Standard_GRS" @@ -27,37 +27,37 @@ class SkuName(Enum): premium_lrs = "Premium_LRS" -class SkuTier(Enum): +class SkuTier(str, Enum): standard = "Standard" premium = "Premium" -class Kind(Enum): +class Kind(str, Enum): storage = "Storage" storage_v2 = "StorageV2" blob_storage = "BlobStorage" -class Reason(Enum): +class Reason(str, Enum): account_name_invalid = "AccountNameInvalid" already_exists = "AlreadyExists" -class KeySource(Enum): +class KeySource(str, Enum): microsoft_storage = "Microsoft.Storage" microsoft_keyvault = "Microsoft.Keyvault" -class Action(Enum): +class Action(str, Enum): allow = "Allow" -class State(Enum): +class State(str, Enum): provisioning = "provisioning" deprovisioning = "deprovisioning" @@ -66,7 +66,7 @@ class State(Enum): network_source_deleted = "networkSourceDeleted" -class Bypass(Enum): +class Bypass(str, Enum): none = "None" logging = "Logging" @@ -74,38 +74,38 @@ class Bypass(Enum): azure_services = "AzureServices" -class DefaultAction(Enum): +class DefaultAction(str, Enum): allow = "Allow" deny = "Deny" -class AccessTier(Enum): +class AccessTier(str, Enum): hot = "Hot" cool = "Cool" -class ProvisioningState(Enum): +class ProvisioningState(str, Enum): creating = "Creating" resolving_dns = "ResolvingDNS" succeeded = "Succeeded" -class AccountStatus(Enum): +class AccountStatus(str, Enum): available = "available" unavailable = "unavailable" -class KeyPermission(Enum): +class KeyPermission(str, Enum): read = "Read" full = "Full" -class UsageUnit(Enum): +class UsageUnit(str, Enum): count = "Count" bytes = "Bytes" @@ -115,7 +115,7 @@ class UsageUnit(Enum): bytes_per_second = "BytesPerSecond" -class Services(Enum): +class Services(str, Enum): b = "b" q = "q" @@ -123,14 +123,14 @@ class Services(Enum): f = "f" -class SignedResourceTypes(Enum): +class SignedResourceTypes(str, Enum): s = "s" c = "c" o = "o" -class Permissions(Enum): +class Permissions(str, Enum): r = "r" d = "d" @@ -142,13 +142,13 @@ class Permissions(Enum): p = "p" -class HttpProtocol(Enum): +class HttpProtocol(str, Enum): httpshttp = "https,http" https = "https" -class SignedResource(Enum): +class SignedResource(str, Enum): b = "b" c = "c" diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/usage.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/usage.py index 97d387ac89cc..103482b94b0f 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/usage.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/usage.py @@ -46,8 +46,8 @@ class Usage(Model): 'name': {'key': 'name', 'type': 'UsageName'}, } - def __init__(self): - super(Usage, self).__init__() + def __init__(self, **kwargs): + super(Usage, self).__init__(**kwargs) self.unit = None self.current_value = None self.limit = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/usage_name.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/usage_name.py index c09f75b38c9a..e4082bf52384 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/usage_name.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/usage_name.py @@ -35,7 +35,7 @@ class UsageName(Model): 'localized_value': {'key': 'localizedValue', 'type': 'str'}, } - def __init__(self): - super(UsageName, self).__init__() + def __init__(self, **kwargs): + super(UsageName, self).__init__(**kwargs) self.value = None self.localized_value = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/usage_name_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/usage_name_py3.py new file mode 100644 index 000000000000..f519bb5072b1 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/usage_name_py3.py @@ -0,0 +1,41 @@ +# 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 msrest.serialization import Model + + +class UsageName(Model): + """The usage names that can be used; currently limited to StorageAccount. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: Gets a string describing the resource name. + :vartype value: str + :ivar localized_value: Gets a localized string describing the resource + name. + :vartype localized_value: str + """ + + _validation = { + 'value': {'readonly': True}, + 'localized_value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(UsageName, self).__init__(**kwargs) + self.value = None + self.localized_value = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/usage_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/usage_py3.py new file mode 100644 index 000000000000..8f40f289293a --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/usage_py3.py @@ -0,0 +1,54 @@ +# 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 msrest.serialization import Model + + +class Usage(Model): + """Describes Storage Resource Usage. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar unit: Gets the unit of measurement. Possible values include: + 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', + 'BytesPerSecond' + :vartype unit: str or ~azure.mgmt.storage.v2017_10_01.models.UsageUnit + :ivar current_value: Gets the current count of the allocated resources in + the subscription. + :vartype current_value: int + :ivar limit: Gets the maximum count of the resources that can be allocated + in the subscription. + :vartype limit: int + :ivar name: Gets the name of the type of usage. + :vartype name: ~azure.mgmt.storage.v2017_10_01.models.UsageName + """ + + _validation = { + 'unit': {'readonly': True}, + 'current_value': {'readonly': True}, + 'limit': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'UsageUnit'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + def __init__(self, **kwargs) -> None: + super(Usage, self).__init__(**kwargs) + self.unit = None + self.current_value = None + self.limit = None + self.name = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/virtual_network_rule.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/virtual_network_rule.py index c7cfb0bc87d5..23706c107a6f 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/virtual_network_rule.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/virtual_network_rule.py @@ -15,7 +15,10 @@ class VirtualNetworkRule(Model): """Virtual Network rule. - :param virtual_network_resource_id: Resource ID of a subnet, for example: + All required parameters must be populated in order to send to Azure. + + :param virtual_network_resource_id: Required. Resource ID of a subnet, for + example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. :type virtual_network_resource_id: str :param action: The action of virtual network rule. Possible values @@ -37,8 +40,8 @@ class VirtualNetworkRule(Model): 'state': {'key': 'state', 'type': 'State'}, } - def __init__(self, virtual_network_resource_id, action="Allow", state=None): - super(VirtualNetworkRule, self).__init__() - self.virtual_network_resource_id = virtual_network_resource_id - self.action = action - self.state = state + def __init__(self, **kwargs): + super(VirtualNetworkRule, self).__init__(**kwargs) + self.virtual_network_resource_id = kwargs.get('virtual_network_resource_id', None) + self.action = kwargs.get('action', "Allow") + self.state = kwargs.get('state', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/virtual_network_rule_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/virtual_network_rule_py3.py new file mode 100644 index 000000000000..064d3c3e6730 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/virtual_network_rule_py3.py @@ -0,0 +1,47 @@ +# 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 msrest.serialization import Model + + +class VirtualNetworkRule(Model): + """Virtual Network rule. + + All required parameters must be populated in order to send to Azure. + + :param virtual_network_resource_id: Required. Resource ID of a subnet, for + example: + /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + :type virtual_network_resource_id: str + :param action: The action of virtual network rule. Possible values + include: 'Allow'. Default value: "Allow" . + :type action: str or ~azure.mgmt.storage.v2017_10_01.models.Action + :param state: Gets the state of virtual network rule. Possible values + include: 'provisioning', 'deprovisioning', 'succeeded', 'failed', + 'networkSourceDeleted' + :type state: str or ~azure.mgmt.storage.v2017_10_01.models.State + """ + + _validation = { + 'virtual_network_resource_id': {'required': True}, + } + + _attribute_map = { + 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'Action'}, + 'state': {'key': 'state', 'type': 'State'}, + } + + def __init__(self, *, virtual_network_resource_id: str, action="Allow", state=None, **kwargs) -> None: + super(VirtualNetworkRule, self).__init__(**kwargs) + self.virtual_network_resource_id = virtual_network_resource_id + self.action = action + self.state = state diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/operations.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/operations.py index 8a53c74f6d0b..61cb0b666c71 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/operations.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/operations.py @@ -22,7 +22,7 @@ class Operations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2017-10-01". """ @@ -55,7 +55,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/providers/Microsoft.Storage/operations' + url = self.list.metadata['url'] # Construct parameters query_parameters = {} @@ -96,3 +96,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/providers/Microsoft.Storage/operations'} diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/skus_operations.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/skus_operations.py index 31030135fe25..e207d3d64657 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/skus_operations.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/skus_operations.py @@ -22,7 +22,7 @@ class SkusOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2017-10-01". """ @@ -56,7 +56,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/skus' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -101,3 +101,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/skus'} diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/storage_accounts_operations.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/storage_accounts_operations.py index bf36fb047d94..8f51e895b19b 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/storage_accounts_operations.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/storage_accounts_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class StorageAccountsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2017-10-01". """ @@ -60,7 +60,7 @@ def check_name_availability( account_name = models.StorageAccountCheckNameAvailabilityParameters(name=name) # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability' + url = self.check_name_availability.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -103,12 +103,13 @@ def check_name_availability( return client_raw_response return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability'} def _create_initial( self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}' + url = self.create.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -155,7 +156,7 @@ def _create_initial( return deserialized def create( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties @@ -174,13 +175,16 @@ def create( :type parameters: ~azure.mgmt.storage.v2017_10_01.models.StorageAccountCreateParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - StorageAccount or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns StorageAccount or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.storage.v2017_10_01.models.StorageAccount] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.storage.v2017_10_01.models.StorageAccount]] :raises: :class:`CloudError` """ raw_result = self._create_initial( @@ -191,30 +195,8 @@ def create( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('StorageAccount', response) if raw: @@ -223,12 +205,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} def delete( self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): @@ -251,7 +235,7 @@ def delete( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -285,6 +269,7 @@ def delete( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} def get_properties( self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): @@ -310,7 +295,7 @@ def get_properties( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}' + url = self.get_properties.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -351,6 +336,7 @@ def get_properties( return client_raw_response return deserialized + get_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} def update( self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): @@ -386,7 +372,7 @@ def update( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}' + url = self.update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -431,6 +417,7 @@ def update( return client_raw_response return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} def list( self, custom_headers=None, raw=False, **operation_config): @@ -452,7 +439,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -497,6 +484,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts'} def list_by_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -521,7 +509,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts' + url = self.list_by_resource_group.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -567,6 +555,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts'} def list_keys( self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): @@ -591,7 +580,7 @@ def list_keys( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys' + url = self.list_keys.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -632,6 +621,7 @@ def list_keys( return client_raw_response return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys'} def regenerate_key( self, resource_group_name, account_name, key_name, custom_headers=None, raw=False, **operation_config): @@ -661,7 +651,7 @@ def regenerate_key( regenerate_key1 = models.StorageAccountRegenerateKeyParameters(key_name=key_name) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey' + url = self.regenerate_key.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -706,6 +696,7 @@ def regenerate_key( return client_raw_response return deserialized + regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey'} def list_account_sas( self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): @@ -733,7 +724,7 @@ def list_account_sas( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas' + url = self.list_account_sas.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -778,6 +769,7 @@ def list_account_sas( return client_raw_response return deserialized + list_account_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas'} def list_service_sas( self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): @@ -805,7 +797,7 @@ def list_service_sas( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas' + url = self.list_service_sas.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), @@ -850,3 +842,4 @@ def list_service_sas( return client_raw_response return deserialized + list_service_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas'} diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/usage_operations.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/usage_operations.py index 208259eb29ec..1af3b6f8d6ed 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/usage_operations.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/usage_operations.py @@ -22,7 +22,7 @@ class UsageOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2017-10-01". """ @@ -56,7 +56,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -101,3 +101,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages'} diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/storage_management_client.py b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/storage_management_client.py index 4e930c826f31..cc2712bd90b7 100644 --- a/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/storage_management_client.py +++ b/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/storage_management_client.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import ServiceClient +from msrest.service_client import SDKClient from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION @@ -54,7 +54,7 @@ def __init__( self.subscription_id = subscription_id -class StorageManagementClient(object): +class StorageManagementClient(SDKClient): """The Azure Storage Management API. :ivar config: Configuration for client. @@ -83,7 +83,7 @@ def __init__( self, credentials, subscription_id, base_url=None): self.config = StorageManagementClientConfiguration(credentials, subscription_id, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + super(StorageManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self.api_version = '2017-10-01' diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/__init__.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/__init__.py new file mode 100644 index 000000000000..0854715e0c10 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/__init__.py @@ -0,0 +1,18 @@ +# 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 .storage_management_client import StorageManagementClient +from .version import VERSION + +__all__ = ['StorageManagementClient'] + +__version__ = VERSION + diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/__init__.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/__init__.py new file mode 100644 index 000000000000..010d2c212913 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/__init__.py @@ -0,0 +1,213 @@ +# 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. +# -------------------------------------------------------------------------- + +try: + from .operation_display_py3 import OperationDisplay + from .dimension_py3 import Dimension + from .metric_specification_py3 import MetricSpecification + from .service_specification_py3 import ServiceSpecification + from .operation_py3 import Operation + from .storage_account_check_name_availability_parameters_py3 import StorageAccountCheckNameAvailabilityParameters + from .sku_capability_py3 import SKUCapability + from .restriction_py3 import Restriction + from .sku_py3 import Sku + from .check_name_availability_result_py3 import CheckNameAvailabilityResult + from .custom_domain_py3 import CustomDomain + from .encryption_service_py3 import EncryptionService + from .encryption_services_py3 import EncryptionServices + from .key_vault_properties_py3 import KeyVaultProperties + from .encryption_py3 import Encryption + from .virtual_network_rule_py3 import VirtualNetworkRule + from .ip_rule_py3 import IPRule + from .network_rule_set_py3 import NetworkRuleSet + from .identity_py3 import Identity + from .storage_account_create_parameters_py3 import StorageAccountCreateParameters + from .endpoints_py3 import Endpoints + from .storage_account_py3 import StorageAccount + from .storage_account_key_py3 import StorageAccountKey + from .storage_account_list_keys_result_py3 import StorageAccountListKeysResult + from .storage_account_regenerate_key_parameters_py3 import StorageAccountRegenerateKeyParameters + from .storage_account_update_parameters_py3 import StorageAccountUpdateParameters + from .usage_name_py3 import UsageName + from .usage_py3 import Usage + from .account_sas_parameters_py3 import AccountSasParameters + from .list_account_sas_response_py3 import ListAccountSasResponse + from .service_sas_parameters_py3 import ServiceSasParameters + from .list_service_sas_response_py3 import ListServiceSasResponse + from .proxy_resource_py3 import ProxyResource + from .azure_entity_resource_py3 import AzureEntityResource + from .resource_py3 import Resource + from .tracked_resource_py3 import TrackedResource + from .update_history_property_py3 import UpdateHistoryProperty + from .immutability_policy_properties_py3 import ImmutabilityPolicyProperties + from .tag_property_py3 import TagProperty + from .legal_hold_properties_py3 import LegalHoldProperties + from .blob_container_py3 import BlobContainer + from .immutability_policy_py3 import ImmutabilityPolicy + from .legal_hold_py3 import LegalHold + from .list_container_item_py3 import ListContainerItem + from .list_container_items_py3 import ListContainerItems +except (SyntaxError, ImportError): + from .operation_display import OperationDisplay + from .dimension import Dimension + from .metric_specification import MetricSpecification + from .service_specification import ServiceSpecification + from .operation import Operation + from .storage_account_check_name_availability_parameters import StorageAccountCheckNameAvailabilityParameters + from .sku_capability import SKUCapability + from .restriction import Restriction + from .sku import Sku + from .check_name_availability_result import CheckNameAvailabilityResult + from .custom_domain import CustomDomain + from .encryption_service import EncryptionService + from .encryption_services import EncryptionServices + from .key_vault_properties import KeyVaultProperties + from .encryption import Encryption + from .virtual_network_rule import VirtualNetworkRule + from .ip_rule import IPRule + from .network_rule_set import NetworkRuleSet + from .identity import Identity + from .storage_account_create_parameters import StorageAccountCreateParameters + from .endpoints import Endpoints + from .storage_account import StorageAccount + from .storage_account_key import StorageAccountKey + from .storage_account_list_keys_result import StorageAccountListKeysResult + from .storage_account_regenerate_key_parameters import StorageAccountRegenerateKeyParameters + from .storage_account_update_parameters import StorageAccountUpdateParameters + from .usage_name import UsageName + from .usage import Usage + from .account_sas_parameters import AccountSasParameters + from .list_account_sas_response import ListAccountSasResponse + from .service_sas_parameters import ServiceSasParameters + from .list_service_sas_response import ListServiceSasResponse + from .proxy_resource import ProxyResource + from .azure_entity_resource import AzureEntityResource + from .resource import Resource + from .tracked_resource import TrackedResource + from .update_history_property import UpdateHistoryProperty + from .immutability_policy_properties import ImmutabilityPolicyProperties + from .tag_property import TagProperty + from .legal_hold_properties import LegalHoldProperties + from .blob_container import BlobContainer + from .immutability_policy import ImmutabilityPolicy + from .legal_hold import LegalHold + from .list_container_item import ListContainerItem + from .list_container_items import ListContainerItems +from .operation_paged import OperationPaged +from .sku_paged import SkuPaged +from .storage_account_paged import StorageAccountPaged +from .usage_paged import UsagePaged +from .storage_management_client_enums import ( + ReasonCode, + SkuName, + SkuTier, + Kind, + Reason, + KeySource, + Action, + State, + Bypass, + DefaultAction, + AccessTier, + ProvisioningState, + AccountStatus, + KeyPermission, + UsageUnit, + Services, + SignedResourceTypes, + Permissions, + HttpProtocol, + SignedResource, + PublicAccess, + LeaseStatus, + LeaseState, + LeaseDuration, + ImmutabilityPolicyState, + ImmutabilityPolicyUpdateType, +) + +__all__ = [ + 'OperationDisplay', + 'Dimension', + 'MetricSpecification', + 'ServiceSpecification', + 'Operation', + 'StorageAccountCheckNameAvailabilityParameters', + 'SKUCapability', + 'Restriction', + 'Sku', + 'CheckNameAvailabilityResult', + 'CustomDomain', + 'EncryptionService', + 'EncryptionServices', + 'KeyVaultProperties', + 'Encryption', + 'VirtualNetworkRule', + 'IPRule', + 'NetworkRuleSet', + 'Identity', + 'StorageAccountCreateParameters', + 'Endpoints', + 'StorageAccount', + 'StorageAccountKey', + 'StorageAccountListKeysResult', + 'StorageAccountRegenerateKeyParameters', + 'StorageAccountUpdateParameters', + 'UsageName', + 'Usage', + 'AccountSasParameters', + 'ListAccountSasResponse', + 'ServiceSasParameters', + 'ListServiceSasResponse', + 'ProxyResource', + 'AzureEntityResource', + 'Resource', + 'TrackedResource', + 'UpdateHistoryProperty', + 'ImmutabilityPolicyProperties', + 'TagProperty', + 'LegalHoldProperties', + 'BlobContainer', + 'ImmutabilityPolicy', + 'LegalHold', + 'ListContainerItem', + 'ListContainerItems', + 'OperationPaged', + 'SkuPaged', + 'StorageAccountPaged', + 'UsagePaged', + 'ReasonCode', + 'SkuName', + 'SkuTier', + 'Kind', + 'Reason', + 'KeySource', + 'Action', + 'State', + 'Bypass', + 'DefaultAction', + 'AccessTier', + 'ProvisioningState', + 'AccountStatus', + 'KeyPermission', + 'UsageUnit', + 'Services', + 'SignedResourceTypes', + 'Permissions', + 'HttpProtocol', + 'SignedResource', + 'PublicAccess', + 'LeaseStatus', + 'LeaseState', + 'LeaseDuration', + 'ImmutabilityPolicyState', + 'ImmutabilityPolicyUpdateType', +] diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/account_sas_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/account_sas_parameters.py new file mode 100644 index 000000000000..7acf3ff04e92 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/account_sas_parameters.py @@ -0,0 +1,80 @@ +# 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 msrest.serialization import Model + + +class AccountSasParameters(Model): + """The parameters to list SAS credentials of a storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: Required. The signed services accessible with the account + SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). + Possible values include: 'b', 'q', 't', 'f' + :type services: str or ~azure.mgmt.storage.v2018_02_01.models.Services + :param resource_types: Required. The signed resource types that are + accessible with the account SAS. Service (s): Access to service-level + APIs; Container (c): Access to container-level APIs; Object (o): Access to + object-level APIs for blobs, queue messages, table entities, and files. + Possible values include: 's', 'c', 'o' + :type resource_types: str or + ~azure.mgmt.storage.v2018_02_01.models.SignedResourceTypes + :param permissions: Required. The signed permissions for the account SAS. + Possible values include: Read (r), Write (w), Delete (d), List (l), Add + (a), Create (c), Update (u) and Process (p). Possible values include: 'r', + 'd', 'w', 'l', 'a', 'c', 'u', 'p' + :type permissions: str or + ~azure.mgmt.storage.v2018_02_01.models.Permissions + :param ip_address_or_range: An IP address or a range of IP addresses from + which to accept requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the + account SAS. Possible values include: 'https,http', 'https' + :type protocols: str or + ~azure.mgmt.storage.v2018_02_01.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: datetime + :param shared_access_expiry_time: Required. The time at which the shared + access signature becomes invalid. + :type shared_access_expiry_time: datetime + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + """ + + _validation = { + 'services': {'required': True}, + 'resource_types': {'required': True}, + 'permissions': {'required': True}, + 'shared_access_expiry_time': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'signedServices', 'type': 'str'}, + 'resource_types': {'key': 'signedResourceTypes', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AccountSasParameters, self).__init__(**kwargs) + self.services = kwargs.get('services', None) + self.resource_types = kwargs.get('resource_types', None) + self.permissions = kwargs.get('permissions', None) + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + self.protocols = kwargs.get('protocols', None) + self.shared_access_start_time = kwargs.get('shared_access_start_time', None) + self.shared_access_expiry_time = kwargs.get('shared_access_expiry_time', None) + self.key_to_sign = kwargs.get('key_to_sign', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/account_sas_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/account_sas_parameters_py3.py new file mode 100644 index 000000000000..3d0bb4cd3adc --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/account_sas_parameters_py3.py @@ -0,0 +1,80 @@ +# 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 msrest.serialization import Model + + +class AccountSasParameters(Model): + """The parameters to list SAS credentials of a storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: Required. The signed services accessible with the account + SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). + Possible values include: 'b', 'q', 't', 'f' + :type services: str or ~azure.mgmt.storage.v2018_02_01.models.Services + :param resource_types: Required. The signed resource types that are + accessible with the account SAS. Service (s): Access to service-level + APIs; Container (c): Access to container-level APIs; Object (o): Access to + object-level APIs for blobs, queue messages, table entities, and files. + Possible values include: 's', 'c', 'o' + :type resource_types: str or + ~azure.mgmt.storage.v2018_02_01.models.SignedResourceTypes + :param permissions: Required. The signed permissions for the account SAS. + Possible values include: Read (r), Write (w), Delete (d), List (l), Add + (a), Create (c), Update (u) and Process (p). Possible values include: 'r', + 'd', 'w', 'l', 'a', 'c', 'u', 'p' + :type permissions: str or + ~azure.mgmt.storage.v2018_02_01.models.Permissions + :param ip_address_or_range: An IP address or a range of IP addresses from + which to accept requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the + account SAS. Possible values include: 'https,http', 'https' + :type protocols: str or + ~azure.mgmt.storage.v2018_02_01.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: datetime + :param shared_access_expiry_time: Required. The time at which the shared + access signature becomes invalid. + :type shared_access_expiry_time: datetime + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + """ + + _validation = { + 'services': {'required': True}, + 'resource_types': {'required': True}, + 'permissions': {'required': True}, + 'shared_access_expiry_time': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'signedServices', 'type': 'str'}, + 'resource_types': {'key': 'signedResourceTypes', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + } + + def __init__(self, *, services, resource_types, permissions, shared_access_expiry_time, ip_address_or_range: str=None, protocols=None, shared_access_start_time=None, key_to_sign: str=None, **kwargs) -> None: + super(AccountSasParameters, self).__init__(**kwargs) + self.services = services + self.resource_types = resource_types + self.permissions = permissions + self.ip_address_or_range = ip_address_or_range + self.protocols = protocols + self.shared_access_start_time = shared_access_start_time + self.shared_access_expiry_time = shared_access_expiry_time + self.key_to_sign = key_to_sign diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/azure_entity_resource.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/azure_entity_resource.py new file mode 100644 index 000000000000..3bffaab8d35b --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/azure_entity_resource.py @@ -0,0 +1,50 @@ +# 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 .resource import Resource + + +class AzureEntityResource(Resource): + """The resource model definition for a Azure Resource Manager resource with an + etag. + + 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} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AzureEntityResource, self).__init__(**kwargs) + self.etag = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/azure_entity_resource_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/azure_entity_resource_py3.py new file mode 100644 index 000000000000..c93d1b04bfd7 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/azure_entity_resource_py3.py @@ -0,0 +1,50 @@ +# 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 .resource import Resource + + +class AzureEntityResource(Resource): + """The resource model definition for a Azure Resource Manager resource with an + etag. + + 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} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(AzureEntityResource, self).__init__(**kwargs) + self.etag = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/blob_container.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/blob_container.py new file mode 100644 index 000000000000..96909e68f452 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/blob_container.py @@ -0,0 +1,119 @@ +# 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_entity_resource import AzureEntityResource + + +class BlobContainer(AzureEntityResource): + """Properties of the blob container, including Id, resource name, resource + type, Etag. + + 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} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :param public_access: Specifies whether data in the container may be + accessed publicly and the level of access. Possible values include: + 'Container', 'Blob', 'None' + :type public_access: str or + ~azure.mgmt.storage.v2018_02_01.models.PublicAccess + :ivar last_modified_time: Returns the date and time the container was last + modified. + :vartype last_modified_time: datetime + :ivar lease_status: The lease status of the container. Possible values + include: 'Locked', 'Unlocked' + :vartype lease_status: str or + ~azure.mgmt.storage.v2018_02_01.models.LeaseStatus + :ivar lease_state: Lease state of the container. Possible values include: + 'Available', 'Leased', 'Expired', 'Breaking', 'Broken' + :vartype lease_state: str or + ~azure.mgmt.storage.v2018_02_01.models.LeaseState + :ivar lease_duration: Specifies whether the lease on a container is of + infinite or fixed duration, only when the container is leased. Possible + values include: 'Infinite', 'Fixed' + :vartype lease_duration: str or + ~azure.mgmt.storage.v2018_02_01.models.LeaseDuration + :param metadata: A name-value pair to associate with the container as + metadata. + :type metadata: dict[str, str] + :ivar immutability_policy: The ImmutabilityPolicy property of the + container. + :vartype immutability_policy: + ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicyProperties + :ivar legal_hold: The LegalHold property of the container. + :vartype legal_hold: + ~azure.mgmt.storage.v2018_02_01.models.LegalHoldProperties + :ivar has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :ivar has_immutability_policy: The hasImmutabilityPolicy public property + is set to true by SRP if ImmutabilityPolicy has been created for this + container. The hasImmutabilityPolicy public property is set to false by + SRP if ImmutabilityPolicy has not been created for this container. + :vartype has_immutability_policy: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'lease_status': {'readonly': True}, + 'lease_state': {'readonly': True}, + 'lease_duration': {'readonly': True}, + 'immutability_policy': {'readonly': True}, + 'legal_hold': {'readonly': True}, + 'has_legal_hold': {'readonly': True}, + 'has_immutability_policy': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'public_access': {'key': 'properties.publicAccess', 'type': 'PublicAccess'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, + 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, + 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, + 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, + 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, + 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(BlobContainer, self).__init__(**kwargs) + self.public_access = kwargs.get('public_access', None) + self.last_modified_time = None + self.lease_status = None + self.lease_state = None + self.lease_duration = None + self.metadata = kwargs.get('metadata', None) + self.immutability_policy = None + self.legal_hold = None + self.has_legal_hold = None + self.has_immutability_policy = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/blob_container_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/blob_container_py3.py new file mode 100644 index 000000000000..26f32e8e4737 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/blob_container_py3.py @@ -0,0 +1,119 @@ +# 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_entity_resource import AzureEntityResource + + +class BlobContainer(AzureEntityResource): + """Properties of the blob container, including Id, resource name, resource + type, Etag. + + 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} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :param public_access: Specifies whether data in the container may be + accessed publicly and the level of access. Possible values include: + 'Container', 'Blob', 'None' + :type public_access: str or + ~azure.mgmt.storage.v2018_02_01.models.PublicAccess + :ivar last_modified_time: Returns the date and time the container was last + modified. + :vartype last_modified_time: datetime + :ivar lease_status: The lease status of the container. Possible values + include: 'Locked', 'Unlocked' + :vartype lease_status: str or + ~azure.mgmt.storage.v2018_02_01.models.LeaseStatus + :ivar lease_state: Lease state of the container. Possible values include: + 'Available', 'Leased', 'Expired', 'Breaking', 'Broken' + :vartype lease_state: str or + ~azure.mgmt.storage.v2018_02_01.models.LeaseState + :ivar lease_duration: Specifies whether the lease on a container is of + infinite or fixed duration, only when the container is leased. Possible + values include: 'Infinite', 'Fixed' + :vartype lease_duration: str or + ~azure.mgmt.storage.v2018_02_01.models.LeaseDuration + :param metadata: A name-value pair to associate with the container as + metadata. + :type metadata: dict[str, str] + :ivar immutability_policy: The ImmutabilityPolicy property of the + container. + :vartype immutability_policy: + ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicyProperties + :ivar legal_hold: The LegalHold property of the container. + :vartype legal_hold: + ~azure.mgmt.storage.v2018_02_01.models.LegalHoldProperties + :ivar has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :ivar has_immutability_policy: The hasImmutabilityPolicy public property + is set to true by SRP if ImmutabilityPolicy has been created for this + container. The hasImmutabilityPolicy public property is set to false by + SRP if ImmutabilityPolicy has not been created for this container. + :vartype has_immutability_policy: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'lease_status': {'readonly': True}, + 'lease_state': {'readonly': True}, + 'lease_duration': {'readonly': True}, + 'immutability_policy': {'readonly': True}, + 'legal_hold': {'readonly': True}, + 'has_legal_hold': {'readonly': True}, + 'has_immutability_policy': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'public_access': {'key': 'properties.publicAccess', 'type': 'PublicAccess'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, + 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, + 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, + 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, + 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, + 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, + } + + def __init__(self, *, public_access=None, metadata=None, **kwargs) -> None: + super(BlobContainer, self).__init__(**kwargs) + self.public_access = public_access + self.last_modified_time = None + self.lease_status = None + self.lease_state = None + self.lease_duration = None + self.metadata = metadata + self.immutability_policy = None + self.legal_hold = None + self.has_legal_hold = None + self.has_immutability_policy = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/check_name_availability_result.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/check_name_availability_result.py new file mode 100644 index 000000000000..d4fdcfdf8589 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/check_name_availability_result.py @@ -0,0 +1,50 @@ +# 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 msrest.serialization import Model + + +class CheckNameAvailabilityResult(Model): + """The CheckNameAvailability operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name_available: Gets a boolean value that indicates whether the name + is available for you to use. If true, the name is available. If false, the + name has already been taken or is invalid and cannot be used. + :vartype name_available: bool + :ivar reason: Gets the reason that a storage account name could not be + used. The Reason element is only returned if NameAvailable is false. + Possible values include: 'AccountNameInvalid', 'AlreadyExists' + :vartype reason: str or ~azure.mgmt.storage.v2018_02_01.models.Reason + :ivar message: Gets an error message explaining the Reason value in more + detail. + :vartype message: str + """ + + _validation = { + 'name_available': {'readonly': True}, + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'Reason'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = None + self.reason = None + self.message = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/check_name_availability_result_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/check_name_availability_result_py3.py new file mode 100644 index 000000000000..41a2fada1f87 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/check_name_availability_result_py3.py @@ -0,0 +1,50 @@ +# 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 msrest.serialization import Model + + +class CheckNameAvailabilityResult(Model): + """The CheckNameAvailability operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name_available: Gets a boolean value that indicates whether the name + is available for you to use. If true, the name is available. If false, the + name has already been taken or is invalid and cannot be used. + :vartype name_available: bool + :ivar reason: Gets the reason that a storage account name could not be + used. The Reason element is only returned if NameAvailable is false. + Possible values include: 'AccountNameInvalid', 'AlreadyExists' + :vartype reason: str or ~azure.mgmt.storage.v2018_02_01.models.Reason + :ivar message: Gets an error message explaining the Reason value in more + detail. + :vartype message: str + """ + + _validation = { + 'name_available': {'readonly': True}, + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'Reason'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = None + self.reason = None + self.message = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/custom_domain.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/custom_domain.py new file mode 100644 index 000000000000..585480d7321a --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/custom_domain.py @@ -0,0 +1,41 @@ +# 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 msrest.serialization import Model + + +class CustomDomain(Model): + """The custom domain assigned to this storage account. This can be set via + Update. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the custom domain name assigned to the + storage account. Name is the CNAME source. + :type name: str + :param use_sub_domain: Indicates whether indirect CName validation is + enabled. Default value is false. This should only be set on updates. + :type use_sub_domain: bool + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'use_sub_domain': {'key': 'useSubDomain', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(CustomDomain, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.use_sub_domain = kwargs.get('use_sub_domain', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/custom_domain_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/custom_domain_py3.py new file mode 100644 index 000000000000..4c6fe3f83e35 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/custom_domain_py3.py @@ -0,0 +1,41 @@ +# 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 msrest.serialization import Model + + +class CustomDomain(Model): + """The custom domain assigned to this storage account. This can be set via + Update. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the custom domain name assigned to the + storage account. Name is the CNAME source. + :type name: str + :param use_sub_domain: Indicates whether indirect CName validation is + enabled. Default value is false. This should only be set on updates. + :type use_sub_domain: bool + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'use_sub_domain': {'key': 'useSubDomain', 'type': 'bool'}, + } + + def __init__(self, *, name: str, use_sub_domain: bool=None, **kwargs) -> None: + super(CustomDomain, self).__init__(**kwargs) + self.name = name + self.use_sub_domain = use_sub_domain diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/dimension.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/dimension.py new file mode 100644 index 000000000000..0a0cdaf75da7 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/dimension.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class Dimension(Model): + """Dimension of blobs, possiblly be blob type or access tier. + + :param name: Display name of dimension. + :type name: str + :param display_name: Display name of dimension. + :type display_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Dimension, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/dimension_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/dimension_py3.py new file mode 100644 index 000000000000..6845aa528b4b --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/dimension_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class Dimension(Model): + """Dimension of blobs, possiblly be blob type or access tier. + + :param name: Display name of dimension. + :type name: str + :param display_name: Display name of dimension. + :type display_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, **kwargs) -> None: + super(Dimension, self).__init__(**kwargs) + self.name = name + self.display_name = display_name diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/encryption.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/encryption.py new file mode 100644 index 000000000000..c9fcc801ead9 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/encryption.py @@ -0,0 +1,46 @@ +# 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 msrest.serialization import Model + + +class Encryption(Model): + """The encryption settings on the storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: List of services which support encryption. + :type services: ~azure.mgmt.storage.v2018_02_01.models.EncryptionServices + :param key_source: Required. The encryption keySource (provider). Possible + values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. + Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. + Default value: "Microsoft.Storage" . + :type key_source: str or ~azure.mgmt.storage.v2018_02_01.models.KeySource + :param key_vault_properties: Properties provided by key vault. + :type key_vault_properties: + ~azure.mgmt.storage.v2018_02_01.models.KeyVaultProperties + """ + + _validation = { + 'key_source': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'services', 'type': 'EncryptionServices'}, + 'key_source': {'key': 'keySource', 'type': 'str'}, + 'key_vault_properties': {'key': 'keyvaultproperties', 'type': 'KeyVaultProperties'}, + } + + def __init__(self, **kwargs): + super(Encryption, self).__init__(**kwargs) + self.services = kwargs.get('services', None) + self.key_source = kwargs.get('key_source', "Microsoft.Storage") + self.key_vault_properties = kwargs.get('key_vault_properties', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/encryption_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/encryption_py3.py new file mode 100644 index 000000000000..d4f941b70bff --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/encryption_py3.py @@ -0,0 +1,46 @@ +# 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 msrest.serialization import Model + + +class Encryption(Model): + """The encryption settings on the storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: List of services which support encryption. + :type services: ~azure.mgmt.storage.v2018_02_01.models.EncryptionServices + :param key_source: Required. The encryption keySource (provider). Possible + values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. + Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. + Default value: "Microsoft.Storage" . + :type key_source: str or ~azure.mgmt.storage.v2018_02_01.models.KeySource + :param key_vault_properties: Properties provided by key vault. + :type key_vault_properties: + ~azure.mgmt.storage.v2018_02_01.models.KeyVaultProperties + """ + + _validation = { + 'key_source': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'services', 'type': 'EncryptionServices'}, + 'key_source': {'key': 'keySource', 'type': 'str'}, + 'key_vault_properties': {'key': 'keyvaultproperties', 'type': 'KeyVaultProperties'}, + } + + def __init__(self, *, services=None, key_source="Microsoft.Storage", key_vault_properties=None, **kwargs) -> None: + super(Encryption, self).__init__(**kwargs) + self.services = services + self.key_source = key_source + self.key_vault_properties = key_vault_properties diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/encryption_service.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/encryption_service.py new file mode 100644 index 000000000000..3a020c468f64 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/encryption_service.py @@ -0,0 +1,43 @@ +# 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 msrest.serialization import Model + + +class EncryptionService(Model): + """A service that allows server-side encryption to be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param enabled: A boolean indicating whether or not the service encrypts + the data as it is stored. + :type enabled: bool + :ivar last_enabled_time: Gets a rough estimate of the date/time when the + encryption was last enabled by the user. Only returned when encryption is + enabled. There might be some unencrypted blobs which were written after + this time, as it is just a rough estimate. + :vartype last_enabled_time: datetime + """ + + _validation = { + 'last_enabled_time': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(EncryptionService, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.last_enabled_time = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/encryption_service_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/encryption_service_py3.py new file mode 100644 index 000000000000..0566050c6155 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/encryption_service_py3.py @@ -0,0 +1,43 @@ +# 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 msrest.serialization import Model + + +class EncryptionService(Model): + """A service that allows server-side encryption to be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param enabled: A boolean indicating whether or not the service encrypts + the data as it is stored. + :type enabled: bool + :ivar last_enabled_time: Gets a rough estimate of the date/time when the + encryption was last enabled by the user. Only returned when encryption is + enabled. There might be some unencrypted blobs which were written after + this time, as it is just a rough estimate. + :vartype last_enabled_time: datetime + """ + + _validation = { + 'last_enabled_time': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, + } + + def __init__(self, *, enabled: bool=None, **kwargs) -> None: + super(EncryptionService, self).__init__(**kwargs) + self.enabled = enabled + self.last_enabled_time = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/encryption_services.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/encryption_services.py new file mode 100644 index 000000000000..e47d51e5e2ef --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/encryption_services.py @@ -0,0 +1,48 @@ +# 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 msrest.serialization import Model + + +class EncryptionServices(Model): + """A list of services that support encryption. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param blob: The encryption function of the blob storage service. + :type blob: ~azure.mgmt.storage.v2018_02_01.models.EncryptionService + :param file: The encryption function of the file storage service. + :type file: ~azure.mgmt.storage.v2018_02_01.models.EncryptionService + :ivar table: The encryption function of the table storage service. + :vartype table: ~azure.mgmt.storage.v2018_02_01.models.EncryptionService + :ivar queue: The encryption function of the queue storage service. + :vartype queue: ~azure.mgmt.storage.v2018_02_01.models.EncryptionService + """ + + _validation = { + 'table': {'readonly': True}, + 'queue': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'EncryptionService'}, + 'file': {'key': 'file', 'type': 'EncryptionService'}, + 'table': {'key': 'table', 'type': 'EncryptionService'}, + 'queue': {'key': 'queue', 'type': 'EncryptionService'}, + } + + def __init__(self, **kwargs): + super(EncryptionServices, self).__init__(**kwargs) + self.blob = kwargs.get('blob', None) + self.file = kwargs.get('file', None) + self.table = None + self.queue = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/encryption_services_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/encryption_services_py3.py new file mode 100644 index 000000000000..02f2f95c73ee --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/encryption_services_py3.py @@ -0,0 +1,48 @@ +# 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 msrest.serialization import Model + + +class EncryptionServices(Model): + """A list of services that support encryption. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param blob: The encryption function of the blob storage service. + :type blob: ~azure.mgmt.storage.v2018_02_01.models.EncryptionService + :param file: The encryption function of the file storage service. + :type file: ~azure.mgmt.storage.v2018_02_01.models.EncryptionService + :ivar table: The encryption function of the table storage service. + :vartype table: ~azure.mgmt.storage.v2018_02_01.models.EncryptionService + :ivar queue: The encryption function of the queue storage service. + :vartype queue: ~azure.mgmt.storage.v2018_02_01.models.EncryptionService + """ + + _validation = { + 'table': {'readonly': True}, + 'queue': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'EncryptionService'}, + 'file': {'key': 'file', 'type': 'EncryptionService'}, + 'table': {'key': 'table', 'type': 'EncryptionService'}, + 'queue': {'key': 'queue', 'type': 'EncryptionService'}, + } + + def __init__(self, *, blob=None, file=None, **kwargs) -> None: + super(EncryptionServices, self).__init__(**kwargs) + self.blob = blob + self.file = file + self.table = None + self.queue = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/endpoints.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/endpoints.py new file mode 100644 index 000000000000..ec345fceac47 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/endpoints.py @@ -0,0 +1,51 @@ +# 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 msrest.serialization import Model + + +class Endpoints(Model): + """The URIs that are used to perform a retrieval of a public blob, queue, or + table object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar blob: Gets the blob endpoint. + :vartype blob: str + :ivar queue: Gets the queue endpoint. + :vartype queue: str + :ivar table: Gets the table endpoint. + :vartype table: str + :ivar file: Gets the file endpoint. + :vartype file: str + """ + + _validation = { + 'blob': {'readonly': True}, + 'queue': {'readonly': True}, + 'table': {'readonly': True}, + 'file': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'str'}, + 'queue': {'key': 'queue', 'type': 'str'}, + 'table': {'key': 'table', 'type': 'str'}, + 'file': {'key': 'file', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Endpoints, self).__init__(**kwargs) + self.blob = None + self.queue = None + self.table = None + self.file = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/endpoints_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/endpoints_py3.py new file mode 100644 index 000000000000..a186e9c8d6a9 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/endpoints_py3.py @@ -0,0 +1,51 @@ +# 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 msrest.serialization import Model + + +class Endpoints(Model): + """The URIs that are used to perform a retrieval of a public blob, queue, or + table object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar blob: Gets the blob endpoint. + :vartype blob: str + :ivar queue: Gets the queue endpoint. + :vartype queue: str + :ivar table: Gets the table endpoint. + :vartype table: str + :ivar file: Gets the file endpoint. + :vartype file: str + """ + + _validation = { + 'blob': {'readonly': True}, + 'queue': {'readonly': True}, + 'table': {'readonly': True}, + 'file': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'str'}, + 'queue': {'key': 'queue', 'type': 'str'}, + 'table': {'key': 'table', 'type': 'str'}, + 'file': {'key': 'file', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Endpoints, self).__init__(**kwargs) + self.blob = None + self.queue = None + self.table = None + self.file = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/identity.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/identity.py new file mode 100644 index 000000000000..f526b986fc70 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/identity.py @@ -0,0 +1,48 @@ +# 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 msrest.serialization import Model + + +class Identity(Model): + """Identity for the 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 Azure. + + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :ivar type: Required. The identity type. Default value: "SystemAssigned" . + :vartype type: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "SystemAssigned" + + def __init__(self, **kwargs): + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/identity_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/identity_py3.py new file mode 100644 index 000000000000..22d25fdd85b7 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/identity_py3.py @@ -0,0 +1,48 @@ +# 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 msrest.serialization import Model + + +class Identity(Model): + """Identity for the 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 Azure. + + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :ivar type: Required. The identity type. Default value: "SystemAssigned" . + :vartype type: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "SystemAssigned" + + def __init__(self, **kwargs) -> None: + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/immutability_policy.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/immutability_policy.py new file mode 100644 index 000000000000..2b8eb01dea0f --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/immutability_policy.py @@ -0,0 +1,66 @@ +# 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_entity_resource import AzureEntityResource + + +class ImmutabilityPolicy(AzureEntityResource): + """The ImmutabilityPolicy property of a blob container, including Id, resource + name, resource type, Etag. + + 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 Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :param immutability_period_since_creation_in_days: Required. The + immutability period for the blobs in the container since the policy + creation, in days. + :type immutability_period_since_creation_in_days: int + :ivar state: The ImmutabilityPolicy state of a blob container, possible + values include: Locked and Unlocked. Possible values include: 'Locked', + 'Unlocked' + :vartype state: str or + ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicyState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'immutability_period_since_creation_in_days': {'required': True}, + 'state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ImmutabilityPolicy, self).__init__(**kwargs) + self.immutability_period_since_creation_in_days = kwargs.get('immutability_period_since_creation_in_days', None) + self.state = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/immutability_policy_properties.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/immutability_policy_properties.py new file mode 100644 index 000000000000..60d6e13f0c05 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/immutability_policy_properties.py @@ -0,0 +1,59 @@ +# 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 msrest.serialization import Model + + +class ImmutabilityPolicyProperties(Model): + """The properties of an ImmutabilityPolicy of a blob container. + + 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 Azure. + + :param immutability_period_since_creation_in_days: Required. The + immutability period for the blobs in the container since the policy + creation, in days. + :type immutability_period_since_creation_in_days: int + :ivar state: The ImmutabilityPolicy state of a blob container, possible + values include: Locked and Unlocked. Possible values include: 'Locked', + 'Unlocked' + :vartype state: str or + ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicyState + :ivar etag: ImmutabilityPolicy Etag. + :vartype etag: str + :ivar update_history: The ImmutabilityPolicy update history of the blob + container. + :vartype update_history: + list[~azure.mgmt.storage.v2018_02_01.models.UpdateHistoryProperty] + """ + + _validation = { + 'immutability_period_since_creation_in_days': {'required': True}, + 'state': {'readonly': True}, + 'etag': {'readonly': True}, + 'update_history': {'readonly': True}, + } + + _attribute_map = { + 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'update_history': {'key': 'updateHistory', 'type': '[UpdateHistoryProperty]'}, + } + + def __init__(self, **kwargs): + super(ImmutabilityPolicyProperties, self).__init__(**kwargs) + self.immutability_period_since_creation_in_days = kwargs.get('immutability_period_since_creation_in_days', None) + self.state = None + self.etag = None + self.update_history = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/immutability_policy_properties_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/immutability_policy_properties_py3.py new file mode 100644 index 000000000000..3f0434d3c7c7 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/immutability_policy_properties_py3.py @@ -0,0 +1,59 @@ +# 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 msrest.serialization import Model + + +class ImmutabilityPolicyProperties(Model): + """The properties of an ImmutabilityPolicy of a blob container. + + 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 Azure. + + :param immutability_period_since_creation_in_days: Required. The + immutability period for the blobs in the container since the policy + creation, in days. + :type immutability_period_since_creation_in_days: int + :ivar state: The ImmutabilityPolicy state of a blob container, possible + values include: Locked and Unlocked. Possible values include: 'Locked', + 'Unlocked' + :vartype state: str or + ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicyState + :ivar etag: ImmutabilityPolicy Etag. + :vartype etag: str + :ivar update_history: The ImmutabilityPolicy update history of the blob + container. + :vartype update_history: + list[~azure.mgmt.storage.v2018_02_01.models.UpdateHistoryProperty] + """ + + _validation = { + 'immutability_period_since_creation_in_days': {'required': True}, + 'state': {'readonly': True}, + 'etag': {'readonly': True}, + 'update_history': {'readonly': True}, + } + + _attribute_map = { + 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'update_history': {'key': 'updateHistory', 'type': '[UpdateHistoryProperty]'}, + } + + def __init__(self, *, immutability_period_since_creation_in_days: int, **kwargs) -> None: + super(ImmutabilityPolicyProperties, self).__init__(**kwargs) + self.immutability_period_since_creation_in_days = immutability_period_since_creation_in_days + self.state = None + self.etag = None + self.update_history = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/immutability_policy_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/immutability_policy_py3.py new file mode 100644 index 000000000000..1c0300a983d7 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/immutability_policy_py3.py @@ -0,0 +1,66 @@ +# 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_entity_resource import AzureEntityResource + + +class ImmutabilityPolicy(AzureEntityResource): + """The ImmutabilityPolicy property of a blob container, including Id, resource + name, resource type, Etag. + + 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 Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :param immutability_period_since_creation_in_days: Required. The + immutability period for the blobs in the container since the policy + creation, in days. + :type immutability_period_since_creation_in_days: int + :ivar state: The ImmutabilityPolicy state of a blob container, possible + values include: Locked and Unlocked. Possible values include: 'Locked', + 'Unlocked' + :vartype state: str or + ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicyState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'immutability_period_since_creation_in_days': {'required': True}, + 'state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + } + + def __init__(self, *, immutability_period_since_creation_in_days: int, **kwargs) -> None: + super(ImmutabilityPolicy, self).__init__(**kwargs) + self.immutability_period_since_creation_in_days = immutability_period_since_creation_in_days + self.state = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/ip_rule.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/ip_rule.py new file mode 100644 index 000000000000..cd2416118e59 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/ip_rule.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class IPRule(Model): + """IP rule with specific IP or IP range in CIDR format. + + All required parameters must be populated in order to send to Azure. + + :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR + format. Only IPV4 address is allowed. + :type ip_address_or_range: str + :param action: The action of IP ACL rule. Possible values include: + 'Allow'. Default value: "Allow" . + :type action: str or ~azure.mgmt.storage.v2018_02_01.models.Action + """ + + _validation = { + 'ip_address_or_range': {'required': True}, + } + + _attribute_map = { + 'ip_address_or_range': {'key': 'value', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'Action'}, + } + + def __init__(self, **kwargs): + super(IPRule, self).__init__(**kwargs) + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + self.action = kwargs.get('action', "Allow") diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/ip_rule_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/ip_rule_py3.py new file mode 100644 index 000000000000..34516b5233c0 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/ip_rule_py3.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class IPRule(Model): + """IP rule with specific IP or IP range in CIDR format. + + All required parameters must be populated in order to send to Azure. + + :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR + format. Only IPV4 address is allowed. + :type ip_address_or_range: str + :param action: The action of IP ACL rule. Possible values include: + 'Allow'. Default value: "Allow" . + :type action: str or ~azure.mgmt.storage.v2018_02_01.models.Action + """ + + _validation = { + 'ip_address_or_range': {'required': True}, + } + + _attribute_map = { + 'ip_address_or_range': {'key': 'value', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'Action'}, + } + + def __init__(self, *, ip_address_or_range: str, action="Allow", **kwargs) -> None: + super(IPRule, self).__init__(**kwargs) + self.ip_address_or_range = ip_address_or_range + self.action = action diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/key_vault_properties.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/key_vault_properties.py new file mode 100644 index 000000000000..44eaf379f6f2 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/key_vault_properties.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class KeyVaultProperties(Model): + """Properties of key vault. + + :param key_name: The name of KeyVault key. + :type key_name: str + :param key_version: The version of KeyVault key. + :type key_version: str + :param key_vault_uri: The Uri of KeyVault. + :type key_vault_uri: str + """ + + _attribute_map = { + 'key_name': {'key': 'keyname', 'type': 'str'}, + 'key_version': {'key': 'keyversion', 'type': 'str'}, + 'key_vault_uri': {'key': 'keyvaulturi', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(KeyVaultProperties, self).__init__(**kwargs) + self.key_name = kwargs.get('key_name', None) + self.key_version = kwargs.get('key_version', None) + self.key_vault_uri = kwargs.get('key_vault_uri', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/key_vault_properties_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/key_vault_properties_py3.py new file mode 100644 index 000000000000..9e6350eec898 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/key_vault_properties_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class KeyVaultProperties(Model): + """Properties of key vault. + + :param key_name: The name of KeyVault key. + :type key_name: str + :param key_version: The version of KeyVault key. + :type key_version: str + :param key_vault_uri: The Uri of KeyVault. + :type key_vault_uri: str + """ + + _attribute_map = { + 'key_name': {'key': 'keyname', 'type': 'str'}, + 'key_version': {'key': 'keyversion', 'type': 'str'}, + 'key_vault_uri': {'key': 'keyvaulturi', 'type': 'str'}, + } + + def __init__(self, *, key_name: str=None, key_version: str=None, key_vault_uri: str=None, **kwargs) -> None: + super(KeyVaultProperties, self).__init__(**kwargs) + self.key_name = key_name + self.key_version = key_version + self.key_vault_uri = key_vault_uri diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/legal_hold.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/legal_hold.py new file mode 100644 index 000000000000..4eb93df1d9fe --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/legal_hold.py @@ -0,0 +1,47 @@ +# 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 msrest.serialization import Model + + +class LegalHold(Model): + """The LegalHold property of a blob container. + + 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 Azure. + + :ivar has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :param tags: Required. Each tag should be 3 to 23 alphanumeric characters + and is normalized to lower case at SRP. + :type tags: list[str] + """ + + _validation = { + 'has_legal_hold': {'readonly': True}, + 'tags': {'required': True}, + } + + _attribute_map = { + 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, + 'tags': {'key': 'tags', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(LegalHold, self).__init__(**kwargs) + self.has_legal_hold = None + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/legal_hold_properties.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/legal_hold_properties.py new file mode 100644 index 000000000000..1c018f0b0940 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/legal_hold_properties.py @@ -0,0 +1,43 @@ +# 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 msrest.serialization import Model + + +class LegalHoldProperties(Model): + """The LegalHold property of a blob container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :param tags: The list of LegalHold tags of a blob container. + :type tags: list[~azure.mgmt.storage.v2018_02_01.models.TagProperty] + """ + + _validation = { + 'has_legal_hold': {'readonly': True}, + } + + _attribute_map = { + 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, + 'tags': {'key': 'tags', 'type': '[TagProperty]'}, + } + + def __init__(self, **kwargs): + super(LegalHoldProperties, self).__init__(**kwargs) + self.has_legal_hold = None + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/legal_hold_properties_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/legal_hold_properties_py3.py new file mode 100644 index 000000000000..5dd782fdd092 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/legal_hold_properties_py3.py @@ -0,0 +1,43 @@ +# 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 msrest.serialization import Model + + +class LegalHoldProperties(Model): + """The LegalHold property of a blob container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :param tags: The list of LegalHold tags of a blob container. + :type tags: list[~azure.mgmt.storage.v2018_02_01.models.TagProperty] + """ + + _validation = { + 'has_legal_hold': {'readonly': True}, + } + + _attribute_map = { + 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, + 'tags': {'key': 'tags', 'type': '[TagProperty]'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(LegalHoldProperties, self).__init__(**kwargs) + self.has_legal_hold = None + self.tags = tags diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/legal_hold_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/legal_hold_py3.py new file mode 100644 index 000000000000..a4bc196cb604 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/legal_hold_py3.py @@ -0,0 +1,47 @@ +# 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 msrest.serialization import Model + + +class LegalHold(Model): + """The LegalHold property of a blob container. + + 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 Azure. + + :ivar has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :param tags: Required. Each tag should be 3 to 23 alphanumeric characters + and is normalized to lower case at SRP. + :type tags: list[str] + """ + + _validation = { + 'has_legal_hold': {'readonly': True}, + 'tags': {'required': True}, + } + + _attribute_map = { + 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, + 'tags': {'key': 'tags', 'type': '[str]'}, + } + + def __init__(self, *, tags, **kwargs) -> None: + super(LegalHold, self).__init__(**kwargs) + self.has_legal_hold = None + self.tags = tags diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_account_sas_response.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_account_sas_response.py new file mode 100644 index 000000000000..a56e959a34bd --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_account_sas_response.py @@ -0,0 +1,35 @@ +# 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 msrest.serialization import Model + + +class ListAccountSasResponse(Model): + """The List SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar account_sas_token: List SAS credentials of storage account. + :vartype account_sas_token: str + """ + + _validation = { + 'account_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'account_sas_token': {'key': 'accountSasToken', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ListAccountSasResponse, self).__init__(**kwargs) + self.account_sas_token = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_account_sas_response_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_account_sas_response_py3.py new file mode 100644 index 000000000000..b8b9a314d9f6 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_account_sas_response_py3.py @@ -0,0 +1,35 @@ +# 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 msrest.serialization import Model + + +class ListAccountSasResponse(Model): + """The List SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar account_sas_token: List SAS credentials of storage account. + :vartype account_sas_token: str + """ + + _validation = { + 'account_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'account_sas_token': {'key': 'accountSasToken', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ListAccountSasResponse, self).__init__(**kwargs) + self.account_sas_token = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_container_item.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_container_item.py new file mode 100644 index 000000000000..f6a50512740f --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_container_item.py @@ -0,0 +1,118 @@ +# 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_entity_resource import AzureEntityResource + + +class ListContainerItem(AzureEntityResource): + """The blob container properties be listed out. + + 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} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :param public_access: Specifies whether data in the container may be + accessed publicly and the level of access. Possible values include: + 'Container', 'Blob', 'None' + :type public_access: str or + ~azure.mgmt.storage.v2018_02_01.models.PublicAccess + :ivar last_modified_time: Returns the date and time the container was last + modified. + :vartype last_modified_time: datetime + :ivar lease_status: The lease status of the container. Possible values + include: 'Locked', 'Unlocked' + :vartype lease_status: str or + ~azure.mgmt.storage.v2018_02_01.models.LeaseStatus + :ivar lease_state: Lease state of the container. Possible values include: + 'Available', 'Leased', 'Expired', 'Breaking', 'Broken' + :vartype lease_state: str or + ~azure.mgmt.storage.v2018_02_01.models.LeaseState + :ivar lease_duration: Specifies whether the lease on a container is of + infinite or fixed duration, only when the container is leased. Possible + values include: 'Infinite', 'Fixed' + :vartype lease_duration: str or + ~azure.mgmt.storage.v2018_02_01.models.LeaseDuration + :param metadata: A name-value pair to associate with the container as + metadata. + :type metadata: dict[str, str] + :ivar immutability_policy: The ImmutabilityPolicy property of the + container. + :vartype immutability_policy: + ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicyProperties + :ivar legal_hold: The LegalHold property of the container. + :vartype legal_hold: + ~azure.mgmt.storage.v2018_02_01.models.LegalHoldProperties + :ivar has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :ivar has_immutability_policy: The hasImmutabilityPolicy public property + is set to true by SRP if ImmutabilityPolicy has been created for this + container. The hasImmutabilityPolicy public property is set to false by + SRP if ImmutabilityPolicy has not been created for this container. + :vartype has_immutability_policy: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'lease_status': {'readonly': True}, + 'lease_state': {'readonly': True}, + 'lease_duration': {'readonly': True}, + 'immutability_policy': {'readonly': True}, + 'legal_hold': {'readonly': True}, + 'has_legal_hold': {'readonly': True}, + 'has_immutability_policy': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'public_access': {'key': 'properties.publicAccess', 'type': 'PublicAccess'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, + 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, + 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, + 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, + 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, + 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(ListContainerItem, self).__init__(**kwargs) + self.public_access = kwargs.get('public_access', None) + self.last_modified_time = None + self.lease_status = None + self.lease_state = None + self.lease_duration = None + self.metadata = kwargs.get('metadata', None) + self.immutability_policy = None + self.legal_hold = None + self.has_legal_hold = None + self.has_immutability_policy = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_container_item_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_container_item_py3.py new file mode 100644 index 000000000000..a178276fbaa5 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_container_item_py3.py @@ -0,0 +1,118 @@ +# 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_entity_resource import AzureEntityResource + + +class ListContainerItem(AzureEntityResource): + """The blob container properties be listed out. + + 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} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :param public_access: Specifies whether data in the container may be + accessed publicly and the level of access. Possible values include: + 'Container', 'Blob', 'None' + :type public_access: str or + ~azure.mgmt.storage.v2018_02_01.models.PublicAccess + :ivar last_modified_time: Returns the date and time the container was last + modified. + :vartype last_modified_time: datetime + :ivar lease_status: The lease status of the container. Possible values + include: 'Locked', 'Unlocked' + :vartype lease_status: str or + ~azure.mgmt.storage.v2018_02_01.models.LeaseStatus + :ivar lease_state: Lease state of the container. Possible values include: + 'Available', 'Leased', 'Expired', 'Breaking', 'Broken' + :vartype lease_state: str or + ~azure.mgmt.storage.v2018_02_01.models.LeaseState + :ivar lease_duration: Specifies whether the lease on a container is of + infinite or fixed duration, only when the container is leased. Possible + values include: 'Infinite', 'Fixed' + :vartype lease_duration: str or + ~azure.mgmt.storage.v2018_02_01.models.LeaseDuration + :param metadata: A name-value pair to associate with the container as + metadata. + :type metadata: dict[str, str] + :ivar immutability_policy: The ImmutabilityPolicy property of the + container. + :vartype immutability_policy: + ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicyProperties + :ivar legal_hold: The LegalHold property of the container. + :vartype legal_hold: + ~azure.mgmt.storage.v2018_02_01.models.LegalHoldProperties + :ivar has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :ivar has_immutability_policy: The hasImmutabilityPolicy public property + is set to true by SRP if ImmutabilityPolicy has been created for this + container. The hasImmutabilityPolicy public property is set to false by + SRP if ImmutabilityPolicy has not been created for this container. + :vartype has_immutability_policy: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'lease_status': {'readonly': True}, + 'lease_state': {'readonly': True}, + 'lease_duration': {'readonly': True}, + 'immutability_policy': {'readonly': True}, + 'legal_hold': {'readonly': True}, + 'has_legal_hold': {'readonly': True}, + 'has_immutability_policy': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'public_access': {'key': 'properties.publicAccess', 'type': 'PublicAccess'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, + 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, + 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, + 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, + 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, + 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, + } + + def __init__(self, *, public_access=None, metadata=None, **kwargs) -> None: + super(ListContainerItem, self).__init__(**kwargs) + self.public_access = public_access + self.last_modified_time = None + self.lease_status = None + self.lease_state = None + self.lease_duration = None + self.metadata = metadata + self.immutability_policy = None + self.legal_hold = None + self.has_legal_hold = None + self.has_immutability_policy = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_container_items.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_container_items.py new file mode 100644 index 000000000000..84fd5aa03307 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_container_items.py @@ -0,0 +1,29 @@ +# 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 msrest.serialization import Model + + +class ListContainerItems(Model): + """The list of blob containers. + + :param value: The list of blob containers. + :type value: + list[~azure.mgmt.storage.v2018_02_01.models.ListContainerItem] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ListContainerItem]'}, + } + + def __init__(self, **kwargs): + super(ListContainerItems, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_container_items_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_container_items_py3.py new file mode 100644 index 000000000000..a9ad58faf3d8 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_container_items_py3.py @@ -0,0 +1,29 @@ +# 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 msrest.serialization import Model + + +class ListContainerItems(Model): + """The list of blob containers. + + :param value: The list of blob containers. + :type value: + list[~azure.mgmt.storage.v2018_02_01.models.ListContainerItem] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ListContainerItem]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(ListContainerItems, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_service_sas_response.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_service_sas_response.py new file mode 100644 index 000000000000..800c0298af61 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_service_sas_response.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class ListServiceSasResponse(Model): + """The List service SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar service_sas_token: List service SAS credentials of speicific + resource. + :vartype service_sas_token: str + """ + + _validation = { + 'service_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'service_sas_token': {'key': 'serviceSasToken', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ListServiceSasResponse, self).__init__(**kwargs) + self.service_sas_token = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_service_sas_response_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_service_sas_response_py3.py new file mode 100644 index 000000000000..cffd962e2041 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_service_sas_response_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class ListServiceSasResponse(Model): + """The List service SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar service_sas_token: List service SAS credentials of speicific + resource. + :vartype service_sas_token: str + """ + + _validation = { + 'service_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'service_sas_token': {'key': 'serviceSasToken', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ListServiceSasResponse, self).__init__(**kwargs) + self.service_sas_token = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/metric_specification.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/metric_specification.py new file mode 100644 index 000000000000..79d318a41660 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/metric_specification.py @@ -0,0 +1,63 @@ +# 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 msrest.serialization import Model + + +class MetricSpecification(Model): + """Metric specification of operation. + + :param name: Name of metric specification. + :type name: str + :param display_name: Display name of metric specification. + :type display_name: str + :param display_description: Display description of metric specification. + :type display_description: str + :param unit: Unit could be Bytes or Count. + :type unit: str + :param dimensions: Dimensions of blobs, including blob type and access + tier. + :type dimensions: list[~azure.mgmt.storage.v2018_02_01.models.Dimension] + :param aggregation_type: Aggregation type could be Average. + :type aggregation_type: str + :param fill_gap_with_zero: The property to decide fill gap with zero or + not. + :type fill_gap_with_zero: bool + :param category: The category this metric specification belong to, could + be Capacity. + :type category: str + :param resource_id_dimension_name_override: Account Resource Id. + :type resource_id_dimension_name_override: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'category': {'key': 'category', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MetricSpecification, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.display_description = kwargs.get('display_description', None) + self.unit = kwargs.get('unit', None) + self.dimensions = kwargs.get('dimensions', None) + self.aggregation_type = kwargs.get('aggregation_type', None) + self.fill_gap_with_zero = kwargs.get('fill_gap_with_zero', None) + self.category = kwargs.get('category', None) + self.resource_id_dimension_name_override = kwargs.get('resource_id_dimension_name_override', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/metric_specification_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/metric_specification_py3.py new file mode 100644 index 000000000000..b0d40efc543a --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/metric_specification_py3.py @@ -0,0 +1,63 @@ +# 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 msrest.serialization import Model + + +class MetricSpecification(Model): + """Metric specification of operation. + + :param name: Name of metric specification. + :type name: str + :param display_name: Display name of metric specification. + :type display_name: str + :param display_description: Display description of metric specification. + :type display_description: str + :param unit: Unit could be Bytes or Count. + :type unit: str + :param dimensions: Dimensions of blobs, including blob type and access + tier. + :type dimensions: list[~azure.mgmt.storage.v2018_02_01.models.Dimension] + :param aggregation_type: Aggregation type could be Average. + :type aggregation_type: str + :param fill_gap_with_zero: The property to decide fill gap with zero or + not. + :type fill_gap_with_zero: bool + :param category: The category this metric specification belong to, could + be Capacity. + :type category: str + :param resource_id_dimension_name_override: Account Resource Id. + :type resource_id_dimension_name_override: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'category': {'key': 'category', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, display_description: str=None, unit: str=None, dimensions=None, aggregation_type: str=None, fill_gap_with_zero: bool=None, category: str=None, resource_id_dimension_name_override: str=None, **kwargs) -> None: + super(MetricSpecification, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.display_description = display_description + self.unit = unit + self.dimensions = dimensions + self.aggregation_type = aggregation_type + self.fill_gap_with_zero = fill_gap_with_zero + self.category = category + self.resource_id_dimension_name_override = resource_id_dimension_name_override diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/network_rule_set.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/network_rule_set.py new file mode 100644 index 000000000000..c9a546c136e2 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/network_rule_set.py @@ -0,0 +1,54 @@ +# 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 msrest.serialization import Model + + +class NetworkRuleSet(Model): + """Network rule set. + + All required parameters must be populated in order to send to Azure. + + :param bypass: Specifies whether traffic is bypassed for + Logging/Metrics/AzureServices. Possible values are any combination of + Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None + to bypass none of those traffics. Possible values include: 'None', + 'Logging', 'Metrics', 'AzureServices'. Default value: "AzureServices" . + :type bypass: str or ~azure.mgmt.storage.v2018_02_01.models.Bypass + :param virtual_network_rules: Sets the virtual network rules + :type virtual_network_rules: + list[~azure.mgmt.storage.v2018_02_01.models.VirtualNetworkRule] + :param ip_rules: Sets the IP ACL rules + :type ip_rules: list[~azure.mgmt.storage.v2018_02_01.models.IPRule] + :param default_action: Required. Specifies the default action of allow or + deny when no other rules match. Possible values include: 'Allow', 'Deny'. + Default value: "Allow" . + :type default_action: str or + ~azure.mgmt.storage.v2018_02_01.models.DefaultAction + """ + + _validation = { + 'default_action': {'required': True}, + } + + _attribute_map = { + 'bypass': {'key': 'bypass', 'type': 'str'}, + 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, + 'default_action': {'key': 'defaultAction', 'type': 'DefaultAction'}, + } + + def __init__(self, **kwargs): + super(NetworkRuleSet, self).__init__(**kwargs) + self.bypass = kwargs.get('bypass', "AzureServices") + self.virtual_network_rules = kwargs.get('virtual_network_rules', None) + self.ip_rules = kwargs.get('ip_rules', None) + self.default_action = kwargs.get('default_action', "Allow") diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/network_rule_set_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/network_rule_set_py3.py new file mode 100644 index 000000000000..58b08a0e1419 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/network_rule_set_py3.py @@ -0,0 +1,54 @@ +# 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 msrest.serialization import Model + + +class NetworkRuleSet(Model): + """Network rule set. + + All required parameters must be populated in order to send to Azure. + + :param bypass: Specifies whether traffic is bypassed for + Logging/Metrics/AzureServices. Possible values are any combination of + Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None + to bypass none of those traffics. Possible values include: 'None', + 'Logging', 'Metrics', 'AzureServices'. Default value: "AzureServices" . + :type bypass: str or ~azure.mgmt.storage.v2018_02_01.models.Bypass + :param virtual_network_rules: Sets the virtual network rules + :type virtual_network_rules: + list[~azure.mgmt.storage.v2018_02_01.models.VirtualNetworkRule] + :param ip_rules: Sets the IP ACL rules + :type ip_rules: list[~azure.mgmt.storage.v2018_02_01.models.IPRule] + :param default_action: Required. Specifies the default action of allow or + deny when no other rules match. Possible values include: 'Allow', 'Deny'. + Default value: "Allow" . + :type default_action: str or + ~azure.mgmt.storage.v2018_02_01.models.DefaultAction + """ + + _validation = { + 'default_action': {'required': True}, + } + + _attribute_map = { + 'bypass': {'key': 'bypass', 'type': 'str'}, + 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, + 'default_action': {'key': 'defaultAction', 'type': 'DefaultAction'}, + } + + def __init__(self, *, bypass="AzureServices", virtual_network_rules=None, ip_rules=None, default_action="Allow", **kwargs) -> None: + super(NetworkRuleSet, self).__init__(**kwargs) + self.bypass = bypass + self.virtual_network_rules = virtual_network_rules + self.ip_rules = ip_rules + self.default_action = default_action diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/operation.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/operation.py new file mode 100644 index 000000000000..37982657dc4d --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/operation.py @@ -0,0 +1,42 @@ +# 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 msrest.serialization import Model + + +class Operation(Model): + """Storage REST API operation definition. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: Display metadata associated with the operation. + :type display: ~azure.mgmt.storage.v2018_02_01.models.OperationDisplay + :param origin: The origin of operations. + :type origin: str + :param service_specification: One property of operation, include metric + specifications. + :type service_specification: + ~azure.mgmt.storage.v2018_02_01.models.ServiceSpecification + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) + self.service_specification = kwargs.get('service_specification', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/operation_display.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/operation_display.py new file mode 100644 index 000000000000..12d72186c4f2 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/operation_display.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class OperationDisplay(Model): + """Display metadata associated with the operation. + + :param provider: Service provider: Microsoft Storage. + :type provider: str + :param resource: Resource on which the operation is performed etc. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/operation_display_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/operation_display_py3.py new file mode 100644 index 000000000000..632a6393c99f --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/operation_display_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class OperationDisplay(Model): + """Display metadata associated with the operation. + + :param provider: Service provider: Microsoft Storage. + :type provider: str + :param resource: Resource on which the operation is performed etc. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/operation_paged.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/operation_paged.py new file mode 100644 index 000000000000..826e80757e1f --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/operation_paged.py @@ -0,0 +1,27 @@ +# 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 msrest.paging import Paged + + +class OperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Operation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Operation]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/operation_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/operation_py3.py new file mode 100644 index 000000000000..8e12d0d37abc --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/operation_py3.py @@ -0,0 +1,42 @@ +# 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 msrest.serialization import Model + + +class Operation(Model): + """Storage REST API operation definition. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: Display metadata associated with the operation. + :type display: ~azure.mgmt.storage.v2018_02_01.models.OperationDisplay + :param origin: The origin of operations. + :type origin: str + :param service_specification: One property of operation, include metric + specifications. + :type service_specification: + ~azure.mgmt.storage.v2018_02_01.models.ServiceSpecification + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__(self, *, name: str=None, display=None, origin: str=None, service_specification=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display + self.origin = origin + self.service_specification = service_specification diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/proxy_resource.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/proxy_resource.py new file mode 100644 index 000000000000..0de8fb6bd420 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/proxy_resource.py @@ -0,0 +1,45 @@ +# 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 .resource import Resource + + +class ProxyResource(Resource): + """The resource model definition for a ARM proxy resource. It will have + everything other than required location and tags. + + 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} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + """ + + _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'}, + } + + def __init__(self, **kwargs): + super(ProxyResource, self).__init__(**kwargs) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/proxy_resource_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/proxy_resource_py3.py new file mode 100644 index 000000000000..c557c8c8125d --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/proxy_resource_py3.py @@ -0,0 +1,45 @@ +# 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 .resource import Resource + + +class ProxyResource(Resource): + """The resource model definition for a ARM proxy resource. It will have + everything other than required location and tags. + + 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} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + """ + + _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'}, + } + + def __init__(self, **kwargs) -> None: + super(ProxyResource, self).__init__(**kwargs) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/resource.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/resource.py new file mode 100644 index 000000000000..9333a2ac49ef --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/resource.py @@ -0,0 +1,47 @@ +# 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 msrest.serialization import Model + + +class Resource(Model): + """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. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + """ + + _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'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/resource_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/resource_py3.py new file mode 100644 index 000000000000..370e6c506581 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/resource_py3.py @@ -0,0 +1,47 @@ +# 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 msrest.serialization import Model + + +class Resource(Model): + """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. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + """ + + _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'}, + } + + def __init__(self, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/restriction.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/restriction.py new file mode 100644 index 000000000000..9201ec225a1e --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/restriction.py @@ -0,0 +1,51 @@ +# 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 msrest.serialization import Model + + +class Restriction(Model): + """The restriction because of which SKU cannot be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The type of restrictions. As of now only possible value for + this is location. + :vartype type: str + :ivar values: The value of restrictions. If the restriction type is set to + location. This would be different locations where the SKU is restricted. + :vartype values: list[str] + :param reason_code: The reason for the restriction. As of now this can be + “QuotaId” or “NotAvailableForSubscription”. Quota Id is set when the SKU + has requiredQuotas parameter as the subscription does not belong to that + quota. The “NotAvailableForSubscription” is related to capacity at DC. + Possible values include: 'QuotaId', 'NotAvailableForSubscription' + :type reason_code: str or + ~azure.mgmt.storage.v2018_02_01.models.ReasonCode + """ + + _validation = { + 'type': {'readonly': True}, + 'values': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'reason_code': {'key': 'reasonCode', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Restriction, self).__init__(**kwargs) + self.type = None + self.values = None + self.reason_code = kwargs.get('reason_code', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/restriction_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/restriction_py3.py new file mode 100644 index 000000000000..e081f446828e --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/restriction_py3.py @@ -0,0 +1,51 @@ +# 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 msrest.serialization import Model + + +class Restriction(Model): + """The restriction because of which SKU cannot be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The type of restrictions. As of now only possible value for + this is location. + :vartype type: str + :ivar values: The value of restrictions. If the restriction type is set to + location. This would be different locations where the SKU is restricted. + :vartype values: list[str] + :param reason_code: The reason for the restriction. As of now this can be + “QuotaId” or “NotAvailableForSubscription”. Quota Id is set when the SKU + has requiredQuotas parameter as the subscription does not belong to that + quota. The “NotAvailableForSubscription” is related to capacity at DC. + Possible values include: 'QuotaId', 'NotAvailableForSubscription' + :type reason_code: str or + ~azure.mgmt.storage.v2018_02_01.models.ReasonCode + """ + + _validation = { + 'type': {'readonly': True}, + 'values': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'reason_code': {'key': 'reasonCode', 'type': 'str'}, + } + + def __init__(self, *, reason_code=None, **kwargs) -> None: + super(Restriction, self).__init__(**kwargs) + self.type = None + self.values = None + self.reason_code = reason_code diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/service_sas_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/service_sas_parameters.py new file mode 100644 index 000000000000..e53925809343 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/service_sas_parameters.py @@ -0,0 +1,121 @@ +# 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 msrest.serialization import Model + + +class ServiceSasParameters(Model): + """The parameters to list service SAS credentials of a speicific resource. + + All required parameters must be populated in order to send to Azure. + + :param canonicalized_resource: Required. The canonical path to the signed + resource. + :type canonicalized_resource: str + :param resource: Required. The signed services accessible with the service + SAS. Possible values include: Blob (b), Container (c), File (f), Share + (s). Possible values include: 'b', 'c', 'f', 's' + :type resource: str or + ~azure.mgmt.storage.v2018_02_01.models.SignedResource + :param permissions: The signed permissions for the service SAS. Possible + values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create + (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', + 'l', 'a', 'c', 'u', 'p' + :type permissions: str or + ~azure.mgmt.storage.v2018_02_01.models.Permissions + :param ip_address_or_range: An IP address or a range of IP addresses from + which to accept requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the + account SAS. Possible values include: 'https,http', 'https' + :type protocols: str or + ~azure.mgmt.storage.v2018_02_01.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: datetime + :param shared_access_expiry_time: The time at which the shared access + signature becomes invalid. + :type shared_access_expiry_time: datetime + :param identifier: A unique value up to 64 characters in length that + correlates to an access policy specified for the container, queue, or + table. + :type identifier: str + :param partition_key_start: The start of partition key. + :type partition_key_start: str + :param partition_key_end: The end of partition key. + :type partition_key_end: str + :param row_key_start: The start of row key. + :type row_key_start: str + :param row_key_end: The end of row key. + :type row_key_end: str + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + :param cache_control: The response header override for cache control. + :type cache_control: str + :param content_disposition: The response header override for content + disposition. + :type content_disposition: str + :param content_encoding: The response header override for content + encoding. + :type content_encoding: str + :param content_language: The response header override for content + language. + :type content_language: str + :param content_type: The response header override for content type. + :type content_type: str + """ + + _validation = { + 'canonicalized_resource': {'required': True}, + 'resource': {'required': True}, + 'identifier': {'max_length': 64}, + } + + _attribute_map = { + 'canonicalized_resource': {'key': 'canonicalizedResource', 'type': 'str'}, + 'resource': {'key': 'signedResource', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'identifier': {'key': 'signedIdentifier', 'type': 'str'}, + 'partition_key_start': {'key': 'startPk', 'type': 'str'}, + 'partition_key_end': {'key': 'endPk', 'type': 'str'}, + 'row_key_start': {'key': 'startRk', 'type': 'str'}, + 'row_key_end': {'key': 'endRk', 'type': 'str'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + 'cache_control': {'key': 'rscc', 'type': 'str'}, + 'content_disposition': {'key': 'rscd', 'type': 'str'}, + 'content_encoding': {'key': 'rsce', 'type': 'str'}, + 'content_language': {'key': 'rscl', 'type': 'str'}, + 'content_type': {'key': 'rsct', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ServiceSasParameters, self).__init__(**kwargs) + self.canonicalized_resource = kwargs.get('canonicalized_resource', None) + self.resource = kwargs.get('resource', None) + self.permissions = kwargs.get('permissions', None) + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + self.protocols = kwargs.get('protocols', None) + self.shared_access_start_time = kwargs.get('shared_access_start_time', None) + self.shared_access_expiry_time = kwargs.get('shared_access_expiry_time', None) + self.identifier = kwargs.get('identifier', None) + self.partition_key_start = kwargs.get('partition_key_start', None) + self.partition_key_end = kwargs.get('partition_key_end', None) + self.row_key_start = kwargs.get('row_key_start', None) + self.row_key_end = kwargs.get('row_key_end', None) + self.key_to_sign = kwargs.get('key_to_sign', None) + self.cache_control = kwargs.get('cache_control', None) + self.content_disposition = kwargs.get('content_disposition', None) + self.content_encoding = kwargs.get('content_encoding', None) + self.content_language = kwargs.get('content_language', None) + self.content_type = kwargs.get('content_type', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/service_sas_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/service_sas_parameters_py3.py new file mode 100644 index 000000000000..aa7283ec6230 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/service_sas_parameters_py3.py @@ -0,0 +1,121 @@ +# 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 msrest.serialization import Model + + +class ServiceSasParameters(Model): + """The parameters to list service SAS credentials of a speicific resource. + + All required parameters must be populated in order to send to Azure. + + :param canonicalized_resource: Required. The canonical path to the signed + resource. + :type canonicalized_resource: str + :param resource: Required. The signed services accessible with the service + SAS. Possible values include: Blob (b), Container (c), File (f), Share + (s). Possible values include: 'b', 'c', 'f', 's' + :type resource: str or + ~azure.mgmt.storage.v2018_02_01.models.SignedResource + :param permissions: The signed permissions for the service SAS. Possible + values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create + (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', + 'l', 'a', 'c', 'u', 'p' + :type permissions: str or + ~azure.mgmt.storage.v2018_02_01.models.Permissions + :param ip_address_or_range: An IP address or a range of IP addresses from + which to accept requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the + account SAS. Possible values include: 'https,http', 'https' + :type protocols: str or + ~azure.mgmt.storage.v2018_02_01.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: datetime + :param shared_access_expiry_time: The time at which the shared access + signature becomes invalid. + :type shared_access_expiry_time: datetime + :param identifier: A unique value up to 64 characters in length that + correlates to an access policy specified for the container, queue, or + table. + :type identifier: str + :param partition_key_start: The start of partition key. + :type partition_key_start: str + :param partition_key_end: The end of partition key. + :type partition_key_end: str + :param row_key_start: The start of row key. + :type row_key_start: str + :param row_key_end: The end of row key. + :type row_key_end: str + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + :param cache_control: The response header override for cache control. + :type cache_control: str + :param content_disposition: The response header override for content + disposition. + :type content_disposition: str + :param content_encoding: The response header override for content + encoding. + :type content_encoding: str + :param content_language: The response header override for content + language. + :type content_language: str + :param content_type: The response header override for content type. + :type content_type: str + """ + + _validation = { + 'canonicalized_resource': {'required': True}, + 'resource': {'required': True}, + 'identifier': {'max_length': 64}, + } + + _attribute_map = { + 'canonicalized_resource': {'key': 'canonicalizedResource', 'type': 'str'}, + 'resource': {'key': 'signedResource', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'identifier': {'key': 'signedIdentifier', 'type': 'str'}, + 'partition_key_start': {'key': 'startPk', 'type': 'str'}, + 'partition_key_end': {'key': 'endPk', 'type': 'str'}, + 'row_key_start': {'key': 'startRk', 'type': 'str'}, + 'row_key_end': {'key': 'endRk', 'type': 'str'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + 'cache_control': {'key': 'rscc', 'type': 'str'}, + 'content_disposition': {'key': 'rscd', 'type': 'str'}, + 'content_encoding': {'key': 'rsce', 'type': 'str'}, + 'content_language': {'key': 'rscl', 'type': 'str'}, + 'content_type': {'key': 'rsct', 'type': 'str'}, + } + + def __init__(self, *, canonicalized_resource: str, resource, permissions=None, ip_address_or_range: str=None, protocols=None, shared_access_start_time=None, shared_access_expiry_time=None, identifier: str=None, partition_key_start: str=None, partition_key_end: str=None, row_key_start: str=None, row_key_end: str=None, key_to_sign: str=None, cache_control: str=None, content_disposition: str=None, content_encoding: str=None, content_language: str=None, content_type: str=None, **kwargs) -> None: + super(ServiceSasParameters, self).__init__(**kwargs) + self.canonicalized_resource = canonicalized_resource + self.resource = resource + self.permissions = permissions + self.ip_address_or_range = ip_address_or_range + self.protocols = protocols + self.shared_access_start_time = shared_access_start_time + self.shared_access_expiry_time = shared_access_expiry_time + self.identifier = identifier + self.partition_key_start = partition_key_start + self.partition_key_end = partition_key_end + self.row_key_start = row_key_start + self.row_key_end = row_key_end + self.key_to_sign = key_to_sign + self.cache_control = cache_control + self.content_disposition = content_disposition + self.content_encoding = content_encoding + self.content_language = content_language + self.content_type = content_type diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/service_specification.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/service_specification.py new file mode 100644 index 000000000000..a2cdf93ecdeb --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/service_specification.py @@ -0,0 +1,29 @@ +# 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 msrest.serialization import Model + + +class ServiceSpecification(Model): + """One property of operation, include metric specifications. + + :param metric_specifications: Metric specifications of operation. + :type metric_specifications: + list[~azure.mgmt.storage.v2018_02_01.models.MetricSpecification] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + } + + def __init__(self, **kwargs): + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = kwargs.get('metric_specifications', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/service_specification_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/service_specification_py3.py new file mode 100644 index 000000000000..aadc0db02787 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/service_specification_py3.py @@ -0,0 +1,29 @@ +# 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 msrest.serialization import Model + + +class ServiceSpecification(Model): + """One property of operation, include metric specifications. + + :param metric_specifications: Metric specifications of operation. + :type metric_specifications: + list[~azure.mgmt.storage.v2018_02_01.models.MetricSpecification] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + } + + def __init__(self, *, metric_specifications=None, **kwargs) -> None: + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = metric_specifications diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/sku.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/sku.py new file mode 100644 index 000000000000..51535cde8139 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/sku.py @@ -0,0 +1,78 @@ +# 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 msrest.serialization import Model + + +class Sku(Model): + """The SKU of the storage account. + + 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 Azure. + + :param name: Required. Gets or sets the sku name. Required for account + creation; optional for update. Note that in older versions, sku name was + called accountType. Possible values include: 'Standard_LRS', + 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' + :type name: str or ~azure.mgmt.storage.v2018_02_01.models.SkuName + :ivar tier: Gets the sku tier. This is based on the SKU name. Possible + values include: 'Standard', 'Premium' + :vartype tier: str or ~azure.mgmt.storage.v2018_02_01.models.SkuTier + :ivar resource_type: The type of the resource, usually it is + 'storageAccounts'. + :vartype resource_type: str + :ivar kind: Indicates the type of storage account. Possible values + include: 'Storage', 'StorageV2', 'BlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2018_02_01.models.Kind + :ivar locations: The set of locations that the SKU is available. This will + be supported and registered Azure Geo Regions (e.g. West US, East US, + Southeast Asia, etc.). + :vartype locations: list[str] + :ivar capabilities: The capability information in the specified sku, + including file encryption, network acls, change notification, etc. + :vartype capabilities: + list[~azure.mgmt.storage.v2018_02_01.models.SKUCapability] + :param restrictions: The restrictions because of which SKU cannot be used. + This is empty if there are no restrictions. + :type restrictions: + list[~azure.mgmt.storage.v2018_02_01.models.Restriction] + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'readonly': True}, + 'resource_type': {'readonly': True}, + 'kind': {'readonly': True}, + 'locations': {'readonly': True}, + 'capabilities': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'SkuName'}, + 'tier': {'key': 'tier', 'type': 'SkuTier'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[SKUCapability]'}, + 'restrictions': {'key': 'restrictions', 'type': '[Restriction]'}, + } + + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = None + self.resource_type = None + self.kind = None + self.locations = None + self.capabilities = None + self.restrictions = kwargs.get('restrictions', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/sku_capability.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/sku_capability.py new file mode 100644 index 000000000000..b8fa68ce7778 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/sku_capability.py @@ -0,0 +1,44 @@ +# 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 msrest.serialization import Model + + +class SKUCapability(Model): + """The capability information in the specified sku, including file encryption, + network acls, change notification, etc. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of capability, The capability information in the + specified sku, including file encryption, network acls, change + notification, etc. + :vartype name: str + :ivar value: A string value to indicate states of given capability. + Possibly 'true' or 'false'. + :vartype value: str + """ + + _validation = { + 'name': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SKUCapability, self).__init__(**kwargs) + self.name = None + self.value = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/sku_capability_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/sku_capability_py3.py new file mode 100644 index 000000000000..f349a08eda21 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/sku_capability_py3.py @@ -0,0 +1,44 @@ +# 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 msrest.serialization import Model + + +class SKUCapability(Model): + """The capability information in the specified sku, including file encryption, + network acls, change notification, etc. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of capability, The capability information in the + specified sku, including file encryption, network acls, change + notification, etc. + :vartype name: str + :ivar value: A string value to indicate states of given capability. + Possibly 'true' or 'false'. + :vartype value: str + """ + + _validation = { + 'name': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(SKUCapability, self).__init__(**kwargs) + self.name = None + self.value = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/sku_paged.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/sku_paged.py new file mode 100644 index 000000000000..17028976705a --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/sku_paged.py @@ -0,0 +1,27 @@ +# 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 msrest.paging import Paged + + +class SkuPaged(Paged): + """ + A paging container for iterating over a list of :class:`Sku ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Sku]'} + } + + def __init__(self, *args, **kwargs): + + super(SkuPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/sku_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/sku_py3.py new file mode 100644 index 000000000000..de133a47a6ff --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/sku_py3.py @@ -0,0 +1,78 @@ +# 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 msrest.serialization import Model + + +class Sku(Model): + """The SKU of the storage account. + + 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 Azure. + + :param name: Required. Gets or sets the sku name. Required for account + creation; optional for update. Note that in older versions, sku name was + called accountType. Possible values include: 'Standard_LRS', + 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' + :type name: str or ~azure.mgmt.storage.v2018_02_01.models.SkuName + :ivar tier: Gets the sku tier. This is based on the SKU name. Possible + values include: 'Standard', 'Premium' + :vartype tier: str or ~azure.mgmt.storage.v2018_02_01.models.SkuTier + :ivar resource_type: The type of the resource, usually it is + 'storageAccounts'. + :vartype resource_type: str + :ivar kind: Indicates the type of storage account. Possible values + include: 'Storage', 'StorageV2', 'BlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2018_02_01.models.Kind + :ivar locations: The set of locations that the SKU is available. This will + be supported and registered Azure Geo Regions (e.g. West US, East US, + Southeast Asia, etc.). + :vartype locations: list[str] + :ivar capabilities: The capability information in the specified sku, + including file encryption, network acls, change notification, etc. + :vartype capabilities: + list[~azure.mgmt.storage.v2018_02_01.models.SKUCapability] + :param restrictions: The restrictions because of which SKU cannot be used. + This is empty if there are no restrictions. + :type restrictions: + list[~azure.mgmt.storage.v2018_02_01.models.Restriction] + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'readonly': True}, + 'resource_type': {'readonly': True}, + 'kind': {'readonly': True}, + 'locations': {'readonly': True}, + 'capabilities': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'SkuName'}, + 'tier': {'key': 'tier', 'type': 'SkuTier'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[SKUCapability]'}, + 'restrictions': {'key': 'restrictions', 'type': '[Restriction]'}, + } + + def __init__(self, *, name, restrictions=None, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = None + self.resource_type = None + self.kind = None + self.locations = None + self.capabilities = None + self.restrictions = restrictions diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account.py new file mode 100644 index 000000000000..5314518db468 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account.py @@ -0,0 +1,169 @@ +# 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 .tracked_resource import TrackedResource + + +class StorageAccount(TrackedResource): + """The storage account. + + 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 Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + :ivar sku: Gets the SKU. + :vartype sku: ~azure.mgmt.storage.v2018_02_01.models.Sku + :ivar kind: Gets the Kind. Possible values include: 'Storage', + 'StorageV2', 'BlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2018_02_01.models.Kind + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2018_02_01.models.Identity + :ivar provisioning_state: Gets the status of the storage account at the + time the operation was called. Possible values include: 'Creating', + 'ResolvingDNS', 'Succeeded' + :vartype provisioning_state: str or + ~azure.mgmt.storage.v2018_02_01.models.ProvisioningState + :ivar primary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object. Note that Standard_ZRS + and Premium_LRS accounts only return the blob endpoint. + :vartype primary_endpoints: + ~azure.mgmt.storage.v2018_02_01.models.Endpoints + :ivar primary_location: Gets the location of the primary data center for + the storage account. + :vartype primary_location: str + :ivar status_of_primary: Gets the status indicating whether the primary + location of the storage account is available or unavailable. Possible + values include: 'available', 'unavailable' + :vartype status_of_primary: str or + ~azure.mgmt.storage.v2018_02_01.models.AccountStatus + :ivar last_geo_failover_time: Gets the timestamp of the most recent + instance of a failover to the secondary location. Only the most recent + timestamp is retained. This element is not returned if there has never + been a failover instance. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype last_geo_failover_time: datetime + :ivar secondary_location: Gets the location of the geo-replicated + secondary for the storage account. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype secondary_location: str + :ivar status_of_secondary: Gets the status indicating whether the + secondary location of the storage account is available or unavailable. + Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible + values include: 'available', 'unavailable' + :vartype status_of_secondary: str or + ~azure.mgmt.storage.v2018_02_01.models.AccountStatus + :ivar creation_time: Gets the creation date and time of the storage + account in UTC. + :vartype creation_time: datetime + :ivar custom_domain: Gets the custom domain the user assigned to this + storage account. + :vartype custom_domain: + ~azure.mgmt.storage.v2018_02_01.models.CustomDomain + :ivar secondary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object from the secondary + location of the storage account. Only available if the SKU name is + Standard_RAGRS. + :vartype secondary_endpoints: + ~azure.mgmt.storage.v2018_02_01.models.Endpoints + :ivar encryption: Gets the encryption settings on the account. If + unspecified, the account is unencrypted. + :vartype encryption: ~azure.mgmt.storage.v2018_02_01.models.Encryption + :ivar access_tier: Required for storage accounts where kind = BlobStorage. + The access tier used for billing. Possible values include: 'Hot', 'Cool' + :vartype access_tier: str or + ~azure.mgmt.storage.v2018_02_01.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + :ivar network_rule_set: Network rule set + :vartype network_rule_set: + ~azure.mgmt.storage.v2018_02_01.models.NetworkRuleSet + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'sku': {'readonly': True}, + 'kind': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'primary_endpoints': {'readonly': True}, + 'primary_location': {'readonly': True}, + 'status_of_primary': {'readonly': True}, + 'last_geo_failover_time': {'readonly': True}, + 'secondary_location': {'readonly': True}, + 'status_of_secondary': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'custom_domain': {'readonly': True}, + 'secondary_endpoints': {'readonly': True}, + 'encryption': {'readonly': True}, + 'access_tier': {'readonly': True}, + 'network_rule_set': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, + 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, + 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, + 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'AccountStatus'}, + 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, + 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, + 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'AccountStatus'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + } + + def __init__(self, **kwargs): + super(StorageAccount, self).__init__(**kwargs) + self.sku = None + self.kind = None + self.identity = kwargs.get('identity', None) + self.provisioning_state = None + self.primary_endpoints = None + self.primary_location = None + self.status_of_primary = None + self.last_geo_failover_time = None + self.secondary_location = None + self.status_of_secondary = None + self.creation_time = None + self.custom_domain = None + self.secondary_endpoints = None + self.encryption = None + self.access_tier = None + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False) + self.network_rule_set = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_check_name_availability_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_check_name_availability_parameters.py new file mode 100644 index 000000000000..42cf88a074a0 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_check_name_availability_parameters.py @@ -0,0 +1,45 @@ +# 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 msrest.serialization import Model + + +class StorageAccountCheckNameAvailabilityParameters(Model): + """The parameters used to check the availabity of the storage account name. + + 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 Azure. + + :param name: Required. The storage account name. + :type name: str + :ivar type: Required. The type of resource, + Microsoft.Storage/storageAccounts. Default value: + "Microsoft.Storage/storageAccounts" . + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.Storage/storageAccounts" + + def __init__(self, **kwargs): + super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_check_name_availability_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_check_name_availability_parameters_py3.py new file mode 100644 index 000000000000..e6f50a456902 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_check_name_availability_parameters_py3.py @@ -0,0 +1,45 @@ +# 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 msrest.serialization import Model + + +class StorageAccountCheckNameAvailabilityParameters(Model): + """The parameters used to check the availabity of the storage account name. + + 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 Azure. + + :param name: Required. The storage account name. + :type name: str + :ivar type: Required. The type of resource, + Microsoft.Storage/storageAccounts. Default value: + "Microsoft.Storage/storageAccounts" . + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.Storage/storageAccounts" + + def __init__(self, *, name: str, **kwargs) -> None: + super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = name diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_create_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_create_parameters.py new file mode 100644 index 000000000000..5070e2af3b61 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_create_parameters.py @@ -0,0 +1,91 @@ +# 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 msrest.serialization import Model + + +class StorageAccountCreateParameters(Model): + """The parameters used when creating a storage account. + + All required parameters must be populated in order to send to Azure. + + :param sku: Required. Required. Gets or sets the sku name. + :type sku: ~azure.mgmt.storage.v2018_02_01.models.Sku + :param kind: Required. Required. Indicates the type of storage account. + Possible values include: 'Storage', 'StorageV2', 'BlobStorage' + :type kind: str or ~azure.mgmt.storage.v2018_02_01.models.Kind + :param location: Required. Required. Gets or sets the location of the + resource. This will be one of the supported and registered Azure Geo + Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a + resource cannot be changed once it is created, but if an identical geo + region is specified on update, the request will succeed. + :type location: str + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used for viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key with a length no greater than 128 + characters and a value with a length no greater than 256 characters. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2018_02_01.models.Identity + :param custom_domain: User domain assigned to the storage account. Name is + the CNAME source. Only one custom domain is supported per storage account + at this time. To clear the existing custom domain, use an empty string for + the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2018_02_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. If + left unspecified the account encryption settings will remain the same. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2018_02_01.models.Encryption + :param network_rule_set: Network rule set + :type network_rule_set: + ~azure.mgmt.storage.v2018_02_01.models.NetworkRuleSet + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2018_02_01.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + """ + + _validation = { + 'sku': {'required': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(StorageAccountCreateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.kind = kwargs.get('kind', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.identity = kwargs.get('identity', None) + self.custom_domain = kwargs.get('custom_domain', None) + self.encryption = kwargs.get('encryption', None) + self.network_rule_set = kwargs.get('network_rule_set', None) + self.access_tier = kwargs.get('access_tier', None) + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_create_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_create_parameters_py3.py new file mode 100644 index 000000000000..0fe748ef6ee3 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_create_parameters_py3.py @@ -0,0 +1,91 @@ +# 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 msrest.serialization import Model + + +class StorageAccountCreateParameters(Model): + """The parameters used when creating a storage account. + + All required parameters must be populated in order to send to Azure. + + :param sku: Required. Required. Gets or sets the sku name. + :type sku: ~azure.mgmt.storage.v2018_02_01.models.Sku + :param kind: Required. Required. Indicates the type of storage account. + Possible values include: 'Storage', 'StorageV2', 'BlobStorage' + :type kind: str or ~azure.mgmt.storage.v2018_02_01.models.Kind + :param location: Required. Required. Gets or sets the location of the + resource. This will be one of the supported and registered Azure Geo + Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a + resource cannot be changed once it is created, but if an identical geo + region is specified on update, the request will succeed. + :type location: str + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used for viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key with a length no greater than 128 + characters and a value with a length no greater than 256 characters. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2018_02_01.models.Identity + :param custom_domain: User domain assigned to the storage account. Name is + the CNAME source. Only one custom domain is supported per storage account + at this time. To clear the existing custom domain, use an empty string for + the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2018_02_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. If + left unspecified the account encryption settings will remain the same. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2018_02_01.models.Encryption + :param network_rule_set: Network rule set + :type network_rule_set: + ~azure.mgmt.storage.v2018_02_01.models.NetworkRuleSet + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2018_02_01.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + """ + + _validation = { + 'sku': {'required': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + } + + def __init__(self, *, sku, kind, location: str, tags=None, identity=None, custom_domain=None, encryption=None, network_rule_set=None, access_tier=None, enable_https_traffic_only: bool=False, **kwargs) -> None: + super(StorageAccountCreateParameters, self).__init__(**kwargs) + self.sku = sku + self.kind = kind + self.location = location + self.tags = tags + self.identity = identity + self.custom_domain = custom_domain + self.encryption = encryption + self.network_rule_set = network_rule_set + self.access_tier = access_tier + self.enable_https_traffic_only = enable_https_traffic_only diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_key.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_key.py new file mode 100644 index 000000000000..991103a56300 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_key.py @@ -0,0 +1,47 @@ +# 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 msrest.serialization import Model + + +class StorageAccountKey(Model): + """An access key for the storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar key_name: Name of the key. + :vartype key_name: str + :ivar value: Base 64-encoded value of the key. + :vartype value: str + :ivar permissions: Permissions for the key -- read-only or full + permissions. Possible values include: 'Read', 'Full' + :vartype permissions: str or + ~azure.mgmt.storage.v2018_02_01.models.KeyPermission + """ + + _validation = { + 'key_name': {'readonly': True}, + 'value': {'readonly': True}, + 'permissions': {'readonly': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, + } + + def __init__(self, **kwargs): + super(StorageAccountKey, self).__init__(**kwargs) + self.key_name = None + self.value = None + self.permissions = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_key_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_key_py3.py new file mode 100644 index 000000000000..3dfbadc6938c --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_key_py3.py @@ -0,0 +1,47 @@ +# 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 msrest.serialization import Model + + +class StorageAccountKey(Model): + """An access key for the storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar key_name: Name of the key. + :vartype key_name: str + :ivar value: Base 64-encoded value of the key. + :vartype value: str + :ivar permissions: Permissions for the key -- read-only or full + permissions. Possible values include: 'Read', 'Full' + :vartype permissions: str or + ~azure.mgmt.storage.v2018_02_01.models.KeyPermission + """ + + _validation = { + 'key_name': {'readonly': True}, + 'value': {'readonly': True}, + 'permissions': {'readonly': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, + } + + def __init__(self, **kwargs) -> None: + super(StorageAccountKey, self).__init__(**kwargs) + self.key_name = None + self.value = None + self.permissions = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_list_keys_result.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_list_keys_result.py new file mode 100644 index 000000000000..7c9a1133e1f0 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_list_keys_result.py @@ -0,0 +1,37 @@ +# 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 msrest.serialization import Model + + +class StorageAccountListKeysResult(Model): + """The response from the ListKeys operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar keys: Gets the list of storage account keys and their properties for + the specified storage account. + :vartype keys: + list[~azure.mgmt.storage.v2018_02_01.models.StorageAccountKey] + """ + + _validation = { + 'keys': {'readonly': True}, + } + + _attribute_map = { + 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, + } + + def __init__(self, **kwargs): + super(StorageAccountListKeysResult, self).__init__(**kwargs) + self.keys = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_list_keys_result_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_list_keys_result_py3.py new file mode 100644 index 000000000000..725a2e529a81 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_list_keys_result_py3.py @@ -0,0 +1,37 @@ +# 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 msrest.serialization import Model + + +class StorageAccountListKeysResult(Model): + """The response from the ListKeys operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar keys: Gets the list of storage account keys and their properties for + the specified storage account. + :vartype keys: + list[~azure.mgmt.storage.v2018_02_01.models.StorageAccountKey] + """ + + _validation = { + 'keys': {'readonly': True}, + } + + _attribute_map = { + 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, + } + + def __init__(self, **kwargs) -> None: + super(StorageAccountListKeysResult, self).__init__(**kwargs) + self.keys = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_paged.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_paged.py new file mode 100644 index 000000000000..7097a3ea95e1 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_paged.py @@ -0,0 +1,27 @@ +# 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 msrest.paging import Paged + + +class StorageAccountPaged(Paged): + """ + A paging container for iterating over a list of :class:`StorageAccount ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[StorageAccount]'} + } + + def __init__(self, *args, **kwargs): + + super(StorageAccountPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_py3.py new file mode 100644 index 000000000000..acdbd0c26614 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_py3.py @@ -0,0 +1,169 @@ +# 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 .tracked_resource import TrackedResource + + +class StorageAccount(TrackedResource): + """The storage account. + + 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 Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + :ivar sku: Gets the SKU. + :vartype sku: ~azure.mgmt.storage.v2018_02_01.models.Sku + :ivar kind: Gets the Kind. Possible values include: 'Storage', + 'StorageV2', 'BlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2018_02_01.models.Kind + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2018_02_01.models.Identity + :ivar provisioning_state: Gets the status of the storage account at the + time the operation was called. Possible values include: 'Creating', + 'ResolvingDNS', 'Succeeded' + :vartype provisioning_state: str or + ~azure.mgmt.storage.v2018_02_01.models.ProvisioningState + :ivar primary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object. Note that Standard_ZRS + and Premium_LRS accounts only return the blob endpoint. + :vartype primary_endpoints: + ~azure.mgmt.storage.v2018_02_01.models.Endpoints + :ivar primary_location: Gets the location of the primary data center for + the storage account. + :vartype primary_location: str + :ivar status_of_primary: Gets the status indicating whether the primary + location of the storage account is available or unavailable. Possible + values include: 'available', 'unavailable' + :vartype status_of_primary: str or + ~azure.mgmt.storage.v2018_02_01.models.AccountStatus + :ivar last_geo_failover_time: Gets the timestamp of the most recent + instance of a failover to the secondary location. Only the most recent + timestamp is retained. This element is not returned if there has never + been a failover instance. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype last_geo_failover_time: datetime + :ivar secondary_location: Gets the location of the geo-replicated + secondary for the storage account. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype secondary_location: str + :ivar status_of_secondary: Gets the status indicating whether the + secondary location of the storage account is available or unavailable. + Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible + values include: 'available', 'unavailable' + :vartype status_of_secondary: str or + ~azure.mgmt.storage.v2018_02_01.models.AccountStatus + :ivar creation_time: Gets the creation date and time of the storage + account in UTC. + :vartype creation_time: datetime + :ivar custom_domain: Gets the custom domain the user assigned to this + storage account. + :vartype custom_domain: + ~azure.mgmt.storage.v2018_02_01.models.CustomDomain + :ivar secondary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object from the secondary + location of the storage account. Only available if the SKU name is + Standard_RAGRS. + :vartype secondary_endpoints: + ~azure.mgmt.storage.v2018_02_01.models.Endpoints + :ivar encryption: Gets the encryption settings on the account. If + unspecified, the account is unencrypted. + :vartype encryption: ~azure.mgmt.storage.v2018_02_01.models.Encryption + :ivar access_tier: Required for storage accounts where kind = BlobStorage. + The access tier used for billing. Possible values include: 'Hot', 'Cool' + :vartype access_tier: str or + ~azure.mgmt.storage.v2018_02_01.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + :ivar network_rule_set: Network rule set + :vartype network_rule_set: + ~azure.mgmt.storage.v2018_02_01.models.NetworkRuleSet + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'sku': {'readonly': True}, + 'kind': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'primary_endpoints': {'readonly': True}, + 'primary_location': {'readonly': True}, + 'status_of_primary': {'readonly': True}, + 'last_geo_failover_time': {'readonly': True}, + 'secondary_location': {'readonly': True}, + 'status_of_secondary': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'custom_domain': {'readonly': True}, + 'secondary_endpoints': {'readonly': True}, + 'encryption': {'readonly': True}, + 'access_tier': {'readonly': True}, + 'network_rule_set': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, + 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, + 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, + 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'AccountStatus'}, + 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, + 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, + 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'AccountStatus'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + } + + def __init__(self, *, location: str, tags=None, identity=None, enable_https_traffic_only: bool=False, **kwargs) -> None: + super(StorageAccount, self).__init__(tags=tags, location=location, **kwargs) + self.sku = None + self.kind = None + self.identity = identity + self.provisioning_state = None + self.primary_endpoints = None + self.primary_location = None + self.status_of_primary = None + self.last_geo_failover_time = None + self.secondary_location = None + self.status_of_secondary = None + self.creation_time = None + self.custom_domain = None + self.secondary_endpoints = None + self.encryption = None + self.access_tier = None + self.enable_https_traffic_only = enable_https_traffic_only + self.network_rule_set = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_regenerate_key_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_regenerate_key_parameters.py new file mode 100644 index 000000000000..ca7f33b25112 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_regenerate_key_parameters.py @@ -0,0 +1,35 @@ +# 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 msrest.serialization import Model + + +class StorageAccountRegenerateKeyParameters(Model): + """The parameters used to regenerate the storage account key. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. The name of storage keys that want to be + regenerated, possible vaules are key1, key2. + :type key_name: str + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) + self.key_name = kwargs.get('key_name', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_regenerate_key_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_regenerate_key_parameters_py3.py new file mode 100644 index 000000000000..42f3c0b2e94a --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_regenerate_key_parameters_py3.py @@ -0,0 +1,35 @@ +# 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 msrest.serialization import Model + + +class StorageAccountRegenerateKeyParameters(Model): + """The parameters used to regenerate the storage account key. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. The name of storage keys that want to be + regenerated, possible vaules are key1, key2. + :type key_name: str + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, *, key_name: str, **kwargs) -> None: + super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) + self.key_name = key_name diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_update_parameters.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_update_parameters.py new file mode 100644 index 000000000000..1bbf8c2f58a1 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_update_parameters.py @@ -0,0 +1,78 @@ +# 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 msrest.serialization import Model + + +class StorageAccountUpdateParameters(Model): + """The parameters that can be provided when updating the storage account + properties. + + :param sku: Gets or sets the SKU name. Note that the SKU name cannot be + updated to Standard_ZRS or Premium_LRS, nor can accounts of those sku + names be updated to any other value. + :type sku: ~azure.mgmt.storage.v2018_02_01.models.Sku + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used in viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key no greater in length than 128 + characters and a value no greater in length than 256 characters. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2018_02_01.models.Identity + :param custom_domain: Custom domain assigned to the storage account by the + user. Name is the CNAME source. Only one custom domain is supported per + storage account at this time. To clear the existing custom domain, use an + empty string for the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2018_02_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2018_02_01.models.Encryption + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2018_02_01.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + :param network_rule_set: Network rule set + :type network_rule_set: + ~azure.mgmt.storage.v2018_02_01.models.NetworkRuleSet + :param kind: Optional. Indicates the type of storage account. Currently + only StorageV2 value supported by server. Possible values include: + 'Storage', 'StorageV2', 'BlobStorage' + :type kind: str or ~azure.mgmt.storage.v2018_02_01.models.Kind + """ + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + } + + def __init__(self, **kwargs): + super(StorageAccountUpdateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.tags = kwargs.get('tags', None) + self.identity = kwargs.get('identity', None) + self.custom_domain = kwargs.get('custom_domain', None) + self.encryption = kwargs.get('encryption', None) + self.access_tier = kwargs.get('access_tier', None) + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False) + self.network_rule_set = kwargs.get('network_rule_set', None) + self.kind = kwargs.get('kind', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_update_parameters_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_update_parameters_py3.py new file mode 100644 index 000000000000..b361d85fc5f9 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_update_parameters_py3.py @@ -0,0 +1,78 @@ +# 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 msrest.serialization import Model + + +class StorageAccountUpdateParameters(Model): + """The parameters that can be provided when updating the storage account + properties. + + :param sku: Gets or sets the SKU name. Note that the SKU name cannot be + updated to Standard_ZRS or Premium_LRS, nor can accounts of those sku + names be updated to any other value. + :type sku: ~azure.mgmt.storage.v2018_02_01.models.Sku + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used in viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key no greater in length than 128 + characters and a value no greater in length than 256 characters. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2018_02_01.models.Identity + :param custom_domain: Custom domain assigned to the storage account by the + user. Name is the CNAME source. Only one custom domain is supported per + storage account at this time. To clear the existing custom domain, use an + empty string for the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2018_02_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2018_02_01.models.Encryption + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2018_02_01.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + :param network_rule_set: Network rule set + :type network_rule_set: + ~azure.mgmt.storage.v2018_02_01.models.NetworkRuleSet + :param kind: Optional. Indicates the type of storage account. Currently + only StorageV2 value supported by server. Possible values include: + 'Storage', 'StorageV2', 'BlobStorage' + :type kind: str or ~azure.mgmt.storage.v2018_02_01.models.Kind + """ + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + } + + def __init__(self, *, sku=None, tags=None, identity=None, custom_domain=None, encryption=None, access_tier=None, enable_https_traffic_only: bool=False, network_rule_set=None, kind=None, **kwargs) -> None: + super(StorageAccountUpdateParameters, self).__init__(**kwargs) + self.sku = sku + self.tags = tags + self.identity = identity + self.custom_domain = custom_domain + self.encryption = encryption + self.access_tier = access_tier + self.enable_https_traffic_only = enable_https_traffic_only + self.network_rule_set = network_rule_set + self.kind = kind diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_management_client_enums.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_management_client_enums.py new file mode 100644 index 000000000000..a5a7f3c7171e --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_management_client_enums.py @@ -0,0 +1,197 @@ +# 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 enum import Enum + + +class ReasonCode(str, Enum): + + quota_id = "QuotaId" + not_available_for_subscription = "NotAvailableForSubscription" + + +class SkuName(str, Enum): + + standard_lrs = "Standard_LRS" + standard_grs = "Standard_GRS" + standard_ragrs = "Standard_RAGRS" + standard_zrs = "Standard_ZRS" + premium_lrs = "Premium_LRS" + + +class SkuTier(str, Enum): + + standard = "Standard" + premium = "Premium" + + +class Kind(str, Enum): + + storage = "Storage" + storage_v2 = "StorageV2" + blob_storage = "BlobStorage" + + +class Reason(str, Enum): + + account_name_invalid = "AccountNameInvalid" + already_exists = "AlreadyExists" + + +class KeySource(str, Enum): + + microsoft_storage = "Microsoft.Storage" + microsoft_keyvault = "Microsoft.Keyvault" + + +class Action(str, Enum): + + allow = "Allow" + + +class State(str, Enum): + + provisioning = "provisioning" + deprovisioning = "deprovisioning" + succeeded = "succeeded" + failed = "failed" + network_source_deleted = "networkSourceDeleted" + + +class Bypass(str, Enum): + + none = "None" + logging = "Logging" + metrics = "Metrics" + azure_services = "AzureServices" + + +class DefaultAction(str, Enum): + + allow = "Allow" + deny = "Deny" + + +class AccessTier(str, Enum): + + hot = "Hot" + cool = "Cool" + + +class ProvisioningState(str, Enum): + + creating = "Creating" + resolving_dns = "ResolvingDNS" + succeeded = "Succeeded" + + +class AccountStatus(str, Enum): + + available = "available" + unavailable = "unavailable" + + +class KeyPermission(str, Enum): + + read = "Read" + full = "Full" + + +class UsageUnit(str, Enum): + + count = "Count" + bytes = "Bytes" + seconds = "Seconds" + percent = "Percent" + counts_per_second = "CountsPerSecond" + bytes_per_second = "BytesPerSecond" + + +class Services(str, Enum): + + b = "b" + q = "q" + t = "t" + f = "f" + + +class SignedResourceTypes(str, Enum): + + s = "s" + c = "c" + o = "o" + + +class Permissions(str, Enum): + + r = "r" + d = "d" + w = "w" + l = "l" + a = "a" + c = "c" + u = "u" + p = "p" + + +class HttpProtocol(str, Enum): + + httpshttp = "https,http" + https = "https" + + +class SignedResource(str, Enum): + + b = "b" + c = "c" + f = "f" + s = "s" + + +class PublicAccess(str, Enum): + + container = "Container" + blob = "Blob" + none = "None" + + +class LeaseStatus(str, Enum): + + locked = "Locked" + unlocked = "Unlocked" + + +class LeaseState(str, Enum): + + available = "Available" + leased = "Leased" + expired = "Expired" + breaking = "Breaking" + broken = "Broken" + + +class LeaseDuration(str, Enum): + + infinite = "Infinite" + fixed = "Fixed" + + +class ImmutabilityPolicyState(str, Enum): + + locked = "Locked" + unlocked = "Unlocked" + + +class ImmutabilityPolicyUpdateType(str, Enum): + + put = "put" + lock = "lock" + extend = "extend" diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/tag_property.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/tag_property.py new file mode 100644 index 000000000000..3b879061fd2b --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/tag_property.py @@ -0,0 +1,57 @@ +# 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 msrest.serialization import Model + + +class TagProperty(Model): + """A tag of the LegalHold of a blob container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar tag: The tag value. + :vartype tag: str + :ivar timestamp: Returns the date and time the tag was added. + :vartype timestamp: datetime + :ivar object_identifier: Returns the Object ID of the user who added the + tag. + :vartype object_identifier: str + :ivar tenant_id: Returns the Tenant ID that issued the token for the user + who added the tag. + :vartype tenant_id: str + :ivar upn: Returns the User Principal Name of the user who added the tag. + :vartype upn: str + """ + + _validation = { + 'tag': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'object_identifier': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'upn': {'readonly': True}, + } + + _attribute_map = { + 'tag': {'key': 'tag', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'upn': {'key': 'upn', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TagProperty, self).__init__(**kwargs) + self.tag = None + self.timestamp = None + self.object_identifier = None + self.tenant_id = None + self.upn = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/tag_property_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/tag_property_py3.py new file mode 100644 index 000000000000..22aaf6cb82ba --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/tag_property_py3.py @@ -0,0 +1,57 @@ +# 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 msrest.serialization import Model + + +class TagProperty(Model): + """A tag of the LegalHold of a blob container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar tag: The tag value. + :vartype tag: str + :ivar timestamp: Returns the date and time the tag was added. + :vartype timestamp: datetime + :ivar object_identifier: Returns the Object ID of the user who added the + tag. + :vartype object_identifier: str + :ivar tenant_id: Returns the Tenant ID that issued the token for the user + who added the tag. + :vartype tenant_id: str + :ivar upn: Returns the User Principal Name of the user who added the tag. + :vartype upn: str + """ + + _validation = { + 'tag': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'object_identifier': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'upn': {'readonly': True}, + } + + _attribute_map = { + 'tag': {'key': 'tag', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'upn': {'key': 'upn', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(TagProperty, self).__init__(**kwargs) + self.tag = None + self.timestamp = None + self.object_identifier = None + self.tenant_id = None + self.upn = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/tracked_resource.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/tracked_resource.py new file mode 100644 index 000000000000..27ab94c7a8dd --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/tracked_resource.py @@ -0,0 +1,55 @@ +# 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 .resource import Resource + + +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level 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 Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TrackedResource, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.location = kwargs.get('location', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/tracked_resource_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/tracked_resource_py3.py new file mode 100644 index 000000000000..0e389546a588 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/tracked_resource_py3.py @@ -0,0 +1,55 @@ +# 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 .resource import Resource + + +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level 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 Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(TrackedResource, self).__init__(**kwargs) + self.tags = tags + self.location = location diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/update_history_property.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/update_history_property.py new file mode 100644 index 000000000000..e45713204822 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/update_history_property.py @@ -0,0 +1,68 @@ +# 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 msrest.serialization import Model + + +class UpdateHistoryProperty(Model): + """An update history of the ImmutabilityPolicy of a blob container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar update: The ImmutabilityPolicy update type of a blob container, + possible values include: put, lock and extend. Possible values include: + 'put', 'lock', 'extend' + :vartype update: str or + ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicyUpdateType + :ivar immutability_period_since_creation_in_days: The immutability period + for the blobs in the container since the policy creation, in days. + :vartype immutability_period_since_creation_in_days: int + :ivar timestamp: Returns the date and time the ImmutabilityPolicy was + updated. + :vartype timestamp: datetime + :ivar object_identifier: Returns the Object ID of the user who updated the + ImmutabilityPolicy. + :vartype object_identifier: str + :ivar tenant_id: Returns the Tenant ID that issued the token for the user + who updated the ImmutabilityPolicy. + :vartype tenant_id: str + :ivar upn: Returns the User Principal Name of the user who updated the + ImmutabilityPolicy. + :vartype upn: str + """ + + _validation = { + 'update': {'readonly': True}, + 'immutability_period_since_creation_in_days': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'object_identifier': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'upn': {'readonly': True}, + } + + _attribute_map = { + 'update': {'key': 'update', 'type': 'str'}, + 'immutability_period_since_creation_in_days': {'key': 'immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'upn': {'key': 'upn', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UpdateHistoryProperty, self).__init__(**kwargs) + self.update = None + self.immutability_period_since_creation_in_days = None + self.timestamp = None + self.object_identifier = None + self.tenant_id = None + self.upn = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/update_history_property_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/update_history_property_py3.py new file mode 100644 index 000000000000..b5b4964e9fde --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/update_history_property_py3.py @@ -0,0 +1,68 @@ +# 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 msrest.serialization import Model + + +class UpdateHistoryProperty(Model): + """An update history of the ImmutabilityPolicy of a blob container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar update: The ImmutabilityPolicy update type of a blob container, + possible values include: put, lock and extend. Possible values include: + 'put', 'lock', 'extend' + :vartype update: str or + ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicyUpdateType + :ivar immutability_period_since_creation_in_days: The immutability period + for the blobs in the container since the policy creation, in days. + :vartype immutability_period_since_creation_in_days: int + :ivar timestamp: Returns the date and time the ImmutabilityPolicy was + updated. + :vartype timestamp: datetime + :ivar object_identifier: Returns the Object ID of the user who updated the + ImmutabilityPolicy. + :vartype object_identifier: str + :ivar tenant_id: Returns the Tenant ID that issued the token for the user + who updated the ImmutabilityPolicy. + :vartype tenant_id: str + :ivar upn: Returns the User Principal Name of the user who updated the + ImmutabilityPolicy. + :vartype upn: str + """ + + _validation = { + 'update': {'readonly': True}, + 'immutability_period_since_creation_in_days': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'object_identifier': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'upn': {'readonly': True}, + } + + _attribute_map = { + 'update': {'key': 'update', 'type': 'str'}, + 'immutability_period_since_creation_in_days': {'key': 'immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'upn': {'key': 'upn', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(UpdateHistoryProperty, self).__init__(**kwargs) + self.update = None + self.immutability_period_since_creation_in_days = None + self.timestamp = None + self.object_identifier = None + self.tenant_id = None + self.upn = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/usage.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/usage.py new file mode 100644 index 000000000000..2668cb716b16 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/usage.py @@ -0,0 +1,54 @@ +# 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 msrest.serialization import Model + + +class Usage(Model): + """Describes Storage Resource Usage. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar unit: Gets the unit of measurement. Possible values include: + 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', + 'BytesPerSecond' + :vartype unit: str or ~azure.mgmt.storage.v2018_02_01.models.UsageUnit + :ivar current_value: Gets the current count of the allocated resources in + the subscription. + :vartype current_value: int + :ivar limit: Gets the maximum count of the resources that can be allocated + in the subscription. + :vartype limit: int + :ivar name: Gets the name of the type of usage. + :vartype name: ~azure.mgmt.storage.v2018_02_01.models.UsageName + """ + + _validation = { + 'unit': {'readonly': True}, + 'current_value': {'readonly': True}, + 'limit': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'UsageUnit'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + def __init__(self, **kwargs): + super(Usage, self).__init__(**kwargs) + self.unit = None + self.current_value = None + self.limit = None + self.name = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/usage_name.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/usage_name.py new file mode 100644 index 000000000000..e4082bf52384 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/usage_name.py @@ -0,0 +1,41 @@ +# 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 msrest.serialization import Model + + +class UsageName(Model): + """The usage names that can be used; currently limited to StorageAccount. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: Gets a string describing the resource name. + :vartype value: str + :ivar localized_value: Gets a localized string describing the resource + name. + :vartype localized_value: str + """ + + _validation = { + 'value': {'readonly': True}, + 'localized_value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UsageName, self).__init__(**kwargs) + self.value = None + self.localized_value = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/usage_name_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/usage_name_py3.py new file mode 100644 index 000000000000..f519bb5072b1 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/usage_name_py3.py @@ -0,0 +1,41 @@ +# 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 msrest.serialization import Model + + +class UsageName(Model): + """The usage names that can be used; currently limited to StorageAccount. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: Gets a string describing the resource name. + :vartype value: str + :ivar localized_value: Gets a localized string describing the resource + name. + :vartype localized_value: str + """ + + _validation = { + 'value': {'readonly': True}, + 'localized_value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(UsageName, self).__init__(**kwargs) + self.value = None + self.localized_value = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/usage_paged.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/usage_paged.py new file mode 100644 index 000000000000..b681564312e9 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/usage_paged.py @@ -0,0 +1,27 @@ +# 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 msrest.paging import Paged + + +class UsagePaged(Paged): + """ + A paging container for iterating over a list of :class:`Usage ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Usage]'} + } + + def __init__(self, *args, **kwargs): + + super(UsagePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/usage_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/usage_py3.py new file mode 100644 index 000000000000..eb7bbdc2f151 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/usage_py3.py @@ -0,0 +1,54 @@ +# 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 msrest.serialization import Model + + +class Usage(Model): + """Describes Storage Resource Usage. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar unit: Gets the unit of measurement. Possible values include: + 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', + 'BytesPerSecond' + :vartype unit: str or ~azure.mgmt.storage.v2018_02_01.models.UsageUnit + :ivar current_value: Gets the current count of the allocated resources in + the subscription. + :vartype current_value: int + :ivar limit: Gets the maximum count of the resources that can be allocated + in the subscription. + :vartype limit: int + :ivar name: Gets the name of the type of usage. + :vartype name: ~azure.mgmt.storage.v2018_02_01.models.UsageName + """ + + _validation = { + 'unit': {'readonly': True}, + 'current_value': {'readonly': True}, + 'limit': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'UsageUnit'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + def __init__(self, **kwargs) -> None: + super(Usage, self).__init__(**kwargs) + self.unit = None + self.current_value = None + self.limit = None + self.name = None diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/virtual_network_rule.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/virtual_network_rule.py new file mode 100644 index 000000000000..f8c08b6000e0 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/virtual_network_rule.py @@ -0,0 +1,47 @@ +# 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 msrest.serialization import Model + + +class VirtualNetworkRule(Model): + """Virtual Network rule. + + All required parameters must be populated in order to send to Azure. + + :param virtual_network_resource_id: Required. Resource ID of a subnet, for + example: + /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + :type virtual_network_resource_id: str + :param action: The action of virtual network rule. Possible values + include: 'Allow'. Default value: "Allow" . + :type action: str or ~azure.mgmt.storage.v2018_02_01.models.Action + :param state: Gets the state of virtual network rule. Possible values + include: 'provisioning', 'deprovisioning', 'succeeded', 'failed', + 'networkSourceDeleted' + :type state: str or ~azure.mgmt.storage.v2018_02_01.models.State + """ + + _validation = { + 'virtual_network_resource_id': {'required': True}, + } + + _attribute_map = { + 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'Action'}, + 'state': {'key': 'state', 'type': 'State'}, + } + + def __init__(self, **kwargs): + super(VirtualNetworkRule, self).__init__(**kwargs) + self.virtual_network_resource_id = kwargs.get('virtual_network_resource_id', None) + self.action = kwargs.get('action', "Allow") + self.state = kwargs.get('state', None) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/virtual_network_rule_py3.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/virtual_network_rule_py3.py new file mode 100644 index 000000000000..43673a374a5b --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/virtual_network_rule_py3.py @@ -0,0 +1,47 @@ +# 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 msrest.serialization import Model + + +class VirtualNetworkRule(Model): + """Virtual Network rule. + + All required parameters must be populated in order to send to Azure. + + :param virtual_network_resource_id: Required. Resource ID of a subnet, for + example: + /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + :type virtual_network_resource_id: str + :param action: The action of virtual network rule. Possible values + include: 'Allow'. Default value: "Allow" . + :type action: str or ~azure.mgmt.storage.v2018_02_01.models.Action + :param state: Gets the state of virtual network rule. Possible values + include: 'provisioning', 'deprovisioning', 'succeeded', 'failed', + 'networkSourceDeleted' + :type state: str or ~azure.mgmt.storage.v2018_02_01.models.State + """ + + _validation = { + 'virtual_network_resource_id': {'required': True}, + } + + _attribute_map = { + 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'Action'}, + 'state': {'key': 'state', 'type': 'State'}, + } + + def __init__(self, *, virtual_network_resource_id: str, action="Allow", state=None, **kwargs) -> None: + super(VirtualNetworkRule, self).__init__(**kwargs) + self.virtual_network_resource_id = virtual_network_resource_id + self.action = action + self.state = state diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/__init__.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/__init__.py new file mode 100644 index 000000000000..b9b73b2babc4 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/__init__.py @@ -0,0 +1,24 @@ +# 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 .operations import Operations +from .skus_operations import SkusOperations +from .storage_accounts_operations import StorageAccountsOperations +from .usage_operations import UsageOperations +from .blob_containers_operations import BlobContainersOperations + +__all__ = [ + 'Operations', + 'SkusOperations', + 'StorageAccountsOperations', + 'UsageOperations', + 'BlobContainersOperations', +] diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/blob_containers_operations.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/blob_containers_operations.py new file mode 100644 index 000000000000..dcf30438e5be --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/blob_containers_operations.py @@ -0,0 +1,1045 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class BlobContainersOperations(object): + """BlobContainersOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2018-02-01". + :ivar immutability_policy_name: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default'. Constant value: "default". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-02-01" + self.immutability_policy_name = "default" + + self.config = config + + def list( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Lists all containers and does not support a prefix like data plane. + Also SRP today does not return continuation token. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ListContainerItems or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_02_01.models.ListContainerItems or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ListContainerItems', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers'} + + def create( + self, resource_group_name, account_name, container_name, public_access=None, metadata=None, custom_headers=None, raw=False, **operation_config): + """Creates a new container under the specified account as described by + request body. The container resource includes metadata and properties + for that container. It does not include a list of the blobs contained + by the container. . + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param public_access: Specifies whether data in the container may be + accessed publicly and the level of access. Possible values include: + 'Container', 'Blob', 'None' + :type public_access: str or + ~azure.mgmt.storage.v2018_02_01.models.PublicAccess + :param metadata: A name-value pair to associate with the container as + metadata. + :type metadata: dict[str, str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BlobContainer or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_02_01.models.BlobContainer or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + blob_container = models.BlobContainer(public_access=public_access, metadata=metadata) + + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(blob_container, 'BlobContainer') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 201: + deserialized = self._deserialize('BlobContainer', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} + + def update( + self, resource_group_name, account_name, container_name, public_access=None, metadata=None, custom_headers=None, raw=False, **operation_config): + """Updates container properties as specified in request body. Properties + not mentioned in the request will be unchanged. Update fails if the + specified container doesn't already exist. . + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param public_access: Specifies whether data in the container may be + accessed publicly and the level of access. Possible values include: + 'Container', 'Blob', 'None' + :type public_access: str or + ~azure.mgmt.storage.v2018_02_01.models.PublicAccess + :param metadata: A name-value pair to associate with the container as + metadata. + :type metadata: dict[str, str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BlobContainer or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_02_01.models.BlobContainer or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + blob_container = models.BlobContainer(public_access=public_access, metadata=metadata) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(blob_container, 'BlobContainer') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BlobContainer', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} + + def get( + self, resource_group_name, account_name, container_name, custom_headers=None, raw=False, **operation_config): + """Gets properties of a specified container. . + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BlobContainer or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_02_01.models.BlobContainer or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BlobContainer', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} + + def delete( + self, resource_group_name, account_name, container_name, custom_headers=None, raw=False, **operation_config): + """Deletes specified container under its account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} + + def set_legal_hold( + self, resource_group_name, account_name, container_name, tags, custom_headers=None, raw=False, **operation_config): + """Sets legal hold tags. Setting the same tag results in an idempotent + operation. SetLegalHold follows an append pattern and does not clear + out the existing tags that are not specified in the request. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param tags: Each tag should be 3 to 23 alphanumeric characters and is + normalized to lower case at SRP. + :type tags: list[str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: LegalHold or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_02_01.models.LegalHold or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + legal_hold = models.LegalHold(tags=tags) + + # Construct URL + url = self.set_legal_hold.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(legal_hold, 'LegalHold') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('LegalHold', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + set_legal_hold.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/setLegalHold'} + + def clear_legal_hold( + self, resource_group_name, account_name, container_name, tags, custom_headers=None, raw=False, **operation_config): + """Clears legal hold tags. Clearing the same or non-existent tag results + in an idempotent operation. ClearLegalHold clears out only the + specified tags in the request. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param tags: Each tag should be 3 to 23 alphanumeric characters and is + normalized to lower case at SRP. + :type tags: list[str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: LegalHold or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_02_01.models.LegalHold or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + legal_hold = models.LegalHold(tags=tags) + + # Construct URL + url = self.clear_legal_hold.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(legal_hold, 'LegalHold') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('LegalHold', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + clear_legal_hold.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/clearLegalHold'} + + def create_or_update_immutability_policy( + self, resource_group_name, account_name, container_name, immutability_period_since_creation_in_days, if_match=None, custom_headers=None, raw=False, **operation_config): + """Creates or updates an unlocked immutability policy. ETag in If-Match is + honored if given but not required for this operation. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param immutability_period_since_creation_in_days: The immutability + period for the blobs in the container since the policy creation, in + days. + :type immutability_period_since_creation_in_days: int + :param if_match: The entity state (ETag) version of the immutability + policy to update. A value of "*" can be used to apply the operation + only if the immutability policy already exists. If omitted, this + operation will always be applied. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ImmutabilityPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = None + if immutability_period_since_creation_in_days is not None: + parameters = models.ImmutabilityPolicy(immutability_period_since_creation_in_days=immutability_period_since_creation_in_days) + + # Construct URL + url = self.create_or_update_immutability_policy.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'immutabilityPolicyName': self._serialize.url("self.immutability_policy_name", self.immutability_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + if parameters is not None: + body_content = self._serialize.body(parameters, 'ImmutabilityPolicy') + else: + body_content = None + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('ImmutabilityPolicy', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + create_or_update_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'} + + def get_immutability_policy( + self, resource_group_name, account_name, container_name, if_match=None, custom_headers=None, raw=False, **operation_config): + """Gets the existing immutability policy along with the corresponding ETag + in response headers and body. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param if_match: The entity state (ETag) version of the immutability + policy to update. A value of "*" can be used to apply the operation + only if the immutability policy already exists. If omitted, this + operation will always be applied. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ImmutabilityPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_immutability_policy.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'immutabilityPolicyName': self._serialize.url("self.immutability_policy_name", self.immutability_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('ImmutabilityPolicy', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'} + + def delete_immutability_policy( + self, resource_group_name, account_name, container_name, if_match, custom_headers=None, raw=False, **operation_config): + """Aborts an unlocked immutability policy. The response of delete has + immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is + required for this operation. Deleting a locked immutability policy is + not allowed, only way is to delete the container after deleting all + blobs inside the container. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param if_match: The entity state (ETag) version of the immutability + policy to update. A value of "*" can be used to apply the operation + only if the immutability policy already exists. If omitted, this + operation will always be applied. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ImmutabilityPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete_immutability_policy.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'immutabilityPolicyName': self._serialize.url("self.immutability_policy_name", self.immutability_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('ImmutabilityPolicy', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + delete_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'} + + def lock_immutability_policy( + self, resource_group_name, account_name, container_name, if_match, custom_headers=None, raw=False, **operation_config): + """Sets the ImmutabilityPolicy to Locked state. The only action allowed on + a Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is + required for this operation. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param if_match: The entity state (ETag) version of the immutability + policy to update. A value of "*" can be used to apply the operation + only if the immutability policy already exists. If omitted, this + operation will always be applied. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ImmutabilityPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.lock_immutability_policy.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('ImmutabilityPolicy', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + lock_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/lock'} + + def extend_immutability_policy( + self, resource_group_name, account_name, container_name, if_match, immutability_period_since_creation_in_days, custom_headers=None, raw=False, **operation_config): + """Extends the immutabilityPeriodSinceCreationInDays of a locked + immutabilityPolicy. The only action allowed on a Locked policy will be + this action. ETag in If-Match is required for this operation. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param if_match: The entity state (ETag) version of the immutability + policy to update. A value of "*" can be used to apply the operation + only if the immutability policy already exists. If omitted, this + operation will always be applied. + :type if_match: str + :param immutability_period_since_creation_in_days: The immutability + period for the blobs in the container since the policy creation, in + days. + :type immutability_period_since_creation_in_days: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ImmutabilityPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = None + if immutability_period_since_creation_in_days is not None: + parameters = models.ImmutabilityPolicy(immutability_period_since_creation_in_days=immutability_period_since_creation_in_days) + + # Construct URL + url = self.extend_immutability_policy.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + if parameters is not None: + body_content = self._serialize.body(parameters, 'ImmutabilityPolicy') + else: + body_content = None + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('ImmutabilityPolicy', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + extend_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/extend'} diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/operations.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/operations.py new file mode 100644 index 000000000000..c7049ade6b06 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/operations.py @@ -0,0 +1,99 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class Operations(object): + """Operations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2018-02-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-02-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available Storage Rest API operations. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Operation + :rtype: + ~azure.mgmt.storage.v2018_02_01.models.OperationPaged[~azure.mgmt.storage.v2018_02_01.models.Operation] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Storage/operations'} diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/skus_operations.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/skus_operations.py new file mode 100644 index 000000000000..16d00abe29d7 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/skus_operations.py @@ -0,0 +1,104 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class SkusOperations(object): + """SkusOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2018-02-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-02-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists the available SKUs supported by Microsoft.Storage for given + subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Sku + :rtype: + ~azure.mgmt.storage.v2018_02_01.models.SkuPaged[~azure.mgmt.storage.v2018_02_01.models.Sku] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.SkuPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.SkuPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/skus'} diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/storage_accounts_operations.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/storage_accounts_operations.py new file mode 100644 index 000000000000..75e62a807756 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/storage_accounts_operations.py @@ -0,0 +1,845 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class StorageAccountsOperations(object): + """StorageAccountsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2018-02-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-02-01" + + self.config = config + + def check_name_availability( + self, name, custom_headers=None, raw=False, **operation_config): + """Checks that the storage account name is valid and is not already in + use. + + :param name: The storage account name. + :type name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: CheckNameAvailabilityResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2018_02_01.models.CheckNameAvailabilityResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + account_name = models.StorageAccountCheckNameAvailabilityParameters(name=name) + + # Construct URL + url = self.check_name_availability.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(account_name, 'StorageAccountCheckNameAvailabilityParameters') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('CheckNameAvailabilityResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability'} + + + def _create_initial( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'StorageAccountCreateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('StorageAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Asynchronously creates a new storage account with the specified + parameters. If an account is already created and a subsequent create + request is issued with different properties, the account properties + will be updated. If an account is already created and a subsequent + create or update request is issued with the exact same set of + properties, the request will succeed. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide for the created account. + :type parameters: + ~azure.mgmt.storage.v2018_02_01.models.StorageAccountCreateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns StorageAccount or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.storage.v2018_02_01.models.StorageAccount] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.storage.v2018_02_01.models.StorageAccount]] + :raises: :class:`CloudError` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + account_name=account_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('StorageAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} + + def delete( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Deletes a storage account in Microsoft Azure. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} + + def get_properties( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Returns the properties for the specified storage account including but + not limited to name, SKU name, location, and account status. The + ListKeys operation should be used to retrieve storage keys. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: StorageAccount or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_02_01.models.StorageAccount or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_properties.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('StorageAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} + + def update( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + """The update operation can be used to update the SKU, encryption, access + tier, or tags for a storage account. It can also be used to map the + account to a custom domain. Only one custom domain is supported per + storage account; the replacement/change of custom domain is not + supported. In order to replace an old custom domain, the old value must + be cleared/unregistered before a new value can be set. The update of + multiple properties is supported. This call does not change the storage + keys for the account. If you want to change the storage account keys, + use the regenerate keys operation. The location and name of the storage + account cannot be changed after creation. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide for the updated account. + :type parameters: + ~azure.mgmt.storage.v2018_02_01.models.StorageAccountUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: StorageAccount or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_02_01.models.StorageAccount or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'StorageAccountUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('StorageAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all the storage accounts available under the subscription. Note + that storage keys are not returned; use the ListKeys operation for + this. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of StorageAccount + :rtype: + ~azure.mgmt.storage.v2018_02_01.models.StorageAccountPaged[~azure.mgmt.storage.v2018_02_01.models.StorageAccount] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.StorageAccountPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.StorageAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Lists all the storage accounts available under the given resource + group. Note that storage keys are not returned; use the ListKeys + operation for this. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of StorageAccount + :rtype: + ~azure.mgmt.storage.v2018_02_01.models.StorageAccountPaged[~azure.mgmt.storage.v2018_02_01.models.StorageAccount] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.StorageAccountPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.StorageAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts'} + + def list_keys( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Lists the access keys for the specified storage account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: StorageAccountListKeysResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2018_02_01.models.StorageAccountListKeysResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_keys.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('StorageAccountListKeysResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys'} + + def regenerate_key( + self, resource_group_name, account_name, key_name, custom_headers=None, raw=False, **operation_config): + """Regenerates one of the access keys for the specified storage account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param key_name: The name of storage keys that want to be regenerated, + possible vaules are key1, key2. + :type key_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: StorageAccountListKeysResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2018_02_01.models.StorageAccountListKeysResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + regenerate_key1 = models.StorageAccountRegenerateKeyParameters(key_name=key_name) + + # Construct URL + url = self.regenerate_key.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(regenerate_key1, 'StorageAccountRegenerateKeyParameters') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('StorageAccountListKeysResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey'} + + def list_account_sas( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + """List SAS credentials of a storage account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide to list SAS credentials + for the storage account. + :type parameters: + ~azure.mgmt.storage.v2018_02_01.models.AccountSasParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ListAccountSasResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_02_01.models.ListAccountSasResponse + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_account_sas.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'AccountSasParameters') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ListAccountSasResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_account_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas'} + + def list_service_sas( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + """List service SAS credentials of a specific resource. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide to list service SAS + credentials. + :type parameters: + ~azure.mgmt.storage.v2018_02_01.models.ServiceSasParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ListServiceSasResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_02_01.models.ListServiceSasResponse + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_service_sas.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ServiceSasParameters') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ListServiceSasResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_service_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas'} diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/usage_operations.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/usage_operations.py new file mode 100644 index 000000000000..edbb101b587f --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/usage_operations.py @@ -0,0 +1,104 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class UsageOperations(object): + """UsageOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2018-02-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-02-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Gets the current usage count and the limit for the resources under the + subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Usage + :rtype: + ~azure.mgmt.storage.v2018_02_01.models.UsagePaged[~azure.mgmt.storage.v2018_02_01.models.Usage] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.UsagePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.UsagePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages'} diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/storage_management_client.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/storage_management_client.py new file mode 100644 index 000000000000..a70542395629 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/storage_management_client.py @@ -0,0 +1,101 @@ +# 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 msrest.service_client import SDKClient +from msrest import Serializer, Deserializer +from msrestazure import AzureConfiguration +from .version import VERSION +from .operations.operations import Operations +from .operations.skus_operations import SkusOperations +from .operations.storage_accounts_operations import StorageAccountsOperations +from .operations.usage_operations import UsageOperations +from .operations.blob_containers_operations import BlobContainersOperations +from . import models + + +class StorageManagementClientConfiguration(AzureConfiguration): + """Configuration for StorageManagementClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(StorageManagementClientConfiguration, self).__init__(base_url) + + self.add_user_agent('azure-mgmt-storage/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id + + +class StorageManagementClient(SDKClient): + """The Azure Storage Management API. + + :ivar config: Configuration for client. + :vartype config: StorageManagementClientConfiguration + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.storage.v2018_02_01.operations.Operations + :ivar skus: Skus operations + :vartype skus: azure.mgmt.storage.v2018_02_01.operations.SkusOperations + :ivar storage_accounts: StorageAccounts operations + :vartype storage_accounts: azure.mgmt.storage.v2018_02_01.operations.StorageAccountsOperations + :ivar usage: Usage operations + :vartype usage: azure.mgmt.storage.v2018_02_01.operations.UsageOperations + :ivar blob_containers: BlobContainers operations + :vartype blob_containers: azure.mgmt.storage.v2018_02_01.operations.BlobContainersOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = StorageManagementClientConfiguration(credentials, subscription_id, base_url) + super(StorageManagementClient, self).__init__(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '2018-02-01' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) + self.skus = SkusOperations( + self._client, self.config, self._serialize, self._deserialize) + self.storage_accounts = StorageAccountsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.usage = UsageOperations( + self._client, self.config, self._serialize, self._deserialize) + self.blob_containers = BlobContainersOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/version.py b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/version.py new file mode 100644 index 000000000000..848a6c9f9e92 --- /dev/null +++ b/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/version.py @@ -0,0 +1,13 @@ +# 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. +# -------------------------------------------------------------------------- + +VERSION = "2018-02-01" + diff --git a/azure-mgmt-web/azure/mgmt/web/models/__init__.py b/azure-mgmt-web/azure/mgmt/web/models/__init__.py index a50f89c31cf9..3e8d506ff635 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/__init__.py +++ b/azure-mgmt-web/azure/mgmt/web/models/__init__.py @@ -9,208 +9,434 @@ # regenerated. # -------------------------------------------------------------------------- -from .app_service_certificate import AppServiceCertificate -from .app_service_certificate_resource import AppServiceCertificateResource -from .certificate_details import CertificateDetails -from .app_service_certificate_order import AppServiceCertificateOrder -from .app_service_certificate_order_patch_resource import AppServiceCertificateOrderPatchResource -from .app_service_certificate_patch_resource import AppServiceCertificatePatchResource -from .certificate_email import CertificateEmail -from .certificate_order_action import CertificateOrderAction -from .reissue_certificate_order_request import ReissueCertificateOrderRequest -from .renew_certificate_order_request import RenewCertificateOrderRequest -from .site_seal import SiteSeal -from .site_seal_request import SiteSealRequest -from .vnet_route import VnetRoute -from .vnet_info import VnetInfo -from .vnet_gateway import VnetGateway -from .user import User -from .snapshot_recovery_target import SnapshotRecoveryTarget -from .snapshot_recovery_request import SnapshotRecoveryRequest -from .resource_metric_availability import ResourceMetricAvailability -from .resource_metric_name import ResourceMetricName -from .resource_metric_definition import ResourceMetricDefinition -from .push_settings import PushSettings -from .identifier import Identifier -from .hybrid_connection_key import HybridConnectionKey -from .hybrid_connection import HybridConnection -from .proxy_only_resource import ProxyOnlyResource -from .managed_service_identity import ManagedServiceIdentity -from .slot_swap_status import SlotSwapStatus -from .cloning_info import CloningInfo -from .hosting_environment_profile import HostingEnvironmentProfile -from .ip_security_restriction import IpSecurityRestriction -from .api_definition_info import ApiDefinitionInfo -from .cors_settings import CorsSettings -from .auto_heal_custom_action import AutoHealCustomAction -from .auto_heal_actions import AutoHealActions -from .slow_requests_based_trigger import SlowRequestsBasedTrigger -from .status_codes_based_trigger import StatusCodesBasedTrigger -from .requests_based_trigger import RequestsBasedTrigger -from .auto_heal_triggers import AutoHealTriggers -from .auto_heal_rules import AutoHealRules -from .site_limits import SiteLimits -from .ramp_up_rule import RampUpRule -from .experiments import Experiments -from .virtual_directory import VirtualDirectory -from .virtual_application import VirtualApplication -from .handler_mapping import HandlerMapping -from .site_machine_key import SiteMachineKey -from .conn_string_info import ConnStringInfo -from .name_value_pair import NameValuePair -from .site_config import SiteConfig -from .host_name_ssl_state import HostNameSslState -from .site import Site -from .capability import Capability -from .sku_capacity import SkuCapacity -from .sku_description import SkuDescription -from .app_service_plan import AppServicePlan -from .resource import Resource -from .name_identifier import NameIdentifier -from .metric_availability import MetricAvailability -from .dimension import Dimension -from .metric_specification import MetricSpecification -from .service_specification import ServiceSpecification -from .csm_operation_description_properties import CsmOperationDescriptionProperties -from .csm_operation_display import CsmOperationDisplay -from .csm_operation_description import CsmOperationDescription -from .address import Address -from .contact import Contact -from .host_name import HostName -from .domain_purchase_consent import DomainPurchaseConsent -from .domain import Domain -from .domain_availablility_check_result import DomainAvailablilityCheckResult -from .domain_control_center_sso_request import DomainControlCenterSsoRequest -from .domain_ownership_identifier import DomainOwnershipIdentifier -from .domain_patch_resource import DomainPatchResource -from .domain_recommendation_search_parameters import DomainRecommendationSearchParameters -from .error_response import ErrorResponse, ErrorResponseException -from .tld_legal_agreement import TldLegalAgreement -from .top_level_domain import TopLevelDomain -from .top_level_domain_agreement_option import TopLevelDomainAgreementOption -from .certificate import Certificate -from .certificate_patch_resource import CertificatePatchResource -from .virtual_network_profile import VirtualNetworkProfile -from .worker_pool import WorkerPool -from .virtual_ip_mapping import VirtualIPMapping -from .stamp_capacity import StampCapacity -from .network_access_control_entry import NetworkAccessControlEntry -from .app_service_environment import AppServiceEnvironment -from .localizable_string import LocalizableString -from .csm_usage_quota import CsmUsageQuota -from .error_entity import ErrorEntity -from .operation import Operation -from .resource_metric_property import ResourceMetricProperty -from .resource_metric_value import ResourceMetricValue -from .resource_metric import ResourceMetric -from .web_app_collection import WebAppCollection -from .deleted_site import DeletedSite -from .solution import Solution -from .detector_abnormal_time_period import DetectorAbnormalTimePeriod -from .abnormal_time_period import AbnormalTimePeriod -from .detector_definition import DetectorDefinition -from .diagnostic_metric_sample import DiagnosticMetricSample -from .diagnostic_metric_set import DiagnosticMetricSet -from .data_source import DataSource -from .response_meta_data import ResponseMetaData -from .analysis_data import AnalysisData -from .analysis_definition import AnalysisDefinition -from .diagnostic_analysis import DiagnosticAnalysis -from .diagnostic_category import DiagnosticCategory -from .diagnostic_detector_response import DiagnosticDetectorResponse -from .stack_minor_version import StackMinorVersion -from .stack_major_version import StackMajorVersion -from .application_stack import ApplicationStack -from .recommendation import Recommendation -from .recommendation_rule import RecommendationRule -from .csm_move_resource_envelope import CsmMoveResourceEnvelope -from .geo_region import GeoRegion -from .hosting_environment_deployment_info import HostingEnvironmentDeploymentInfo -from .deployment_locations import DeploymentLocations -from .global_csm_sku_description import GlobalCsmSkuDescription -from .premier_add_on_offer import PremierAddOnOffer -from .resource_name_availability import ResourceNameAvailability -from .resource_name_availability_request import ResourceNameAvailabilityRequest -from .sku_infos import SkuInfos -from .source_control import SourceControl -from .validate_request import ValidateRequest -from .validate_response_error import ValidateResponseError -from .validate_response import ValidateResponse -from .vnet_parameters import VnetParameters -from .vnet_validation_test_failure import VnetValidationTestFailure -from .vnet_validation_failure_details import VnetValidationFailureDetails -from .file_system_application_logs_config import FileSystemApplicationLogsConfig -from .azure_table_storage_application_logs_config import AzureTableStorageApplicationLogsConfig -from .azure_blob_storage_application_logs_config import AzureBlobStorageApplicationLogsConfig -from .application_logs_config import ApplicationLogsConfig -from .azure_blob_storage_http_logs_config import AzureBlobStorageHttpLogsConfig -from .database_backup_setting import DatabaseBackupSetting -from .backup_item import BackupItem -from .backup_schedule import BackupSchedule -from .backup_request import BackupRequest -from .conn_string_value_type_pair import ConnStringValueTypePair -from .connection_string_dictionary import ConnectionStringDictionary -from .continuous_web_job import ContinuousWebJob -from .csm_publishing_profile_options import CsmPublishingProfileOptions -from .csm_slot_entity import CsmSlotEntity -from .custom_hostname_analysis_result import CustomHostnameAnalysisResult -from .deployment import Deployment -from .enabled_config import EnabledConfig -from .file_system_http_logs_config import FileSystemHttpLogsConfig -from .function_envelope import FunctionEnvelope -from .function_secrets import FunctionSecrets -from .host_name_binding import HostNameBinding -from .http_logs_config import HttpLogsConfig -from .ms_deploy import MSDeploy -from .ms_deploy_log_entry import MSDeployLogEntry -from .ms_deploy_log import MSDeployLog -from .ms_deploy_status import MSDeployStatus -from .migrate_my_sql_request import MigrateMySqlRequest -from .migrate_my_sql_status import MigrateMySqlStatus -from .relay_service_connection_entity import RelayServiceConnectionEntity -from .network_features import NetworkFeatures -from .perf_mon_sample import PerfMonSample -from .perf_mon_set import PerfMonSet -from .perf_mon_response import PerfMonResponse -from .premier_add_on import PremierAddOn -from .process_thread_info import ProcessThreadInfo -from .process_module_info import ProcessModuleInfo -from .process_info import ProcessInfo -from .public_certificate import PublicCertificate -from .restore_request import RestoreRequest -from .restore_response import RestoreResponse -from .site_auth_settings import SiteAuthSettings -from .site_cloneability_criterion import SiteCloneabilityCriterion -from .site_cloneability import SiteCloneability -from .site_config_resource import SiteConfigResource -from .site_configuration_snapshot_info import SiteConfigurationSnapshotInfo -from .site_extension_info import SiteExtensionInfo -from .site_instance import SiteInstance -from .site_logs_config import SiteLogsConfig -from .site_patch_resource import SitePatchResource -from .site_php_error_log_flag import SitePhpErrorLogFlag -from .site_source_control import SiteSourceControl -from .slot_config_names_resource import SlotConfigNamesResource -from .slot_difference import SlotDifference -from .snapshot import Snapshot -from .storage_migration_options import StorageMigrationOptions -from .storage_migration_response import StorageMigrationResponse -from .string_dictionary import StringDictionary -from .triggered_job_run import TriggeredJobRun -from .triggered_job_history import TriggeredJobHistory -from .triggered_web_job import TriggeredWebJob -from .web_job import WebJob -from .address_response import AddressResponse -from .app_service_environment_resource import AppServiceEnvironmentResource -from .app_service_environment_patch_resource import AppServiceEnvironmentPatchResource -from .hosting_environment_diagnostics import HostingEnvironmentDiagnostics -from .metric_availabilily import MetricAvailabilily -from .metric_definition import MetricDefinition -from .sku_info import SkuInfo -from .usage import Usage -from .worker_pool_resource import WorkerPoolResource -from .app_service_plan_patch_resource import AppServicePlanPatchResource -from .hybrid_connection_limits import HybridConnectionLimits +try: + from .app_service_certificate_py3 import AppServiceCertificate + from .app_service_certificate_resource_py3 import AppServiceCertificateResource + from .certificate_details_py3 import CertificateDetails + from .app_service_certificate_order_py3 import AppServiceCertificateOrder + from .app_service_certificate_order_patch_resource_py3 import AppServiceCertificateOrderPatchResource + from .app_service_certificate_patch_resource_py3 import AppServiceCertificatePatchResource + from .certificate_email_py3 import CertificateEmail + from .certificate_order_action_py3 import CertificateOrderAction + from .reissue_certificate_order_request_py3 import ReissueCertificateOrderRequest + from .renew_certificate_order_request_py3 import RenewCertificateOrderRequest + from .site_seal_py3 import SiteSeal + from .site_seal_request_py3 import SiteSealRequest + from .vnet_route_py3 import VnetRoute + from .vnet_info_py3 import VnetInfo + from .vnet_gateway_py3 import VnetGateway + from .user_py3 import User + from .snapshot_recovery_target_py3 import SnapshotRecoveryTarget + from .snapshot_recovery_request_py3 import SnapshotRecoveryRequest + from .resource_metric_availability_py3 import ResourceMetricAvailability + from .resource_metric_name_py3 import ResourceMetricName + from .resource_metric_definition_py3 import ResourceMetricDefinition + from .push_settings_py3 import PushSettings + from .identifier_py3 import Identifier + from .hybrid_connection_key_py3 import HybridConnectionKey + from .hybrid_connection_py3 import HybridConnection + from .proxy_only_resource_py3 import ProxyOnlyResource + from .managed_service_identity_py3 import ManagedServiceIdentity + from .slot_swap_status_py3 import SlotSwapStatus + from .cloning_info_py3 import CloningInfo + from .hosting_environment_profile_py3 import HostingEnvironmentProfile + from .ip_security_restriction_py3 import IpSecurityRestriction + from .api_definition_info_py3 import ApiDefinitionInfo + from .cors_settings_py3 import CorsSettings + from .auto_heal_custom_action_py3 import AutoHealCustomAction + from .auto_heal_actions_py3 import AutoHealActions + from .slow_requests_based_trigger_py3 import SlowRequestsBasedTrigger + from .status_codes_based_trigger_py3 import StatusCodesBasedTrigger + from .requests_based_trigger_py3 import RequestsBasedTrigger + from .auto_heal_triggers_py3 import AutoHealTriggers + from .auto_heal_rules_py3 import AutoHealRules + from .site_limits_py3 import SiteLimits + from .ramp_up_rule_py3 import RampUpRule + from .experiments_py3 import Experiments + from .virtual_directory_py3 import VirtualDirectory + from .virtual_application_py3 import VirtualApplication + from .handler_mapping_py3 import HandlerMapping + from .site_machine_key_py3 import SiteMachineKey + from .conn_string_info_py3 import ConnStringInfo + from .name_value_pair_py3 import NameValuePair + from .site_config_py3 import SiteConfig + from .host_name_ssl_state_py3 import HostNameSslState + from .site_py3 import Site + from .capability_py3 import Capability + from .sku_capacity_py3 import SkuCapacity + from .sku_description_py3 import SkuDescription + from .app_service_plan_py3 import AppServicePlan + from .resource_py3 import Resource + from .name_identifier_py3 import NameIdentifier + from .metric_availability_py3 import MetricAvailability + from .dimension_py3 import Dimension + from .metric_specification_py3 import MetricSpecification + from .service_specification_py3 import ServiceSpecification + from .csm_operation_description_properties_py3 import CsmOperationDescriptionProperties + from .csm_operation_display_py3 import CsmOperationDisplay + from .csm_operation_description_py3 import CsmOperationDescription + from .address_py3 import Address + from .contact_py3 import Contact + from .host_name_py3 import HostName + from .domain_purchase_consent_py3 import DomainPurchaseConsent + from .domain_py3 import Domain + from .domain_availablility_check_result_py3 import DomainAvailablilityCheckResult + from .domain_control_center_sso_request_py3 import DomainControlCenterSsoRequest + from .domain_ownership_identifier_py3 import DomainOwnershipIdentifier + from .domain_patch_resource_py3 import DomainPatchResource + from .domain_recommendation_search_parameters_py3 import DomainRecommendationSearchParameters + from .error_response_py3 import ErrorResponse, ErrorResponseException + from .tld_legal_agreement_py3 import TldLegalAgreement + from .top_level_domain_py3 import TopLevelDomain + from .top_level_domain_agreement_option_py3 import TopLevelDomainAgreementOption + from .certificate_py3 import Certificate + from .certificate_patch_resource_py3 import CertificatePatchResource + from .virtual_network_profile_py3 import VirtualNetworkProfile + from .worker_pool_py3 import WorkerPool + from .virtual_ip_mapping_py3 import VirtualIPMapping + from .stamp_capacity_py3 import StampCapacity + from .network_access_control_entry_py3 import NetworkAccessControlEntry + from .app_service_environment_py3 import AppServiceEnvironment + from .localizable_string_py3 import LocalizableString + from .csm_usage_quota_py3 import CsmUsageQuota + from .error_entity_py3 import ErrorEntity + from .default_error_response_error_details_item_py3 import DefaultErrorResponseErrorDetailsItem + from .default_error_response_error_py3 import DefaultErrorResponseError + from .default_error_response_py3 import DefaultErrorResponse, DefaultErrorResponseException + from .operation_py3 import Operation + from .resource_metric_property_py3 import ResourceMetricProperty + from .resource_metric_value_py3 import ResourceMetricValue + from .resource_metric_py3 import ResourceMetric + from .web_app_collection_py3 import WebAppCollection + from .deleted_site_py3 import DeletedSite + from .solution_py3 import Solution + from .detector_abnormal_time_period_py3 import DetectorAbnormalTimePeriod + from .abnormal_time_period_py3 import AbnormalTimePeriod + from .detector_definition_py3 import DetectorDefinition + from .diagnostic_metric_sample_py3 import DiagnosticMetricSample + from .diagnostic_metric_set_py3 import DiagnosticMetricSet + from .data_source_py3 import DataSource + from .response_meta_data_py3 import ResponseMetaData + from .analysis_data_py3 import AnalysisData + from .analysis_definition_py3 import AnalysisDefinition + from .data_table_response_column_py3 import DataTableResponseColumn + from .data_table_response_object_py3 import DataTableResponseObject + from .detector_info_py3 import DetectorInfo + from .rendering_py3 import Rendering + from .diagnostic_data_py3 import DiagnosticData + from .detector_response_py3 import DetectorResponse + from .diagnostic_analysis_py3 import DiagnosticAnalysis + from .diagnostic_category_py3 import DiagnosticCategory + from .diagnostic_detector_response_py3 import DiagnosticDetectorResponse + from .stack_minor_version_py3 import StackMinorVersion + from .stack_major_version_py3 import StackMajorVersion + from .application_stack_py3 import ApplicationStack + from .recommendation_py3 import Recommendation + from .recommendation_rule_py3 import RecommendationRule + from .resource_health_metadata_py3 import ResourceHealthMetadata + from .billing_meter_py3 import BillingMeter + from .csm_move_resource_envelope_py3 import CsmMoveResourceEnvelope + from .geo_region_py3 import GeoRegion + from .hosting_environment_deployment_info_py3 import HostingEnvironmentDeploymentInfo + from .deployment_locations_py3 import DeploymentLocations + from .global_csm_sku_description_py3 import GlobalCsmSkuDescription + from .premier_add_on_offer_py3 import PremierAddOnOffer + from .resource_name_availability_py3 import ResourceNameAvailability + from .resource_name_availability_request_py3 import ResourceNameAvailabilityRequest + from .sku_infos_py3 import SkuInfos + from .source_control_py3 import SourceControl + from .validate_request_py3 import ValidateRequest + from .validate_response_error_py3 import ValidateResponseError + from .validate_response_py3 import ValidateResponse + from .vnet_parameters_py3 import VnetParameters + from .vnet_validation_test_failure_py3 import VnetValidationTestFailure + from .vnet_validation_failure_details_py3 import VnetValidationFailureDetails + from .file_system_application_logs_config_py3 import FileSystemApplicationLogsConfig + from .azure_table_storage_application_logs_config_py3 import AzureTableStorageApplicationLogsConfig + from .azure_blob_storage_application_logs_config_py3 import AzureBlobStorageApplicationLogsConfig + from .application_logs_config_py3 import ApplicationLogsConfig + from .azure_blob_storage_http_logs_config_py3 import AzureBlobStorageHttpLogsConfig + from .database_backup_setting_py3 import DatabaseBackupSetting + from .backup_item_py3 import BackupItem + from .backup_schedule_py3 import BackupSchedule + from .backup_request_py3 import BackupRequest + from .conn_string_value_type_pair_py3 import ConnStringValueTypePair + from .connection_string_dictionary_py3 import ConnectionStringDictionary + from .continuous_web_job_py3 import ContinuousWebJob + from .csm_publishing_profile_options_py3 import CsmPublishingProfileOptions + from .csm_slot_entity_py3 import CsmSlotEntity + from .custom_hostname_analysis_result_py3 import CustomHostnameAnalysisResult + from .deployment_py3 import Deployment + from .enabled_config_py3 import EnabledConfig + from .file_system_http_logs_config_py3 import FileSystemHttpLogsConfig + from .function_envelope_py3 import FunctionEnvelope + from .function_secrets_py3 import FunctionSecrets + from .host_name_binding_py3 import HostNameBinding + from .http_logs_config_py3 import HttpLogsConfig + from .ms_deploy_py3 import MSDeploy + from .ms_deploy_log_entry_py3 import MSDeployLogEntry + from .ms_deploy_log_py3 import MSDeployLog + from .ms_deploy_status_py3 import MSDeployStatus + from .migrate_my_sql_request_py3 import MigrateMySqlRequest + from .migrate_my_sql_status_py3 import MigrateMySqlStatus + from .relay_service_connection_entity_py3 import RelayServiceConnectionEntity + from .network_features_py3 import NetworkFeatures + from .perf_mon_sample_py3 import PerfMonSample + from .perf_mon_set_py3 import PerfMonSet + from .perf_mon_response_py3 import PerfMonResponse + from .premier_add_on_py3 import PremierAddOn + from .process_thread_info_py3 import ProcessThreadInfo + from .process_module_info_py3 import ProcessModuleInfo + from .process_info_py3 import ProcessInfo + from .public_certificate_py3 import PublicCertificate + from .restore_request_py3 import RestoreRequest + from .restore_response_py3 import RestoreResponse + from .site_auth_settings_py3 import SiteAuthSettings + from .site_cloneability_criterion_py3 import SiteCloneabilityCriterion + from .site_cloneability_py3 import SiteCloneability + from .site_config_resource_py3 import SiteConfigResource + from .site_configuration_snapshot_info_py3 import SiteConfigurationSnapshotInfo + from .site_extension_info_py3 import SiteExtensionInfo + from .site_instance_py3 import SiteInstance + from .site_logs_config_py3 import SiteLogsConfig + from .site_patch_resource_py3 import SitePatchResource + from .site_php_error_log_flag_py3 import SitePhpErrorLogFlag + from .site_source_control_py3 import SiteSourceControl + from .slot_config_names_resource_py3 import SlotConfigNamesResource + from .slot_difference_py3 import SlotDifference + from .snapshot_py3 import Snapshot + from .storage_migration_options_py3 import StorageMigrationOptions + from .storage_migration_response_py3 import StorageMigrationResponse + from .string_dictionary_py3 import StringDictionary + from .triggered_job_run_py3 import TriggeredJobRun + from .triggered_job_history_py3 import TriggeredJobHistory + from .triggered_web_job_py3 import TriggeredWebJob + from .web_job_py3 import WebJob + from .address_response_py3 import AddressResponse + from .app_service_environment_resource_py3 import AppServiceEnvironmentResource + from .app_service_environment_patch_resource_py3 import AppServiceEnvironmentPatchResource + from .hosting_environment_diagnostics_py3 import HostingEnvironmentDiagnostics + from .metric_availabilily_py3 import MetricAvailabilily + from .metric_definition_py3 import MetricDefinition + from .sku_info_py3 import SkuInfo + from .usage_py3 import Usage + from .worker_pool_resource_py3 import WorkerPoolResource + from .app_service_plan_patch_resource_py3 import AppServicePlanPatchResource + from .hybrid_connection_limits_py3 import HybridConnectionLimits +except (SyntaxError, ImportError): + from .app_service_certificate import AppServiceCertificate + from .app_service_certificate_resource import AppServiceCertificateResource + from .certificate_details import CertificateDetails + from .app_service_certificate_order import AppServiceCertificateOrder + from .app_service_certificate_order_patch_resource import AppServiceCertificateOrderPatchResource + from .app_service_certificate_patch_resource import AppServiceCertificatePatchResource + from .certificate_email import CertificateEmail + from .certificate_order_action import CertificateOrderAction + from .reissue_certificate_order_request import ReissueCertificateOrderRequest + from .renew_certificate_order_request import RenewCertificateOrderRequest + from .site_seal import SiteSeal + from .site_seal_request import SiteSealRequest + from .vnet_route import VnetRoute + from .vnet_info import VnetInfo + from .vnet_gateway import VnetGateway + from .user import User + from .snapshot_recovery_target import SnapshotRecoveryTarget + from .snapshot_recovery_request import SnapshotRecoveryRequest + from .resource_metric_availability import ResourceMetricAvailability + from .resource_metric_name import ResourceMetricName + from .resource_metric_definition import ResourceMetricDefinition + from .push_settings import PushSettings + from .identifier import Identifier + from .hybrid_connection_key import HybridConnectionKey + from .hybrid_connection import HybridConnection + from .proxy_only_resource import ProxyOnlyResource + from .managed_service_identity import ManagedServiceIdentity + from .slot_swap_status import SlotSwapStatus + from .cloning_info import CloningInfo + from .hosting_environment_profile import HostingEnvironmentProfile + from .ip_security_restriction import IpSecurityRestriction + from .api_definition_info import ApiDefinitionInfo + from .cors_settings import CorsSettings + from .auto_heal_custom_action import AutoHealCustomAction + from .auto_heal_actions import AutoHealActions + from .slow_requests_based_trigger import SlowRequestsBasedTrigger + from .status_codes_based_trigger import StatusCodesBasedTrigger + from .requests_based_trigger import RequestsBasedTrigger + from .auto_heal_triggers import AutoHealTriggers + from .auto_heal_rules import AutoHealRules + from .site_limits import SiteLimits + from .ramp_up_rule import RampUpRule + from .experiments import Experiments + from .virtual_directory import VirtualDirectory + from .virtual_application import VirtualApplication + from .handler_mapping import HandlerMapping + from .site_machine_key import SiteMachineKey + from .conn_string_info import ConnStringInfo + from .name_value_pair import NameValuePair + from .site_config import SiteConfig + from .host_name_ssl_state import HostNameSslState + from .site import Site + from .capability import Capability + from .sku_capacity import SkuCapacity + from .sku_description import SkuDescription + from .app_service_plan import AppServicePlan + from .resource import Resource + from .name_identifier import NameIdentifier + from .metric_availability import MetricAvailability + from .dimension import Dimension + from .metric_specification import MetricSpecification + from .service_specification import ServiceSpecification + from .csm_operation_description_properties import CsmOperationDescriptionProperties + from .csm_operation_display import CsmOperationDisplay + from .csm_operation_description import CsmOperationDescription + from .address import Address + from .contact import Contact + from .host_name import HostName + from .domain_purchase_consent import DomainPurchaseConsent + from .domain import Domain + from .domain_availablility_check_result import DomainAvailablilityCheckResult + from .domain_control_center_sso_request import DomainControlCenterSsoRequest + from .domain_ownership_identifier import DomainOwnershipIdentifier + from .domain_patch_resource import DomainPatchResource + from .domain_recommendation_search_parameters import DomainRecommendationSearchParameters + from .error_response import ErrorResponse, ErrorResponseException + from .tld_legal_agreement import TldLegalAgreement + from .top_level_domain import TopLevelDomain + from .top_level_domain_agreement_option import TopLevelDomainAgreementOption + from .certificate import Certificate + from .certificate_patch_resource import CertificatePatchResource + from .virtual_network_profile import VirtualNetworkProfile + from .worker_pool import WorkerPool + from .virtual_ip_mapping import VirtualIPMapping + from .stamp_capacity import StampCapacity + from .network_access_control_entry import NetworkAccessControlEntry + from .app_service_environment import AppServiceEnvironment + from .localizable_string import LocalizableString + from .csm_usage_quota import CsmUsageQuota + from .error_entity import ErrorEntity + from .default_error_response_error_details_item import DefaultErrorResponseErrorDetailsItem + from .default_error_response_error import DefaultErrorResponseError + from .default_error_response import DefaultErrorResponse, DefaultErrorResponseException + from .operation import Operation + from .resource_metric_property import ResourceMetricProperty + from .resource_metric_value import ResourceMetricValue + from .resource_metric import ResourceMetric + from .web_app_collection import WebAppCollection + from .deleted_site import DeletedSite + from .solution import Solution + from .detector_abnormal_time_period import DetectorAbnormalTimePeriod + from .abnormal_time_period import AbnormalTimePeriod + from .detector_definition import DetectorDefinition + from .diagnostic_metric_sample import DiagnosticMetricSample + from .diagnostic_metric_set import DiagnosticMetricSet + from .data_source import DataSource + from .response_meta_data import ResponseMetaData + from .analysis_data import AnalysisData + from .analysis_definition import AnalysisDefinition + from .data_table_response_column import DataTableResponseColumn + from .data_table_response_object import DataTableResponseObject + from .detector_info import DetectorInfo + from .rendering import Rendering + from .diagnostic_data import DiagnosticData + from .detector_response import DetectorResponse + from .diagnostic_analysis import DiagnosticAnalysis + from .diagnostic_category import DiagnosticCategory + from .diagnostic_detector_response import DiagnosticDetectorResponse + from .stack_minor_version import StackMinorVersion + from .stack_major_version import StackMajorVersion + from .application_stack import ApplicationStack + from .recommendation import Recommendation + from .recommendation_rule import RecommendationRule + from .resource_health_metadata import ResourceHealthMetadata + from .billing_meter import BillingMeter + from .csm_move_resource_envelope import CsmMoveResourceEnvelope + from .geo_region import GeoRegion + from .hosting_environment_deployment_info import HostingEnvironmentDeploymentInfo + from .deployment_locations import DeploymentLocations + from .global_csm_sku_description import GlobalCsmSkuDescription + from .premier_add_on_offer import PremierAddOnOffer + from .resource_name_availability import ResourceNameAvailability + from .resource_name_availability_request import ResourceNameAvailabilityRequest + from .sku_infos import SkuInfos + from .source_control import SourceControl + from .validate_request import ValidateRequest + from .validate_response_error import ValidateResponseError + from .validate_response import ValidateResponse + from .vnet_parameters import VnetParameters + from .vnet_validation_test_failure import VnetValidationTestFailure + from .vnet_validation_failure_details import VnetValidationFailureDetails + from .file_system_application_logs_config import FileSystemApplicationLogsConfig + from .azure_table_storage_application_logs_config import AzureTableStorageApplicationLogsConfig + from .azure_blob_storage_application_logs_config import AzureBlobStorageApplicationLogsConfig + from .application_logs_config import ApplicationLogsConfig + from .azure_blob_storage_http_logs_config import AzureBlobStorageHttpLogsConfig + from .database_backup_setting import DatabaseBackupSetting + from .backup_item import BackupItem + from .backup_schedule import BackupSchedule + from .backup_request import BackupRequest + from .conn_string_value_type_pair import ConnStringValueTypePair + from .connection_string_dictionary import ConnectionStringDictionary + from .continuous_web_job import ContinuousWebJob + from .csm_publishing_profile_options import CsmPublishingProfileOptions + from .csm_slot_entity import CsmSlotEntity + from .custom_hostname_analysis_result import CustomHostnameAnalysisResult + from .deployment import Deployment + from .enabled_config import EnabledConfig + from .file_system_http_logs_config import FileSystemHttpLogsConfig + from .function_envelope import FunctionEnvelope + from .function_secrets import FunctionSecrets + from .host_name_binding import HostNameBinding + from .http_logs_config import HttpLogsConfig + from .ms_deploy import MSDeploy + from .ms_deploy_log_entry import MSDeployLogEntry + from .ms_deploy_log import MSDeployLog + from .ms_deploy_status import MSDeployStatus + from .migrate_my_sql_request import MigrateMySqlRequest + from .migrate_my_sql_status import MigrateMySqlStatus + from .relay_service_connection_entity import RelayServiceConnectionEntity + from .network_features import NetworkFeatures + from .perf_mon_sample import PerfMonSample + from .perf_mon_set import PerfMonSet + from .perf_mon_response import PerfMonResponse + from .premier_add_on import PremierAddOn + from .process_thread_info import ProcessThreadInfo + from .process_module_info import ProcessModuleInfo + from .process_info import ProcessInfo + from .public_certificate import PublicCertificate + from .restore_request import RestoreRequest + from .restore_response import RestoreResponse + from .site_auth_settings import SiteAuthSettings + from .site_cloneability_criterion import SiteCloneabilityCriterion + from .site_cloneability import SiteCloneability + from .site_config_resource import SiteConfigResource + from .site_configuration_snapshot_info import SiteConfigurationSnapshotInfo + from .site_extension_info import SiteExtensionInfo + from .site_instance import SiteInstance + from .site_logs_config import SiteLogsConfig + from .site_patch_resource import SitePatchResource + from .site_php_error_log_flag import SitePhpErrorLogFlag + from .site_source_control import SiteSourceControl + from .slot_config_names_resource import SlotConfigNamesResource + from .slot_difference import SlotDifference + from .snapshot import Snapshot + from .storage_migration_options import StorageMigrationOptions + from .storage_migration_response import StorageMigrationResponse + from .string_dictionary import StringDictionary + from .triggered_job_run import TriggeredJobRun + from .triggered_job_history import TriggeredJobHistory + from .triggered_web_job import TriggeredWebJob + from .web_job import WebJob + from .address_response import AddressResponse + from .app_service_environment_resource import AppServiceEnvironmentResource + from .app_service_environment_patch_resource import AppServiceEnvironmentPatchResource + from .hosting_environment_diagnostics import HostingEnvironmentDiagnostics + from .metric_availabilily import MetricAvailabilily + from .metric_definition import MetricDefinition + from .sku_info import SkuInfo + from .usage import Usage + from .worker_pool_resource import WorkerPoolResource + from .app_service_plan_patch_resource import AppServicePlanPatchResource + from .hybrid_connection_limits import HybridConnectionLimits from .app_service_certificate_order_paged import AppServiceCertificateOrderPaged from .app_service_certificate_resource_paged import AppServiceCertificateResourcePaged from .csm_operation_description_paged import CsmOperationDescriptionPaged @@ -221,14 +447,18 @@ from .tld_legal_agreement_paged import TldLegalAgreementPaged from .certificate_paged import CertificatePaged from .deleted_site_paged import DeletedSitePaged +from .detector_response_paged import DetectorResponsePaged from .diagnostic_category_paged import DiagnosticCategoryPaged from .analysis_definition_paged import AnalysisDefinitionPaged from .detector_definition_paged import DetectorDefinitionPaged from .application_stack_paged import ApplicationStackPaged +from .recommendation_paged import RecommendationPaged +from .resource_health_metadata_paged import ResourceHealthMetadataPaged from .source_control_paged import SourceControlPaged from .geo_region_paged import GeoRegionPaged from .identifier_paged import IdentifierPaged from .premier_add_on_offer_paged import PremierAddOnOfferPaged +from .billing_meter_paged import BillingMeterPaged from .site_paged import SitePaged from .backup_item_paged import BackupItemPaged from .site_config_resource_paged import SiteConfigResourcePaged @@ -267,6 +497,7 @@ CertificateOrderStatus, CertificateOrderActionType, RouteType, + ManagedServiceIdentityType, AutoHealActionType, ConnectionStringType, ScmType, @@ -292,6 +523,7 @@ OperationStatus, IssueType, SolutionType, + RenderingType, ResourceScopeType, NotificationLevel, Channels, @@ -411,6 +643,9 @@ 'LocalizableString', 'CsmUsageQuota', 'ErrorEntity', + 'DefaultErrorResponseErrorDetailsItem', + 'DefaultErrorResponseError', + 'DefaultErrorResponse', 'DefaultErrorResponseException', 'Operation', 'ResourceMetricProperty', 'ResourceMetricValue', @@ -427,6 +662,12 @@ 'ResponseMetaData', 'AnalysisData', 'AnalysisDefinition', + 'DataTableResponseColumn', + 'DataTableResponseObject', + 'DetectorInfo', + 'Rendering', + 'DiagnosticData', + 'DetectorResponse', 'DiagnosticAnalysis', 'DiagnosticCategory', 'DiagnosticDetectorResponse', @@ -435,6 +676,8 @@ 'ApplicationStack', 'Recommendation', 'RecommendationRule', + 'ResourceHealthMetadata', + 'BillingMeter', 'CsmMoveResourceEnvelope', 'GeoRegion', 'HostingEnvironmentDeploymentInfo', @@ -533,14 +776,18 @@ 'TldLegalAgreementPaged', 'CertificatePaged', 'DeletedSitePaged', + 'DetectorResponsePaged', 'DiagnosticCategoryPaged', 'AnalysisDefinitionPaged', 'DetectorDefinitionPaged', 'ApplicationStackPaged', + 'RecommendationPaged', + 'ResourceHealthMetadataPaged', 'SourceControlPaged', 'GeoRegionPaged', 'IdentifierPaged', 'PremierAddOnOfferPaged', + 'BillingMeterPaged', 'SitePaged', 'BackupItemPaged', 'SiteConfigResourcePaged', @@ -578,6 +825,7 @@ 'CertificateOrderStatus', 'CertificateOrderActionType', 'RouteType', + 'ManagedServiceIdentityType', 'AutoHealActionType', 'ConnectionStringType', 'ScmType', @@ -603,6 +851,7 @@ 'OperationStatus', 'IssueType', 'SolutionType', + 'RenderingType', 'ResourceScopeType', 'NotificationLevel', 'Channels', diff --git a/azure-mgmt-web/azure/mgmt/web/models/abnormal_time_period.py b/azure-mgmt-web/azure/mgmt/web/models/abnormal_time_period.py index d2b01c9e5999..1e2a3eebde83 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/abnormal_time_period.py +++ b/azure-mgmt-web/azure/mgmt/web/models/abnormal_time_period.py @@ -32,9 +32,9 @@ class AbnormalTimePeriod(Model): 'solutions': {'key': 'solutions', 'type': '[Solution]'}, } - def __init__(self, start_time=None, end_time=None, events=None, solutions=None): - super(AbnormalTimePeriod, self).__init__() - self.start_time = start_time - self.end_time = end_time - self.events = events - self.solutions = solutions + def __init__(self, **kwargs): + super(AbnormalTimePeriod, self).__init__(**kwargs) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.events = kwargs.get('events', None) + self.solutions = kwargs.get('solutions', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/abnormal_time_period_py3.py b/azure-mgmt-web/azure/mgmt/web/models/abnormal_time_period_py3.py new file mode 100644 index 000000000000..7b621b2aa297 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/abnormal_time_period_py3.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class AbnormalTimePeriod(Model): + """Class representing Abnormal Time Period identified in diagnosis. + + :param start_time: Start time of the downtime + :type start_time: datetime + :param end_time: End time of the downtime + :type end_time: datetime + :param events: List of Possible Cause of downtime + :type events: list[~azure.mgmt.web.models.DetectorAbnormalTimePeriod] + :param solutions: List of proposed solutions + :type solutions: list[~azure.mgmt.web.models.Solution] + """ + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'events': {'key': 'events', 'type': '[DetectorAbnormalTimePeriod]'}, + 'solutions': {'key': 'solutions', 'type': '[Solution]'}, + } + + def __init__(self, *, start_time=None, end_time=None, events=None, solutions=None, **kwargs) -> None: + super(AbnormalTimePeriod, self).__init__(**kwargs) + self.start_time = start_time + self.end_time = end_time + self.events = events + self.solutions = solutions diff --git a/azure-mgmt-web/azure/mgmt/web/models/address.py b/azure-mgmt-web/azure/mgmt/web/models/address.py index 9b8956e9ed18..712c11c55bf6 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/address.py +++ b/azure-mgmt-web/azure/mgmt/web/models/address.py @@ -15,17 +15,19 @@ class Address(Model): """Address information for domain registration. - :param address1: First line of an Address. + All required parameters must be populated in order to send to Azure. + + :param address1: Required. First line of an Address. :type address1: str :param address2: The second line of the Address. Optional. :type address2: str - :param city: The city for the address. + :param city: Required. The city for the address. :type city: str - :param country: The country for the address. + :param country: Required. The country for the address. :type country: str - :param postal_code: The postal code for the address. + :param postal_code: Required. The postal code for the address. :type postal_code: str - :param state: The state or province for the address. + :param state: Required. The state or province for the address. :type state: str """ @@ -46,11 +48,11 @@ class Address(Model): 'state': {'key': 'state', 'type': 'str'}, } - def __init__(self, address1, city, country, postal_code, state, address2=None): - super(Address, self).__init__() - self.address1 = address1 - self.address2 = address2 - self.city = city - self.country = country - self.postal_code = postal_code - self.state = state + def __init__(self, **kwargs): + super(Address, self).__init__(**kwargs) + self.address1 = kwargs.get('address1', None) + self.address2 = kwargs.get('address2', None) + self.city = kwargs.get('city', None) + self.country = kwargs.get('country', None) + self.postal_code = kwargs.get('postal_code', None) + self.state = kwargs.get('state', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/address_py3.py b/azure-mgmt-web/azure/mgmt/web/models/address_py3.py new file mode 100644 index 000000000000..5f7c235ed217 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/address_py3.py @@ -0,0 +1,58 @@ +# 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 msrest.serialization import Model + + +class Address(Model): + """Address information for domain registration. + + All required parameters must be populated in order to send to Azure. + + :param address1: Required. First line of an Address. + :type address1: str + :param address2: The second line of the Address. Optional. + :type address2: str + :param city: Required. The city for the address. + :type city: str + :param country: Required. The country for the address. + :type country: str + :param postal_code: Required. The postal code for the address. + :type postal_code: str + :param state: Required. The state or province for the address. + :type state: str + """ + + _validation = { + 'address1': {'required': True}, + 'city': {'required': True}, + 'country': {'required': True}, + 'postal_code': {'required': True}, + 'state': {'required': True}, + } + + _attribute_map = { + 'address1': {'key': 'address1', 'type': 'str'}, + 'address2': {'key': 'address2', 'type': 'str'}, + 'city': {'key': 'city', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, + 'postal_code': {'key': 'postalCode', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__(self, *, address1: str, city: str, country: str, postal_code: str, state: str, address2: str=None, **kwargs) -> None: + super(Address, self).__init__(**kwargs) + self.address1 = address1 + self.address2 = address2 + self.city = city + self.country = country + self.postal_code = postal_code + self.state = state diff --git a/azure-mgmt-web/azure/mgmt/web/models/address_response.py b/azure-mgmt-web/azure/mgmt/web/models/address_response.py index 7bb9c356952b..851a713cc4ee 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/address_response.py +++ b/azure-mgmt-web/azure/mgmt/web/models/address_response.py @@ -34,9 +34,9 @@ class AddressResponse(Model): 'vip_mappings': {'key': 'vipMappings', 'type': '[VirtualIPMapping]'}, } - def __init__(self, service_ip_address=None, internal_ip_address=None, outbound_ip_addresses=None, vip_mappings=None): - super(AddressResponse, self).__init__() - self.service_ip_address = service_ip_address - self.internal_ip_address = internal_ip_address - self.outbound_ip_addresses = outbound_ip_addresses - self.vip_mappings = vip_mappings + def __init__(self, **kwargs): + super(AddressResponse, self).__init__(**kwargs) + self.service_ip_address = kwargs.get('service_ip_address', None) + self.internal_ip_address = kwargs.get('internal_ip_address', None) + self.outbound_ip_addresses = kwargs.get('outbound_ip_addresses', None) + self.vip_mappings = kwargs.get('vip_mappings', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/address_response_py3.py b/azure-mgmt-web/azure/mgmt/web/models/address_response_py3.py new file mode 100644 index 000000000000..5268c2dce078 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/address_response_py3.py @@ -0,0 +1,42 @@ +# 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 msrest.serialization import Model + + +class AddressResponse(Model): + """Describes main public IP address and any extra virtual IPs. + + :param service_ip_address: Main public virtual IP. + :type service_ip_address: str + :param internal_ip_address: Virtual Network internal IP address of the App + Service Environment if it is in internal load-balancing mode. + :type internal_ip_address: str + :param outbound_ip_addresses: IP addresses appearing on outbound + connections. + :type outbound_ip_addresses: list[str] + :param vip_mappings: Additional virtual IPs. + :type vip_mappings: list[~azure.mgmt.web.models.VirtualIPMapping] + """ + + _attribute_map = { + 'service_ip_address': {'key': 'serviceIpAddress', 'type': 'str'}, + 'internal_ip_address': {'key': 'internalIpAddress', 'type': 'str'}, + 'outbound_ip_addresses': {'key': 'outboundIpAddresses', 'type': '[str]'}, + 'vip_mappings': {'key': 'vipMappings', 'type': '[VirtualIPMapping]'}, + } + + def __init__(self, *, service_ip_address: str=None, internal_ip_address: str=None, outbound_ip_addresses=None, vip_mappings=None, **kwargs) -> None: + super(AddressResponse, self).__init__(**kwargs) + self.service_ip_address = service_ip_address + self.internal_ip_address = internal_ip_address + self.outbound_ip_addresses = outbound_ip_addresses + self.vip_mappings = vip_mappings diff --git a/azure-mgmt-web/azure/mgmt/web/models/analysis_data.py b/azure-mgmt-web/azure/mgmt/web/models/analysis_data.py index 648935998a8f..0c2606f3ba50 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/analysis_data.py +++ b/azure-mgmt-web/azure/mgmt/web/models/analysis_data.py @@ -35,10 +35,10 @@ class AnalysisData(Model): 'detector_meta_data': {'key': 'detectorMetaData', 'type': 'ResponseMetaData'}, } - def __init__(self, source=None, detector_definition=None, metrics=None, data=None, detector_meta_data=None): - super(AnalysisData, self).__init__() - self.source = source - self.detector_definition = detector_definition - self.metrics = metrics - self.data = data - self.detector_meta_data = detector_meta_data + def __init__(self, **kwargs): + super(AnalysisData, self).__init__(**kwargs) + self.source = kwargs.get('source', None) + self.detector_definition = kwargs.get('detector_definition', None) + self.metrics = kwargs.get('metrics', None) + self.data = kwargs.get('data', None) + self.detector_meta_data = kwargs.get('detector_meta_data', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/analysis_data_py3.py b/azure-mgmt-web/azure/mgmt/web/models/analysis_data_py3.py new file mode 100644 index 000000000000..38d0cb227509 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/analysis_data_py3.py @@ -0,0 +1,44 @@ +# 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 msrest.serialization import Model + + +class AnalysisData(Model): + """Class Representing Detector Evidence used for analysis. + + :param source: Name of the Detector + :type source: str + :param detector_definition: Detector Definition + :type detector_definition: ~azure.mgmt.web.models.DetectorDefinition + :param metrics: Source Metrics + :type metrics: list[~azure.mgmt.web.models.DiagnosticMetricSet] + :param data: Additional Source Data + :type data: list[list[~azure.mgmt.web.models.NameValuePair]] + :param detector_meta_data: Detector Meta Data + :type detector_meta_data: ~azure.mgmt.web.models.ResponseMetaData + """ + + _attribute_map = { + 'source': {'key': 'source', 'type': 'str'}, + 'detector_definition': {'key': 'detectorDefinition', 'type': 'DetectorDefinition'}, + 'metrics': {'key': 'metrics', 'type': '[DiagnosticMetricSet]'}, + 'data': {'key': 'data', 'type': '[[NameValuePair]]'}, + 'detector_meta_data': {'key': 'detectorMetaData', 'type': 'ResponseMetaData'}, + } + + def __init__(self, *, source: str=None, detector_definition=None, metrics=None, data=None, detector_meta_data=None, **kwargs) -> None: + super(AnalysisData, self).__init__(**kwargs) + self.source = source + self.detector_definition = detector_definition + self.metrics = metrics + self.data = data + self.detector_meta_data = detector_meta_data diff --git a/azure-mgmt-web/azure/mgmt/web/models/analysis_definition.py b/azure-mgmt-web/azure/mgmt/web/models/analysis_definition.py index 3cdc5f3bf839..58943eea9d91 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/analysis_definition.py +++ b/azure-mgmt-web/azure/mgmt/web/models/analysis_definition.py @@ -45,6 +45,6 @@ class AnalysisDefinition(ProxyOnlyResource): 'description': {'key': 'properties.description', 'type': 'str'}, } - def __init__(self, kind=None): - super(AnalysisDefinition, self).__init__(kind=kind) + def __init__(self, **kwargs): + super(AnalysisDefinition, self).__init__(**kwargs) self.description = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/analysis_definition_py3.py b/azure-mgmt-web/azure/mgmt/web/models/analysis_definition_py3.py new file mode 100644 index 000000000000..bade61efc4f9 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/analysis_definition_py3.py @@ -0,0 +1,50 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class AnalysisDefinition(ProxyOnlyResource): + """Definition of Analysis. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar description: Description of the Analysis + :vartype description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, *, kind: str=None, **kwargs) -> None: + super(AnalysisDefinition, self).__init__(kind=kind, **kwargs) + self.description = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/api_definition_info.py b/azure-mgmt-web/azure/mgmt/web/models/api_definition_info.py index 63d8e2be4c4e..ea39cea45caf 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/api_definition_info.py +++ b/azure-mgmt-web/azure/mgmt/web/models/api_definition_info.py @@ -23,6 +23,6 @@ class ApiDefinitionInfo(Model): 'url': {'key': 'url', 'type': 'str'}, } - def __init__(self, url=None): - super(ApiDefinitionInfo, self).__init__() - self.url = url + def __init__(self, **kwargs): + super(ApiDefinitionInfo, self).__init__(**kwargs) + self.url = kwargs.get('url', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/api_definition_info_py3.py b/azure-mgmt-web/azure/mgmt/web/models/api_definition_info_py3.py new file mode 100644 index 000000000000..c871cfac7df2 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/api_definition_info_py3.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class ApiDefinitionInfo(Model): + """Information about the formal API definition for the app. + + :param url: The URL of the API definition. + :type url: str + """ + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'}, + } + + def __init__(self, *, url: str=None, **kwargs) -> None: + super(ApiDefinitionInfo, self).__init__(**kwargs) + self.url = url diff --git a/azure-mgmt-web/azure/mgmt/web/models/app_service_certificate.py b/azure-mgmt-web/azure/mgmt/web/models/app_service_certificate.py index ddeb88a33f07..a678f8540c30 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/app_service_certificate.py +++ b/azure-mgmt-web/azure/mgmt/web/models/app_service_certificate.py @@ -42,8 +42,8 @@ class AppServiceCertificate(Model): 'provisioning_state': {'key': 'provisioningState', 'type': 'KeyVaultSecretStatus'}, } - def __init__(self, key_vault_id=None, key_vault_secret_name=None): - super(AppServiceCertificate, self).__init__() - self.key_vault_id = key_vault_id - self.key_vault_secret_name = key_vault_secret_name + def __init__(self, **kwargs): + super(AppServiceCertificate, self).__init__(**kwargs) + self.key_vault_id = kwargs.get('key_vault_id', None) + self.key_vault_secret_name = kwargs.get('key_vault_secret_name', None) self.provisioning_state = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/app_service_certificate_order.py b/azure-mgmt-web/azure/mgmt/web/models/app_service_certificate_order.py index bf72656661c5..187b8ef08aca 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/app_service_certificate_order.py +++ b/azure-mgmt-web/azure/mgmt/web/models/app_service_certificate_order.py @@ -18,13 +18,15 @@ class AppServiceCertificateOrder(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 Azure. + :ivar id: Resource Id. :vartype id: str :ivar name: Resource Name. :vartype name: str :param kind: Kind of resource. :type kind: str - :param location: Resource Location. + :param location: Required. Resource Location. :type location: str :ivar type: Resource type. :vartype type: str @@ -42,8 +44,9 @@ class AppServiceCertificateOrder(Resource): :type validity_in_years: int :param key_size: Certificate key size. Default value: 2048 . :type key_size: int - :param product_type: Certificate product type. Possible values include: - 'StandardDomainValidatedSsl', 'StandardDomainValidatedWildCardSsl' + :param product_type: Required. Certificate product type. Possible values + include: 'StandardDomainValidatedSsl', + 'StandardDomainValidatedWildCardSsl' :type product_type: str or ~azure.mgmt.web.models.CertificateProductType :param auto_renew: true if the certificate should be automatically renewed when it expires; otherwise, false. @@ -131,19 +134,19 @@ class AppServiceCertificateOrder(Resource): 'next_auto_renewal_time_stamp': {'key': 'properties.nextAutoRenewalTimeStamp', 'type': 'iso-8601'}, } - def __init__(self, location, product_type, kind=None, tags=None, certificates=None, distinguished_name=None, validity_in_years=1, key_size=2048, auto_renew=True, csr=None): - super(AppServiceCertificateOrder, self).__init__(kind=kind, location=location, tags=tags) - self.certificates = certificates - self.distinguished_name = distinguished_name + def __init__(self, **kwargs): + super(AppServiceCertificateOrder, self).__init__(**kwargs) + self.certificates = kwargs.get('certificates', None) + self.distinguished_name = kwargs.get('distinguished_name', None) self.domain_verification_token = None - self.validity_in_years = validity_in_years - self.key_size = key_size - self.product_type = product_type - self.auto_renew = auto_renew + self.validity_in_years = kwargs.get('validity_in_years', 1) + self.key_size = kwargs.get('key_size', 2048) + self.product_type = kwargs.get('product_type', None) + self.auto_renew = kwargs.get('auto_renew', True) self.provisioning_state = None self.status = None self.signed_certificate = None - self.csr = csr + self.csr = kwargs.get('csr', None) self.intermediate = None self.root = None self.serial_number = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/app_service_certificate_order_patch_resource.py b/azure-mgmt-web/azure/mgmt/web/models/app_service_certificate_order_patch_resource.py index d8e89475dd34..131e707b8ac6 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/app_service_certificate_order_patch_resource.py +++ b/azure-mgmt-web/azure/mgmt/web/models/app_service_certificate_order_patch_resource.py @@ -18,6 +18,8 @@ class AppServiceCertificateOrderPatchResource(ProxyOnlyResource): 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 Azure. + :ivar id: Resource Id. :vartype id: str :ivar name: Resource Name. @@ -38,8 +40,9 @@ class AppServiceCertificateOrderPatchResource(ProxyOnlyResource): :type validity_in_years: int :param key_size: Certificate key size. Default value: 2048 . :type key_size: int - :param product_type: Certificate product type. Possible values include: - 'StandardDomainValidatedSsl', 'StandardDomainValidatedWildCardSsl' + :param product_type: Required. Certificate product type. Possible values + include: 'StandardDomainValidatedSsl', + 'StandardDomainValidatedWildCardSsl' :type product_type: str or ~azure.mgmt.web.models.CertificateProductType :param auto_renew: true if the certificate should be automatically renewed when it expires; otherwise, false. @@ -124,19 +127,19 @@ class AppServiceCertificateOrderPatchResource(ProxyOnlyResource): 'next_auto_renewal_time_stamp': {'key': 'properties.nextAutoRenewalTimeStamp', 'type': 'iso-8601'}, } - def __init__(self, product_type, kind=None, certificates=None, distinguished_name=None, validity_in_years=1, key_size=2048, auto_renew=True, csr=None): - super(AppServiceCertificateOrderPatchResource, self).__init__(kind=kind) - self.certificates = certificates - self.distinguished_name = distinguished_name + def __init__(self, **kwargs): + super(AppServiceCertificateOrderPatchResource, self).__init__(**kwargs) + self.certificates = kwargs.get('certificates', None) + self.distinguished_name = kwargs.get('distinguished_name', None) self.domain_verification_token = None - self.validity_in_years = validity_in_years - self.key_size = key_size - self.product_type = product_type - self.auto_renew = auto_renew + self.validity_in_years = kwargs.get('validity_in_years', 1) + self.key_size = kwargs.get('key_size', 2048) + self.product_type = kwargs.get('product_type', None) + self.auto_renew = kwargs.get('auto_renew', True) self.provisioning_state = None self.status = None self.signed_certificate = None - self.csr = csr + self.csr = kwargs.get('csr', None) self.intermediate = None self.root = None self.serial_number = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/app_service_certificate_order_patch_resource_py3.py b/azure-mgmt-web/azure/mgmt/web/models/app_service_certificate_order_patch_resource_py3.py new file mode 100644 index 000000000000..5676f8f836df --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/app_service_certificate_order_patch_resource_py3.py @@ -0,0 +1,150 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class AppServiceCertificateOrderPatchResource(ProxyOnlyResource): + """ARM resource for a certificate order that is purchased through Azure. + + 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 Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param certificates: State of the Key Vault secret. + :type certificates: dict[str, + ~azure.mgmt.web.models.AppServiceCertificate] + :param distinguished_name: Certificate distinguished name. + :type distinguished_name: str + :ivar domain_verification_token: Domain verification token. + :vartype domain_verification_token: str + :param validity_in_years: Duration in years (must be between 1 and 3). + Default value: 1 . + :type validity_in_years: int + :param key_size: Certificate key size. Default value: 2048 . + :type key_size: int + :param product_type: Required. Certificate product type. Possible values + include: 'StandardDomainValidatedSsl', + 'StandardDomainValidatedWildCardSsl' + :type product_type: str or ~azure.mgmt.web.models.CertificateProductType + :param auto_renew: true if the certificate should be + automatically renewed when it expires; otherwise, false. + Default value: True . + :type auto_renew: bool + :ivar provisioning_state: Status of certificate order. Possible values + include: 'Succeeded', 'Failed', 'Canceled', 'InProgress', 'Deleting' + :vartype provisioning_state: str or + ~azure.mgmt.web.models.ProvisioningState + :ivar status: Current order status. Possible values include: + 'Pendingissuance', 'Issued', 'Revoked', 'Canceled', 'Denied', + 'Pendingrevocation', 'PendingRekey', 'Unused', 'Expired', 'NotSubmitted' + :vartype status: str or ~azure.mgmt.web.models.CertificateOrderStatus + :ivar signed_certificate: Signed certificate. + :vartype signed_certificate: ~azure.mgmt.web.models.CertificateDetails + :param csr: Last CSR that was created for this order. + :type csr: str + :ivar intermediate: Intermediate certificate. + :vartype intermediate: ~azure.mgmt.web.models.CertificateDetails + :ivar root: Root certificate. + :vartype root: ~azure.mgmt.web.models.CertificateDetails + :ivar serial_number: Current serial number of the certificate. + :vartype serial_number: str + :ivar last_certificate_issuance_time: Certificate last issuance time. + :vartype last_certificate_issuance_time: datetime + :ivar expiration_time: Certificate expiration time. + :vartype expiration_time: datetime + :ivar is_private_key_external: true if private key is + external; otherwise, false. + :vartype is_private_key_external: bool + :ivar app_service_certificate_not_renewable_reasons: Reasons why App + Service Certificate is not renewable at the current moment. + :vartype app_service_certificate_not_renewable_reasons: list[str] + :ivar next_auto_renewal_time_stamp: Time stamp when the certificate would + be auto renewed next + :vartype next_auto_renewal_time_stamp: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'domain_verification_token': {'readonly': True}, + 'validity_in_years': {'maximum': 3, 'minimum': 1}, + 'product_type': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'signed_certificate': {'readonly': True}, + 'intermediate': {'readonly': True}, + 'root': {'readonly': True}, + 'serial_number': {'readonly': True}, + 'last_certificate_issuance_time': {'readonly': True}, + 'expiration_time': {'readonly': True}, + 'is_private_key_external': {'readonly': True}, + 'app_service_certificate_not_renewable_reasons': {'readonly': True}, + 'next_auto_renewal_time_stamp': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'certificates': {'key': 'properties.certificates', 'type': '{AppServiceCertificate}'}, + 'distinguished_name': {'key': 'properties.distinguishedName', 'type': 'str'}, + 'domain_verification_token': {'key': 'properties.domainVerificationToken', 'type': 'str'}, + 'validity_in_years': {'key': 'properties.validityInYears', 'type': 'int'}, + 'key_size': {'key': 'properties.keySize', 'type': 'int'}, + 'product_type': {'key': 'properties.productType', 'type': 'CertificateProductType'}, + 'auto_renew': {'key': 'properties.autoRenew', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, + 'status': {'key': 'properties.status', 'type': 'CertificateOrderStatus'}, + 'signed_certificate': {'key': 'properties.signedCertificate', 'type': 'CertificateDetails'}, + 'csr': {'key': 'properties.csr', 'type': 'str'}, + 'intermediate': {'key': 'properties.intermediate', 'type': 'CertificateDetails'}, + 'root': {'key': 'properties.root', 'type': 'CertificateDetails'}, + 'serial_number': {'key': 'properties.serialNumber', 'type': 'str'}, + 'last_certificate_issuance_time': {'key': 'properties.lastCertificateIssuanceTime', 'type': 'iso-8601'}, + 'expiration_time': {'key': 'properties.expirationTime', 'type': 'iso-8601'}, + 'is_private_key_external': {'key': 'properties.isPrivateKeyExternal', 'type': 'bool'}, + 'app_service_certificate_not_renewable_reasons': {'key': 'properties.appServiceCertificateNotRenewableReasons', 'type': '[str]'}, + 'next_auto_renewal_time_stamp': {'key': 'properties.nextAutoRenewalTimeStamp', 'type': 'iso-8601'}, + } + + def __init__(self, *, product_type, kind: str=None, certificates=None, distinguished_name: str=None, validity_in_years: int=1, key_size: int=2048, auto_renew: bool=True, csr: str=None, **kwargs) -> None: + super(AppServiceCertificateOrderPatchResource, self).__init__(kind=kind, **kwargs) + self.certificates = certificates + self.distinguished_name = distinguished_name + self.domain_verification_token = None + self.validity_in_years = validity_in_years + self.key_size = key_size + self.product_type = product_type + self.auto_renew = auto_renew + self.provisioning_state = None + self.status = None + self.signed_certificate = None + self.csr = csr + self.intermediate = None + self.root = None + self.serial_number = None + self.last_certificate_issuance_time = None + self.expiration_time = None + self.is_private_key_external = None + self.app_service_certificate_not_renewable_reasons = None + self.next_auto_renewal_time_stamp = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/app_service_certificate_order_py3.py b/azure-mgmt-web/azure/mgmt/web/models/app_service_certificate_order_py3.py new file mode 100644 index 000000000000..78d5fa1fb07c --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/app_service_certificate_order_py3.py @@ -0,0 +1,157 @@ +# 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 .resource import Resource + + +class AppServiceCertificateOrder(Resource): + """SSL certificate purchase order. + + 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 Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param certificates: State of the Key Vault secret. + :type certificates: dict[str, + ~azure.mgmt.web.models.AppServiceCertificate] + :param distinguished_name: Certificate distinguished name. + :type distinguished_name: str + :ivar domain_verification_token: Domain verification token. + :vartype domain_verification_token: str + :param validity_in_years: Duration in years (must be between 1 and 3). + Default value: 1 . + :type validity_in_years: int + :param key_size: Certificate key size. Default value: 2048 . + :type key_size: int + :param product_type: Required. Certificate product type. Possible values + include: 'StandardDomainValidatedSsl', + 'StandardDomainValidatedWildCardSsl' + :type product_type: str or ~azure.mgmt.web.models.CertificateProductType + :param auto_renew: true if the certificate should be + automatically renewed when it expires; otherwise, false. + Default value: True . + :type auto_renew: bool + :ivar provisioning_state: Status of certificate order. Possible values + include: 'Succeeded', 'Failed', 'Canceled', 'InProgress', 'Deleting' + :vartype provisioning_state: str or + ~azure.mgmt.web.models.ProvisioningState + :ivar status: Current order status. Possible values include: + 'Pendingissuance', 'Issued', 'Revoked', 'Canceled', 'Denied', + 'Pendingrevocation', 'PendingRekey', 'Unused', 'Expired', 'NotSubmitted' + :vartype status: str or ~azure.mgmt.web.models.CertificateOrderStatus + :ivar signed_certificate: Signed certificate. + :vartype signed_certificate: ~azure.mgmt.web.models.CertificateDetails + :param csr: Last CSR that was created for this order. + :type csr: str + :ivar intermediate: Intermediate certificate. + :vartype intermediate: ~azure.mgmt.web.models.CertificateDetails + :ivar root: Root certificate. + :vartype root: ~azure.mgmt.web.models.CertificateDetails + :ivar serial_number: Current serial number of the certificate. + :vartype serial_number: str + :ivar last_certificate_issuance_time: Certificate last issuance time. + :vartype last_certificate_issuance_time: datetime + :ivar expiration_time: Certificate expiration time. + :vartype expiration_time: datetime + :ivar is_private_key_external: true if private key is + external; otherwise, false. + :vartype is_private_key_external: bool + :ivar app_service_certificate_not_renewable_reasons: Reasons why App + Service Certificate is not renewable at the current moment. + :vartype app_service_certificate_not_renewable_reasons: list[str] + :ivar next_auto_renewal_time_stamp: Time stamp when the certificate would + be auto renewed next + :vartype next_auto_renewal_time_stamp: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'domain_verification_token': {'readonly': True}, + 'validity_in_years': {'maximum': 3, 'minimum': 1}, + 'product_type': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'signed_certificate': {'readonly': True}, + 'intermediate': {'readonly': True}, + 'root': {'readonly': True}, + 'serial_number': {'readonly': True}, + 'last_certificate_issuance_time': {'readonly': True}, + 'expiration_time': {'readonly': True}, + 'is_private_key_external': {'readonly': True}, + 'app_service_certificate_not_renewable_reasons': {'readonly': True}, + 'next_auto_renewal_time_stamp': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'certificates': {'key': 'properties.certificates', 'type': '{AppServiceCertificate}'}, + 'distinguished_name': {'key': 'properties.distinguishedName', 'type': 'str'}, + 'domain_verification_token': {'key': 'properties.domainVerificationToken', 'type': 'str'}, + 'validity_in_years': {'key': 'properties.validityInYears', 'type': 'int'}, + 'key_size': {'key': 'properties.keySize', 'type': 'int'}, + 'product_type': {'key': 'properties.productType', 'type': 'CertificateProductType'}, + 'auto_renew': {'key': 'properties.autoRenew', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, + 'status': {'key': 'properties.status', 'type': 'CertificateOrderStatus'}, + 'signed_certificate': {'key': 'properties.signedCertificate', 'type': 'CertificateDetails'}, + 'csr': {'key': 'properties.csr', 'type': 'str'}, + 'intermediate': {'key': 'properties.intermediate', 'type': 'CertificateDetails'}, + 'root': {'key': 'properties.root', 'type': 'CertificateDetails'}, + 'serial_number': {'key': 'properties.serialNumber', 'type': 'str'}, + 'last_certificate_issuance_time': {'key': 'properties.lastCertificateIssuanceTime', 'type': 'iso-8601'}, + 'expiration_time': {'key': 'properties.expirationTime', 'type': 'iso-8601'}, + 'is_private_key_external': {'key': 'properties.isPrivateKeyExternal', 'type': 'bool'}, + 'app_service_certificate_not_renewable_reasons': {'key': 'properties.appServiceCertificateNotRenewableReasons', 'type': '[str]'}, + 'next_auto_renewal_time_stamp': {'key': 'properties.nextAutoRenewalTimeStamp', 'type': 'iso-8601'}, + } + + def __init__(self, *, location: str, product_type, kind: str=None, tags=None, certificates=None, distinguished_name: str=None, validity_in_years: int=1, key_size: int=2048, auto_renew: bool=True, csr: str=None, **kwargs) -> None: + super(AppServiceCertificateOrder, self).__init__(kind=kind, location=location, tags=tags, **kwargs) + self.certificates = certificates + self.distinguished_name = distinguished_name + self.domain_verification_token = None + self.validity_in_years = validity_in_years + self.key_size = key_size + self.product_type = product_type + self.auto_renew = auto_renew + self.provisioning_state = None + self.status = None + self.signed_certificate = None + self.csr = csr + self.intermediate = None + self.root = None + self.serial_number = None + self.last_certificate_issuance_time = None + self.expiration_time = None + self.is_private_key_external = None + self.app_service_certificate_not_renewable_reasons = None + self.next_auto_renewal_time_stamp = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/app_service_certificate_patch_resource.py b/azure-mgmt-web/azure/mgmt/web/models/app_service_certificate_patch_resource.py index 396fb0c5a54b..fb6bea6358a4 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/app_service_certificate_patch_resource.py +++ b/azure-mgmt-web/azure/mgmt/web/models/app_service_certificate_patch_resource.py @@ -58,8 +58,8 @@ class AppServiceCertificatePatchResource(ProxyOnlyResource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'KeyVaultSecretStatus'}, } - def __init__(self, kind=None, key_vault_id=None, key_vault_secret_name=None): - super(AppServiceCertificatePatchResource, self).__init__(kind=kind) - self.key_vault_id = key_vault_id - self.key_vault_secret_name = key_vault_secret_name + def __init__(self, **kwargs): + super(AppServiceCertificatePatchResource, self).__init__(**kwargs) + self.key_vault_id = kwargs.get('key_vault_id', None) + self.key_vault_secret_name = kwargs.get('key_vault_secret_name', None) self.provisioning_state = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/app_service_certificate_patch_resource_py3.py b/azure-mgmt-web/azure/mgmt/web/models/app_service_certificate_patch_resource_py3.py new file mode 100644 index 000000000000..521f97c7e92b --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/app_service_certificate_patch_resource_py3.py @@ -0,0 +1,65 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class AppServiceCertificatePatchResource(ProxyOnlyResource): + """Key Vault container ARM resource for a certificate that is purchased + through Azure. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param key_vault_id: Key Vault resource Id. + :type key_vault_id: str + :param key_vault_secret_name: Key Vault secret name. + :type key_vault_secret_name: str + :ivar provisioning_state: Status of the Key Vault secret. Possible values + include: 'Initialized', 'WaitingOnCertificateOrder', 'Succeeded', + 'CertificateOrderFailed', 'OperationNotPermittedOnKeyVault', + 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', + 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', + 'Unknown' + :vartype provisioning_state: str or + ~azure.mgmt.web.models.KeyVaultSecretStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'key_vault_id': {'key': 'properties.keyVaultId', 'type': 'str'}, + 'key_vault_secret_name': {'key': 'properties.keyVaultSecretName', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'KeyVaultSecretStatus'}, + } + + def __init__(self, *, kind: str=None, key_vault_id: str=None, key_vault_secret_name: str=None, **kwargs) -> None: + super(AppServiceCertificatePatchResource, self).__init__(kind=kind, **kwargs) + self.key_vault_id = key_vault_id + self.key_vault_secret_name = key_vault_secret_name + self.provisioning_state = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/app_service_certificate_py3.py b/azure-mgmt-web/azure/mgmt/web/models/app_service_certificate_py3.py new file mode 100644 index 000000000000..e30db2b48566 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/app_service_certificate_py3.py @@ -0,0 +1,49 @@ +# 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 msrest.serialization import Model + + +class AppServiceCertificate(Model): + """Key Vault container for a certificate that is purchased through Azure. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param key_vault_id: Key Vault resource Id. + :type key_vault_id: str + :param key_vault_secret_name: Key Vault secret name. + :type key_vault_secret_name: str + :ivar provisioning_state: Status of the Key Vault secret. Possible values + include: 'Initialized', 'WaitingOnCertificateOrder', 'Succeeded', + 'CertificateOrderFailed', 'OperationNotPermittedOnKeyVault', + 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', + 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', + 'Unknown' + :vartype provisioning_state: str or + ~azure.mgmt.web.models.KeyVaultSecretStatus + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'key_vault_id': {'key': 'keyVaultId', 'type': 'str'}, + 'key_vault_secret_name': {'key': 'keyVaultSecretName', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'KeyVaultSecretStatus'}, + } + + def __init__(self, *, key_vault_id: str=None, key_vault_secret_name: str=None, **kwargs) -> None: + super(AppServiceCertificate, self).__init__(**kwargs) + self.key_vault_id = key_vault_id + self.key_vault_secret_name = key_vault_secret_name + self.provisioning_state = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/app_service_certificate_resource.py b/azure-mgmt-web/azure/mgmt/web/models/app_service_certificate_resource.py index b326f42f3a47..be01e27689f9 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/app_service_certificate_resource.py +++ b/azure-mgmt-web/azure/mgmt/web/models/app_service_certificate_resource.py @@ -19,13 +19,15 @@ class AppServiceCertificateResource(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 Azure. + :ivar id: Resource Id. :vartype id: str :ivar name: Resource Name. :vartype name: str :param kind: Kind of resource. :type kind: str - :param location: Resource Location. + :param location: Required. Resource Location. :type location: str :ivar type: Resource type. :vartype type: str @@ -65,8 +67,8 @@ class AppServiceCertificateResource(Resource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'KeyVaultSecretStatus'}, } - def __init__(self, location, kind=None, tags=None, key_vault_id=None, key_vault_secret_name=None): - super(AppServiceCertificateResource, self).__init__(kind=kind, location=location, tags=tags) - self.key_vault_id = key_vault_id - self.key_vault_secret_name = key_vault_secret_name + def __init__(self, **kwargs): + super(AppServiceCertificateResource, self).__init__(**kwargs) + self.key_vault_id = kwargs.get('key_vault_id', None) + self.key_vault_secret_name = kwargs.get('key_vault_secret_name', None) self.provisioning_state = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/app_service_certificate_resource_py3.py b/azure-mgmt-web/azure/mgmt/web/models/app_service_certificate_resource_py3.py new file mode 100644 index 000000000000..55ceeb826af6 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/app_service_certificate_resource_py3.py @@ -0,0 +1,74 @@ +# 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 .resource import Resource + + +class AppServiceCertificateResource(Resource): + """Key Vault container ARM resource for a certificate that is purchased + through Azure. + + 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 Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param key_vault_id: Key Vault resource Id. + :type key_vault_id: str + :param key_vault_secret_name: Key Vault secret name. + :type key_vault_secret_name: str + :ivar provisioning_state: Status of the Key Vault secret. Possible values + include: 'Initialized', 'WaitingOnCertificateOrder', 'Succeeded', + 'CertificateOrderFailed', 'OperationNotPermittedOnKeyVault', + 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', + 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', + 'Unknown' + :vartype provisioning_state: str or + ~azure.mgmt.web.models.KeyVaultSecretStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'key_vault_id': {'key': 'properties.keyVaultId', 'type': 'str'}, + 'key_vault_secret_name': {'key': 'properties.keyVaultSecretName', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'KeyVaultSecretStatus'}, + } + + def __init__(self, *, location: str, kind: str=None, tags=None, key_vault_id: str=None, key_vault_secret_name: str=None, **kwargs) -> None: + super(AppServiceCertificateResource, self).__init__(kind=kind, location=location, tags=tags, **kwargs) + self.key_vault_id = key_vault_id + self.key_vault_secret_name = key_vault_secret_name + self.provisioning_state = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/app_service_environment.py b/azure-mgmt-web/azure/mgmt/web/models/app_service_environment.py index db13b73e5f00..0188bc2cf194 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/app_service_environment.py +++ b/azure-mgmt-web/azure/mgmt/web/models/app_service_environment.py @@ -18,9 +18,12 @@ class AppServiceEnvironment(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param name: Name of the App Service Environment. + All required parameters must be populated in order to send to Azure. + + :param name: Required. Name of the App Service Environment. :type name: str - :param location: Location of the App Service Environment, e.g. "West US". + :param location: Required. Location of the App Service Environment, e.g. + "West US". :type location: str :ivar provisioning_state: Provisioning state of the App Service Environment. Possible values include: 'Succeeded', 'Failed', 'Canceled', @@ -37,7 +40,7 @@ class AppServiceEnvironment(Model): :type vnet_resource_group_name: str :param vnet_subnet_name: Subnet of the Virtual Network. :type vnet_subnet_name: str - :param virtual_network: Description of the Virtual Network. + :param virtual_network: Required. Description of the Virtual Network. :type virtual_network: ~azure.mgmt.web.models.VirtualNetworkProfile :param internal_load_balancing_mode: Specifies which endpoints to serve internally in the Virtual Network for the App Service Environment. @@ -48,8 +51,8 @@ class AppServiceEnvironment(Model): :type multi_size: str :param multi_role_count: Number of front-end instances. :type multi_role_count: int - :param worker_pools: Description of worker pools with worker size IDs, VM - sizes, and number of workers in each pool. + :param worker_pools: Required. Description of worker pools with worker + size IDs, VM sizes, and number of workers in each pool. :type worker_pools: list[~azure.mgmt.web.models.WorkerPool] :param ipssl_address_count: Number of IP SSL addresses reserved for the App Service Environment. @@ -188,26 +191,26 @@ class AppServiceEnvironment(Model): 'user_whitelisted_ip_ranges': {'key': 'userWhitelistedIpRanges', 'type': '[str]'}, } - def __init__(self, name, location, virtual_network, worker_pools, vnet_name=None, vnet_resource_group_name=None, vnet_subnet_name=None, internal_load_balancing_mode=None, multi_size=None, multi_role_count=None, ipssl_address_count=None, dns_suffix=None, network_access_control_list=None, front_end_scale_factor=None, api_management_account_id=None, suspended=None, dynamic_cache_enabled=None, cluster_settings=None, user_whitelisted_ip_ranges=None): - super(AppServiceEnvironment, self).__init__() - self.name = name - self.location = location + def __init__(self, **kwargs): + super(AppServiceEnvironment, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.location = kwargs.get('location', None) self.provisioning_state = None self.status = None - self.vnet_name = vnet_name - self.vnet_resource_group_name = vnet_resource_group_name - self.vnet_subnet_name = vnet_subnet_name - self.virtual_network = virtual_network - self.internal_load_balancing_mode = internal_load_balancing_mode - self.multi_size = multi_size - self.multi_role_count = multi_role_count - self.worker_pools = worker_pools - self.ipssl_address_count = ipssl_address_count + self.vnet_name = kwargs.get('vnet_name', None) + self.vnet_resource_group_name = kwargs.get('vnet_resource_group_name', None) + self.vnet_subnet_name = kwargs.get('vnet_subnet_name', None) + self.virtual_network = kwargs.get('virtual_network', None) + self.internal_load_balancing_mode = kwargs.get('internal_load_balancing_mode', None) + self.multi_size = kwargs.get('multi_size', None) + self.multi_role_count = kwargs.get('multi_role_count', None) + self.worker_pools = kwargs.get('worker_pools', None) + self.ipssl_address_count = kwargs.get('ipssl_address_count', None) self.database_edition = None self.database_service_objective = None self.upgrade_domains = None self.subscription_id = None - self.dns_suffix = dns_suffix + self.dns_suffix = kwargs.get('dns_suffix', None) self.last_action = None self.last_action_result = None self.allowed_multi_sizes = None @@ -215,14 +218,14 @@ def __init__(self, name, location, virtual_network, worker_pools, vnet_name=None self.maximum_number_of_machines = None self.vip_mappings = None self.environment_capacities = None - self.network_access_control_list = network_access_control_list + self.network_access_control_list = kwargs.get('network_access_control_list', None) self.environment_is_healthy = None self.environment_status = None self.resource_group = None - self.front_end_scale_factor = front_end_scale_factor + self.front_end_scale_factor = kwargs.get('front_end_scale_factor', None) self.default_front_end_scale_factor = None - self.api_management_account_id = api_management_account_id - self.suspended = suspended - self.dynamic_cache_enabled = dynamic_cache_enabled - self.cluster_settings = cluster_settings - self.user_whitelisted_ip_ranges = user_whitelisted_ip_ranges + self.api_management_account_id = kwargs.get('api_management_account_id', None) + self.suspended = kwargs.get('suspended', None) + self.dynamic_cache_enabled = kwargs.get('dynamic_cache_enabled', None) + self.cluster_settings = kwargs.get('cluster_settings', None) + self.user_whitelisted_ip_ranges = kwargs.get('user_whitelisted_ip_ranges', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/app_service_environment_patch_resource.py b/azure-mgmt-web/azure/mgmt/web/models/app_service_environment_patch_resource.py index fc92893eb4f4..d64026258130 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/app_service_environment_patch_resource.py +++ b/azure-mgmt-web/azure/mgmt/web/models/app_service_environment_patch_resource.py @@ -18,6 +18,8 @@ class AppServiceEnvironmentPatchResource(ProxyOnlyResource): 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 Azure. + :ivar id: Resource Id. :vartype id: str :ivar name: Resource Name. @@ -26,10 +28,11 @@ class AppServiceEnvironmentPatchResource(ProxyOnlyResource): :type kind: str :ivar type: Resource type. :vartype type: str - :param app_service_environment_patch_resource_name: Name of the App - Service Environment. + :param app_service_environment_patch_resource_name: Required. Name of the + App Service Environment. :type app_service_environment_patch_resource_name: str - :param location: Location of the App Service Environment, e.g. "West US". + :param location: Required. Location of the App Service Environment, e.g. + "West US". :type location: str :ivar provisioning_state: Provisioning state of the App Service Environment. Possible values include: 'Succeeded', 'Failed', 'Canceled', @@ -46,7 +49,7 @@ class AppServiceEnvironmentPatchResource(ProxyOnlyResource): :type vnet_resource_group_name: str :param vnet_subnet_name: Subnet of the Virtual Network. :type vnet_subnet_name: str - :param virtual_network: Description of the Virtual Network. + :param virtual_network: Required. Description of the Virtual Network. :type virtual_network: ~azure.mgmt.web.models.VirtualNetworkProfile :param internal_load_balancing_mode: Specifies which endpoints to serve internally in the Virtual Network for the App Service Environment. @@ -57,8 +60,8 @@ class AppServiceEnvironmentPatchResource(ProxyOnlyResource): :type multi_size: str :param multi_role_count: Number of front-end instances. :type multi_role_count: int - :param worker_pools: Description of worker pools with worker size IDs, VM - sizes, and number of workers in each pool. + :param worker_pools: Required. Description of worker pools with worker + size IDs, VM sizes, and number of workers in each pool. :type worker_pools: list[~azure.mgmt.web.models.WorkerPool] :param ipssl_address_count: Number of IP SSL addresses reserved for the App Service Environment. @@ -204,26 +207,26 @@ class AppServiceEnvironmentPatchResource(ProxyOnlyResource): 'user_whitelisted_ip_ranges': {'key': 'properties.userWhitelistedIpRanges', 'type': '[str]'}, } - def __init__(self, app_service_environment_patch_resource_name, location, virtual_network, worker_pools, kind=None, vnet_name=None, vnet_resource_group_name=None, vnet_subnet_name=None, internal_load_balancing_mode=None, multi_size=None, multi_role_count=None, ipssl_address_count=None, dns_suffix=None, network_access_control_list=None, front_end_scale_factor=None, api_management_account_id=None, suspended=None, dynamic_cache_enabled=None, cluster_settings=None, user_whitelisted_ip_ranges=None): - super(AppServiceEnvironmentPatchResource, self).__init__(kind=kind) - self.app_service_environment_patch_resource_name = app_service_environment_patch_resource_name - self.location = location + def __init__(self, **kwargs): + super(AppServiceEnvironmentPatchResource, self).__init__(**kwargs) + self.app_service_environment_patch_resource_name = kwargs.get('app_service_environment_patch_resource_name', None) + self.location = kwargs.get('location', None) self.provisioning_state = None self.status = None - self.vnet_name = vnet_name - self.vnet_resource_group_name = vnet_resource_group_name - self.vnet_subnet_name = vnet_subnet_name - self.virtual_network = virtual_network - self.internal_load_balancing_mode = internal_load_balancing_mode - self.multi_size = multi_size - self.multi_role_count = multi_role_count - self.worker_pools = worker_pools - self.ipssl_address_count = ipssl_address_count + self.vnet_name = kwargs.get('vnet_name', None) + self.vnet_resource_group_name = kwargs.get('vnet_resource_group_name', None) + self.vnet_subnet_name = kwargs.get('vnet_subnet_name', None) + self.virtual_network = kwargs.get('virtual_network', None) + self.internal_load_balancing_mode = kwargs.get('internal_load_balancing_mode', None) + self.multi_size = kwargs.get('multi_size', None) + self.multi_role_count = kwargs.get('multi_role_count', None) + self.worker_pools = kwargs.get('worker_pools', None) + self.ipssl_address_count = kwargs.get('ipssl_address_count', None) self.database_edition = None self.database_service_objective = None self.upgrade_domains = None self.subscription_id = None - self.dns_suffix = dns_suffix + self.dns_suffix = kwargs.get('dns_suffix', None) self.last_action = None self.last_action_result = None self.allowed_multi_sizes = None @@ -231,14 +234,14 @@ def __init__(self, app_service_environment_patch_resource_name, location, virtua self.maximum_number_of_machines = None self.vip_mappings = None self.environment_capacities = None - self.network_access_control_list = network_access_control_list + self.network_access_control_list = kwargs.get('network_access_control_list', None) self.environment_is_healthy = None self.environment_status = None self.resource_group = None - self.front_end_scale_factor = front_end_scale_factor + self.front_end_scale_factor = kwargs.get('front_end_scale_factor', None) self.default_front_end_scale_factor = None - self.api_management_account_id = api_management_account_id - self.suspended = suspended - self.dynamic_cache_enabled = dynamic_cache_enabled - self.cluster_settings = cluster_settings - self.user_whitelisted_ip_ranges = user_whitelisted_ip_ranges + self.api_management_account_id = kwargs.get('api_management_account_id', None) + self.suspended = kwargs.get('suspended', None) + self.dynamic_cache_enabled = kwargs.get('dynamic_cache_enabled', None) + self.cluster_settings = kwargs.get('cluster_settings', None) + self.user_whitelisted_ip_ranges = kwargs.get('user_whitelisted_ip_ranges', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/app_service_environment_patch_resource_py3.py b/azure-mgmt-web/azure/mgmt/web/models/app_service_environment_patch_resource_py3.py new file mode 100644 index 000000000000..f6771a869795 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/app_service_environment_patch_resource_py3.py @@ -0,0 +1,247 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class AppServiceEnvironmentPatchResource(ProxyOnlyResource): + """ARM resource for a app service enviroment. + + 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 Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param app_service_environment_patch_resource_name: Required. Name of the + App Service Environment. + :type app_service_environment_patch_resource_name: str + :param location: Required. Location of the App Service Environment, e.g. + "West US". + :type location: str + :ivar provisioning_state: Provisioning state of the App Service + Environment. Possible values include: 'Succeeded', 'Failed', 'Canceled', + 'InProgress', 'Deleting' + :vartype provisioning_state: str or + ~azure.mgmt.web.models.ProvisioningState + :ivar status: Current status of the App Service Environment. Possible + values include: 'Preparing', 'Ready', 'Scaling', 'Deleting' + :vartype status: str or ~azure.mgmt.web.models.HostingEnvironmentStatus + :param vnet_name: Name of the Virtual Network for the App Service + Environment. + :type vnet_name: str + :param vnet_resource_group_name: Resource group of the Virtual Network. + :type vnet_resource_group_name: str + :param vnet_subnet_name: Subnet of the Virtual Network. + :type vnet_subnet_name: str + :param virtual_network: Required. Description of the Virtual Network. + :type virtual_network: ~azure.mgmt.web.models.VirtualNetworkProfile + :param internal_load_balancing_mode: Specifies which endpoints to serve + internally in the Virtual Network for the App Service Environment. + Possible values include: 'None', 'Web', 'Publishing' + :type internal_load_balancing_mode: str or + ~azure.mgmt.web.models.InternalLoadBalancingMode + :param multi_size: Front-end VM size, e.g. "Medium", "Large". + :type multi_size: str + :param multi_role_count: Number of front-end instances. + :type multi_role_count: int + :param worker_pools: Required. Description of worker pools with worker + size IDs, VM sizes, and number of workers in each pool. + :type worker_pools: list[~azure.mgmt.web.models.WorkerPool] + :param ipssl_address_count: Number of IP SSL addresses reserved for the + App Service Environment. + :type ipssl_address_count: int + :ivar database_edition: Edition of the metadata database for the App + Service Environment, e.g. "Standard". + :vartype database_edition: str + :ivar database_service_objective: Service objective of the metadata + database for the App Service Environment, e.g. "S0". + :vartype database_service_objective: str + :ivar upgrade_domains: Number of upgrade domains of the App Service + Environment. + :vartype upgrade_domains: int + :ivar subscription_id: Subscription of the App Service Environment. + :vartype subscription_id: str + :param dns_suffix: DNS suffix of the App Service Environment. + :type dns_suffix: str + :ivar last_action: Last deployment action on the App Service Environment. + :vartype last_action: str + :ivar last_action_result: Result of the last deployment action on the App + Service Environment. + :vartype last_action_result: str + :ivar allowed_multi_sizes: List of comma separated strings describing + which VM sizes are allowed for front-ends. + :vartype allowed_multi_sizes: str + :ivar allowed_worker_sizes: List of comma separated strings describing + which VM sizes are allowed for workers. + :vartype allowed_worker_sizes: str + :ivar maximum_number_of_machines: Maximum number of VMs in the App Service + Environment. + :vartype maximum_number_of_machines: int + :ivar vip_mappings: Description of IP SSL mapping for the App Service + Environment. + :vartype vip_mappings: list[~azure.mgmt.web.models.VirtualIPMapping] + :ivar environment_capacities: Current total, used, and available worker + capacities. + :vartype environment_capacities: + list[~azure.mgmt.web.models.StampCapacity] + :param network_access_control_list: Access control list for controlling + traffic to the App Service Environment. + :type network_access_control_list: + list[~azure.mgmt.web.models.NetworkAccessControlEntry] + :ivar environment_is_healthy: True/false indicating whether the App + Service Environment is healthy. + :vartype environment_is_healthy: bool + :ivar environment_status: Detailed message about with results of the last + check of the App Service Environment. + :vartype environment_status: str + :ivar resource_group: Resource group of the App Service Environment. + :vartype resource_group: str + :param front_end_scale_factor: Scale factor for front-ends. + :type front_end_scale_factor: int + :ivar default_front_end_scale_factor: Default Scale Factor for FrontEnds. + :vartype default_front_end_scale_factor: int + :param api_management_account_id: API Management Account associated with + the App Service Environment. + :type api_management_account_id: str + :param suspended: true if the App Service Environment is + suspended; otherwise, false. The environment can be + suspended, e.g. when the management endpoint is no longer available + (most likely because NSG blocked the incoming traffic). + :type suspended: bool + :param dynamic_cache_enabled: True/false indicating whether the App + Service Environment is suspended. The environment can be suspended e.g. + when the management endpoint is no longer available + (most likely because NSG blocked the incoming traffic). + :type dynamic_cache_enabled: bool + :param cluster_settings: Custom settings for changing the behavior of the + App Service Environment. + :type cluster_settings: list[~azure.mgmt.web.models.NameValuePair] + :param user_whitelisted_ip_ranges: User added ip ranges to whitelist on + ASE db + :type user_whitelisted_ip_ranges: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'app_service_environment_patch_resource_name': {'required': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'virtual_network': {'required': True}, + 'worker_pools': {'required': True}, + 'database_edition': {'readonly': True}, + 'database_service_objective': {'readonly': True}, + 'upgrade_domains': {'readonly': True}, + 'subscription_id': {'readonly': True}, + 'last_action': {'readonly': True}, + 'last_action_result': {'readonly': True}, + 'allowed_multi_sizes': {'readonly': True}, + 'allowed_worker_sizes': {'readonly': True}, + 'maximum_number_of_machines': {'readonly': True}, + 'vip_mappings': {'readonly': True}, + 'environment_capacities': {'readonly': True}, + 'environment_is_healthy': {'readonly': True}, + 'environment_status': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'default_front_end_scale_factor': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'app_service_environment_patch_resource_name': {'key': 'properties.name', 'type': 'str'}, + 'location': {'key': 'properties.location', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, + 'status': {'key': 'properties.status', 'type': 'HostingEnvironmentStatus'}, + 'vnet_name': {'key': 'properties.vnetName', 'type': 'str'}, + 'vnet_resource_group_name': {'key': 'properties.vnetResourceGroupName', 'type': 'str'}, + 'vnet_subnet_name': {'key': 'properties.vnetSubnetName', 'type': 'str'}, + 'virtual_network': {'key': 'properties.virtualNetwork', 'type': 'VirtualNetworkProfile'}, + 'internal_load_balancing_mode': {'key': 'properties.internalLoadBalancingMode', 'type': 'InternalLoadBalancingMode'}, + 'multi_size': {'key': 'properties.multiSize', 'type': 'str'}, + 'multi_role_count': {'key': 'properties.multiRoleCount', 'type': 'int'}, + 'worker_pools': {'key': 'properties.workerPools', 'type': '[WorkerPool]'}, + 'ipssl_address_count': {'key': 'properties.ipsslAddressCount', 'type': 'int'}, + 'database_edition': {'key': 'properties.databaseEdition', 'type': 'str'}, + 'database_service_objective': {'key': 'properties.databaseServiceObjective', 'type': 'str'}, + 'upgrade_domains': {'key': 'properties.upgradeDomains', 'type': 'int'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + 'dns_suffix': {'key': 'properties.dnsSuffix', 'type': 'str'}, + 'last_action': {'key': 'properties.lastAction', 'type': 'str'}, + 'last_action_result': {'key': 'properties.lastActionResult', 'type': 'str'}, + 'allowed_multi_sizes': {'key': 'properties.allowedMultiSizes', 'type': 'str'}, + 'allowed_worker_sizes': {'key': 'properties.allowedWorkerSizes', 'type': 'str'}, + 'maximum_number_of_machines': {'key': 'properties.maximumNumberOfMachines', 'type': 'int'}, + 'vip_mappings': {'key': 'properties.vipMappings', 'type': '[VirtualIPMapping]'}, + 'environment_capacities': {'key': 'properties.environmentCapacities', 'type': '[StampCapacity]'}, + 'network_access_control_list': {'key': 'properties.networkAccessControlList', 'type': '[NetworkAccessControlEntry]'}, + 'environment_is_healthy': {'key': 'properties.environmentIsHealthy', 'type': 'bool'}, + 'environment_status': {'key': 'properties.environmentStatus', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'front_end_scale_factor': {'key': 'properties.frontEndScaleFactor', 'type': 'int'}, + 'default_front_end_scale_factor': {'key': 'properties.defaultFrontEndScaleFactor', 'type': 'int'}, + 'api_management_account_id': {'key': 'properties.apiManagementAccountId', 'type': 'str'}, + 'suspended': {'key': 'properties.suspended', 'type': 'bool'}, + 'dynamic_cache_enabled': {'key': 'properties.dynamicCacheEnabled', 'type': 'bool'}, + 'cluster_settings': {'key': 'properties.clusterSettings', 'type': '[NameValuePair]'}, + 'user_whitelisted_ip_ranges': {'key': 'properties.userWhitelistedIpRanges', 'type': '[str]'}, + } + + def __init__(self, *, app_service_environment_patch_resource_name: str, location: str, virtual_network, worker_pools, kind: str=None, vnet_name: str=None, vnet_resource_group_name: str=None, vnet_subnet_name: str=None, internal_load_balancing_mode=None, multi_size: str=None, multi_role_count: int=None, ipssl_address_count: int=None, dns_suffix: str=None, network_access_control_list=None, front_end_scale_factor: int=None, api_management_account_id: str=None, suspended: bool=None, dynamic_cache_enabled: bool=None, cluster_settings=None, user_whitelisted_ip_ranges=None, **kwargs) -> None: + super(AppServiceEnvironmentPatchResource, self).__init__(kind=kind, **kwargs) + self.app_service_environment_patch_resource_name = app_service_environment_patch_resource_name + self.location = location + self.provisioning_state = None + self.status = None + self.vnet_name = vnet_name + self.vnet_resource_group_name = vnet_resource_group_name + self.vnet_subnet_name = vnet_subnet_name + self.virtual_network = virtual_network + self.internal_load_balancing_mode = internal_load_balancing_mode + self.multi_size = multi_size + self.multi_role_count = multi_role_count + self.worker_pools = worker_pools + self.ipssl_address_count = ipssl_address_count + self.database_edition = None + self.database_service_objective = None + self.upgrade_domains = None + self.subscription_id = None + self.dns_suffix = dns_suffix + self.last_action = None + self.last_action_result = None + self.allowed_multi_sizes = None + self.allowed_worker_sizes = None + self.maximum_number_of_machines = None + self.vip_mappings = None + self.environment_capacities = None + self.network_access_control_list = network_access_control_list + self.environment_is_healthy = None + self.environment_status = None + self.resource_group = None + self.front_end_scale_factor = front_end_scale_factor + self.default_front_end_scale_factor = None + self.api_management_account_id = api_management_account_id + self.suspended = suspended + self.dynamic_cache_enabled = dynamic_cache_enabled + self.cluster_settings = cluster_settings + self.user_whitelisted_ip_ranges = user_whitelisted_ip_ranges diff --git a/azure-mgmt-web/azure/mgmt/web/models/app_service_environment_py3.py b/azure-mgmt-web/azure/mgmt/web/models/app_service_environment_py3.py new file mode 100644 index 000000000000..fd0968e50c29 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/app_service_environment_py3.py @@ -0,0 +1,231 @@ +# 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 msrest.serialization import Model + + +class AppServiceEnvironment(Model): + """Description of an App Service 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 Azure. + + :param name: Required. Name of the App Service Environment. + :type name: str + :param location: Required. Location of the App Service Environment, e.g. + "West US". + :type location: str + :ivar provisioning_state: Provisioning state of the App Service + Environment. Possible values include: 'Succeeded', 'Failed', 'Canceled', + 'InProgress', 'Deleting' + :vartype provisioning_state: str or + ~azure.mgmt.web.models.ProvisioningState + :ivar status: Current status of the App Service Environment. Possible + values include: 'Preparing', 'Ready', 'Scaling', 'Deleting' + :vartype status: str or ~azure.mgmt.web.models.HostingEnvironmentStatus + :param vnet_name: Name of the Virtual Network for the App Service + Environment. + :type vnet_name: str + :param vnet_resource_group_name: Resource group of the Virtual Network. + :type vnet_resource_group_name: str + :param vnet_subnet_name: Subnet of the Virtual Network. + :type vnet_subnet_name: str + :param virtual_network: Required. Description of the Virtual Network. + :type virtual_network: ~azure.mgmt.web.models.VirtualNetworkProfile + :param internal_load_balancing_mode: Specifies which endpoints to serve + internally in the Virtual Network for the App Service Environment. + Possible values include: 'None', 'Web', 'Publishing' + :type internal_load_balancing_mode: str or + ~azure.mgmt.web.models.InternalLoadBalancingMode + :param multi_size: Front-end VM size, e.g. "Medium", "Large". + :type multi_size: str + :param multi_role_count: Number of front-end instances. + :type multi_role_count: int + :param worker_pools: Required. Description of worker pools with worker + size IDs, VM sizes, and number of workers in each pool. + :type worker_pools: list[~azure.mgmt.web.models.WorkerPool] + :param ipssl_address_count: Number of IP SSL addresses reserved for the + App Service Environment. + :type ipssl_address_count: int + :ivar database_edition: Edition of the metadata database for the App + Service Environment, e.g. "Standard". + :vartype database_edition: str + :ivar database_service_objective: Service objective of the metadata + database for the App Service Environment, e.g. "S0". + :vartype database_service_objective: str + :ivar upgrade_domains: Number of upgrade domains of the App Service + Environment. + :vartype upgrade_domains: int + :ivar subscription_id: Subscription of the App Service Environment. + :vartype subscription_id: str + :param dns_suffix: DNS suffix of the App Service Environment. + :type dns_suffix: str + :ivar last_action: Last deployment action on the App Service Environment. + :vartype last_action: str + :ivar last_action_result: Result of the last deployment action on the App + Service Environment. + :vartype last_action_result: str + :ivar allowed_multi_sizes: List of comma separated strings describing + which VM sizes are allowed for front-ends. + :vartype allowed_multi_sizes: str + :ivar allowed_worker_sizes: List of comma separated strings describing + which VM sizes are allowed for workers. + :vartype allowed_worker_sizes: str + :ivar maximum_number_of_machines: Maximum number of VMs in the App Service + Environment. + :vartype maximum_number_of_machines: int + :ivar vip_mappings: Description of IP SSL mapping for the App Service + Environment. + :vartype vip_mappings: list[~azure.mgmt.web.models.VirtualIPMapping] + :ivar environment_capacities: Current total, used, and available worker + capacities. + :vartype environment_capacities: + list[~azure.mgmt.web.models.StampCapacity] + :param network_access_control_list: Access control list for controlling + traffic to the App Service Environment. + :type network_access_control_list: + list[~azure.mgmt.web.models.NetworkAccessControlEntry] + :ivar environment_is_healthy: True/false indicating whether the App + Service Environment is healthy. + :vartype environment_is_healthy: bool + :ivar environment_status: Detailed message about with results of the last + check of the App Service Environment. + :vartype environment_status: str + :ivar resource_group: Resource group of the App Service Environment. + :vartype resource_group: str + :param front_end_scale_factor: Scale factor for front-ends. + :type front_end_scale_factor: int + :ivar default_front_end_scale_factor: Default Scale Factor for FrontEnds. + :vartype default_front_end_scale_factor: int + :param api_management_account_id: API Management Account associated with + the App Service Environment. + :type api_management_account_id: str + :param suspended: true if the App Service Environment is + suspended; otherwise, false. The environment can be + suspended, e.g. when the management endpoint is no longer available + (most likely because NSG blocked the incoming traffic). + :type suspended: bool + :param dynamic_cache_enabled: True/false indicating whether the App + Service Environment is suspended. The environment can be suspended e.g. + when the management endpoint is no longer available + (most likely because NSG blocked the incoming traffic). + :type dynamic_cache_enabled: bool + :param cluster_settings: Custom settings for changing the behavior of the + App Service Environment. + :type cluster_settings: list[~azure.mgmt.web.models.NameValuePair] + :param user_whitelisted_ip_ranges: User added ip ranges to whitelist on + ASE db + :type user_whitelisted_ip_ranges: list[str] + """ + + _validation = { + 'name': {'required': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'virtual_network': {'required': True}, + 'worker_pools': {'required': True}, + 'database_edition': {'readonly': True}, + 'database_service_objective': {'readonly': True}, + 'upgrade_domains': {'readonly': True}, + 'subscription_id': {'readonly': True}, + 'last_action': {'readonly': True}, + 'last_action_result': {'readonly': True}, + 'allowed_multi_sizes': {'readonly': True}, + 'allowed_worker_sizes': {'readonly': True}, + 'maximum_number_of_machines': {'readonly': True}, + 'vip_mappings': {'readonly': True}, + 'environment_capacities': {'readonly': True}, + 'environment_is_healthy': {'readonly': True}, + 'environment_status': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'default_front_end_scale_factor': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'ProvisioningState'}, + 'status': {'key': 'status', 'type': 'HostingEnvironmentStatus'}, + 'vnet_name': {'key': 'vnetName', 'type': 'str'}, + 'vnet_resource_group_name': {'key': 'vnetResourceGroupName', 'type': 'str'}, + 'vnet_subnet_name': {'key': 'vnetSubnetName', 'type': 'str'}, + 'virtual_network': {'key': 'virtualNetwork', 'type': 'VirtualNetworkProfile'}, + 'internal_load_balancing_mode': {'key': 'internalLoadBalancingMode', 'type': 'InternalLoadBalancingMode'}, + 'multi_size': {'key': 'multiSize', 'type': 'str'}, + 'multi_role_count': {'key': 'multiRoleCount', 'type': 'int'}, + 'worker_pools': {'key': 'workerPools', 'type': '[WorkerPool]'}, + 'ipssl_address_count': {'key': 'ipsslAddressCount', 'type': 'int'}, + 'database_edition': {'key': 'databaseEdition', 'type': 'str'}, + 'database_service_objective': {'key': 'databaseServiceObjective', 'type': 'str'}, + 'upgrade_domains': {'key': 'upgradeDomains', 'type': 'int'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'dns_suffix': {'key': 'dnsSuffix', 'type': 'str'}, + 'last_action': {'key': 'lastAction', 'type': 'str'}, + 'last_action_result': {'key': 'lastActionResult', 'type': 'str'}, + 'allowed_multi_sizes': {'key': 'allowedMultiSizes', 'type': 'str'}, + 'allowed_worker_sizes': {'key': 'allowedWorkerSizes', 'type': 'str'}, + 'maximum_number_of_machines': {'key': 'maximumNumberOfMachines', 'type': 'int'}, + 'vip_mappings': {'key': 'vipMappings', 'type': '[VirtualIPMapping]'}, + 'environment_capacities': {'key': 'environmentCapacities', 'type': '[StampCapacity]'}, + 'network_access_control_list': {'key': 'networkAccessControlList', 'type': '[NetworkAccessControlEntry]'}, + 'environment_is_healthy': {'key': 'environmentIsHealthy', 'type': 'bool'}, + 'environment_status': {'key': 'environmentStatus', 'type': 'str'}, + 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, + 'front_end_scale_factor': {'key': 'frontEndScaleFactor', 'type': 'int'}, + 'default_front_end_scale_factor': {'key': 'defaultFrontEndScaleFactor', 'type': 'int'}, + 'api_management_account_id': {'key': 'apiManagementAccountId', 'type': 'str'}, + 'suspended': {'key': 'suspended', 'type': 'bool'}, + 'dynamic_cache_enabled': {'key': 'dynamicCacheEnabled', 'type': 'bool'}, + 'cluster_settings': {'key': 'clusterSettings', 'type': '[NameValuePair]'}, + 'user_whitelisted_ip_ranges': {'key': 'userWhitelistedIpRanges', 'type': '[str]'}, + } + + def __init__(self, *, name: str, location: str, virtual_network, worker_pools, vnet_name: str=None, vnet_resource_group_name: str=None, vnet_subnet_name: str=None, internal_load_balancing_mode=None, multi_size: str=None, multi_role_count: int=None, ipssl_address_count: int=None, dns_suffix: str=None, network_access_control_list=None, front_end_scale_factor: int=None, api_management_account_id: str=None, suspended: bool=None, dynamic_cache_enabled: bool=None, cluster_settings=None, user_whitelisted_ip_ranges=None, **kwargs) -> None: + super(AppServiceEnvironment, self).__init__(**kwargs) + self.name = name + self.location = location + self.provisioning_state = None + self.status = None + self.vnet_name = vnet_name + self.vnet_resource_group_name = vnet_resource_group_name + self.vnet_subnet_name = vnet_subnet_name + self.virtual_network = virtual_network + self.internal_load_balancing_mode = internal_load_balancing_mode + self.multi_size = multi_size + self.multi_role_count = multi_role_count + self.worker_pools = worker_pools + self.ipssl_address_count = ipssl_address_count + self.database_edition = None + self.database_service_objective = None + self.upgrade_domains = None + self.subscription_id = None + self.dns_suffix = dns_suffix + self.last_action = None + self.last_action_result = None + self.allowed_multi_sizes = None + self.allowed_worker_sizes = None + self.maximum_number_of_machines = None + self.vip_mappings = None + self.environment_capacities = None + self.network_access_control_list = network_access_control_list + self.environment_is_healthy = None + self.environment_status = None + self.resource_group = None + self.front_end_scale_factor = front_end_scale_factor + self.default_front_end_scale_factor = None + self.api_management_account_id = api_management_account_id + self.suspended = suspended + self.dynamic_cache_enabled = dynamic_cache_enabled + self.cluster_settings = cluster_settings + self.user_whitelisted_ip_ranges = user_whitelisted_ip_ranges diff --git a/azure-mgmt-web/azure/mgmt/web/models/app_service_environment_resource.py b/azure-mgmt-web/azure/mgmt/web/models/app_service_environment_resource.py index 58ebede0b657..c51a186cb590 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/app_service_environment_resource.py +++ b/azure-mgmt-web/azure/mgmt/web/models/app_service_environment_resource.py @@ -18,23 +18,25 @@ class AppServiceEnvironmentResource(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 Azure. + :ivar id: Resource Id. :vartype id: str :ivar name: Resource Name. :vartype name: str :param kind: Kind of resource. :type kind: str - :param location: Resource Location. + :param location: Required. Resource Location. :type location: str :ivar type: Resource type. :vartype type: str :param tags: Resource tags. :type tags: dict[str, str] - :param app_service_environment_resource_name: Name of the App Service - Environment. + :param app_service_environment_resource_name: Required. Name of the App + Service Environment. :type app_service_environment_resource_name: str - :param app_service_environment_resource_location: Location of the App - Service Environment, e.g. "West US". + :param app_service_environment_resource_location: Required. Location of + the App Service Environment, e.g. "West US". :type app_service_environment_resource_location: str :ivar provisioning_state: Provisioning state of the App Service Environment. Possible values include: 'Succeeded', 'Failed', 'Canceled', @@ -51,7 +53,7 @@ class AppServiceEnvironmentResource(Resource): :type vnet_resource_group_name: str :param vnet_subnet_name: Subnet of the Virtual Network. :type vnet_subnet_name: str - :param virtual_network: Description of the Virtual Network. + :param virtual_network: Required. Description of the Virtual Network. :type virtual_network: ~azure.mgmt.web.models.VirtualNetworkProfile :param internal_load_balancing_mode: Specifies which endpoints to serve internally in the Virtual Network for the App Service Environment. @@ -62,8 +64,8 @@ class AppServiceEnvironmentResource(Resource): :type multi_size: str :param multi_role_count: Number of front-end instances. :type multi_role_count: int - :param worker_pools: Description of worker pools with worker size IDs, VM - sizes, and number of workers in each pool. + :param worker_pools: Required. Description of worker pools with worker + size IDs, VM sizes, and number of workers in each pool. :type worker_pools: list[~azure.mgmt.web.models.WorkerPool] :param ipssl_address_count: Number of IP SSL addresses reserved for the App Service Environment. @@ -212,26 +214,26 @@ class AppServiceEnvironmentResource(Resource): 'user_whitelisted_ip_ranges': {'key': 'properties.userWhitelistedIpRanges', 'type': '[str]'}, } - def __init__(self, location, app_service_environment_resource_name, app_service_environment_resource_location, virtual_network, worker_pools, kind=None, tags=None, vnet_name=None, vnet_resource_group_name=None, vnet_subnet_name=None, internal_load_balancing_mode=None, multi_size=None, multi_role_count=None, ipssl_address_count=None, dns_suffix=None, network_access_control_list=None, front_end_scale_factor=None, api_management_account_id=None, suspended=None, dynamic_cache_enabled=None, cluster_settings=None, user_whitelisted_ip_ranges=None): - super(AppServiceEnvironmentResource, self).__init__(kind=kind, location=location, tags=tags) - self.app_service_environment_resource_name = app_service_environment_resource_name - self.app_service_environment_resource_location = app_service_environment_resource_location + def __init__(self, **kwargs): + super(AppServiceEnvironmentResource, self).__init__(**kwargs) + self.app_service_environment_resource_name = kwargs.get('app_service_environment_resource_name', None) + self.app_service_environment_resource_location = kwargs.get('app_service_environment_resource_location', None) self.provisioning_state = None self.status = None - self.vnet_name = vnet_name - self.vnet_resource_group_name = vnet_resource_group_name - self.vnet_subnet_name = vnet_subnet_name - self.virtual_network = virtual_network - self.internal_load_balancing_mode = internal_load_balancing_mode - self.multi_size = multi_size - self.multi_role_count = multi_role_count - self.worker_pools = worker_pools - self.ipssl_address_count = ipssl_address_count + self.vnet_name = kwargs.get('vnet_name', None) + self.vnet_resource_group_name = kwargs.get('vnet_resource_group_name', None) + self.vnet_subnet_name = kwargs.get('vnet_subnet_name', None) + self.virtual_network = kwargs.get('virtual_network', None) + self.internal_load_balancing_mode = kwargs.get('internal_load_balancing_mode', None) + self.multi_size = kwargs.get('multi_size', None) + self.multi_role_count = kwargs.get('multi_role_count', None) + self.worker_pools = kwargs.get('worker_pools', None) + self.ipssl_address_count = kwargs.get('ipssl_address_count', None) self.database_edition = None self.database_service_objective = None self.upgrade_domains = None self.subscription_id = None - self.dns_suffix = dns_suffix + self.dns_suffix = kwargs.get('dns_suffix', None) self.last_action = None self.last_action_result = None self.allowed_multi_sizes = None @@ -239,14 +241,14 @@ def __init__(self, location, app_service_environment_resource_name, app_service_ self.maximum_number_of_machines = None self.vip_mappings = None self.environment_capacities = None - self.network_access_control_list = network_access_control_list + self.network_access_control_list = kwargs.get('network_access_control_list', None) self.environment_is_healthy = None self.environment_status = None self.resource_group = None - self.front_end_scale_factor = front_end_scale_factor + self.front_end_scale_factor = kwargs.get('front_end_scale_factor', None) self.default_front_end_scale_factor = None - self.api_management_account_id = api_management_account_id - self.suspended = suspended - self.dynamic_cache_enabled = dynamic_cache_enabled - self.cluster_settings = cluster_settings - self.user_whitelisted_ip_ranges = user_whitelisted_ip_ranges + self.api_management_account_id = kwargs.get('api_management_account_id', None) + self.suspended = kwargs.get('suspended', None) + self.dynamic_cache_enabled = kwargs.get('dynamic_cache_enabled', None) + self.cluster_settings = kwargs.get('cluster_settings', None) + self.user_whitelisted_ip_ranges = kwargs.get('user_whitelisted_ip_ranges', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/app_service_environment_resource_py3.py b/azure-mgmt-web/azure/mgmt/web/models/app_service_environment_resource_py3.py new file mode 100644 index 000000000000..43fe539a0715 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/app_service_environment_resource_py3.py @@ -0,0 +1,254 @@ +# 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 .resource import Resource + + +class AppServiceEnvironmentResource(Resource): + """App Service Environment 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 Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param app_service_environment_resource_name: Required. Name of the App + Service Environment. + :type app_service_environment_resource_name: str + :param app_service_environment_resource_location: Required. Location of + the App Service Environment, e.g. "West US". + :type app_service_environment_resource_location: str + :ivar provisioning_state: Provisioning state of the App Service + Environment. Possible values include: 'Succeeded', 'Failed', 'Canceled', + 'InProgress', 'Deleting' + :vartype provisioning_state: str or + ~azure.mgmt.web.models.ProvisioningState + :ivar status: Current status of the App Service Environment. Possible + values include: 'Preparing', 'Ready', 'Scaling', 'Deleting' + :vartype status: str or ~azure.mgmt.web.models.HostingEnvironmentStatus + :param vnet_name: Name of the Virtual Network for the App Service + Environment. + :type vnet_name: str + :param vnet_resource_group_name: Resource group of the Virtual Network. + :type vnet_resource_group_name: str + :param vnet_subnet_name: Subnet of the Virtual Network. + :type vnet_subnet_name: str + :param virtual_network: Required. Description of the Virtual Network. + :type virtual_network: ~azure.mgmt.web.models.VirtualNetworkProfile + :param internal_load_balancing_mode: Specifies which endpoints to serve + internally in the Virtual Network for the App Service Environment. + Possible values include: 'None', 'Web', 'Publishing' + :type internal_load_balancing_mode: str or + ~azure.mgmt.web.models.InternalLoadBalancingMode + :param multi_size: Front-end VM size, e.g. "Medium", "Large". + :type multi_size: str + :param multi_role_count: Number of front-end instances. + :type multi_role_count: int + :param worker_pools: Required. Description of worker pools with worker + size IDs, VM sizes, and number of workers in each pool. + :type worker_pools: list[~azure.mgmt.web.models.WorkerPool] + :param ipssl_address_count: Number of IP SSL addresses reserved for the + App Service Environment. + :type ipssl_address_count: int + :ivar database_edition: Edition of the metadata database for the App + Service Environment, e.g. "Standard". + :vartype database_edition: str + :ivar database_service_objective: Service objective of the metadata + database for the App Service Environment, e.g. "S0". + :vartype database_service_objective: str + :ivar upgrade_domains: Number of upgrade domains of the App Service + Environment. + :vartype upgrade_domains: int + :ivar subscription_id: Subscription of the App Service Environment. + :vartype subscription_id: str + :param dns_suffix: DNS suffix of the App Service Environment. + :type dns_suffix: str + :ivar last_action: Last deployment action on the App Service Environment. + :vartype last_action: str + :ivar last_action_result: Result of the last deployment action on the App + Service Environment. + :vartype last_action_result: str + :ivar allowed_multi_sizes: List of comma separated strings describing + which VM sizes are allowed for front-ends. + :vartype allowed_multi_sizes: str + :ivar allowed_worker_sizes: List of comma separated strings describing + which VM sizes are allowed for workers. + :vartype allowed_worker_sizes: str + :ivar maximum_number_of_machines: Maximum number of VMs in the App Service + Environment. + :vartype maximum_number_of_machines: int + :ivar vip_mappings: Description of IP SSL mapping for the App Service + Environment. + :vartype vip_mappings: list[~azure.mgmt.web.models.VirtualIPMapping] + :ivar environment_capacities: Current total, used, and available worker + capacities. + :vartype environment_capacities: + list[~azure.mgmt.web.models.StampCapacity] + :param network_access_control_list: Access control list for controlling + traffic to the App Service Environment. + :type network_access_control_list: + list[~azure.mgmt.web.models.NetworkAccessControlEntry] + :ivar environment_is_healthy: True/false indicating whether the App + Service Environment is healthy. + :vartype environment_is_healthy: bool + :ivar environment_status: Detailed message about with results of the last + check of the App Service Environment. + :vartype environment_status: str + :ivar resource_group: Resource group of the App Service Environment. + :vartype resource_group: str + :param front_end_scale_factor: Scale factor for front-ends. + :type front_end_scale_factor: int + :ivar default_front_end_scale_factor: Default Scale Factor for FrontEnds. + :vartype default_front_end_scale_factor: int + :param api_management_account_id: API Management Account associated with + the App Service Environment. + :type api_management_account_id: str + :param suspended: true if the App Service Environment is + suspended; otherwise, false. The environment can be + suspended, e.g. when the management endpoint is no longer available + (most likely because NSG blocked the incoming traffic). + :type suspended: bool + :param dynamic_cache_enabled: True/false indicating whether the App + Service Environment is suspended. The environment can be suspended e.g. + when the management endpoint is no longer available + (most likely because NSG blocked the incoming traffic). + :type dynamic_cache_enabled: bool + :param cluster_settings: Custom settings for changing the behavior of the + App Service Environment. + :type cluster_settings: list[~azure.mgmt.web.models.NameValuePair] + :param user_whitelisted_ip_ranges: User added ip ranges to whitelist on + ASE db + :type user_whitelisted_ip_ranges: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'app_service_environment_resource_name': {'required': True}, + 'app_service_environment_resource_location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'virtual_network': {'required': True}, + 'worker_pools': {'required': True}, + 'database_edition': {'readonly': True}, + 'database_service_objective': {'readonly': True}, + 'upgrade_domains': {'readonly': True}, + 'subscription_id': {'readonly': True}, + 'last_action': {'readonly': True}, + 'last_action_result': {'readonly': True}, + 'allowed_multi_sizes': {'readonly': True}, + 'allowed_worker_sizes': {'readonly': True}, + 'maximum_number_of_machines': {'readonly': True}, + 'vip_mappings': {'readonly': True}, + 'environment_capacities': {'readonly': True}, + 'environment_is_healthy': {'readonly': True}, + 'environment_status': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'default_front_end_scale_factor': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'app_service_environment_resource_name': {'key': 'properties.name', 'type': 'str'}, + 'app_service_environment_resource_location': {'key': 'properties.location', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, + 'status': {'key': 'properties.status', 'type': 'HostingEnvironmentStatus'}, + 'vnet_name': {'key': 'properties.vnetName', 'type': 'str'}, + 'vnet_resource_group_name': {'key': 'properties.vnetResourceGroupName', 'type': 'str'}, + 'vnet_subnet_name': {'key': 'properties.vnetSubnetName', 'type': 'str'}, + 'virtual_network': {'key': 'properties.virtualNetwork', 'type': 'VirtualNetworkProfile'}, + 'internal_load_balancing_mode': {'key': 'properties.internalLoadBalancingMode', 'type': 'InternalLoadBalancingMode'}, + 'multi_size': {'key': 'properties.multiSize', 'type': 'str'}, + 'multi_role_count': {'key': 'properties.multiRoleCount', 'type': 'int'}, + 'worker_pools': {'key': 'properties.workerPools', 'type': '[WorkerPool]'}, + 'ipssl_address_count': {'key': 'properties.ipsslAddressCount', 'type': 'int'}, + 'database_edition': {'key': 'properties.databaseEdition', 'type': 'str'}, + 'database_service_objective': {'key': 'properties.databaseServiceObjective', 'type': 'str'}, + 'upgrade_domains': {'key': 'properties.upgradeDomains', 'type': 'int'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + 'dns_suffix': {'key': 'properties.dnsSuffix', 'type': 'str'}, + 'last_action': {'key': 'properties.lastAction', 'type': 'str'}, + 'last_action_result': {'key': 'properties.lastActionResult', 'type': 'str'}, + 'allowed_multi_sizes': {'key': 'properties.allowedMultiSizes', 'type': 'str'}, + 'allowed_worker_sizes': {'key': 'properties.allowedWorkerSizes', 'type': 'str'}, + 'maximum_number_of_machines': {'key': 'properties.maximumNumberOfMachines', 'type': 'int'}, + 'vip_mappings': {'key': 'properties.vipMappings', 'type': '[VirtualIPMapping]'}, + 'environment_capacities': {'key': 'properties.environmentCapacities', 'type': '[StampCapacity]'}, + 'network_access_control_list': {'key': 'properties.networkAccessControlList', 'type': '[NetworkAccessControlEntry]'}, + 'environment_is_healthy': {'key': 'properties.environmentIsHealthy', 'type': 'bool'}, + 'environment_status': {'key': 'properties.environmentStatus', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'front_end_scale_factor': {'key': 'properties.frontEndScaleFactor', 'type': 'int'}, + 'default_front_end_scale_factor': {'key': 'properties.defaultFrontEndScaleFactor', 'type': 'int'}, + 'api_management_account_id': {'key': 'properties.apiManagementAccountId', 'type': 'str'}, + 'suspended': {'key': 'properties.suspended', 'type': 'bool'}, + 'dynamic_cache_enabled': {'key': 'properties.dynamicCacheEnabled', 'type': 'bool'}, + 'cluster_settings': {'key': 'properties.clusterSettings', 'type': '[NameValuePair]'}, + 'user_whitelisted_ip_ranges': {'key': 'properties.userWhitelistedIpRanges', 'type': '[str]'}, + } + + def __init__(self, *, location: str, app_service_environment_resource_name: str, app_service_environment_resource_location: str, virtual_network, worker_pools, kind: str=None, tags=None, vnet_name: str=None, vnet_resource_group_name: str=None, vnet_subnet_name: str=None, internal_load_balancing_mode=None, multi_size: str=None, multi_role_count: int=None, ipssl_address_count: int=None, dns_suffix: str=None, network_access_control_list=None, front_end_scale_factor: int=None, api_management_account_id: str=None, suspended: bool=None, dynamic_cache_enabled: bool=None, cluster_settings=None, user_whitelisted_ip_ranges=None, **kwargs) -> None: + super(AppServiceEnvironmentResource, self).__init__(kind=kind, location=location, tags=tags, **kwargs) + self.app_service_environment_resource_name = app_service_environment_resource_name + self.app_service_environment_resource_location = app_service_environment_resource_location + self.provisioning_state = None + self.status = None + self.vnet_name = vnet_name + self.vnet_resource_group_name = vnet_resource_group_name + self.vnet_subnet_name = vnet_subnet_name + self.virtual_network = virtual_network + self.internal_load_balancing_mode = internal_load_balancing_mode + self.multi_size = multi_size + self.multi_role_count = multi_role_count + self.worker_pools = worker_pools + self.ipssl_address_count = ipssl_address_count + self.database_edition = None + self.database_service_objective = None + self.upgrade_domains = None + self.subscription_id = None + self.dns_suffix = dns_suffix + self.last_action = None + self.last_action_result = None + self.allowed_multi_sizes = None + self.allowed_worker_sizes = None + self.maximum_number_of_machines = None + self.vip_mappings = None + self.environment_capacities = None + self.network_access_control_list = network_access_control_list + self.environment_is_healthy = None + self.environment_status = None + self.resource_group = None + self.front_end_scale_factor = front_end_scale_factor + self.default_front_end_scale_factor = None + self.api_management_account_id = api_management_account_id + self.suspended = suspended + self.dynamic_cache_enabled = dynamic_cache_enabled + self.cluster_settings = cluster_settings + self.user_whitelisted_ip_ranges = user_whitelisted_ip_ranges diff --git a/azure-mgmt-web/azure/mgmt/web/models/app_service_plan.py b/azure-mgmt-web/azure/mgmt/web/models/app_service_plan.py index 69647b08d17a..3f7258ef8712 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/app_service_plan.py +++ b/azure-mgmt-web/azure/mgmt/web/models/app_service_plan.py @@ -18,19 +18,21 @@ class AppServicePlan(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 Azure. + :ivar id: Resource Id. :vartype id: str :ivar name: Resource Name. :vartype name: str :param kind: Kind of resource. :type kind: str - :param location: Resource Location. + :param location: Required. Resource Location. :type location: str :ivar type: Resource type. :vartype type: str :param tags: Resource tags. :type tags: dict[str, str] - :param app_service_plan_name: Name for the App Service plan. + :param app_service_plan_name: Required. Name for the App Service plan. :type app_service_plan_name: str :param worker_tier_name: Target worker tier assigned to the App Service plan. @@ -124,23 +126,23 @@ class AppServicePlan(Resource): 'sku': {'key': 'sku', 'type': 'SkuDescription'}, } - def __init__(self, location, app_service_plan_name, kind=None, tags=None, worker_tier_name=None, admin_site_name=None, hosting_environment_profile=None, per_site_scaling=False, is_spot=None, spot_expiration_time=None, reserved=False, target_worker_count=None, target_worker_size_id=None, sku=None): - super(AppServicePlan, self).__init__(kind=kind, location=location, tags=tags) - self.app_service_plan_name = app_service_plan_name - self.worker_tier_name = worker_tier_name + def __init__(self, **kwargs): + super(AppServicePlan, self).__init__(**kwargs) + self.app_service_plan_name = kwargs.get('app_service_plan_name', None) + self.worker_tier_name = kwargs.get('worker_tier_name', None) self.status = None self.subscription = None - self.admin_site_name = admin_site_name - self.hosting_environment_profile = hosting_environment_profile + self.admin_site_name = kwargs.get('admin_site_name', None) + self.hosting_environment_profile = kwargs.get('hosting_environment_profile', None) self.maximum_number_of_workers = None self.geo_region = None - self.per_site_scaling = per_site_scaling + self.per_site_scaling = kwargs.get('per_site_scaling', False) self.number_of_sites = None - self.is_spot = is_spot - self.spot_expiration_time = spot_expiration_time + self.is_spot = kwargs.get('is_spot', None) + self.spot_expiration_time = kwargs.get('spot_expiration_time', None) self.resource_group = None - self.reserved = reserved - self.target_worker_count = target_worker_count - self.target_worker_size_id = target_worker_size_id + self.reserved = kwargs.get('reserved', False) + self.target_worker_count = kwargs.get('target_worker_count', None) + self.target_worker_size_id = kwargs.get('target_worker_size_id', None) self.provisioning_state = None - self.sku = sku + self.sku = kwargs.get('sku', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/app_service_plan_patch_resource.py b/azure-mgmt-web/azure/mgmt/web/models/app_service_plan_patch_resource.py index a2a773a5469e..f7bee7ea7449 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/app_service_plan_patch_resource.py +++ b/azure-mgmt-web/azure/mgmt/web/models/app_service_plan_patch_resource.py @@ -18,6 +18,8 @@ class AppServicePlanPatchResource(ProxyOnlyResource): 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 Azure. + :ivar id: Resource Id. :vartype id: str :ivar name: Resource Name. @@ -26,8 +28,8 @@ class AppServicePlanPatchResource(ProxyOnlyResource): :type kind: str :ivar type: Resource type. :vartype type: str - :param app_service_plan_patch_resource_name: Name for the App Service - plan. + :param app_service_plan_patch_resource_name: Required. Name for the App + Service plan. :type app_service_plan_patch_resource_name: str :param worker_tier_name: Target worker tier assigned to the App Service plan. @@ -115,22 +117,22 @@ class AppServicePlanPatchResource(ProxyOnlyResource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, } - def __init__(self, app_service_plan_patch_resource_name, kind=None, worker_tier_name=None, admin_site_name=None, hosting_environment_profile=None, per_site_scaling=False, is_spot=None, spot_expiration_time=None, reserved=False, target_worker_count=None, target_worker_size_id=None): - super(AppServicePlanPatchResource, self).__init__(kind=kind) - self.app_service_plan_patch_resource_name = app_service_plan_patch_resource_name - self.worker_tier_name = worker_tier_name + def __init__(self, **kwargs): + super(AppServicePlanPatchResource, self).__init__(**kwargs) + self.app_service_plan_patch_resource_name = kwargs.get('app_service_plan_patch_resource_name', None) + self.worker_tier_name = kwargs.get('worker_tier_name', None) self.status = None self.subscription = None - self.admin_site_name = admin_site_name - self.hosting_environment_profile = hosting_environment_profile + self.admin_site_name = kwargs.get('admin_site_name', None) + self.hosting_environment_profile = kwargs.get('hosting_environment_profile', None) self.maximum_number_of_workers = None self.geo_region = None - self.per_site_scaling = per_site_scaling + self.per_site_scaling = kwargs.get('per_site_scaling', False) self.number_of_sites = None - self.is_spot = is_spot - self.spot_expiration_time = spot_expiration_time + self.is_spot = kwargs.get('is_spot', None) + self.spot_expiration_time = kwargs.get('spot_expiration_time', None) self.resource_group = None - self.reserved = reserved - self.target_worker_count = target_worker_count - self.target_worker_size_id = target_worker_size_id + self.reserved = kwargs.get('reserved', False) + self.target_worker_count = kwargs.get('target_worker_count', None) + self.target_worker_size_id = kwargs.get('target_worker_size_id', None) self.provisioning_state = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/app_service_plan_patch_resource_py3.py b/azure-mgmt-web/azure/mgmt/web/models/app_service_plan_patch_resource_py3.py new file mode 100644 index 000000000000..01f603b43aa5 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/app_service_plan_patch_resource_py3.py @@ -0,0 +1,138 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class AppServicePlanPatchResource(ProxyOnlyResource): + """ARM resource for a app service plan. + + 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 Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param app_service_plan_patch_resource_name: Required. Name for the App + Service plan. + :type app_service_plan_patch_resource_name: str + :param worker_tier_name: Target worker tier assigned to the App Service + plan. + :type worker_tier_name: str + :ivar status: App Service plan status. Possible values include: 'Ready', + 'Pending', 'Creating' + :vartype status: str or ~azure.mgmt.web.models.StatusOptions + :ivar subscription: App Service plan subscription. + :vartype subscription: str + :param admin_site_name: App Service plan administration site. + :type admin_site_name: str + :param hosting_environment_profile: Specification for the App Service + Environment to use for the App Service plan. + :type hosting_environment_profile: + ~azure.mgmt.web.models.HostingEnvironmentProfile + :ivar maximum_number_of_workers: Maximum number of instances that can be + assigned to this App Service plan. + :vartype maximum_number_of_workers: int + :ivar geo_region: Geographical location for the App Service plan. + :vartype geo_region: str + :param per_site_scaling: If true, apps assigned to this App + Service plan can be scaled independently. + If false, apps assigned to this App Service plan will scale + to all instances of the plan. Default value: False . + :type per_site_scaling: bool + :ivar number_of_sites: Number of apps assigned to this App Service plan. + :vartype number_of_sites: int + :param is_spot: If true, this App Service Plan owns spot + instances. + :type is_spot: bool + :param spot_expiration_time: The time when the server farm expires. Valid + only if it is a spot server farm. + :type spot_expiration_time: datetime + :ivar resource_group: Resource group of the App Service plan. + :vartype resource_group: str + :param reserved: If Linux app service plan true, + false otherwise. Default value: False . + :type reserved: bool + :param target_worker_count: Scaling worker count. + :type target_worker_count: int + :param target_worker_size_id: Scaling worker size ID. + :type target_worker_size_id: int + :ivar provisioning_state: Provisioning state of the App Service + Environment. Possible values include: 'Succeeded', 'Failed', 'Canceled', + 'InProgress', 'Deleting' + :vartype provisioning_state: str or + ~azure.mgmt.web.models.ProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'app_service_plan_patch_resource_name': {'required': True}, + 'status': {'readonly': True}, + 'subscription': {'readonly': True}, + 'maximum_number_of_workers': {'readonly': True}, + 'geo_region': {'readonly': True}, + 'number_of_sites': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'app_service_plan_patch_resource_name': {'key': 'properties.name', 'type': 'str'}, + 'worker_tier_name': {'key': 'properties.workerTierName', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'StatusOptions'}, + 'subscription': {'key': 'properties.subscription', 'type': 'str'}, + 'admin_site_name': {'key': 'properties.adminSiteName', 'type': 'str'}, + 'hosting_environment_profile': {'key': 'properties.hostingEnvironmentProfile', 'type': 'HostingEnvironmentProfile'}, + 'maximum_number_of_workers': {'key': 'properties.maximumNumberOfWorkers', 'type': 'int'}, + 'geo_region': {'key': 'properties.geoRegion', 'type': 'str'}, + 'per_site_scaling': {'key': 'properties.perSiteScaling', 'type': 'bool'}, + 'number_of_sites': {'key': 'properties.numberOfSites', 'type': 'int'}, + 'is_spot': {'key': 'properties.isSpot', 'type': 'bool'}, + 'spot_expiration_time': {'key': 'properties.spotExpirationTime', 'type': 'iso-8601'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'reserved': {'key': 'properties.reserved', 'type': 'bool'}, + 'target_worker_count': {'key': 'properties.targetWorkerCount', 'type': 'int'}, + 'target_worker_size_id': {'key': 'properties.targetWorkerSizeId', 'type': 'int'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, + } + + def __init__(self, *, app_service_plan_patch_resource_name: str, kind: str=None, worker_tier_name: str=None, admin_site_name: str=None, hosting_environment_profile=None, per_site_scaling: bool=False, is_spot: bool=None, spot_expiration_time=None, reserved: bool=False, target_worker_count: int=None, target_worker_size_id: int=None, **kwargs) -> None: + super(AppServicePlanPatchResource, self).__init__(kind=kind, **kwargs) + self.app_service_plan_patch_resource_name = app_service_plan_patch_resource_name + self.worker_tier_name = worker_tier_name + self.status = None + self.subscription = None + self.admin_site_name = admin_site_name + self.hosting_environment_profile = hosting_environment_profile + self.maximum_number_of_workers = None + self.geo_region = None + self.per_site_scaling = per_site_scaling + self.number_of_sites = None + self.is_spot = is_spot + self.spot_expiration_time = spot_expiration_time + self.resource_group = None + self.reserved = reserved + self.target_worker_count = target_worker_count + self.target_worker_size_id = target_worker_size_id + self.provisioning_state = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/app_service_plan_py3.py b/azure-mgmt-web/azure/mgmt/web/models/app_service_plan_py3.py new file mode 100644 index 000000000000..db1f54e873ae --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/app_service_plan_py3.py @@ -0,0 +1,148 @@ +# 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 .resource import Resource + + +class AppServicePlan(Resource): + """App Service plan. + + 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 Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param app_service_plan_name: Required. Name for the App Service plan. + :type app_service_plan_name: str + :param worker_tier_name: Target worker tier assigned to the App Service + plan. + :type worker_tier_name: str + :ivar status: App Service plan status. Possible values include: 'Ready', + 'Pending', 'Creating' + :vartype status: str or ~azure.mgmt.web.models.StatusOptions + :ivar subscription: App Service plan subscription. + :vartype subscription: str + :param admin_site_name: App Service plan administration site. + :type admin_site_name: str + :param hosting_environment_profile: Specification for the App Service + Environment to use for the App Service plan. + :type hosting_environment_profile: + ~azure.mgmt.web.models.HostingEnvironmentProfile + :ivar maximum_number_of_workers: Maximum number of instances that can be + assigned to this App Service plan. + :vartype maximum_number_of_workers: int + :ivar geo_region: Geographical location for the App Service plan. + :vartype geo_region: str + :param per_site_scaling: If true, apps assigned to this App + Service plan can be scaled independently. + If false, apps assigned to this App Service plan will scale + to all instances of the plan. Default value: False . + :type per_site_scaling: bool + :ivar number_of_sites: Number of apps assigned to this App Service plan. + :vartype number_of_sites: int + :param is_spot: If true, this App Service Plan owns spot + instances. + :type is_spot: bool + :param spot_expiration_time: The time when the server farm expires. Valid + only if it is a spot server farm. + :type spot_expiration_time: datetime + :ivar resource_group: Resource group of the App Service plan. + :vartype resource_group: str + :param reserved: If Linux app service plan true, + false otherwise. Default value: False . + :type reserved: bool + :param target_worker_count: Scaling worker count. + :type target_worker_count: int + :param target_worker_size_id: Scaling worker size ID. + :type target_worker_size_id: int + :ivar provisioning_state: Provisioning state of the App Service + Environment. Possible values include: 'Succeeded', 'Failed', 'Canceled', + 'InProgress', 'Deleting' + :vartype provisioning_state: str or + ~azure.mgmt.web.models.ProvisioningState + :param sku: + :type sku: ~azure.mgmt.web.models.SkuDescription + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'app_service_plan_name': {'required': True}, + 'status': {'readonly': True}, + 'subscription': {'readonly': True}, + 'maximum_number_of_workers': {'readonly': True}, + 'geo_region': {'readonly': True}, + 'number_of_sites': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'app_service_plan_name': {'key': 'properties.name', 'type': 'str'}, + 'worker_tier_name': {'key': 'properties.workerTierName', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'StatusOptions'}, + 'subscription': {'key': 'properties.subscription', 'type': 'str'}, + 'admin_site_name': {'key': 'properties.adminSiteName', 'type': 'str'}, + 'hosting_environment_profile': {'key': 'properties.hostingEnvironmentProfile', 'type': 'HostingEnvironmentProfile'}, + 'maximum_number_of_workers': {'key': 'properties.maximumNumberOfWorkers', 'type': 'int'}, + 'geo_region': {'key': 'properties.geoRegion', 'type': 'str'}, + 'per_site_scaling': {'key': 'properties.perSiteScaling', 'type': 'bool'}, + 'number_of_sites': {'key': 'properties.numberOfSites', 'type': 'int'}, + 'is_spot': {'key': 'properties.isSpot', 'type': 'bool'}, + 'spot_expiration_time': {'key': 'properties.spotExpirationTime', 'type': 'iso-8601'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'reserved': {'key': 'properties.reserved', 'type': 'bool'}, + 'target_worker_count': {'key': 'properties.targetWorkerCount', 'type': 'int'}, + 'target_worker_size_id': {'key': 'properties.targetWorkerSizeId', 'type': 'int'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, + 'sku': {'key': 'sku', 'type': 'SkuDescription'}, + } + + def __init__(self, *, location: str, app_service_plan_name: str, kind: str=None, tags=None, worker_tier_name: str=None, admin_site_name: str=None, hosting_environment_profile=None, per_site_scaling: bool=False, is_spot: bool=None, spot_expiration_time=None, reserved: bool=False, target_worker_count: int=None, target_worker_size_id: int=None, sku=None, **kwargs) -> None: + super(AppServicePlan, self).__init__(kind=kind, location=location, tags=tags, **kwargs) + self.app_service_plan_name = app_service_plan_name + self.worker_tier_name = worker_tier_name + self.status = None + self.subscription = None + self.admin_site_name = admin_site_name + self.hosting_environment_profile = hosting_environment_profile + self.maximum_number_of_workers = None + self.geo_region = None + self.per_site_scaling = per_site_scaling + self.number_of_sites = None + self.is_spot = is_spot + self.spot_expiration_time = spot_expiration_time + self.resource_group = None + self.reserved = reserved + self.target_worker_count = target_worker_count + self.target_worker_size_id = target_worker_size_id + self.provisioning_state = None + self.sku = sku diff --git a/azure-mgmt-web/azure/mgmt/web/models/application_logs_config.py b/azure-mgmt-web/azure/mgmt/web/models/application_logs_config.py index b9a7bb1ebb58..d6a74fa876db 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/application_logs_config.py +++ b/azure-mgmt-web/azure/mgmt/web/models/application_logs_config.py @@ -32,8 +32,8 @@ class ApplicationLogsConfig(Model): 'azure_blob_storage': {'key': 'azureBlobStorage', 'type': 'AzureBlobStorageApplicationLogsConfig'}, } - def __init__(self, file_system=None, azure_table_storage=None, azure_blob_storage=None): - super(ApplicationLogsConfig, self).__init__() - self.file_system = file_system - self.azure_table_storage = azure_table_storage - self.azure_blob_storage = azure_blob_storage + def __init__(self, **kwargs): + super(ApplicationLogsConfig, self).__init__(**kwargs) + self.file_system = kwargs.get('file_system', None) + self.azure_table_storage = kwargs.get('azure_table_storage', None) + self.azure_blob_storage = kwargs.get('azure_blob_storage', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/application_logs_config_py3.py b/azure-mgmt-web/azure/mgmt/web/models/application_logs_config_py3.py new file mode 100644 index 000000000000..a548ed73ad7c --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/application_logs_config_py3.py @@ -0,0 +1,39 @@ +# 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 msrest.serialization import Model + + +class ApplicationLogsConfig(Model): + """Application logs configuration. + + :param file_system: Application logs to file system configuration. + :type file_system: ~azure.mgmt.web.models.FileSystemApplicationLogsConfig + :param azure_table_storage: Application logs to azure table storage + configuration. + :type azure_table_storage: + ~azure.mgmt.web.models.AzureTableStorageApplicationLogsConfig + :param azure_blob_storage: Application logs to blob storage configuration. + :type azure_blob_storage: + ~azure.mgmt.web.models.AzureBlobStorageApplicationLogsConfig + """ + + _attribute_map = { + 'file_system': {'key': 'fileSystem', 'type': 'FileSystemApplicationLogsConfig'}, + 'azure_table_storage': {'key': 'azureTableStorage', 'type': 'AzureTableStorageApplicationLogsConfig'}, + 'azure_blob_storage': {'key': 'azureBlobStorage', 'type': 'AzureBlobStorageApplicationLogsConfig'}, + } + + def __init__(self, *, file_system=None, azure_table_storage=None, azure_blob_storage=None, **kwargs) -> None: + super(ApplicationLogsConfig, self).__init__(**kwargs) + self.file_system = file_system + self.azure_table_storage = azure_table_storage + self.azure_blob_storage = azure_blob_storage diff --git a/azure-mgmt-web/azure/mgmt/web/models/application_stack.py b/azure-mgmt-web/azure/mgmt/web/models/application_stack.py index ba8fceaef641..5611a8e82717 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/application_stack.py +++ b/azure-mgmt-web/azure/mgmt/web/models/application_stack.py @@ -35,10 +35,10 @@ class ApplicationStack(Model): 'frameworks': {'key': 'frameworks', 'type': '[ApplicationStack]'}, } - def __init__(self, name=None, display=None, dependency=None, major_versions=None, frameworks=None): - super(ApplicationStack, self).__init__() - self.name = name - self.display = display - self.dependency = dependency - self.major_versions = major_versions - self.frameworks = frameworks + def __init__(self, **kwargs): + super(ApplicationStack, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.dependency = kwargs.get('dependency', None) + self.major_versions = kwargs.get('major_versions', None) + self.frameworks = kwargs.get('frameworks', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/application_stack_py3.py b/azure-mgmt-web/azure/mgmt/web/models/application_stack_py3.py new file mode 100644 index 000000000000..38aac1d8aa47 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/application_stack_py3.py @@ -0,0 +1,44 @@ +# 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 msrest.serialization import Model + + +class ApplicationStack(Model): + """Application stack. + + :param name: Application stack name. + :type name: str + :param display: Application stack display name. + :type display: str + :param dependency: Application stack dependency. + :type dependency: str + :param major_versions: List of major versions available. + :type major_versions: list[~azure.mgmt.web.models.StackMajorVersion] + :param frameworks: List of frameworks associated with application stack. + :type frameworks: list[~azure.mgmt.web.models.ApplicationStack] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'str'}, + 'dependency': {'key': 'dependency', 'type': 'str'}, + 'major_versions': {'key': 'majorVersions', 'type': '[StackMajorVersion]'}, + 'frameworks': {'key': 'frameworks', 'type': '[ApplicationStack]'}, + } + + def __init__(self, *, name: str=None, display: str=None, dependency: str=None, major_versions=None, frameworks=None, **kwargs) -> None: + super(ApplicationStack, self).__init__(**kwargs) + self.name = name + self.display = display + self.dependency = dependency + self.major_versions = major_versions + self.frameworks = frameworks diff --git a/azure-mgmt-web/azure/mgmt/web/models/auto_heal_actions.py b/azure-mgmt-web/azure/mgmt/web/models/auto_heal_actions.py index f1595e9be056..01626a1790e4 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/auto_heal_actions.py +++ b/azure-mgmt-web/azure/mgmt/web/models/auto_heal_actions.py @@ -31,8 +31,8 @@ class AutoHealActions(Model): 'min_process_execution_time': {'key': 'minProcessExecutionTime', 'type': 'str'}, } - def __init__(self, action_type=None, custom_action=None, min_process_execution_time=None): - super(AutoHealActions, self).__init__() - self.action_type = action_type - self.custom_action = custom_action - self.min_process_execution_time = min_process_execution_time + def __init__(self, **kwargs): + super(AutoHealActions, self).__init__(**kwargs) + self.action_type = kwargs.get('action_type', None) + self.custom_action = kwargs.get('custom_action', None) + self.min_process_execution_time = kwargs.get('min_process_execution_time', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/auto_heal_actions_py3.py b/azure-mgmt-web/azure/mgmt/web/models/auto_heal_actions_py3.py new file mode 100644 index 000000000000..c02ab3fea6f9 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/auto_heal_actions_py3.py @@ -0,0 +1,38 @@ +# 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 msrest.serialization import Model + + +class AutoHealActions(Model): + """Actions which to take by the auto-heal module when a rule is triggered. + + :param action_type: Predefined action to be taken. Possible values + include: 'Recycle', 'LogEvent', 'CustomAction' + :type action_type: str or ~azure.mgmt.web.models.AutoHealActionType + :param custom_action: Custom action to be taken. + :type custom_action: ~azure.mgmt.web.models.AutoHealCustomAction + :param min_process_execution_time: Minimum time the process must execute + before taking the action + :type min_process_execution_time: str + """ + + _attribute_map = { + 'action_type': {'key': 'actionType', 'type': 'AutoHealActionType'}, + 'custom_action': {'key': 'customAction', 'type': 'AutoHealCustomAction'}, + 'min_process_execution_time': {'key': 'minProcessExecutionTime', 'type': 'str'}, + } + + def __init__(self, *, action_type=None, custom_action=None, min_process_execution_time: str=None, **kwargs) -> None: + super(AutoHealActions, self).__init__(**kwargs) + self.action_type = action_type + self.custom_action = custom_action + self.min_process_execution_time = min_process_execution_time diff --git a/azure-mgmt-web/azure/mgmt/web/models/auto_heal_custom_action.py b/azure-mgmt-web/azure/mgmt/web/models/auto_heal_custom_action.py index e015fce2b903..d034dc301007 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/auto_heal_custom_action.py +++ b/azure-mgmt-web/azure/mgmt/web/models/auto_heal_custom_action.py @@ -27,7 +27,7 @@ class AutoHealCustomAction(Model): 'parameters': {'key': 'parameters', 'type': 'str'}, } - def __init__(self, exe=None, parameters=None): - super(AutoHealCustomAction, self).__init__() - self.exe = exe - self.parameters = parameters + def __init__(self, **kwargs): + super(AutoHealCustomAction, self).__init__(**kwargs) + self.exe = kwargs.get('exe', None) + self.parameters = kwargs.get('parameters', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/auto_heal_custom_action_py3.py b/azure-mgmt-web/azure/mgmt/web/models/auto_heal_custom_action_py3.py new file mode 100644 index 000000000000..bd1f4208adb2 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/auto_heal_custom_action_py3.py @@ -0,0 +1,33 @@ +# 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 msrest.serialization import Model + + +class AutoHealCustomAction(Model): + """Custom action to be executed + when an auto heal rule is triggered. + + :param exe: Executable to be run. + :type exe: str + :param parameters: Parameters for the executable. + :type parameters: str + """ + + _attribute_map = { + 'exe': {'key': 'exe', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'str'}, + } + + def __init__(self, *, exe: str=None, parameters: str=None, **kwargs) -> None: + super(AutoHealCustomAction, self).__init__(**kwargs) + self.exe = exe + self.parameters = parameters diff --git a/azure-mgmt-web/azure/mgmt/web/models/auto_heal_rules.py b/azure-mgmt-web/azure/mgmt/web/models/auto_heal_rules.py index 2cdc14a5fead..0c751d639275 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/auto_heal_rules.py +++ b/azure-mgmt-web/azure/mgmt/web/models/auto_heal_rules.py @@ -27,7 +27,7 @@ class AutoHealRules(Model): 'actions': {'key': 'actions', 'type': 'AutoHealActions'}, } - def __init__(self, triggers=None, actions=None): - super(AutoHealRules, self).__init__() - self.triggers = triggers - self.actions = actions + def __init__(self, **kwargs): + super(AutoHealRules, self).__init__(**kwargs) + self.triggers = kwargs.get('triggers', None) + self.actions = kwargs.get('actions', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/auto_heal_rules_py3.py b/azure-mgmt-web/azure/mgmt/web/models/auto_heal_rules_py3.py new file mode 100644 index 000000000000..38fe260c3d88 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/auto_heal_rules_py3.py @@ -0,0 +1,33 @@ +# 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 msrest.serialization import Model + + +class AutoHealRules(Model): + """Rules that can be defined for auto-heal. + + :param triggers: Conditions that describe when to execute the auto-heal + actions. + :type triggers: ~azure.mgmt.web.models.AutoHealTriggers + :param actions: Actions to be executed when a rule is triggered. + :type actions: ~azure.mgmt.web.models.AutoHealActions + """ + + _attribute_map = { + 'triggers': {'key': 'triggers', 'type': 'AutoHealTriggers'}, + 'actions': {'key': 'actions', 'type': 'AutoHealActions'}, + } + + def __init__(self, *, triggers=None, actions=None, **kwargs) -> None: + super(AutoHealRules, self).__init__(**kwargs) + self.triggers = triggers + self.actions = actions diff --git a/azure-mgmt-web/azure/mgmt/web/models/auto_heal_triggers.py b/azure-mgmt-web/azure/mgmt/web/models/auto_heal_triggers.py index 4d41496e95f1..6e86339d57eb 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/auto_heal_triggers.py +++ b/azure-mgmt-web/azure/mgmt/web/models/auto_heal_triggers.py @@ -32,9 +32,9 @@ class AutoHealTriggers(Model): 'slow_requests': {'key': 'slowRequests', 'type': 'SlowRequestsBasedTrigger'}, } - def __init__(self, requests=None, private_bytes_in_kb=None, status_codes=None, slow_requests=None): - super(AutoHealTriggers, self).__init__() - self.requests = requests - self.private_bytes_in_kb = private_bytes_in_kb - self.status_codes = status_codes - self.slow_requests = slow_requests + def __init__(self, **kwargs): + super(AutoHealTriggers, self).__init__(**kwargs) + self.requests = kwargs.get('requests', None) + self.private_bytes_in_kb = kwargs.get('private_bytes_in_kb', None) + self.status_codes = kwargs.get('status_codes', None) + self.slow_requests = kwargs.get('slow_requests', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/auto_heal_triggers_py3.py b/azure-mgmt-web/azure/mgmt/web/models/auto_heal_triggers_py3.py new file mode 100644 index 000000000000..59947d2fc4b3 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/auto_heal_triggers_py3.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class AutoHealTriggers(Model): + """Triggers for auto-heal. + + :param requests: A rule based on total requests. + :type requests: ~azure.mgmt.web.models.RequestsBasedTrigger + :param private_bytes_in_kb: A rule based on private bytes. + :type private_bytes_in_kb: int + :param status_codes: A rule based on status codes. + :type status_codes: list[~azure.mgmt.web.models.StatusCodesBasedTrigger] + :param slow_requests: A rule based on request execution time. + :type slow_requests: ~azure.mgmt.web.models.SlowRequestsBasedTrigger + """ + + _attribute_map = { + 'requests': {'key': 'requests', 'type': 'RequestsBasedTrigger'}, + 'private_bytes_in_kb': {'key': 'privateBytesInKB', 'type': 'int'}, + 'status_codes': {'key': 'statusCodes', 'type': '[StatusCodesBasedTrigger]'}, + 'slow_requests': {'key': 'slowRequests', 'type': 'SlowRequestsBasedTrigger'}, + } + + def __init__(self, *, requests=None, private_bytes_in_kb: int=None, status_codes=None, slow_requests=None, **kwargs) -> None: + super(AutoHealTriggers, self).__init__(**kwargs) + self.requests = requests + self.private_bytes_in_kb = private_bytes_in_kb + self.status_codes = status_codes + self.slow_requests = slow_requests diff --git a/azure-mgmt-web/azure/mgmt/web/models/azure_blob_storage_application_logs_config.py b/azure-mgmt-web/azure/mgmt/web/models/azure_blob_storage_application_logs_config.py index 0038c7d09545..f159f61ec92d 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/azure_blob_storage_application_logs_config.py +++ b/azure-mgmt-web/azure/mgmt/web/models/azure_blob_storage_application_logs_config.py @@ -33,8 +33,8 @@ class AzureBlobStorageApplicationLogsConfig(Model): 'retention_in_days': {'key': 'retentionInDays', 'type': 'int'}, } - def __init__(self, level=None, sas_url=None, retention_in_days=None): - super(AzureBlobStorageApplicationLogsConfig, self).__init__() - self.level = level - self.sas_url = sas_url - self.retention_in_days = retention_in_days + def __init__(self, **kwargs): + super(AzureBlobStorageApplicationLogsConfig, self).__init__(**kwargs) + self.level = kwargs.get('level', None) + self.sas_url = kwargs.get('sas_url', None) + self.retention_in_days = kwargs.get('retention_in_days', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/azure_blob_storage_application_logs_config_py3.py b/azure-mgmt-web/azure/mgmt/web/models/azure_blob_storage_application_logs_config_py3.py new file mode 100644 index 000000000000..9d8ec9a8d181 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/azure_blob_storage_application_logs_config_py3.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class AzureBlobStorageApplicationLogsConfig(Model): + """Application logs azure blob storage configuration. + + :param level: Log level. Possible values include: 'Off', 'Verbose', + 'Information', 'Warning', 'Error' + :type level: str or ~azure.mgmt.web.models.LogLevel + :param sas_url: SAS url to a azure blob container with + read/write/list/delete permissions. + :type sas_url: str + :param retention_in_days: Retention in days. + Remove blobs older than X days. + 0 or lower means no retention. + :type retention_in_days: int + """ + + _attribute_map = { + 'level': {'key': 'level', 'type': 'LogLevel'}, + 'sas_url': {'key': 'sasUrl', 'type': 'str'}, + 'retention_in_days': {'key': 'retentionInDays', 'type': 'int'}, + } + + def __init__(self, *, level=None, sas_url: str=None, retention_in_days: int=None, **kwargs) -> None: + super(AzureBlobStorageApplicationLogsConfig, self).__init__(**kwargs) + self.level = level + self.sas_url = sas_url + self.retention_in_days = retention_in_days diff --git a/azure-mgmt-web/azure/mgmt/web/models/azure_blob_storage_http_logs_config.py b/azure-mgmt-web/azure/mgmt/web/models/azure_blob_storage_http_logs_config.py index 44f0f1fe8cfe..23b4be2198f2 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/azure_blob_storage_http_logs_config.py +++ b/azure-mgmt-web/azure/mgmt/web/models/azure_blob_storage_http_logs_config.py @@ -33,8 +33,8 @@ class AzureBlobStorageHttpLogsConfig(Model): 'enabled': {'key': 'enabled', 'type': 'bool'}, } - def __init__(self, sas_url=None, retention_in_days=None, enabled=None): - super(AzureBlobStorageHttpLogsConfig, self).__init__() - self.sas_url = sas_url - self.retention_in_days = retention_in_days - self.enabled = enabled + def __init__(self, **kwargs): + super(AzureBlobStorageHttpLogsConfig, self).__init__(**kwargs) + self.sas_url = kwargs.get('sas_url', None) + self.retention_in_days = kwargs.get('retention_in_days', None) + self.enabled = kwargs.get('enabled', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/azure_blob_storage_http_logs_config_py3.py b/azure-mgmt-web/azure/mgmt/web/models/azure_blob_storage_http_logs_config_py3.py new file mode 100644 index 000000000000..92ceaa1208a6 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/azure_blob_storage_http_logs_config_py3.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class AzureBlobStorageHttpLogsConfig(Model): + """Http logs to azure blob storage configuration. + + :param sas_url: SAS url to a azure blob container with + read/write/list/delete permissions. + :type sas_url: str + :param retention_in_days: Retention in days. + Remove blobs older than X days. + 0 or lower means no retention. + :type retention_in_days: int + :param enabled: True if configuration is enabled, false if it is disabled + and null if configuration is not set. + :type enabled: bool + """ + + _attribute_map = { + 'sas_url': {'key': 'sasUrl', 'type': 'str'}, + 'retention_in_days': {'key': 'retentionInDays', 'type': 'int'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__(self, *, sas_url: str=None, retention_in_days: int=None, enabled: bool=None, **kwargs) -> None: + super(AzureBlobStorageHttpLogsConfig, self).__init__(**kwargs) + self.sas_url = sas_url + self.retention_in_days = retention_in_days + self.enabled = enabled diff --git a/azure-mgmt-web/azure/mgmt/web/models/azure_table_storage_application_logs_config.py b/azure-mgmt-web/azure/mgmt/web/models/azure_table_storage_application_logs_config.py index 67326ab3ed8e..0586a88e2334 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/azure_table_storage_application_logs_config.py +++ b/azure-mgmt-web/azure/mgmt/web/models/azure_table_storage_application_logs_config.py @@ -15,10 +15,12 @@ class AzureTableStorageApplicationLogsConfig(Model): """Application logs to Azure table storage configuration. + All required parameters must be populated in order to send to Azure. + :param level: Log level. Possible values include: 'Off', 'Verbose', 'Information', 'Warning', 'Error' :type level: str or ~azure.mgmt.web.models.LogLevel - :param sas_url: SAS URL to an Azure table with add/query/delete + :param sas_url: Required. SAS URL to an Azure table with add/query/delete permissions. :type sas_url: str """ @@ -32,7 +34,7 @@ class AzureTableStorageApplicationLogsConfig(Model): 'sas_url': {'key': 'sasUrl', 'type': 'str'}, } - def __init__(self, sas_url, level=None): - super(AzureTableStorageApplicationLogsConfig, self).__init__() - self.level = level - self.sas_url = sas_url + def __init__(self, **kwargs): + super(AzureTableStorageApplicationLogsConfig, self).__init__(**kwargs) + self.level = kwargs.get('level', None) + self.sas_url = kwargs.get('sas_url', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/azure_table_storage_application_logs_config_py3.py b/azure-mgmt-web/azure/mgmt/web/models/azure_table_storage_application_logs_config_py3.py new file mode 100644 index 000000000000..5ebf91d3de72 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/azure_table_storage_application_logs_config_py3.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class AzureTableStorageApplicationLogsConfig(Model): + """Application logs to Azure table storage configuration. + + All required parameters must be populated in order to send to Azure. + + :param level: Log level. Possible values include: 'Off', 'Verbose', + 'Information', 'Warning', 'Error' + :type level: str or ~azure.mgmt.web.models.LogLevel + :param sas_url: Required. SAS URL to an Azure table with add/query/delete + permissions. + :type sas_url: str + """ + + _validation = { + 'sas_url': {'required': True}, + } + + _attribute_map = { + 'level': {'key': 'level', 'type': 'LogLevel'}, + 'sas_url': {'key': 'sasUrl', 'type': 'str'}, + } + + def __init__(self, *, sas_url: str, level=None, **kwargs) -> None: + super(AzureTableStorageApplicationLogsConfig, self).__init__(**kwargs) + self.level = level + self.sas_url = sas_url diff --git a/azure-mgmt-web/azure/mgmt/web/models/backup_item.py b/azure-mgmt-web/azure/mgmt/web/models/backup_item.py index c51f778fb347..0ad7297687cb 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/backup_item.py +++ b/azure-mgmt-web/azure/mgmt/web/models/backup_item.py @@ -104,8 +104,8 @@ class BackupItem(ProxyOnlyResource): 'website_size_in_bytes': {'key': 'properties.websiteSizeInBytes', 'type': 'long'}, } - def __init__(self, kind=None): - super(BackupItem, self).__init__(kind=kind) + def __init__(self, **kwargs): + super(BackupItem, self).__init__(**kwargs) self.backup_id = None self.storage_account_url = None self.blob_name = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/backup_item_py3.py b/azure-mgmt-web/azure/mgmt/web/models/backup_item_py3.py new file mode 100644 index 000000000000..54acee81b769 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/backup_item_py3.py @@ -0,0 +1,122 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class BackupItem(ProxyOnlyResource): + """Backup description. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar backup_id: Id of the backup. + :vartype backup_id: int + :ivar storage_account_url: SAS URL for the storage account container which + contains this backup. + :vartype storage_account_url: str + :ivar blob_name: Name of the blob which contains data for this backup. + :vartype blob_name: str + :ivar backup_item_name: Name of this backup. + :vartype backup_item_name: str + :ivar status: Backup status. Possible values include: 'InProgress', + 'Failed', 'Succeeded', 'TimedOut', 'Created', 'Skipped', + 'PartiallySucceeded', 'DeleteInProgress', 'DeleteFailed', 'Deleted' + :vartype status: str or ~azure.mgmt.web.models.BackupItemStatus + :ivar size_in_bytes: Size of the backup in bytes. + :vartype size_in_bytes: long + :ivar created: Timestamp of the backup creation. + :vartype created: datetime + :ivar log: Details regarding this backup. Might contain an error message. + :vartype log: str + :ivar databases: List of databases included in the backup. + :vartype databases: list[~azure.mgmt.web.models.DatabaseBackupSetting] + :ivar scheduled: True if this backup has been created due to a schedule + being triggered. + :vartype scheduled: bool + :ivar last_restore_time_stamp: Timestamp of a last restore operation which + used this backup. + :vartype last_restore_time_stamp: datetime + :ivar finished_time_stamp: Timestamp when this backup finished. + :vartype finished_time_stamp: datetime + :ivar correlation_id: Unique correlation identifier. Please use this along + with the timestamp while communicating with Azure support. + :vartype correlation_id: str + :ivar website_size_in_bytes: Size of the original web app which has been + backed up. + :vartype website_size_in_bytes: long + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'backup_id': {'readonly': True}, + 'storage_account_url': {'readonly': True}, + 'blob_name': {'readonly': True}, + 'backup_item_name': {'readonly': True}, + 'status': {'readonly': True}, + 'size_in_bytes': {'readonly': True}, + 'created': {'readonly': True}, + 'log': {'readonly': True}, + 'databases': {'readonly': True}, + 'scheduled': {'readonly': True}, + 'last_restore_time_stamp': {'readonly': True}, + 'finished_time_stamp': {'readonly': True}, + 'correlation_id': {'readonly': True}, + 'website_size_in_bytes': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'backup_id': {'key': 'properties.id', 'type': 'int'}, + 'storage_account_url': {'key': 'properties.storageAccountUrl', 'type': 'str'}, + 'blob_name': {'key': 'properties.blobName', 'type': 'str'}, + 'backup_item_name': {'key': 'properties.name', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'BackupItemStatus'}, + 'size_in_bytes': {'key': 'properties.sizeInBytes', 'type': 'long'}, + 'created': {'key': 'properties.created', 'type': 'iso-8601'}, + 'log': {'key': 'properties.log', 'type': 'str'}, + 'databases': {'key': 'properties.databases', 'type': '[DatabaseBackupSetting]'}, + 'scheduled': {'key': 'properties.scheduled', 'type': 'bool'}, + 'last_restore_time_stamp': {'key': 'properties.lastRestoreTimeStamp', 'type': 'iso-8601'}, + 'finished_time_stamp': {'key': 'properties.finishedTimeStamp', 'type': 'iso-8601'}, + 'correlation_id': {'key': 'properties.correlationId', 'type': 'str'}, + 'website_size_in_bytes': {'key': 'properties.websiteSizeInBytes', 'type': 'long'}, + } + + def __init__(self, *, kind: str=None, **kwargs) -> None: + super(BackupItem, self).__init__(kind=kind, **kwargs) + self.backup_id = None + self.storage_account_url = None + self.blob_name = None + self.backup_item_name = None + self.status = None + self.size_in_bytes = None + self.created = None + self.log = None + self.databases = None + self.scheduled = None + self.last_restore_time_stamp = None + self.finished_time_stamp = None + self.correlation_id = None + self.website_size_in_bytes = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/backup_request.py b/azure-mgmt-web/azure/mgmt/web/models/backup_request.py index d3e9df59b00d..9eeb28e28cf0 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/backup_request.py +++ b/azure-mgmt-web/azure/mgmt/web/models/backup_request.py @@ -18,6 +18,8 @@ class BackupRequest(ProxyOnlyResource): 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 Azure. + :ivar id: Resource Id. :vartype id: str :ivar name: Resource Name. @@ -26,12 +28,12 @@ class BackupRequest(ProxyOnlyResource): :type kind: str :ivar type: Resource type. :vartype type: str - :param backup_request_name: Name of the backup. + :param backup_request_name: Required. Name of the backup. :type backup_request_name: str :param enabled: True if the backup schedule is enabled (must be included in that case), false if the backup schedule should be disabled. :type enabled: bool - :param storage_account_url: SAS URL to the container. + :param storage_account_url: Required. SAS URL to the container. :type storage_account_url: str :param backup_schedule: Schedule for the backup if it is executed periodically. @@ -65,11 +67,11 @@ class BackupRequest(ProxyOnlyResource): 'backup_request_type': {'key': 'properties.type', 'type': 'BackupRestoreOperationType'}, } - def __init__(self, backup_request_name, storage_account_url, kind=None, enabled=None, backup_schedule=None, databases=None, backup_request_type=None): - super(BackupRequest, self).__init__(kind=kind) - self.backup_request_name = backup_request_name - self.enabled = enabled - self.storage_account_url = storage_account_url - self.backup_schedule = backup_schedule - self.databases = databases - self.backup_request_type = backup_request_type + def __init__(self, **kwargs): + super(BackupRequest, self).__init__(**kwargs) + self.backup_request_name = kwargs.get('backup_request_name', None) + self.enabled = kwargs.get('enabled', None) + self.storage_account_url = kwargs.get('storage_account_url', None) + self.backup_schedule = kwargs.get('backup_schedule', None) + self.databases = kwargs.get('databases', None) + self.backup_request_type = kwargs.get('backup_request_type', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/backup_request_py3.py b/azure-mgmt-web/azure/mgmt/web/models/backup_request_py3.py new file mode 100644 index 000000000000..c8eb0c1ed696 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/backup_request_py3.py @@ -0,0 +1,77 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class BackupRequest(ProxyOnlyResource): + """Description of a backup which will be performed. + + 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 Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param backup_request_name: Required. Name of the backup. + :type backup_request_name: str + :param enabled: True if the backup schedule is enabled (must be included + in that case), false if the backup schedule should be disabled. + :type enabled: bool + :param storage_account_url: Required. SAS URL to the container. + :type storage_account_url: str + :param backup_schedule: Schedule for the backup if it is executed + periodically. + :type backup_schedule: ~azure.mgmt.web.models.BackupSchedule + :param databases: Databases included in the backup. + :type databases: list[~azure.mgmt.web.models.DatabaseBackupSetting] + :param backup_request_type: Type of the backup. Possible values include: + 'Default', 'Clone', 'Relocation', 'Snapshot' + :type backup_request_type: str or + ~azure.mgmt.web.models.BackupRestoreOperationType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'backup_request_name': {'required': True}, + 'storage_account_url': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'backup_request_name': {'key': 'properties.name', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'storage_account_url': {'key': 'properties.storageAccountUrl', 'type': 'str'}, + 'backup_schedule': {'key': 'properties.backupSchedule', 'type': 'BackupSchedule'}, + 'databases': {'key': 'properties.databases', 'type': '[DatabaseBackupSetting]'}, + 'backup_request_type': {'key': 'properties.type', 'type': 'BackupRestoreOperationType'}, + } + + def __init__(self, *, backup_request_name: str, storage_account_url: str, kind: str=None, enabled: bool=None, backup_schedule=None, databases=None, backup_request_type=None, **kwargs) -> None: + super(BackupRequest, self).__init__(kind=kind, **kwargs) + self.backup_request_name = backup_request_name + self.enabled = enabled + self.storage_account_url = storage_account_url + self.backup_schedule = backup_schedule + self.databases = databases + self.backup_request_type = backup_request_type diff --git a/azure-mgmt-web/azure/mgmt/web/models/backup_schedule.py b/azure-mgmt-web/azure/mgmt/web/models/backup_schedule.py index c1267a13c4f0..12cda3fe6bc1 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/backup_schedule.py +++ b/azure-mgmt-web/azure/mgmt/web/models/backup_schedule.py @@ -19,21 +19,23 @@ class BackupSchedule(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param frequency_interval: How often the backup should be executed (e.g. - for weekly backup, this should be set to 7 and FrequencyUnit should be set - to Day). Default value: 7 . + All required parameters must be populated in order to send to Azure. + + :param frequency_interval: Required. How often the backup should be + executed (e.g. for weekly backup, this should be set to 7 and + FrequencyUnit should be set to Day). Default value: 7 . :type frequency_interval: int - :param frequency_unit: The unit of time for how often the backup should be - executed (e.g. for weekly backup, this should be set to Day and + :param frequency_unit: Required. The unit of time for how often the backup + should be executed (e.g. for weekly backup, this should be set to Day and FrequencyInterval should be set to 7). Possible values include: 'Day', 'Hour'. Default value: "Day" . :type frequency_unit: str or ~azure.mgmt.web.models.FrequencyUnit - :param keep_at_least_one_backup: True if the retention policy should - always keep at least one backup in the storage account, regardless how old - it is; false otherwise. Default value: True . + :param keep_at_least_one_backup: Required. True if the retention policy + should always keep at least one backup in the storage account, regardless + how old it is; false otherwise. Default value: True . :type keep_at_least_one_backup: bool - :param retention_period_in_days: After how many days backups should be - deleted. Default value: 30 . + :param retention_period_in_days: Required. After how many days backups + should be deleted. Default value: 30 . :type retention_period_in_days: int :param start_time: When the schedule should start working. :type start_time: datetime @@ -58,11 +60,11 @@ class BackupSchedule(Model): 'last_execution_time': {'key': 'lastExecutionTime', 'type': 'iso-8601'}, } - def __init__(self, frequency_interval=7, frequency_unit="Day", keep_at_least_one_backup=True, retention_period_in_days=30, start_time=None): - super(BackupSchedule, self).__init__() - self.frequency_interval = frequency_interval - self.frequency_unit = frequency_unit - self.keep_at_least_one_backup = keep_at_least_one_backup - self.retention_period_in_days = retention_period_in_days - self.start_time = start_time + def __init__(self, **kwargs): + super(BackupSchedule, self).__init__(**kwargs) + self.frequency_interval = kwargs.get('frequency_interval', 7) + self.frequency_unit = kwargs.get('frequency_unit', "Day") + self.keep_at_least_one_backup = kwargs.get('keep_at_least_one_backup', True) + self.retention_period_in_days = kwargs.get('retention_period_in_days', 30) + self.start_time = kwargs.get('start_time', None) self.last_execution_time = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/backup_schedule_py3.py b/azure-mgmt-web/azure/mgmt/web/models/backup_schedule_py3.py new file mode 100644 index 000000000000..4b8b0d39d163 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/backup_schedule_py3.py @@ -0,0 +1,70 @@ +# 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 msrest.serialization import Model + + +class BackupSchedule(Model): + """Description of a backup schedule. Describes how often should be the backup + performed and what should be the retention policy. + + 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 Azure. + + :param frequency_interval: Required. How often the backup should be + executed (e.g. for weekly backup, this should be set to 7 and + FrequencyUnit should be set to Day). Default value: 7 . + :type frequency_interval: int + :param frequency_unit: Required. The unit of time for how often the backup + should be executed (e.g. for weekly backup, this should be set to Day and + FrequencyInterval should be set to 7). Possible values include: 'Day', + 'Hour'. Default value: "Day" . + :type frequency_unit: str or ~azure.mgmt.web.models.FrequencyUnit + :param keep_at_least_one_backup: Required. True if the retention policy + should always keep at least one backup in the storage account, regardless + how old it is; false otherwise. Default value: True . + :type keep_at_least_one_backup: bool + :param retention_period_in_days: Required. After how many days backups + should be deleted. Default value: 30 . + :type retention_period_in_days: int + :param start_time: When the schedule should start working. + :type start_time: datetime + :ivar last_execution_time: Last time when this schedule was triggered. + :vartype last_execution_time: datetime + """ + + _validation = { + 'frequency_interval': {'required': True}, + 'frequency_unit': {'required': True}, + 'keep_at_least_one_backup': {'required': True}, + 'retention_period_in_days': {'required': True}, + 'last_execution_time': {'readonly': True}, + } + + _attribute_map = { + 'frequency_interval': {'key': 'frequencyInterval', 'type': 'int'}, + 'frequency_unit': {'key': 'frequencyUnit', 'type': 'FrequencyUnit'}, + 'keep_at_least_one_backup': {'key': 'keepAtLeastOneBackup', 'type': 'bool'}, + 'retention_period_in_days': {'key': 'retentionPeriodInDays', 'type': 'int'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'last_execution_time': {'key': 'lastExecutionTime', 'type': 'iso-8601'}, + } + + def __init__(self, *, frequency_interval: int=7, frequency_unit="Day", keep_at_least_one_backup: bool=True, retention_period_in_days: int=30, start_time=None, **kwargs) -> None: + super(BackupSchedule, self).__init__(**kwargs) + self.frequency_interval = frequency_interval + self.frequency_unit = frequency_unit + self.keep_at_least_one_backup = keep_at_least_one_backup + self.retention_period_in_days = retention_period_in_days + self.start_time = start_time + self.last_execution_time = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/billing_meter.py b/azure-mgmt-web/azure/mgmt/web/models/billing_meter.py new file mode 100644 index 000000000000..e83d0a976d74 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/billing_meter.py @@ -0,0 +1,66 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class BillingMeter(ProxyOnlyResource): + """App Service billing entity that contains information about meter which the + Azure billing system utilizes to charge users for services. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param meter_id: Meter GUID onboarded in Commerce + :type meter_id: str + :param billing_location: Azure Location of billable resource + :type billing_location: str + :param short_name: Short Name from App Service Azure pricing Page + :type short_name: str + :param friendly_name: Friendly name of the meter + :type friendly_name: str + :param resource_type: App Service resource type meter used for + :type resource_type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'meter_id': {'key': 'properties.meterId', 'type': 'str'}, + 'billing_location': {'key': 'properties.billingLocation', 'type': 'str'}, + 'short_name': {'key': 'properties.shortName', 'type': 'str'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'resource_type': {'key': 'properties.resourceType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BillingMeter, self).__init__(**kwargs) + self.meter_id = kwargs.get('meter_id', None) + self.billing_location = kwargs.get('billing_location', None) + self.short_name = kwargs.get('short_name', None) + self.friendly_name = kwargs.get('friendly_name', None) + self.resource_type = kwargs.get('resource_type', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/billing_meter_paged.py b/azure-mgmt-web/azure/mgmt/web/models/billing_meter_paged.py new file mode 100644 index 000000000000..cb7b9103b59d --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/billing_meter_paged.py @@ -0,0 +1,27 @@ +# 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 msrest.paging import Paged + + +class BillingMeterPaged(Paged): + """ + A paging container for iterating over a list of :class:`BillingMeter ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[BillingMeter]'} + } + + def __init__(self, *args, **kwargs): + + super(BillingMeterPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-web/azure/mgmt/web/models/billing_meter_py3.py b/azure-mgmt-web/azure/mgmt/web/models/billing_meter_py3.py new file mode 100644 index 000000000000..f395d176bc5f --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/billing_meter_py3.py @@ -0,0 +1,66 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class BillingMeter(ProxyOnlyResource): + """App Service billing entity that contains information about meter which the + Azure billing system utilizes to charge users for services. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param meter_id: Meter GUID onboarded in Commerce + :type meter_id: str + :param billing_location: Azure Location of billable resource + :type billing_location: str + :param short_name: Short Name from App Service Azure pricing Page + :type short_name: str + :param friendly_name: Friendly name of the meter + :type friendly_name: str + :param resource_type: App Service resource type meter used for + :type resource_type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'meter_id': {'key': 'properties.meterId', 'type': 'str'}, + 'billing_location': {'key': 'properties.billingLocation', 'type': 'str'}, + 'short_name': {'key': 'properties.shortName', 'type': 'str'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'resource_type': {'key': 'properties.resourceType', 'type': 'str'}, + } + + def __init__(self, *, kind: str=None, meter_id: str=None, billing_location: str=None, short_name: str=None, friendly_name: str=None, resource_type: str=None, **kwargs) -> None: + super(BillingMeter, self).__init__(kind=kind, **kwargs) + self.meter_id = meter_id + self.billing_location = billing_location + self.short_name = short_name + self.friendly_name = friendly_name + self.resource_type = resource_type diff --git a/azure-mgmt-web/azure/mgmt/web/models/capability.py b/azure-mgmt-web/azure/mgmt/web/models/capability.py index d69bc114238c..798ed866cbcf 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/capability.py +++ b/azure-mgmt-web/azure/mgmt/web/models/capability.py @@ -29,8 +29,8 @@ class Capability(Model): 'reason': {'key': 'reason', 'type': 'str'}, } - def __init__(self, name=None, value=None, reason=None): - super(Capability, self).__init__() - self.name = name - self.value = value - self.reason = reason + def __init__(self, **kwargs): + super(Capability, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) + self.reason = kwargs.get('reason', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/capability_py3.py b/azure-mgmt-web/azure/mgmt/web/models/capability_py3.py new file mode 100644 index 000000000000..3445faa1b7c8 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/capability_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class Capability(Model): + """Describes the capabilities/features allowed for a specific SKU. + + :param name: Name of the SKU capability. + :type name: str + :param value: Value of the SKU capability. + :type value: str + :param reason: Reason of the SKU capability. + :type reason: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'reason': {'key': 'reason', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, value: str=None, reason: str=None, **kwargs) -> None: + super(Capability, self).__init__(**kwargs) + self.name = name + self.value = value + self.reason = reason diff --git a/azure-mgmt-web/azure/mgmt/web/models/certificate.py b/azure-mgmt-web/azure/mgmt/web/models/certificate.py index 5183a1ad5dca..bdf7ba410ff1 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/certificate.py +++ b/azure-mgmt-web/azure/mgmt/web/models/certificate.py @@ -18,13 +18,15 @@ class Certificate(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 Azure. + :ivar id: Resource Id. :vartype id: str :ivar name: Resource Name. :vartype name: str :param kind: Kind of resource. :type kind: str - :param location: Resource Location. + :param location: Required. Resource Location. :type location: str :ivar type: Resource type. :vartype type: str @@ -48,7 +50,7 @@ class Certificate(Resource): :vartype issue_date: datetime :ivar expiration_date: Certificate expriration date. :vartype expiration_date: datetime - :param password: Certificate password. + :param password: Required. Certificate password. :type password: str :ivar thumbprint: Certificate thumbprint. :vartype thumbprint: str @@ -133,25 +135,25 @@ class Certificate(Resource): 'server_farm_id': {'key': 'properties.serverFarmId', 'type': 'str'}, } - def __init__(self, location, password, kind=None, tags=None, host_names=None, pfx_blob=None, key_vault_id=None, key_vault_secret_name=None, server_farm_id=None): - super(Certificate, self).__init__(kind=kind, location=location, tags=tags) + def __init__(self, **kwargs): + super(Certificate, self).__init__(**kwargs) self.friendly_name = None self.subject_name = None - self.host_names = host_names - self.pfx_blob = pfx_blob + self.host_names = kwargs.get('host_names', None) + self.pfx_blob = kwargs.get('pfx_blob', None) self.site_name = None self.self_link = None self.issuer = None self.issue_date = None self.expiration_date = None - self.password = password + self.password = kwargs.get('password', None) self.thumbprint = None self.valid = None self.cer_blob = None self.public_key_hash = None self.hosting_environment_profile = None - self.key_vault_id = key_vault_id - self.key_vault_secret_name = key_vault_secret_name + self.key_vault_id = kwargs.get('key_vault_id', None) + self.key_vault_secret_name = kwargs.get('key_vault_secret_name', None) self.key_vault_secret_status = None self.geo_region = None - self.server_farm_id = server_farm_id + self.server_farm_id = kwargs.get('server_farm_id', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/certificate_details.py b/azure-mgmt-web/azure/mgmt/web/models/certificate_details.py index fecd8e11d4e7..847767cc4b40 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/certificate_details.py +++ b/azure-mgmt-web/azure/mgmt/web/models/certificate_details.py @@ -62,8 +62,8 @@ class CertificateDetails(Model): 'raw_data': {'key': 'rawData', 'type': 'str'}, } - def __init__(self): - super(CertificateDetails, self).__init__() + def __init__(self, **kwargs): + super(CertificateDetails, self).__init__(**kwargs) self.version = None self.serial_number = None self.thumbprint = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/certificate_details_py3.py b/azure-mgmt-web/azure/mgmt/web/models/certificate_details_py3.py new file mode 100644 index 000000000000..6ea61e10ca94 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/certificate_details_py3.py @@ -0,0 +1,75 @@ +# 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 msrest.serialization import Model + + +class CertificateDetails(Model): + """SSL certificate details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar version: Certificate Version. + :vartype version: int + :ivar serial_number: Certificate Serial Number. + :vartype serial_number: str + :ivar thumbprint: Certificate Thumbprint. + :vartype thumbprint: str + :ivar subject: Certificate Subject. + :vartype subject: str + :ivar not_before: Date Certificate is valid from. + :vartype not_before: datetime + :ivar not_after: Date Certificate is valid to. + :vartype not_after: datetime + :ivar signature_algorithm: Certificate Signature algorithm. + :vartype signature_algorithm: str + :ivar issuer: Certificate Issuer. + :vartype issuer: str + :ivar raw_data: Raw certificate data. + :vartype raw_data: str + """ + + _validation = { + 'version': {'readonly': True}, + 'serial_number': {'readonly': True}, + 'thumbprint': {'readonly': True}, + 'subject': {'readonly': True}, + 'not_before': {'readonly': True}, + 'not_after': {'readonly': True}, + 'signature_algorithm': {'readonly': True}, + 'issuer': {'readonly': True}, + 'raw_data': {'readonly': True}, + } + + _attribute_map = { + 'version': {'key': 'version', 'type': 'int'}, + 'serial_number': {'key': 'serialNumber', 'type': 'str'}, + 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + 'subject': {'key': 'subject', 'type': 'str'}, + 'not_before': {'key': 'notBefore', 'type': 'iso-8601'}, + 'not_after': {'key': 'notAfter', 'type': 'iso-8601'}, + 'signature_algorithm': {'key': 'signatureAlgorithm', 'type': 'str'}, + 'issuer': {'key': 'issuer', 'type': 'str'}, + 'raw_data': {'key': 'rawData', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(CertificateDetails, self).__init__(**kwargs) + self.version = None + self.serial_number = None + self.thumbprint = None + self.subject = None + self.not_before = None + self.not_after = None + self.signature_algorithm = None + self.issuer = None + self.raw_data = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/certificate_email.py b/azure-mgmt-web/azure/mgmt/web/models/certificate_email.py index 674c722acc58..a7a1b8666e48 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/certificate_email.py +++ b/azure-mgmt-web/azure/mgmt/web/models/certificate_email.py @@ -47,7 +47,7 @@ class CertificateEmail(ProxyOnlyResource): 'time_stamp': {'key': 'properties.timeStamp', 'type': 'iso-8601'}, } - def __init__(self, kind=None, email_id=None, time_stamp=None): - super(CertificateEmail, self).__init__(kind=kind) - self.email_id = email_id - self.time_stamp = time_stamp + def __init__(self, **kwargs): + super(CertificateEmail, self).__init__(**kwargs) + self.email_id = kwargs.get('email_id', None) + self.time_stamp = kwargs.get('time_stamp', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/certificate_email_py3.py b/azure-mgmt-web/azure/mgmt/web/models/certificate_email_py3.py new file mode 100644 index 000000000000..25e359a3cdbd --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/certificate_email_py3.py @@ -0,0 +1,53 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class CertificateEmail(ProxyOnlyResource): + """SSL certificate email. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param email_id: Email id. + :type email_id: str + :param time_stamp: Time stamp. + :type time_stamp: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'email_id': {'key': 'properties.emailId', 'type': 'str'}, + 'time_stamp': {'key': 'properties.timeStamp', 'type': 'iso-8601'}, + } + + def __init__(self, *, kind: str=None, email_id: str=None, time_stamp=None, **kwargs) -> None: + super(CertificateEmail, self).__init__(kind=kind, **kwargs) + self.email_id = email_id + self.time_stamp = time_stamp diff --git a/azure-mgmt-web/azure/mgmt/web/models/certificate_order_action.py b/azure-mgmt-web/azure/mgmt/web/models/certificate_order_action.py index 3144e61ed987..90b968f54f3f 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/certificate_order_action.py +++ b/azure-mgmt-web/azure/mgmt/web/models/certificate_order_action.py @@ -53,7 +53,7 @@ class CertificateOrderAction(ProxyOnlyResource): 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, } - def __init__(self, kind=None, certificate_order_action_type=None, created_at=None): - super(CertificateOrderAction, self).__init__(kind=kind) - self.certificate_order_action_type = certificate_order_action_type - self.created_at = created_at + def __init__(self, **kwargs): + super(CertificateOrderAction, self).__init__(**kwargs) + self.certificate_order_action_type = kwargs.get('certificate_order_action_type', None) + self.created_at = kwargs.get('created_at', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/certificate_order_action_py3.py b/azure-mgmt-web/azure/mgmt/web/models/certificate_order_action_py3.py new file mode 100644 index 000000000000..5c8e81b5f966 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/certificate_order_action_py3.py @@ -0,0 +1,59 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class CertificateOrderAction(ProxyOnlyResource): + """Certificate order action. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param certificate_order_action_type: Action type. Possible values + include: 'CertificateIssued', 'CertificateOrderCanceled', + 'CertificateOrderCreated', 'CertificateRevoked', + 'DomainValidationComplete', 'FraudDetected', 'OrgNameChange', + 'OrgValidationComplete', 'SanDrop', 'FraudCleared', 'CertificateExpired', + 'CertificateExpirationWarning', 'FraudDocumentationRequired', 'Unknown' + :type certificate_order_action_type: str or + ~azure.mgmt.web.models.CertificateOrderActionType + :param created_at: Time at which the certificate action was performed. + :type created_at: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'certificate_order_action_type': {'key': 'properties.type', 'type': 'CertificateOrderActionType'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + } + + def __init__(self, *, kind: str=None, certificate_order_action_type=None, created_at=None, **kwargs) -> None: + super(CertificateOrderAction, self).__init__(kind=kind, **kwargs) + self.certificate_order_action_type = certificate_order_action_type + self.created_at = created_at diff --git a/azure-mgmt-web/azure/mgmt/web/models/certificate_patch_resource.py b/azure-mgmt-web/azure/mgmt/web/models/certificate_patch_resource.py index 3492c509073c..9ea811e73399 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/certificate_patch_resource.py +++ b/azure-mgmt-web/azure/mgmt/web/models/certificate_patch_resource.py @@ -18,6 +18,8 @@ class CertificatePatchResource(ProxyOnlyResource): 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 Azure. + :ivar id: Resource Id. :vartype id: str :ivar name: Resource Name. @@ -44,7 +46,7 @@ class CertificatePatchResource(ProxyOnlyResource): :vartype issue_date: datetime :ivar expiration_date: Certificate expriration date. :vartype expiration_date: datetime - :param password: Certificate password. + :param password: Required. Certificate password. :type password: str :ivar thumbprint: Certificate thumbprint. :vartype thumbprint: str @@ -126,25 +128,25 @@ class CertificatePatchResource(ProxyOnlyResource): 'server_farm_id': {'key': 'properties.serverFarmId', 'type': 'str'}, } - def __init__(self, password, kind=None, host_names=None, pfx_blob=None, key_vault_id=None, key_vault_secret_name=None, server_farm_id=None): - super(CertificatePatchResource, self).__init__(kind=kind) + def __init__(self, **kwargs): + super(CertificatePatchResource, self).__init__(**kwargs) self.friendly_name = None self.subject_name = None - self.host_names = host_names - self.pfx_blob = pfx_blob + self.host_names = kwargs.get('host_names', None) + self.pfx_blob = kwargs.get('pfx_blob', None) self.site_name = None self.self_link = None self.issuer = None self.issue_date = None self.expiration_date = None - self.password = password + self.password = kwargs.get('password', None) self.thumbprint = None self.valid = None self.cer_blob = None self.public_key_hash = None self.hosting_environment_profile = None - self.key_vault_id = key_vault_id - self.key_vault_secret_name = key_vault_secret_name + self.key_vault_id = kwargs.get('key_vault_id', None) + self.key_vault_secret_name = kwargs.get('key_vault_secret_name', None) self.key_vault_secret_status = None self.geo_region = None - self.server_farm_id = server_farm_id + self.server_farm_id = kwargs.get('server_farm_id', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/certificate_patch_resource_py3.py b/azure-mgmt-web/azure/mgmt/web/models/certificate_patch_resource_py3.py new file mode 100644 index 000000000000..06f3a75c142e --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/certificate_patch_resource_py3.py @@ -0,0 +1,152 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class CertificatePatchResource(ProxyOnlyResource): + """ARM resource for a certificate. + + 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 Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar friendly_name: Friendly name of the certificate. + :vartype friendly_name: str + :ivar subject_name: Subject name of the certificate. + :vartype subject_name: str + :param host_names: Host names the certificate applies to. + :type host_names: list[str] + :param pfx_blob: Pfx blob. + :type pfx_blob: bytearray + :ivar site_name: App name. + :vartype site_name: str + :ivar self_link: Self link. + :vartype self_link: str + :ivar issuer: Certificate issuer. + :vartype issuer: str + :ivar issue_date: Certificate issue Date. + :vartype issue_date: datetime + :ivar expiration_date: Certificate expriration date. + :vartype expiration_date: datetime + :param password: Required. Certificate password. + :type password: str + :ivar thumbprint: Certificate thumbprint. + :vartype thumbprint: str + :ivar valid: Is the certificate valid?. + :vartype valid: bool + :ivar cer_blob: Raw bytes of .cer file + :vartype cer_blob: bytearray + :ivar public_key_hash: Public key hash. + :vartype public_key_hash: str + :ivar hosting_environment_profile: Specification for the App Service + Environment to use for the certificate. + :vartype hosting_environment_profile: + ~azure.mgmt.web.models.HostingEnvironmentProfile + :param key_vault_id: Key Vault Csm resource Id. + :type key_vault_id: str + :param key_vault_secret_name: Key Vault secret name. + :type key_vault_secret_name: str + :ivar key_vault_secret_status: Status of the Key Vault secret. Possible + values include: 'Initialized', 'WaitingOnCertificateOrder', 'Succeeded', + 'CertificateOrderFailed', 'OperationNotPermittedOnKeyVault', + 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', + 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', + 'Unknown' + :vartype key_vault_secret_status: str or + ~azure.mgmt.web.models.KeyVaultSecretStatus + :ivar geo_region: Region of the certificate. + :vartype geo_region: str + :param server_farm_id: Resource ID of the associated App Service plan, + formatted as: + "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + :type server_farm_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'friendly_name': {'readonly': True}, + 'subject_name': {'readonly': True}, + 'site_name': {'readonly': True}, + 'self_link': {'readonly': True}, + 'issuer': {'readonly': True}, + 'issue_date': {'readonly': True}, + 'expiration_date': {'readonly': True}, + 'password': {'required': True}, + 'thumbprint': {'readonly': True}, + 'valid': {'readonly': True}, + 'cer_blob': {'readonly': True}, + 'public_key_hash': {'readonly': True}, + 'hosting_environment_profile': {'readonly': True}, + 'key_vault_secret_status': {'readonly': True}, + 'geo_region': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'subject_name': {'key': 'properties.subjectName', 'type': 'str'}, + 'host_names': {'key': 'properties.hostNames', 'type': '[str]'}, + 'pfx_blob': {'key': 'properties.pfxBlob', 'type': 'bytearray'}, + 'site_name': {'key': 'properties.siteName', 'type': 'str'}, + 'self_link': {'key': 'properties.selfLink', 'type': 'str'}, + 'issuer': {'key': 'properties.issuer', 'type': 'str'}, + 'issue_date': {'key': 'properties.issueDate', 'type': 'iso-8601'}, + 'expiration_date': {'key': 'properties.expirationDate', 'type': 'iso-8601'}, + 'password': {'key': 'properties.password', 'type': 'str'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'valid': {'key': 'properties.valid', 'type': 'bool'}, + 'cer_blob': {'key': 'properties.cerBlob', 'type': 'bytearray'}, + 'public_key_hash': {'key': 'properties.publicKeyHash', 'type': 'str'}, + 'hosting_environment_profile': {'key': 'properties.hostingEnvironmentProfile', 'type': 'HostingEnvironmentProfile'}, + 'key_vault_id': {'key': 'properties.keyVaultId', 'type': 'str'}, + 'key_vault_secret_name': {'key': 'properties.keyVaultSecretName', 'type': 'str'}, + 'key_vault_secret_status': {'key': 'properties.keyVaultSecretStatus', 'type': 'KeyVaultSecretStatus'}, + 'geo_region': {'key': 'properties.geoRegion', 'type': 'str'}, + 'server_farm_id': {'key': 'properties.serverFarmId', 'type': 'str'}, + } + + def __init__(self, *, password: str, kind: str=None, host_names=None, pfx_blob: bytearray=None, key_vault_id: str=None, key_vault_secret_name: str=None, server_farm_id: str=None, **kwargs) -> None: + super(CertificatePatchResource, self).__init__(kind=kind, **kwargs) + self.friendly_name = None + self.subject_name = None + self.host_names = host_names + self.pfx_blob = pfx_blob + self.site_name = None + self.self_link = None + self.issuer = None + self.issue_date = None + self.expiration_date = None + self.password = password + self.thumbprint = None + self.valid = None + self.cer_blob = None + self.public_key_hash = None + self.hosting_environment_profile = None + self.key_vault_id = key_vault_id + self.key_vault_secret_name = key_vault_secret_name + self.key_vault_secret_status = None + self.geo_region = None + self.server_farm_id = server_farm_id diff --git a/azure-mgmt-web/azure/mgmt/web/models/certificate_py3.py b/azure-mgmt-web/azure/mgmt/web/models/certificate_py3.py new file mode 100644 index 000000000000..1b9c206aac22 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/certificate_py3.py @@ -0,0 +1,159 @@ +# 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 .resource import Resource + + +class Certificate(Resource): + """SSL certificate for an 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 Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :ivar friendly_name: Friendly name of the certificate. + :vartype friendly_name: str + :ivar subject_name: Subject name of the certificate. + :vartype subject_name: str + :param host_names: Host names the certificate applies to. + :type host_names: list[str] + :param pfx_blob: Pfx blob. + :type pfx_blob: bytearray + :ivar site_name: App name. + :vartype site_name: str + :ivar self_link: Self link. + :vartype self_link: str + :ivar issuer: Certificate issuer. + :vartype issuer: str + :ivar issue_date: Certificate issue Date. + :vartype issue_date: datetime + :ivar expiration_date: Certificate expriration date. + :vartype expiration_date: datetime + :param password: Required. Certificate password. + :type password: str + :ivar thumbprint: Certificate thumbprint. + :vartype thumbprint: str + :ivar valid: Is the certificate valid?. + :vartype valid: bool + :ivar cer_blob: Raw bytes of .cer file + :vartype cer_blob: bytearray + :ivar public_key_hash: Public key hash. + :vartype public_key_hash: str + :ivar hosting_environment_profile: Specification for the App Service + Environment to use for the certificate. + :vartype hosting_environment_profile: + ~azure.mgmt.web.models.HostingEnvironmentProfile + :param key_vault_id: Key Vault Csm resource Id. + :type key_vault_id: str + :param key_vault_secret_name: Key Vault secret name. + :type key_vault_secret_name: str + :ivar key_vault_secret_status: Status of the Key Vault secret. Possible + values include: 'Initialized', 'WaitingOnCertificateOrder', 'Succeeded', + 'CertificateOrderFailed', 'OperationNotPermittedOnKeyVault', + 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', + 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', + 'Unknown' + :vartype key_vault_secret_status: str or + ~azure.mgmt.web.models.KeyVaultSecretStatus + :ivar geo_region: Region of the certificate. + :vartype geo_region: str + :param server_farm_id: Resource ID of the associated App Service plan, + formatted as: + "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + :type server_farm_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'friendly_name': {'readonly': True}, + 'subject_name': {'readonly': True}, + 'site_name': {'readonly': True}, + 'self_link': {'readonly': True}, + 'issuer': {'readonly': True}, + 'issue_date': {'readonly': True}, + 'expiration_date': {'readonly': True}, + 'password': {'required': True}, + 'thumbprint': {'readonly': True}, + 'valid': {'readonly': True}, + 'cer_blob': {'readonly': True}, + 'public_key_hash': {'readonly': True}, + 'hosting_environment_profile': {'readonly': True}, + 'key_vault_secret_status': {'readonly': True}, + 'geo_region': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'subject_name': {'key': 'properties.subjectName', 'type': 'str'}, + 'host_names': {'key': 'properties.hostNames', 'type': '[str]'}, + 'pfx_blob': {'key': 'properties.pfxBlob', 'type': 'bytearray'}, + 'site_name': {'key': 'properties.siteName', 'type': 'str'}, + 'self_link': {'key': 'properties.selfLink', 'type': 'str'}, + 'issuer': {'key': 'properties.issuer', 'type': 'str'}, + 'issue_date': {'key': 'properties.issueDate', 'type': 'iso-8601'}, + 'expiration_date': {'key': 'properties.expirationDate', 'type': 'iso-8601'}, + 'password': {'key': 'properties.password', 'type': 'str'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'valid': {'key': 'properties.valid', 'type': 'bool'}, + 'cer_blob': {'key': 'properties.cerBlob', 'type': 'bytearray'}, + 'public_key_hash': {'key': 'properties.publicKeyHash', 'type': 'str'}, + 'hosting_environment_profile': {'key': 'properties.hostingEnvironmentProfile', 'type': 'HostingEnvironmentProfile'}, + 'key_vault_id': {'key': 'properties.keyVaultId', 'type': 'str'}, + 'key_vault_secret_name': {'key': 'properties.keyVaultSecretName', 'type': 'str'}, + 'key_vault_secret_status': {'key': 'properties.keyVaultSecretStatus', 'type': 'KeyVaultSecretStatus'}, + 'geo_region': {'key': 'properties.geoRegion', 'type': 'str'}, + 'server_farm_id': {'key': 'properties.serverFarmId', 'type': 'str'}, + } + + def __init__(self, *, location: str, password: str, kind: str=None, tags=None, host_names=None, pfx_blob: bytearray=None, key_vault_id: str=None, key_vault_secret_name: str=None, server_farm_id: str=None, **kwargs) -> None: + super(Certificate, self).__init__(kind=kind, location=location, tags=tags, **kwargs) + self.friendly_name = None + self.subject_name = None + self.host_names = host_names + self.pfx_blob = pfx_blob + self.site_name = None + self.self_link = None + self.issuer = None + self.issue_date = None + self.expiration_date = None + self.password = password + self.thumbprint = None + self.valid = None + self.cer_blob = None + self.public_key_hash = None + self.hosting_environment_profile = None + self.key_vault_id = key_vault_id + self.key_vault_secret_name = key_vault_secret_name + self.key_vault_secret_status = None + self.geo_region = None + self.server_farm_id = server_farm_id diff --git a/azure-mgmt-web/azure/mgmt/web/models/cloning_info.py b/azure-mgmt-web/azure/mgmt/web/models/cloning_info.py index 193c1610ef4d..233f7df1599c 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/cloning_info.py +++ b/azure-mgmt-web/azure/mgmt/web/models/cloning_info.py @@ -15,6 +15,8 @@ class CloningInfo(Model): """Information needed for cloning operation. + All required parameters must be populated in order to send to Azure. + :param correlation_id: Correlation ID of cloning operation. This ID ties multiple cloning operations together to use the same snapshot. @@ -28,8 +30,8 @@ class CloningInfo(Model): :param clone_source_control: true to clone source control from source app; otherwise, false. :type clone_source_control: bool - :param source_web_app_id: ARM resource ID of the source app. App resource - ID is of the form + :param source_web_app_id: Required. ARM resource ID of the source app. App + resource ID is of the form /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} for production slots and /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} @@ -76,16 +78,16 @@ class CloningInfo(Model): 'ignore_quotas': {'key': 'ignoreQuotas', 'type': 'bool'}, } - def __init__(self, source_web_app_id, correlation_id=None, overwrite=None, clone_custom_host_names=None, clone_source_control=None, hosting_environment=None, app_settings_overrides=None, configure_load_balancing=None, traffic_manager_profile_id=None, traffic_manager_profile_name=None, ignore_quotas=None): - super(CloningInfo, self).__init__() - self.correlation_id = correlation_id - self.overwrite = overwrite - self.clone_custom_host_names = clone_custom_host_names - self.clone_source_control = clone_source_control - self.source_web_app_id = source_web_app_id - self.hosting_environment = hosting_environment - self.app_settings_overrides = app_settings_overrides - self.configure_load_balancing = configure_load_balancing - self.traffic_manager_profile_id = traffic_manager_profile_id - self.traffic_manager_profile_name = traffic_manager_profile_name - self.ignore_quotas = ignore_quotas + def __init__(self, **kwargs): + super(CloningInfo, self).__init__(**kwargs) + self.correlation_id = kwargs.get('correlation_id', None) + self.overwrite = kwargs.get('overwrite', None) + self.clone_custom_host_names = kwargs.get('clone_custom_host_names', None) + self.clone_source_control = kwargs.get('clone_source_control', None) + self.source_web_app_id = kwargs.get('source_web_app_id', None) + self.hosting_environment = kwargs.get('hosting_environment', None) + self.app_settings_overrides = kwargs.get('app_settings_overrides', None) + self.configure_load_balancing = kwargs.get('configure_load_balancing', None) + self.traffic_manager_profile_id = kwargs.get('traffic_manager_profile_id', None) + self.traffic_manager_profile_name = kwargs.get('traffic_manager_profile_name', None) + self.ignore_quotas = kwargs.get('ignore_quotas', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/cloning_info_py3.py b/azure-mgmt-web/azure/mgmt/web/models/cloning_info_py3.py new file mode 100644 index 000000000000..2540e9b3dd8f --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/cloning_info_py3.py @@ -0,0 +1,93 @@ +# 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 msrest.serialization import Model + + +class CloningInfo(Model): + """Information needed for cloning operation. + + All required parameters must be populated in order to send to Azure. + + :param correlation_id: Correlation ID of cloning operation. This ID ties + multiple cloning operations + together to use the same snapshot. + :type correlation_id: str + :param overwrite: true to overwrite destination app; + otherwise, false. + :type overwrite: bool + :param clone_custom_host_names: true to clone custom + hostnames from source app; otherwise, false. + :type clone_custom_host_names: bool + :param clone_source_control: true to clone source control + from source app; otherwise, false. + :type clone_source_control: bool + :param source_web_app_id: Required. ARM resource ID of the source app. App + resource ID is of the form + /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + for production slots and + /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + for other slots. + :type source_web_app_id: str + :param hosting_environment: App Service Environment. + :type hosting_environment: str + :param app_settings_overrides: Application setting overrides for cloned + app. If specified, these settings override the settings cloned + from source app. Otherwise, application settings from source app are + retained. + :type app_settings_overrides: dict[str, str] + :param configure_load_balancing: true to configure load + balancing for source and destination app. + :type configure_load_balancing: bool + :param traffic_manager_profile_id: ARM resource ID of the Traffic Manager + profile to use, if it exists. Traffic Manager resource ID is of the form + /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. + :type traffic_manager_profile_id: str + :param traffic_manager_profile_name: Name of Traffic Manager profile to + create. This is only needed if Traffic Manager profile does not already + exist. + :type traffic_manager_profile_name: str + :param ignore_quotas: true if quotas should be ignored; + otherwise, false. + :type ignore_quotas: bool + """ + + _validation = { + 'source_web_app_id': {'required': True}, + } + + _attribute_map = { + 'correlation_id': {'key': 'correlationId', 'type': 'str'}, + 'overwrite': {'key': 'overwrite', 'type': 'bool'}, + 'clone_custom_host_names': {'key': 'cloneCustomHostNames', 'type': 'bool'}, + 'clone_source_control': {'key': 'cloneSourceControl', 'type': 'bool'}, + 'source_web_app_id': {'key': 'sourceWebAppId', 'type': 'str'}, + 'hosting_environment': {'key': 'hostingEnvironment', 'type': 'str'}, + 'app_settings_overrides': {'key': 'appSettingsOverrides', 'type': '{str}'}, + 'configure_load_balancing': {'key': 'configureLoadBalancing', 'type': 'bool'}, + 'traffic_manager_profile_id': {'key': 'trafficManagerProfileId', 'type': 'str'}, + 'traffic_manager_profile_name': {'key': 'trafficManagerProfileName', 'type': 'str'}, + 'ignore_quotas': {'key': 'ignoreQuotas', 'type': 'bool'}, + } + + def __init__(self, *, source_web_app_id: str, correlation_id: str=None, overwrite: bool=None, clone_custom_host_names: bool=None, clone_source_control: bool=None, hosting_environment: str=None, app_settings_overrides=None, configure_load_balancing: bool=None, traffic_manager_profile_id: str=None, traffic_manager_profile_name: str=None, ignore_quotas: bool=None, **kwargs) -> None: + super(CloningInfo, self).__init__(**kwargs) + self.correlation_id = correlation_id + self.overwrite = overwrite + self.clone_custom_host_names = clone_custom_host_names + self.clone_source_control = clone_source_control + self.source_web_app_id = source_web_app_id + self.hosting_environment = hosting_environment + self.app_settings_overrides = app_settings_overrides + self.configure_load_balancing = configure_load_balancing + self.traffic_manager_profile_id = traffic_manager_profile_id + self.traffic_manager_profile_name = traffic_manager_profile_name + self.ignore_quotas = ignore_quotas diff --git a/azure-mgmt-web/azure/mgmt/web/models/conn_string_info.py b/azure-mgmt-web/azure/mgmt/web/models/conn_string_info.py index 85f5c197d14e..040fbea5e920 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/conn_string_info.py +++ b/azure-mgmt-web/azure/mgmt/web/models/conn_string_info.py @@ -31,8 +31,8 @@ class ConnStringInfo(Model): 'type': {'key': 'type', 'type': 'ConnectionStringType'}, } - def __init__(self, name=None, connection_string=None, type=None): - super(ConnStringInfo, self).__init__() - self.name = name - self.connection_string = connection_string - self.type = type + def __init__(self, **kwargs): + super(ConnStringInfo, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.connection_string = kwargs.get('connection_string', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/conn_string_info_py3.py b/azure-mgmt-web/azure/mgmt/web/models/conn_string_info_py3.py new file mode 100644 index 000000000000..24d38593fded --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/conn_string_info_py3.py @@ -0,0 +1,38 @@ +# 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 msrest.serialization import Model + + +class ConnStringInfo(Model): + """Database connection string information. + + :param name: Name of connection string. + :type name: str + :param connection_string: Connection string value. + :type connection_string: str + :param type: Type of database. Possible values include: 'MySql', + 'SQLServer', 'SQLAzure', 'Custom', 'NotificationHub', 'ServiceBus', + 'EventHub', 'ApiHub', 'DocDb', 'RedisCache', 'PostgreSQL' + :type type: str or ~azure.mgmt.web.models.ConnectionStringType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'connection_string': {'key': 'connectionString', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'ConnectionStringType'}, + } + + def __init__(self, *, name: str=None, connection_string: str=None, type=None, **kwargs) -> None: + super(ConnStringInfo, self).__init__(**kwargs) + self.name = name + self.connection_string = connection_string + self.type = type diff --git a/azure-mgmt-web/azure/mgmt/web/models/conn_string_value_type_pair.py b/azure-mgmt-web/azure/mgmt/web/models/conn_string_value_type_pair.py index a06aab9a003c..8fc0ffe591dd 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/conn_string_value_type_pair.py +++ b/azure-mgmt-web/azure/mgmt/web/models/conn_string_value_type_pair.py @@ -15,9 +15,11 @@ class ConnStringValueTypePair(Model): """Database connection string value to type pair. - :param value: Value of pair. + All required parameters must be populated in order to send to Azure. + + :param value: Required. Value of pair. :type value: str - :param type: Type of database. Possible values include: 'MySql', + :param type: Required. Type of database. Possible values include: 'MySql', 'SQLServer', 'SQLAzure', 'Custom', 'NotificationHub', 'ServiceBus', 'EventHub', 'ApiHub', 'DocDb', 'RedisCache', 'PostgreSQL' :type type: str or ~azure.mgmt.web.models.ConnectionStringType @@ -33,7 +35,7 @@ class ConnStringValueTypePair(Model): 'type': {'key': 'type', 'type': 'ConnectionStringType'}, } - def __init__(self, value, type): - super(ConnStringValueTypePair, self).__init__() - self.value = value - self.type = type + def __init__(self, **kwargs): + super(ConnStringValueTypePair, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/conn_string_value_type_pair_py3.py b/azure-mgmt-web/azure/mgmt/web/models/conn_string_value_type_pair_py3.py new file mode 100644 index 000000000000..e45cabb73a39 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/conn_string_value_type_pair_py3.py @@ -0,0 +1,41 @@ +# 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 msrest.serialization import Model + + +class ConnStringValueTypePair(Model): + """Database connection string value to type pair. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Value of pair. + :type value: str + :param type: Required. Type of database. Possible values include: 'MySql', + 'SQLServer', 'SQLAzure', 'Custom', 'NotificationHub', 'ServiceBus', + 'EventHub', 'ApiHub', 'DocDb', 'RedisCache', 'PostgreSQL' + :type type: str or ~azure.mgmt.web.models.ConnectionStringType + """ + + _validation = { + 'value': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'ConnectionStringType'}, + } + + def __init__(self, *, value: str, type, **kwargs) -> None: + super(ConnStringValueTypePair, self).__init__(**kwargs) + self.value = value + self.type = type diff --git a/azure-mgmt-web/azure/mgmt/web/models/connection_string_dictionary.py b/azure-mgmt-web/azure/mgmt/web/models/connection_string_dictionary.py index 600fb4f02001..d2e4a7bc5f1a 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/connection_string_dictionary.py +++ b/azure-mgmt-web/azure/mgmt/web/models/connection_string_dictionary.py @@ -45,6 +45,6 @@ class ConnectionStringDictionary(ProxyOnlyResource): 'properties': {'key': 'properties', 'type': '{ConnStringValueTypePair}'}, } - def __init__(self, kind=None, properties=None): - super(ConnectionStringDictionary, self).__init__(kind=kind) - self.properties = properties + def __init__(self, **kwargs): + super(ConnectionStringDictionary, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/connection_string_dictionary_py3.py b/azure-mgmt-web/azure/mgmt/web/models/connection_string_dictionary_py3.py new file mode 100644 index 000000000000..4bc016dac8ba --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/connection_string_dictionary_py3.py @@ -0,0 +1,50 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class ConnectionStringDictionary(ProxyOnlyResource): + """String dictionary resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param properties: Connection strings. + :type properties: dict[str, + ~azure.mgmt.web.models.ConnStringValueTypePair] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': '{ConnStringValueTypePair}'}, + } + + def __init__(self, *, kind: str=None, properties=None, **kwargs) -> None: + super(ConnectionStringDictionary, self).__init__(kind=kind, **kwargs) + self.properties = properties diff --git a/azure-mgmt-web/azure/mgmt/web/models/contact.py b/azure-mgmt-web/azure/mgmt/web/models/contact.py index 28b3c6749af2..a18a023642d0 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/contact.py +++ b/azure-mgmt-web/azure/mgmt/web/models/contact.py @@ -18,23 +18,25 @@ class Contact(Model): through the Whois directories as per ICANN requirements. + All required parameters must be populated in order to send to Azure. + :param address_mailing: Mailing address. :type address_mailing: ~azure.mgmt.web.models.Address - :param email: Email address. + :param email: Required. Email address. :type email: str :param fax: Fax number. :type fax: str :param job_title: Job title. :type job_title: str - :param name_first: First name. + :param name_first: Required. First name. :type name_first: str - :param name_last: Last name. + :param name_last: Required. Last name. :type name_last: str :param name_middle: Middle name. :type name_middle: str :param organization: Organization contact belongs to. :type organization: str - :param phone: Phone number. + :param phone: Required. Phone number. :type phone: str """ @@ -57,14 +59,14 @@ class Contact(Model): 'phone': {'key': 'phone', 'type': 'str'}, } - def __init__(self, email, name_first, name_last, phone, address_mailing=None, fax=None, job_title=None, name_middle=None, organization=None): - super(Contact, self).__init__() - self.address_mailing = address_mailing - self.email = email - self.fax = fax - self.job_title = job_title - self.name_first = name_first - self.name_last = name_last - self.name_middle = name_middle - self.organization = organization - self.phone = phone + def __init__(self, **kwargs): + super(Contact, self).__init__(**kwargs) + self.address_mailing = kwargs.get('address_mailing', None) + self.email = kwargs.get('email', None) + self.fax = kwargs.get('fax', None) + self.job_title = kwargs.get('job_title', None) + self.name_first = kwargs.get('name_first', None) + self.name_last = kwargs.get('name_last', None) + self.name_middle = kwargs.get('name_middle', None) + self.organization = kwargs.get('organization', None) + self.phone = kwargs.get('phone', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/contact_py3.py b/azure-mgmt-web/azure/mgmt/web/models/contact_py3.py new file mode 100644 index 000000000000..5567ac2cd1b4 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/contact_py3.py @@ -0,0 +1,72 @@ +# 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 msrest.serialization import Model + + +class Contact(Model): + """Contact information for domain registration. If 'Domain Privacy' option is + not selected then the contact information is made publicly available + through the Whois + directories as per ICANN requirements. + + All required parameters must be populated in order to send to Azure. + + :param address_mailing: Mailing address. + :type address_mailing: ~azure.mgmt.web.models.Address + :param email: Required. Email address. + :type email: str + :param fax: Fax number. + :type fax: str + :param job_title: Job title. + :type job_title: str + :param name_first: Required. First name. + :type name_first: str + :param name_last: Required. Last name. + :type name_last: str + :param name_middle: Middle name. + :type name_middle: str + :param organization: Organization contact belongs to. + :type organization: str + :param phone: Required. Phone number. + :type phone: str + """ + + _validation = { + 'email': {'required': True}, + 'name_first': {'required': True}, + 'name_last': {'required': True}, + 'phone': {'required': True}, + } + + _attribute_map = { + 'address_mailing': {'key': 'addressMailing', 'type': 'Address'}, + 'email': {'key': 'email', 'type': 'str'}, + 'fax': {'key': 'fax', 'type': 'str'}, + 'job_title': {'key': 'jobTitle', 'type': 'str'}, + 'name_first': {'key': 'nameFirst', 'type': 'str'}, + 'name_last': {'key': 'nameLast', 'type': 'str'}, + 'name_middle': {'key': 'nameMiddle', 'type': 'str'}, + 'organization': {'key': 'organization', 'type': 'str'}, + 'phone': {'key': 'phone', 'type': 'str'}, + } + + def __init__(self, *, email: str, name_first: str, name_last: str, phone: str, address_mailing=None, fax: str=None, job_title: str=None, name_middle: str=None, organization: str=None, **kwargs) -> None: + super(Contact, self).__init__(**kwargs) + self.address_mailing = address_mailing + self.email = email + self.fax = fax + self.job_title = job_title + self.name_first = name_first + self.name_last = name_last + self.name_middle = name_middle + self.organization = organization + self.phone = phone diff --git a/azure-mgmt-web/azure/mgmt/web/models/continuous_web_job.py b/azure-mgmt-web/azure/mgmt/web/models/continuous_web_job.py index d8df3ee5ea9a..5e3e2d22cce5 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/continuous_web_job.py +++ b/azure-mgmt-web/azure/mgmt/web/models/continuous_web_job.py @@ -78,16 +78,16 @@ class ContinuousWebJob(ProxyOnlyResource): 'settings': {'key': 'properties.settings', 'type': '{object}'}, } - def __init__(self, kind=None, status=None, detailed_status=None, log_url=None, run_command=None, url=None, extra_info_url=None, job_type=None, error=None, using_sdk=None, settings=None): - super(ContinuousWebJob, self).__init__(kind=kind) - self.status = status - self.detailed_status = detailed_status - self.log_url = log_url + def __init__(self, **kwargs): + super(ContinuousWebJob, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.detailed_status = kwargs.get('detailed_status', None) + self.log_url = kwargs.get('log_url', None) self.continuous_web_job_name = None - self.run_command = run_command - self.url = url - self.extra_info_url = extra_info_url - self.job_type = job_type - self.error = error - self.using_sdk = using_sdk - self.settings = settings + self.run_command = kwargs.get('run_command', None) + self.url = kwargs.get('url', None) + self.extra_info_url = kwargs.get('extra_info_url', None) + self.job_type = kwargs.get('job_type', None) + self.error = kwargs.get('error', None) + self.using_sdk = kwargs.get('using_sdk', None) + self.settings = kwargs.get('settings', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/continuous_web_job_py3.py b/azure-mgmt-web/azure/mgmt/web/models/continuous_web_job_py3.py new file mode 100644 index 000000000000..1c0f1051177f --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/continuous_web_job_py3.py @@ -0,0 +1,93 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class ContinuousWebJob(ProxyOnlyResource): + """Continuous Web Job Information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param status: Job status. Possible values include: 'Initializing', + 'Starting', 'Running', 'PendingRestart', 'Stopped' + :type status: str or ~azure.mgmt.web.models.ContinuousWebJobStatus + :param detailed_status: Detailed status. + :type detailed_status: str + :param log_url: Log URL. + :type log_url: str + :ivar continuous_web_job_name: Job name. Used as job identifier in ARM + resource URI. + :vartype continuous_web_job_name: str + :param run_command: Run command. + :type run_command: str + :param url: Job URL. + :type url: str + :param extra_info_url: Extra Info URL. + :type extra_info_url: str + :param job_type: Job type. Possible values include: 'Continuous', + 'Triggered' + :type job_type: str or ~azure.mgmt.web.models.WebJobType + :param error: Error information. + :type error: str + :param using_sdk: Using SDK? + :type using_sdk: bool + :param settings: Job settings. + :type settings: dict[str, object] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'continuous_web_job_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'ContinuousWebJobStatus'}, + 'detailed_status': {'key': 'properties.detailedStatus', 'type': 'str'}, + 'log_url': {'key': 'properties.logUrl', 'type': 'str'}, + 'continuous_web_job_name': {'key': 'properties.name', 'type': 'str'}, + 'run_command': {'key': 'properties.runCommand', 'type': 'str'}, + 'url': {'key': 'properties.url', 'type': 'str'}, + 'extra_info_url': {'key': 'properties.extraInfoUrl', 'type': 'str'}, + 'job_type': {'key': 'properties.jobType', 'type': 'WebJobType'}, + 'error': {'key': 'properties.error', 'type': 'str'}, + 'using_sdk': {'key': 'properties.usingSdk', 'type': 'bool'}, + 'settings': {'key': 'properties.settings', 'type': '{object}'}, + } + + def __init__(self, *, kind: str=None, status=None, detailed_status: str=None, log_url: str=None, run_command: str=None, url: str=None, extra_info_url: str=None, job_type=None, error: str=None, using_sdk: bool=None, settings=None, **kwargs) -> None: + super(ContinuousWebJob, self).__init__(kind=kind, **kwargs) + self.status = status + self.detailed_status = detailed_status + self.log_url = log_url + self.continuous_web_job_name = None + self.run_command = run_command + self.url = url + self.extra_info_url = extra_info_url + self.job_type = job_type + self.error = error + self.using_sdk = using_sdk + self.settings = settings diff --git a/azure-mgmt-web/azure/mgmt/web/models/cors_settings.py b/azure-mgmt-web/azure/mgmt/web/models/cors_settings.py index 8b4de3fca608..5096932c5327 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/cors_settings.py +++ b/azure-mgmt-web/azure/mgmt/web/models/cors_settings.py @@ -25,6 +25,6 @@ class CorsSettings(Model): 'allowed_origins': {'key': 'allowedOrigins', 'type': '[str]'}, } - def __init__(self, allowed_origins=None): - super(CorsSettings, self).__init__() - self.allowed_origins = allowed_origins + def __init__(self, **kwargs): + super(CorsSettings, self).__init__(**kwargs) + self.allowed_origins = kwargs.get('allowed_origins', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/cors_settings_py3.py b/azure-mgmt-web/azure/mgmt/web/models/cors_settings_py3.py new file mode 100644 index 000000000000..17c530afdd67 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/cors_settings_py3.py @@ -0,0 +1,30 @@ +# 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 msrest.serialization import Model + + +class CorsSettings(Model): + """Cross-Origin Resource Sharing (CORS) settings for the app. + + :param allowed_origins: Gets or sets the list of origins that should be + allowed to make cross-origin + calls (for example: http://example.com:12345). Use "*" to allow all. + :type allowed_origins: list[str] + """ + + _attribute_map = { + 'allowed_origins': {'key': 'allowedOrigins', 'type': '[str]'}, + } + + def __init__(self, *, allowed_origins=None, **kwargs) -> None: + super(CorsSettings, self).__init__(**kwargs) + self.allowed_origins = allowed_origins diff --git a/azure-mgmt-web/azure/mgmt/web/models/csm_move_resource_envelope.py b/azure-mgmt-web/azure/mgmt/web/models/csm_move_resource_envelope.py index 8c3093e3fba0..7b8a19d7ca27 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/csm_move_resource_envelope.py +++ b/azure-mgmt-web/azure/mgmt/web/models/csm_move_resource_envelope.py @@ -31,7 +31,7 @@ class CsmMoveResourceEnvelope(Model): 'resources': {'key': 'resources', 'type': '[str]'}, } - def __init__(self, target_resource_group=None, resources=None): - super(CsmMoveResourceEnvelope, self).__init__() - self.target_resource_group = target_resource_group - self.resources = resources + def __init__(self, **kwargs): + super(CsmMoveResourceEnvelope, self).__init__(**kwargs) + self.target_resource_group = kwargs.get('target_resource_group', None) + self.resources = kwargs.get('resources', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/csm_move_resource_envelope_py3.py b/azure-mgmt-web/azure/mgmt/web/models/csm_move_resource_envelope_py3.py new file mode 100644 index 000000000000..45dd9ab318d6 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/csm_move_resource_envelope_py3.py @@ -0,0 +1,37 @@ +# 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 msrest.serialization import Model + + +class CsmMoveResourceEnvelope(Model): + """Object with a list of the resources that need to be moved and the resource + group they should be moved to. + + :param target_resource_group: + :type target_resource_group: str + :param resources: + :type resources: list[str] + """ + + _validation = { + 'target_resource_group': {'max_length': 90, 'min_length': 1, 'pattern': r' ^[-\w\._\(\)]+[^\.]$'}, + } + + _attribute_map = { + 'target_resource_group': {'key': 'targetResourceGroup', 'type': 'str'}, + 'resources': {'key': 'resources', 'type': '[str]'}, + } + + def __init__(self, *, target_resource_group: str=None, resources=None, **kwargs) -> None: + super(CsmMoveResourceEnvelope, self).__init__(**kwargs) + self.target_resource_group = target_resource_group + self.resources = resources diff --git a/azure-mgmt-web/azure/mgmt/web/models/csm_operation_description.py b/azure-mgmt-web/azure/mgmt/web/models/csm_operation_description.py index 89ee09ec7fae..d1d7494ac89f 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/csm_operation_description.py +++ b/azure-mgmt-web/azure/mgmt/web/models/csm_operation_description.py @@ -32,9 +32,9 @@ class CsmOperationDescription(Model): 'properties': {'key': 'properties', 'type': 'CsmOperationDescriptionProperties'}, } - def __init__(self, name=None, display=None, origin=None, properties=None): - super(CsmOperationDescription, self).__init__() - self.name = name - self.display = display - self.origin = origin - self.properties = properties + def __init__(self, **kwargs): + super(CsmOperationDescription, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/csm_operation_description_properties.py b/azure-mgmt-web/azure/mgmt/web/models/csm_operation_description_properties.py index 9cce3fb92aeb..6362aada58a3 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/csm_operation_description_properties.py +++ b/azure-mgmt-web/azure/mgmt/web/models/csm_operation_description_properties.py @@ -23,6 +23,6 @@ class CsmOperationDescriptionProperties(Model): 'service_specification': {'key': 'serviceSpecification', 'type': 'ServiceSpecification'}, } - def __init__(self, service_specification=None): - super(CsmOperationDescriptionProperties, self).__init__() - self.service_specification = service_specification + def __init__(self, **kwargs): + super(CsmOperationDescriptionProperties, self).__init__(**kwargs) + self.service_specification = kwargs.get('service_specification', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/csm_operation_description_properties_py3.py b/azure-mgmt-web/azure/mgmt/web/models/csm_operation_description_properties_py3.py new file mode 100644 index 000000000000..0dff6ebe4d7b --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/csm_operation_description_properties_py3.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class CsmOperationDescriptionProperties(Model): + """Properties available for a Microsoft.Web resource provider operation. + + :param service_specification: + :type service_specification: ~azure.mgmt.web.models.ServiceSpecification + """ + + _attribute_map = { + 'service_specification': {'key': 'serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__(self, *, service_specification=None, **kwargs) -> None: + super(CsmOperationDescriptionProperties, self).__init__(**kwargs) + self.service_specification = service_specification diff --git a/azure-mgmt-web/azure/mgmt/web/models/csm_operation_description_py3.py b/azure-mgmt-web/azure/mgmt/web/models/csm_operation_description_py3.py new file mode 100644 index 000000000000..ee5aaaae36bb --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/csm_operation_description_py3.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class CsmOperationDescription(Model): + """Description of an operation available for Microsoft.Web resource provider. + + :param name: + :type name: str + :param display: + :type display: ~azure.mgmt.web.models.CsmOperationDisplay + :param origin: + :type origin: str + :param properties: + :type properties: ~azure.mgmt.web.models.CsmOperationDescriptionProperties + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'CsmOperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'CsmOperationDescriptionProperties'}, + } + + def __init__(self, *, name: str=None, display=None, origin: str=None, properties=None, **kwargs) -> None: + super(CsmOperationDescription, self).__init__(**kwargs) + self.name = name + self.display = display + self.origin = origin + self.properties = properties diff --git a/azure-mgmt-web/azure/mgmt/web/models/csm_operation_display.py b/azure-mgmt-web/azure/mgmt/web/models/csm_operation_display.py index f0906307021f..82f7c5b55b83 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/csm_operation_display.py +++ b/azure-mgmt-web/azure/mgmt/web/models/csm_operation_display.py @@ -32,9 +32,9 @@ class CsmOperationDisplay(Model): 'description': {'key': 'description', 'type': 'str'}, } - def __init__(self, provider=None, resource=None, operation=None, description=None): - super(CsmOperationDisplay, self).__init__() - self.provider = provider - self.resource = resource - self.operation = operation - self.description = description + def __init__(self, **kwargs): + super(CsmOperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/csm_operation_display_py3.py b/azure-mgmt-web/azure/mgmt/web/models/csm_operation_display_py3.py new file mode 100644 index 000000000000..f5645fe2e6cf --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/csm_operation_display_py3.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class CsmOperationDisplay(Model): + """Meta data about operation used for display in portal. + + :param provider: + :type provider: str + :param resource: + :type resource: str + :param operation: + :type operation: str + :param description: + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(CsmOperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description diff --git a/azure-mgmt-web/azure/mgmt/web/models/csm_publishing_profile_options.py b/azure-mgmt-web/azure/mgmt/web/models/csm_publishing_profile_options.py index 67897e676cf3..65ab8e37e552 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/csm_publishing_profile_options.py +++ b/azure-mgmt-web/azure/mgmt/web/models/csm_publishing_profile_options.py @@ -26,6 +26,6 @@ class CsmPublishingProfileOptions(Model): 'format': {'key': 'format', 'type': 'str'}, } - def __init__(self, format=None): - super(CsmPublishingProfileOptions, self).__init__() - self.format = format + def __init__(self, **kwargs): + super(CsmPublishingProfileOptions, self).__init__(**kwargs) + self.format = kwargs.get('format', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/csm_publishing_profile_options_py3.py b/azure-mgmt-web/azure/mgmt/web/models/csm_publishing_profile_options_py3.py new file mode 100644 index 000000000000..eee0a5e7c608 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/csm_publishing_profile_options_py3.py @@ -0,0 +1,31 @@ +# 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 msrest.serialization import Model + + +class CsmPublishingProfileOptions(Model): + """Publishing options for requested profile. + + :param format: Name of the format. Valid values are: + FileZilla3 + WebDeploy -- default + Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + :type format: str or ~azure.mgmt.web.models.PublishingProfileFormat + """ + + _attribute_map = { + 'format': {'key': 'format', 'type': 'str'}, + } + + def __init__(self, *, format=None, **kwargs) -> None: + super(CsmPublishingProfileOptions, self).__init__(**kwargs) + self.format = format diff --git a/azure-mgmt-web/azure/mgmt/web/models/csm_slot_entity.py b/azure-mgmt-web/azure/mgmt/web/models/csm_slot_entity.py index 06446508086b..4f2b0eb519f7 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/csm_slot_entity.py +++ b/azure-mgmt-web/azure/mgmt/web/models/csm_slot_entity.py @@ -15,10 +15,13 @@ class CsmSlotEntity(Model): """Deployment slot parameters. - :param target_slot: Destination deployment slot during swap operation. + All required parameters must be populated in order to send to Azure. + + :param target_slot: Required. Destination deployment slot during swap + operation. :type target_slot: str - :param preserve_vnet: true to preserve Virtual Network to the - slot during swap; otherwise, false. + :param preserve_vnet: Required. true to preserve Virtual + Network to the slot during swap; otherwise, false. :type preserve_vnet: bool """ @@ -32,7 +35,7 @@ class CsmSlotEntity(Model): 'preserve_vnet': {'key': 'preserveVnet', 'type': 'bool'}, } - def __init__(self, target_slot, preserve_vnet): - super(CsmSlotEntity, self).__init__() - self.target_slot = target_slot - self.preserve_vnet = preserve_vnet + def __init__(self, **kwargs): + super(CsmSlotEntity, self).__init__(**kwargs) + self.target_slot = kwargs.get('target_slot', None) + self.preserve_vnet = kwargs.get('preserve_vnet', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/csm_slot_entity_py3.py b/azure-mgmt-web/azure/mgmt/web/models/csm_slot_entity_py3.py new file mode 100644 index 000000000000..e367bd554d0b --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/csm_slot_entity_py3.py @@ -0,0 +1,41 @@ +# 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 msrest.serialization import Model + + +class CsmSlotEntity(Model): + """Deployment slot parameters. + + All required parameters must be populated in order to send to Azure. + + :param target_slot: Required. Destination deployment slot during swap + operation. + :type target_slot: str + :param preserve_vnet: Required. true to preserve Virtual + Network to the slot during swap; otherwise, false. + :type preserve_vnet: bool + """ + + _validation = { + 'target_slot': {'required': True}, + 'preserve_vnet': {'required': True}, + } + + _attribute_map = { + 'target_slot': {'key': 'targetSlot', 'type': 'str'}, + 'preserve_vnet': {'key': 'preserveVnet', 'type': 'bool'}, + } + + def __init__(self, *, target_slot: str, preserve_vnet: bool, **kwargs) -> None: + super(CsmSlotEntity, self).__init__(**kwargs) + self.target_slot = target_slot + self.preserve_vnet = preserve_vnet diff --git a/azure-mgmt-web/azure/mgmt/web/models/csm_usage_quota.py b/azure-mgmt-web/azure/mgmt/web/models/csm_usage_quota.py index ce6e4773da6c..6ec31a0dbbab 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/csm_usage_quota.py +++ b/azure-mgmt-web/azure/mgmt/web/models/csm_usage_quota.py @@ -35,10 +35,10 @@ class CsmUsageQuota(Model): 'name': {'key': 'name', 'type': 'LocalizableString'}, } - def __init__(self, unit=None, next_reset_time=None, current_value=None, limit=None, name=None): - super(CsmUsageQuota, self).__init__() - self.unit = unit - self.next_reset_time = next_reset_time - self.current_value = current_value - self.limit = limit - self.name = name + def __init__(self, **kwargs): + super(CsmUsageQuota, self).__init__(**kwargs) + self.unit = kwargs.get('unit', None) + self.next_reset_time = kwargs.get('next_reset_time', None) + self.current_value = kwargs.get('current_value', None) + self.limit = kwargs.get('limit', None) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/csm_usage_quota_py3.py b/azure-mgmt-web/azure/mgmt/web/models/csm_usage_quota_py3.py new file mode 100644 index 000000000000..ec46c5675a51 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/csm_usage_quota_py3.py @@ -0,0 +1,44 @@ +# 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 msrest.serialization import Model + + +class CsmUsageQuota(Model): + """Usage of the quota resource. + + :param unit: Units of measurement for the quota resourse. + :type unit: str + :param next_reset_time: Next reset time for the resource counter. + :type next_reset_time: datetime + :param current_value: The current value of the resource counter. + :type current_value: long + :param limit: The resource limit. + :type limit: long + :param name: Quota name. + :type name: ~azure.mgmt.web.models.LocalizableString + """ + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'str'}, + 'next_reset_time': {'key': 'nextResetTime', 'type': 'iso-8601'}, + 'current_value': {'key': 'currentValue', 'type': 'long'}, + 'limit': {'key': 'limit', 'type': 'long'}, + 'name': {'key': 'name', 'type': 'LocalizableString'}, + } + + def __init__(self, *, unit: str=None, next_reset_time=None, current_value: int=None, limit: int=None, name=None, **kwargs) -> None: + super(CsmUsageQuota, self).__init__(**kwargs) + self.unit = unit + self.next_reset_time = next_reset_time + self.current_value = current_value + self.limit = limit + self.name = name diff --git a/azure-mgmt-web/azure/mgmt/web/models/custom_hostname_analysis_result.py b/azure-mgmt-web/azure/mgmt/web/models/custom_hostname_analysis_result.py index 6b29a631fb1e..caad9e011ea0 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/custom_hostname_analysis_result.py +++ b/azure-mgmt-web/azure/mgmt/web/models/custom_hostname_analysis_result.py @@ -90,16 +90,16 @@ class CustomHostnameAnalysisResult(ProxyOnlyResource): 'alternate_txt_records': {'key': 'properties.alternateTxtRecords', 'type': '[str]'}, } - def __init__(self, kind=None, c_name_records=None, txt_records=None, a_records=None, alternate_cname_records=None, alternate_txt_records=None): - super(CustomHostnameAnalysisResult, self).__init__(kind=kind) + def __init__(self, **kwargs): + super(CustomHostnameAnalysisResult, self).__init__(**kwargs) self.is_hostname_already_verified = None self.custom_domain_verification_test = None self.custom_domain_verification_failure_info = None self.has_conflict_on_scale_unit = None self.has_conflict_across_subscription = None self.conflicting_app_resource_id = None - self.c_name_records = c_name_records - self.txt_records = txt_records - self.a_records = a_records - self.alternate_cname_records = alternate_cname_records - self.alternate_txt_records = alternate_txt_records + self.c_name_records = kwargs.get('c_name_records', None) + self.txt_records = kwargs.get('txt_records', None) + self.a_records = kwargs.get('a_records', None) + self.alternate_cname_records = kwargs.get('alternate_cname_records', None) + self.alternate_txt_records = kwargs.get('alternate_txt_records', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/custom_hostname_analysis_result_py3.py b/azure-mgmt-web/azure/mgmt/web/models/custom_hostname_analysis_result_py3.py new file mode 100644 index 000000000000..88498ba64d79 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/custom_hostname_analysis_result_py3.py @@ -0,0 +1,105 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class CustomHostnameAnalysisResult(ProxyOnlyResource): + """Custom domain analysis. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar is_hostname_already_verified: true if hostname is + already verified; otherwise, false. + :vartype is_hostname_already_verified: bool + :ivar custom_domain_verification_test: DNS verification test result. + Possible values include: 'Passed', 'Failed', 'Skipped' + :vartype custom_domain_verification_test: str or + ~azure.mgmt.web.models.DnsVerificationTestResult + :ivar custom_domain_verification_failure_info: Raw failure information if + DNS verification fails. + :vartype custom_domain_verification_failure_info: + ~azure.mgmt.web.models.ErrorEntity + :ivar has_conflict_on_scale_unit: true if there is a conflict + on a scale unit; otherwise, false. + :vartype has_conflict_on_scale_unit: bool + :ivar has_conflict_across_subscription: true if htere is a + conflict across subscriptions; otherwise, false. + :vartype has_conflict_across_subscription: bool + :ivar conflicting_app_resource_id: Name of the conflicting app on scale + unit if it's within the same subscription. + :vartype conflicting_app_resource_id: str + :param c_name_records: CName records controller can see for this hostname. + :type c_name_records: list[str] + :param txt_records: TXT records controller can see for this hostname. + :type txt_records: list[str] + :param a_records: A records controller can see for this hostname. + :type a_records: list[str] + :param alternate_cname_records: Alternate CName records controller can see + for this hostname. + :type alternate_cname_records: list[str] + :param alternate_txt_records: Alternate TXT records controller can see for + this hostname. + :type alternate_txt_records: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'is_hostname_already_verified': {'readonly': True}, + 'custom_domain_verification_test': {'readonly': True}, + 'custom_domain_verification_failure_info': {'readonly': True}, + 'has_conflict_on_scale_unit': {'readonly': True}, + 'has_conflict_across_subscription': {'readonly': True}, + 'conflicting_app_resource_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'is_hostname_already_verified': {'key': 'properties.isHostnameAlreadyVerified', 'type': 'bool'}, + 'custom_domain_verification_test': {'key': 'properties.customDomainVerificationTest', 'type': 'DnsVerificationTestResult'}, + 'custom_domain_verification_failure_info': {'key': 'properties.customDomainVerificationFailureInfo', 'type': 'ErrorEntity'}, + 'has_conflict_on_scale_unit': {'key': 'properties.hasConflictOnScaleUnit', 'type': 'bool'}, + 'has_conflict_across_subscription': {'key': 'properties.hasConflictAcrossSubscription', 'type': 'bool'}, + 'conflicting_app_resource_id': {'key': 'properties.conflictingAppResourceId', 'type': 'str'}, + 'c_name_records': {'key': 'properties.cNameRecords', 'type': '[str]'}, + 'txt_records': {'key': 'properties.txtRecords', 'type': '[str]'}, + 'a_records': {'key': 'properties.aRecords', 'type': '[str]'}, + 'alternate_cname_records': {'key': 'properties.alternateCNameRecords', 'type': '[str]'}, + 'alternate_txt_records': {'key': 'properties.alternateTxtRecords', 'type': '[str]'}, + } + + def __init__(self, *, kind: str=None, c_name_records=None, txt_records=None, a_records=None, alternate_cname_records=None, alternate_txt_records=None, **kwargs) -> None: + super(CustomHostnameAnalysisResult, self).__init__(kind=kind, **kwargs) + self.is_hostname_already_verified = None + self.custom_domain_verification_test = None + self.custom_domain_verification_failure_info = None + self.has_conflict_on_scale_unit = None + self.has_conflict_across_subscription = None + self.conflicting_app_resource_id = None + self.c_name_records = c_name_records + self.txt_records = txt_records + self.a_records = a_records + self.alternate_cname_records = alternate_cname_records + self.alternate_txt_records = alternate_txt_records diff --git a/azure-mgmt-web/azure/mgmt/web/models/data_source.py b/azure-mgmt-web/azure/mgmt/web/models/data_source.py index 03793780359a..7a2c50d6e370 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/data_source.py +++ b/azure-mgmt-web/azure/mgmt/web/models/data_source.py @@ -26,7 +26,7 @@ class DataSource(Model): 'data_source_uri': {'key': 'dataSourceUri', 'type': '[NameValuePair]'}, } - def __init__(self, instructions=None, data_source_uri=None): - super(DataSource, self).__init__() - self.instructions = instructions - self.data_source_uri = data_source_uri + def __init__(self, **kwargs): + super(DataSource, self).__init__(**kwargs) + self.instructions = kwargs.get('instructions', None) + self.data_source_uri = kwargs.get('data_source_uri', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/data_source_py3.py b/azure-mgmt-web/azure/mgmt/web/models/data_source_py3.py new file mode 100644 index 000000000000..b6db5b64ff21 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/data_source_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class DataSource(Model): + """Class representing data source used by the detectors. + + :param instructions: Instrunctions if any for the data source + :type instructions: list[str] + :param data_source_uri: Datasource Uri Links + :type data_source_uri: list[~azure.mgmt.web.models.NameValuePair] + """ + + _attribute_map = { + 'instructions': {'key': 'instructions', 'type': '[str]'}, + 'data_source_uri': {'key': 'dataSourceUri', 'type': '[NameValuePair]'}, + } + + def __init__(self, *, instructions=None, data_source_uri=None, **kwargs) -> None: + super(DataSource, self).__init__(**kwargs) + self.instructions = instructions + self.data_source_uri = data_source_uri diff --git a/azure-mgmt-web/azure/mgmt/web/models/data_table_response_column.py b/azure-mgmt-web/azure/mgmt/web/models/data_table_response_column.py new file mode 100644 index 000000000000..8a6230c72956 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/data_table_response_column.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class DataTableResponseColumn(Model): + """Column definition. + + :param column_name: Name of the column + :type column_name: str + :param data_type: Data type which looks like 'String' or 'Int32'. + :type data_type: str + :param column_type: Column Type + :type column_type: str + """ + + _attribute_map = { + 'column_name': {'key': 'columnName', 'type': 'str'}, + 'data_type': {'key': 'dataType', 'type': 'str'}, + 'column_type': {'key': 'columnType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DataTableResponseColumn, self).__init__(**kwargs) + self.column_name = kwargs.get('column_name', None) + self.data_type = kwargs.get('data_type', None) + self.column_type = kwargs.get('column_type', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/data_table_response_column_py3.py b/azure-mgmt-web/azure/mgmt/web/models/data_table_response_column_py3.py new file mode 100644 index 000000000000..a8a0fa2b1209 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/data_table_response_column_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class DataTableResponseColumn(Model): + """Column definition. + + :param column_name: Name of the column + :type column_name: str + :param data_type: Data type which looks like 'String' or 'Int32'. + :type data_type: str + :param column_type: Column Type + :type column_type: str + """ + + _attribute_map = { + 'column_name': {'key': 'columnName', 'type': 'str'}, + 'data_type': {'key': 'dataType', 'type': 'str'}, + 'column_type': {'key': 'columnType', 'type': 'str'}, + } + + def __init__(self, *, column_name: str=None, data_type: str=None, column_type: str=None, **kwargs) -> None: + super(DataTableResponseColumn, self).__init__(**kwargs) + self.column_name = column_name + self.data_type = data_type + self.column_type = column_type diff --git a/azure-mgmt-web/azure/mgmt/web/models/data_table_response_object.py b/azure-mgmt-web/azure/mgmt/web/models/data_table_response_object.py new file mode 100644 index 000000000000..28efd2e527f8 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/data_table_response_object.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class DataTableResponseObject(Model): + """Data Table which defines columns and raw row values. + + :param table_name: Name of the table + :type table_name: str + :param columns: List of columns with data types + :type columns: list[~azure.mgmt.web.models.DataTableResponseColumn] + :param rows: Raw row values + :type rows: list[list[str]] + """ + + _attribute_map = { + 'table_name': {'key': 'tableName', 'type': 'str'}, + 'columns': {'key': 'columns', 'type': '[DataTableResponseColumn]'}, + 'rows': {'key': 'rows', 'type': '[[str]]'}, + } + + def __init__(self, **kwargs): + super(DataTableResponseObject, self).__init__(**kwargs) + self.table_name = kwargs.get('table_name', None) + self.columns = kwargs.get('columns', None) + self.rows = kwargs.get('rows', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/data_table_response_object_py3.py b/azure-mgmt-web/azure/mgmt/web/models/data_table_response_object_py3.py new file mode 100644 index 000000000000..c5a45a8f311a --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/data_table_response_object_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class DataTableResponseObject(Model): + """Data Table which defines columns and raw row values. + + :param table_name: Name of the table + :type table_name: str + :param columns: List of columns with data types + :type columns: list[~azure.mgmt.web.models.DataTableResponseColumn] + :param rows: Raw row values + :type rows: list[list[str]] + """ + + _attribute_map = { + 'table_name': {'key': 'tableName', 'type': 'str'}, + 'columns': {'key': 'columns', 'type': '[DataTableResponseColumn]'}, + 'rows': {'key': 'rows', 'type': '[[str]]'}, + } + + def __init__(self, *, table_name: str=None, columns=None, rows=None, **kwargs) -> None: + super(DataTableResponseObject, self).__init__(**kwargs) + self.table_name = table_name + self.columns = columns + self.rows = rows diff --git a/azure-mgmt-web/azure/mgmt/web/models/database_backup_setting.py b/azure-mgmt-web/azure/mgmt/web/models/database_backup_setting.py index bd54f5fde4a4..a9ea496e18bc 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/database_backup_setting.py +++ b/azure-mgmt-web/azure/mgmt/web/models/database_backup_setting.py @@ -15,8 +15,10 @@ class DatabaseBackupSetting(Model): """Database backup settings. - :param database_type: Database type (e.g. SqlAzure / MySql). Possible - values include: 'SqlAzure', 'MySql', 'LocalMySql', 'PostgreSql' + All required parameters must be populated in order to send to Azure. + + :param database_type: Required. Database type (e.g. SqlAzure / MySql). + Possible values include: 'SqlAzure', 'MySql', 'LocalMySql', 'PostgreSql' :type database_type: str or ~azure.mgmt.web.models.DatabaseType :param name: :type name: str @@ -41,9 +43,9 @@ class DatabaseBackupSetting(Model): 'connection_string': {'key': 'connectionString', 'type': 'str'}, } - def __init__(self, database_type, name=None, connection_string_name=None, connection_string=None): - super(DatabaseBackupSetting, self).__init__() - self.database_type = database_type - self.name = name - self.connection_string_name = connection_string_name - self.connection_string = connection_string + def __init__(self, **kwargs): + super(DatabaseBackupSetting, self).__init__(**kwargs) + self.database_type = kwargs.get('database_type', None) + self.name = kwargs.get('name', None) + self.connection_string_name = kwargs.get('connection_string_name', None) + self.connection_string = kwargs.get('connection_string', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/database_backup_setting_py3.py b/azure-mgmt-web/azure/mgmt/web/models/database_backup_setting_py3.py new file mode 100644 index 000000000000..caeb63246f45 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/database_backup_setting_py3.py @@ -0,0 +1,51 @@ +# 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 msrest.serialization import Model + + +class DatabaseBackupSetting(Model): + """Database backup settings. + + All required parameters must be populated in order to send to Azure. + + :param database_type: Required. Database type (e.g. SqlAzure / MySql). + Possible values include: 'SqlAzure', 'MySql', 'LocalMySql', 'PostgreSql' + :type database_type: str or ~azure.mgmt.web.models.DatabaseType + :param name: + :type name: str + :param connection_string_name: Contains a connection string name that is + linked to the SiteConfig.ConnectionStrings. + This is used during restore with overwrite connection strings options. + :type connection_string_name: str + :param connection_string: Contains a connection string to a database which + is being backed up or restored. If the restore should happen to a new + database, the database name inside is the new one. + :type connection_string: str + """ + + _validation = { + 'database_type': {'required': True}, + } + + _attribute_map = { + 'database_type': {'key': 'databaseType', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'connection_string_name': {'key': 'connectionStringName', 'type': 'str'}, + 'connection_string': {'key': 'connectionString', 'type': 'str'}, + } + + def __init__(self, *, database_type, name: str=None, connection_string_name: str=None, connection_string: str=None, **kwargs) -> None: + super(DatabaseBackupSetting, self).__init__(**kwargs) + self.database_type = database_type + self.name = name + self.connection_string_name = connection_string_name + self.connection_string = connection_string diff --git a/azure-mgmt-web/azure/mgmt/web/models/default_error_response.py b/azure-mgmt-web/azure/mgmt/web/models/default_error_response.py new file mode 100644 index 000000000000..438128e5fc67 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/default_error_response.py @@ -0,0 +1,48 @@ +# 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 msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class DefaultErrorResponse(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.web.models.DefaultErrorResponseError + """ + + _validation = { + 'error': {'readonly': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'DefaultErrorResponseError'}, + } + + def __init__(self, **kwargs): + super(DefaultErrorResponse, self).__init__(**kwargs) + self.error = None + + +class DefaultErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'DefaultErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(DefaultErrorResponseException, self).__init__(deserialize, response, 'DefaultErrorResponse', *args) diff --git a/azure-mgmt-web/azure/mgmt/web/models/default_error_response_error.py b/azure-mgmt-web/azure/mgmt/web/models/default_error_response_error.py new file mode 100644 index 000000000000..df5d32e35563 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/default_error_response_error.py @@ -0,0 +1,55 @@ +# 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 msrest.serialization import Model + + +class DefaultErrorResponseError(Model): + """Error model. + + 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 + :ivar message: Detailed error description and debugging information. + :vartype message: str + :ivar target: Detailed error description and debugging information. + :vartype target: str + :param details: + :type details: + list[~azure.mgmt.web.models.DefaultErrorResponseErrorDetailsItem] + :ivar innererror: More information to debug error. + :vartype innererror: str + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'innererror': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[DefaultErrorResponseErrorDetailsItem]'}, + 'innererror': {'key': 'innererror', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DefaultErrorResponseError, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = kwargs.get('details', None) + self.innererror = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/default_error_response_error_details_item.py b/azure-mgmt-web/azure/mgmt/web/models/default_error_response_error_details_item.py new file mode 100644 index 000000000000..7fb1c5ded635 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/default_error_response_error_details_item.py @@ -0,0 +1,45 @@ +# 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 msrest.serialization import Model + + +class DefaultErrorResponseErrorDetailsItem(Model): + """Detailed errors. + + 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 + :ivar message: Detailed error description and debugging information. + :vartype message: str + :ivar target: Detailed error description and debugging information. + :vartype target: str + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DefaultErrorResponseErrorDetailsItem, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/default_error_response_error_details_item_py3.py b/azure-mgmt-web/azure/mgmt/web/models/default_error_response_error_details_item_py3.py new file mode 100644 index 000000000000..9a4deb14b49e --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/default_error_response_error_details_item_py3.py @@ -0,0 +1,45 @@ +# 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 msrest.serialization import Model + + +class DefaultErrorResponseErrorDetailsItem(Model): + """Detailed errors. + + 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 + :ivar message: Detailed error description and debugging information. + :vartype message: str + :ivar target: Detailed error description and debugging information. + :vartype target: str + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(DefaultErrorResponseErrorDetailsItem, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/default_error_response_error_py3.py b/azure-mgmt-web/azure/mgmt/web/models/default_error_response_error_py3.py new file mode 100644 index 000000000000..b8666a06f08a --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/default_error_response_error_py3.py @@ -0,0 +1,55 @@ +# 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 msrest.serialization import Model + + +class DefaultErrorResponseError(Model): + """Error model. + + 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 + :ivar message: Detailed error description and debugging information. + :vartype message: str + :ivar target: Detailed error description and debugging information. + :vartype target: str + :param details: + :type details: + list[~azure.mgmt.web.models.DefaultErrorResponseErrorDetailsItem] + :ivar innererror: More information to debug error. + :vartype innererror: str + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'innererror': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[DefaultErrorResponseErrorDetailsItem]'}, + 'innererror': {'key': 'innererror', 'type': 'str'}, + } + + def __init__(self, *, details=None, **kwargs) -> None: + super(DefaultErrorResponseError, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = details + self.innererror = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/default_error_response_py3.py b/azure-mgmt-web/azure/mgmt/web/models/default_error_response_py3.py new file mode 100644 index 000000000000..f121af5f03b0 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/default_error_response_py3.py @@ -0,0 +1,48 @@ +# 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 msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class DefaultErrorResponse(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.web.models.DefaultErrorResponseError + """ + + _validation = { + 'error': {'readonly': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'DefaultErrorResponseError'}, + } + + def __init__(self, **kwargs) -> None: + super(DefaultErrorResponse, self).__init__(**kwargs) + self.error = None + + +class DefaultErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'DefaultErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(DefaultErrorResponseException, self).__init__(deserialize, response, 'DefaultErrorResponse', *args) diff --git a/azure-mgmt-web/azure/mgmt/web/models/deleted_site.py b/azure-mgmt-web/azure/mgmt/web/models/deleted_site.py index 19a9102156d8..5aa094a18f0e 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/deleted_site.py +++ b/azure-mgmt-web/azure/mgmt/web/models/deleted_site.py @@ -49,9 +49,9 @@ class DeletedSite(Model): 'slot': {'key': 'slot', 'type': 'str'}, } - def __init__(self, id=None): - super(DeletedSite, self).__init__() - self.id = id + def __init__(self, **kwargs): + super(DeletedSite, self).__init__(**kwargs) + self.id = kwargs.get('id', None) self.deleted_timestamp = None self.subscription = None self.resource_group = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/deleted_site_py3.py b/azure-mgmt-web/azure/mgmt/web/models/deleted_site_py3.py new file mode 100644 index 000000000000..a6d712ebec38 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/deleted_site_py3.py @@ -0,0 +1,59 @@ +# 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 msrest.serialization import Model + + +class DeletedSite(Model): + """A deleted app. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Numeric id for the deleted site + :type id: int + :ivar deleted_timestamp: Time in UTC when the app was deleted. + :vartype deleted_timestamp: str + :ivar subscription: Subscription containing the deleted site + :vartype subscription: str + :ivar resource_group: ResourceGroup that contained the deleted site + :vartype resource_group: str + :ivar name: Name of the deleted site + :vartype name: str + :ivar slot: Slot of the deleted site + :vartype slot: str + """ + + _validation = { + 'deleted_timestamp': {'readonly': True}, + 'subscription': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'name': {'readonly': True}, + 'slot': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'deleted_timestamp': {'key': 'deletedTimestamp', 'type': 'str'}, + 'subscription': {'key': 'subscription', 'type': 'str'}, + 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'slot': {'key': 'slot', 'type': 'str'}, + } + + def __init__(self, *, id: int=None, **kwargs) -> None: + super(DeletedSite, self).__init__(**kwargs) + self.id = id + self.deleted_timestamp = None + self.subscription = None + self.resource_group = None + self.name = None + self.slot = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/deployment.py b/azure-mgmt-web/azure/mgmt/web/models/deployment.py index 27ce8941211f..c6ab92e0e999 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/deployment.py +++ b/azure-mgmt-web/azure/mgmt/web/models/deployment.py @@ -72,15 +72,15 @@ class Deployment(ProxyOnlyResource): 'details': {'key': 'properties.details', 'type': 'str'}, } - def __init__(self, kind=None, deployment_id=None, status=None, message=None, author=None, deployer=None, author_email=None, start_time=None, end_time=None, active=None, details=None): - super(Deployment, self).__init__(kind=kind) - self.deployment_id = deployment_id - self.status = status - self.message = message - self.author = author - self.deployer = deployer - self.author_email = author_email - self.start_time = start_time - self.end_time = end_time - self.active = active - self.details = details + def __init__(self, **kwargs): + super(Deployment, self).__init__(**kwargs) + self.deployment_id = kwargs.get('deployment_id', None) + self.status = kwargs.get('status', None) + self.message = kwargs.get('message', None) + self.author = kwargs.get('author', None) + self.deployer = kwargs.get('deployer', None) + self.author_email = kwargs.get('author_email', None) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.active = kwargs.get('active', None) + self.details = kwargs.get('details', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/deployment_locations.py b/azure-mgmt-web/azure/mgmt/web/models/deployment_locations.py index edda1454a99c..f7cf08b81fa3 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/deployment_locations.py +++ b/azure-mgmt-web/azure/mgmt/web/models/deployment_locations.py @@ -34,8 +34,8 @@ class DeploymentLocations(Model): 'hosting_environment_deployment_infos': {'key': 'hostingEnvironmentDeploymentInfos', 'type': '[HostingEnvironmentDeploymentInfo]'}, } - def __init__(self, locations=None, hosting_environments=None, hosting_environment_deployment_infos=None): - super(DeploymentLocations, self).__init__() - self.locations = locations - self.hosting_environments = hosting_environments - self.hosting_environment_deployment_infos = hosting_environment_deployment_infos + def __init__(self, **kwargs): + super(DeploymentLocations, self).__init__(**kwargs) + self.locations = kwargs.get('locations', None) + self.hosting_environments = kwargs.get('hosting_environments', None) + self.hosting_environment_deployment_infos = kwargs.get('hosting_environment_deployment_infos', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/deployment_locations_py3.py b/azure-mgmt-web/azure/mgmt/web/models/deployment_locations_py3.py new file mode 100644 index 000000000000..19167455ae81 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/deployment_locations_py3.py @@ -0,0 +1,41 @@ +# 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 msrest.serialization import Model + + +class DeploymentLocations(Model): + """List of available locations (regions or App Service Environments) for + deployment of App Service resources. + + :param locations: Available regions. + :type locations: list[~azure.mgmt.web.models.GeoRegion] + :param hosting_environments: Available App Service Environments with full + descriptions of the environments. + :type hosting_environments: + list[~azure.mgmt.web.models.AppServiceEnvironment] + :param hosting_environment_deployment_infos: Available App Service + Environments with basic information. + :type hosting_environment_deployment_infos: + list[~azure.mgmt.web.models.HostingEnvironmentDeploymentInfo] + """ + + _attribute_map = { + 'locations': {'key': 'locations', 'type': '[GeoRegion]'}, + 'hosting_environments': {'key': 'hostingEnvironments', 'type': '[AppServiceEnvironment]'}, + 'hosting_environment_deployment_infos': {'key': 'hostingEnvironmentDeploymentInfos', 'type': '[HostingEnvironmentDeploymentInfo]'}, + } + + def __init__(self, *, locations=None, hosting_environments=None, hosting_environment_deployment_infos=None, **kwargs) -> None: + super(DeploymentLocations, self).__init__(**kwargs) + self.locations = locations + self.hosting_environments = hosting_environments + self.hosting_environment_deployment_infos = hosting_environment_deployment_infos diff --git a/azure-mgmt-web/azure/mgmt/web/models/deployment_py3.py b/azure-mgmt-web/azure/mgmt/web/models/deployment_py3.py new file mode 100644 index 000000000000..e5e96215a888 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/deployment_py3.py @@ -0,0 +1,86 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class Deployment(ProxyOnlyResource): + """User crendentials used for publishing activity. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param deployment_id: Identifier for deployment. + :type deployment_id: str + :param status: Deployment status. + :type status: int + :param message: Details about deployment status. + :type message: str + :param author: Who authored the deployment. + :type author: str + :param deployer: Who performed the deployment. + :type deployer: str + :param author_email: Author email. + :type author_email: str + :param start_time: Start time. + :type start_time: datetime + :param end_time: End time. + :type end_time: datetime + :param active: True if deployment is currently active, false if completed + and null if not started. + :type active: bool + :param details: Details on deployment. + :type details: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'deployment_id': {'key': 'properties.id', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'int'}, + 'message': {'key': 'properties.message', 'type': 'str'}, + 'author': {'key': 'properties.author', 'type': 'str'}, + 'deployer': {'key': 'properties.deployer', 'type': 'str'}, + 'author_email': {'key': 'properties.authorEmail', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'active': {'key': 'properties.active', 'type': 'bool'}, + 'details': {'key': 'properties.details', 'type': 'str'}, + } + + def __init__(self, *, kind: str=None, deployment_id: str=None, status: int=None, message: str=None, author: str=None, deployer: str=None, author_email: str=None, start_time=None, end_time=None, active: bool=None, details: str=None, **kwargs) -> None: + super(Deployment, self).__init__(kind=kind, **kwargs) + self.deployment_id = deployment_id + self.status = status + self.message = message + self.author = author + self.deployer = deployer + self.author_email = author_email + self.start_time = start_time + self.end_time = end_time + self.active = active + self.details = details diff --git a/azure-mgmt-web/azure/mgmt/web/models/detector_abnormal_time_period.py b/azure-mgmt-web/azure/mgmt/web/models/detector_abnormal_time_period.py index d1bdbc1cb0c8..79d6784e465e 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/detector_abnormal_time_period.py +++ b/azure-mgmt-web/azure/mgmt/web/models/detector_abnormal_time_period.py @@ -46,13 +46,13 @@ class DetectorAbnormalTimePeriod(Model): 'solutions': {'key': 'solutions', 'type': '[Solution]'}, } - def __init__(self, start_time=None, end_time=None, message=None, source=None, priority=None, meta_data=None, type=None, solutions=None): - super(DetectorAbnormalTimePeriod, self).__init__() - self.start_time = start_time - self.end_time = end_time - self.message = message - self.source = source - self.priority = priority - self.meta_data = meta_data - self.type = type - self.solutions = solutions + def __init__(self, **kwargs): + super(DetectorAbnormalTimePeriod, self).__init__(**kwargs) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.message = kwargs.get('message', None) + self.source = kwargs.get('source', None) + self.priority = kwargs.get('priority', None) + self.meta_data = kwargs.get('meta_data', None) + self.type = kwargs.get('type', None) + self.solutions = kwargs.get('solutions', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/detector_abnormal_time_period_py3.py b/azure-mgmt-web/azure/mgmt/web/models/detector_abnormal_time_period_py3.py new file mode 100644 index 000000000000..63507c374c07 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/detector_abnormal_time_period_py3.py @@ -0,0 +1,58 @@ +# 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 msrest.serialization import Model + + +class DetectorAbnormalTimePeriod(Model): + """Class representing Abnormal Time Period detected. + + :param start_time: Start time of the corelated event + :type start_time: datetime + :param end_time: End time of the corelated event + :type end_time: datetime + :param message: Message describing the event + :type message: str + :param source: Represents the name of the Detector + :type source: str + :param priority: Represents the rank of the Detector + :type priority: float + :param meta_data: Downtime metadata + :type meta_data: list[list[~azure.mgmt.web.models.NameValuePair]] + :param type: Represents the type of the Detector. Possible values include: + 'ServiceIncident', 'AppDeployment', 'AppCrash', 'RuntimeIssueDetected', + 'AseDeployment', 'UserIssue', 'PlatformIssue', 'Other' + :type type: str or ~azure.mgmt.web.models.IssueType + :param solutions: List of proposed solutions + :type solutions: list[~azure.mgmt.web.models.Solution] + """ + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'message': {'key': 'message', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'float'}, + 'meta_data': {'key': 'metaData', 'type': '[[NameValuePair]]'}, + 'type': {'key': 'type', 'type': 'IssueType'}, + 'solutions': {'key': 'solutions', 'type': '[Solution]'}, + } + + def __init__(self, *, start_time=None, end_time=None, message: str=None, source: str=None, priority: float=None, meta_data=None, type=None, solutions=None, **kwargs) -> None: + super(DetectorAbnormalTimePeriod, self).__init__(**kwargs) + self.start_time = start_time + self.end_time = end_time + self.message = message + self.source = source + self.priority = priority + self.meta_data = meta_data + self.type = type + self.solutions = solutions diff --git a/azure-mgmt-web/azure/mgmt/web/models/detector_definition.py b/azure-mgmt-web/azure/mgmt/web/models/detector_definition.py index 5cfa7e58126f..df4be4fcf342 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/detector_definition.py +++ b/azure-mgmt-web/azure/mgmt/web/models/detector_definition.py @@ -57,8 +57,8 @@ class DetectorDefinition(ProxyOnlyResource): 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, } - def __init__(self, kind=None): - super(DetectorDefinition, self).__init__(kind=kind) + def __init__(self, **kwargs): + super(DetectorDefinition, self).__init__(**kwargs) self.display_name = None self.description = None self.rank = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/detector_definition_py3.py b/azure-mgmt-web/azure/mgmt/web/models/detector_definition_py3.py new file mode 100644 index 000000000000..4631b77740a0 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/detector_definition_py3.py @@ -0,0 +1,65 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class DetectorDefinition(ProxyOnlyResource): + """Class representing detector definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar display_name: Display name of the detector + :vartype display_name: str + :ivar description: Description of the detector + :vartype description: str + :ivar rank: Detector Rank + :vartype rank: float + :ivar is_enabled: Flag representing whether detector is enabled or not. + :vartype is_enabled: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'rank': {'readonly': True}, + 'is_enabled': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'rank': {'key': 'properties.rank', 'type': 'float'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + } + + def __init__(self, *, kind: str=None, **kwargs) -> None: + super(DetectorDefinition, self).__init__(kind=kind, **kwargs) + self.display_name = None + self.description = None + self.rank = None + self.is_enabled = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/detector_info.py b/azure-mgmt-web/azure/mgmt/web/models/detector_info.py new file mode 100644 index 000000000000..2cc5f88f8eb8 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/detector_info.py @@ -0,0 +1,50 @@ +# 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 msrest.serialization import Model + + +class DetectorInfo(Model): + """Definition of Detector. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar description: Short description of the detector and its purpose + :vartype description: str + :ivar category: Support Category + :vartype category: str + :ivar sub_category: Support Sub Category + :vartype sub_category: str + :ivar support_topic_id: Support Topic Id + :vartype support_topic_id: str + """ + + _validation = { + 'description': {'readonly': True}, + 'category': {'readonly': True}, + 'sub_category': {'readonly': True}, + 'support_topic_id': {'readonly': True}, + } + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'category': {'key': 'category', 'type': 'str'}, + 'sub_category': {'key': 'subCategory', 'type': 'str'}, + 'support_topic_id': {'key': 'supportTopicId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DetectorInfo, self).__init__(**kwargs) + self.description = None + self.category = None + self.sub_category = None + self.support_topic_id = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/detector_info_py3.py b/azure-mgmt-web/azure/mgmt/web/models/detector_info_py3.py new file mode 100644 index 000000000000..0343c78a5c09 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/detector_info_py3.py @@ -0,0 +1,50 @@ +# 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 msrest.serialization import Model + + +class DetectorInfo(Model): + """Definition of Detector. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar description: Short description of the detector and its purpose + :vartype description: str + :ivar category: Support Category + :vartype category: str + :ivar sub_category: Support Sub Category + :vartype sub_category: str + :ivar support_topic_id: Support Topic Id + :vartype support_topic_id: str + """ + + _validation = { + 'description': {'readonly': True}, + 'category': {'readonly': True}, + 'sub_category': {'readonly': True}, + 'support_topic_id': {'readonly': True}, + } + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'category': {'key': 'category', 'type': 'str'}, + 'sub_category': {'key': 'subCategory', 'type': 'str'}, + 'support_topic_id': {'key': 'supportTopicId', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(DetectorInfo, self).__init__(**kwargs) + self.description = None + self.category = None + self.sub_category = None + self.support_topic_id = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/detector_response.py b/azure-mgmt-web/azure/mgmt/web/models/detector_response.py new file mode 100644 index 000000000000..65a27080a7aa --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/detector_response.py @@ -0,0 +1,53 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class DetectorResponse(ProxyOnlyResource): + """Class representing Response from Detector. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param metadata: metadata for the detector + :type metadata: ~azure.mgmt.web.models.DetectorInfo + :param dataset: Data Set + :type dataset: list[~azure.mgmt.web.models.DiagnosticData] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': 'DetectorInfo'}, + 'dataset': {'key': 'properties.dataset', 'type': '[DiagnosticData]'}, + } + + def __init__(self, **kwargs): + super(DetectorResponse, self).__init__(**kwargs) + self.metadata = kwargs.get('metadata', None) + self.dataset = kwargs.get('dataset', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/detector_response_paged.py b/azure-mgmt-web/azure/mgmt/web/models/detector_response_paged.py new file mode 100644 index 000000000000..57ed8d9b2788 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/detector_response_paged.py @@ -0,0 +1,27 @@ +# 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 msrest.paging import Paged + + +class DetectorResponsePaged(Paged): + """ + A paging container for iterating over a list of :class:`DetectorResponse ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DetectorResponse]'} + } + + def __init__(self, *args, **kwargs): + + super(DetectorResponsePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-web/azure/mgmt/web/models/detector_response_py3.py b/azure-mgmt-web/azure/mgmt/web/models/detector_response_py3.py new file mode 100644 index 000000000000..f5adef32af1b --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/detector_response_py3.py @@ -0,0 +1,53 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class DetectorResponse(ProxyOnlyResource): + """Class representing Response from Detector. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param metadata: metadata for the detector + :type metadata: ~azure.mgmt.web.models.DetectorInfo + :param dataset: Data Set + :type dataset: list[~azure.mgmt.web.models.DiagnosticData] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': 'DetectorInfo'}, + 'dataset': {'key': 'properties.dataset', 'type': '[DiagnosticData]'}, + } + + def __init__(self, *, kind: str=None, metadata=None, dataset=None, **kwargs) -> None: + super(DetectorResponse, self).__init__(kind=kind, **kwargs) + self.metadata = metadata + self.dataset = dataset diff --git a/azure-mgmt-web/azure/mgmt/web/models/diagnostic_analysis.py b/azure-mgmt-web/azure/mgmt/web/models/diagnostic_analysis.py index a902a69adfac..4f81c2feea2d 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/diagnostic_analysis.py +++ b/azure-mgmt-web/azure/mgmt/web/models/diagnostic_analysis.py @@ -59,10 +59,10 @@ class DiagnosticAnalysis(ProxyOnlyResource): 'non_correlated_detectors': {'key': 'properties.nonCorrelatedDetectors', 'type': '[DetectorDefinition]'}, } - def __init__(self, kind=None, start_time=None, end_time=None, abnormal_time_periods=None, payload=None, non_correlated_detectors=None): - super(DiagnosticAnalysis, self).__init__(kind=kind) - self.start_time = start_time - self.end_time = end_time - self.abnormal_time_periods = abnormal_time_periods - self.payload = payload - self.non_correlated_detectors = non_correlated_detectors + def __init__(self, **kwargs): + super(DiagnosticAnalysis, self).__init__(**kwargs) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.abnormal_time_periods = kwargs.get('abnormal_time_periods', None) + self.payload = kwargs.get('payload', None) + self.non_correlated_detectors = kwargs.get('non_correlated_detectors', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/diagnostic_analysis_py3.py b/azure-mgmt-web/azure/mgmt/web/models/diagnostic_analysis_py3.py new file mode 100644 index 000000000000..aabdadfc8cca --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/diagnostic_analysis_py3.py @@ -0,0 +1,68 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class DiagnosticAnalysis(ProxyOnlyResource): + """Class representing a diagnostic analysis done on an application. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param start_time: Start time of the period + :type start_time: datetime + :param end_time: End time of the period + :type end_time: datetime + :param abnormal_time_periods: List of time periods. + :type abnormal_time_periods: + list[~azure.mgmt.web.models.AbnormalTimePeriod] + :param payload: Data by each detector + :type payload: list[~azure.mgmt.web.models.AnalysisData] + :param non_correlated_detectors: Data by each detector for detectors that + did not corelate + :type non_correlated_detectors: + list[~azure.mgmt.web.models.DetectorDefinition] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'abnormal_time_periods': {'key': 'properties.abnormalTimePeriods', 'type': '[AbnormalTimePeriod]'}, + 'payload': {'key': 'properties.payload', 'type': '[AnalysisData]'}, + 'non_correlated_detectors': {'key': 'properties.nonCorrelatedDetectors', 'type': '[DetectorDefinition]'}, + } + + def __init__(self, *, kind: str=None, start_time=None, end_time=None, abnormal_time_periods=None, payload=None, non_correlated_detectors=None, **kwargs) -> None: + super(DiagnosticAnalysis, self).__init__(kind=kind, **kwargs) + self.start_time = start_time + self.end_time = end_time + self.abnormal_time_periods = abnormal_time_periods + self.payload = payload + self.non_correlated_detectors = non_correlated_detectors diff --git a/azure-mgmt-web/azure/mgmt/web/models/diagnostic_category.py b/azure-mgmt-web/azure/mgmt/web/models/diagnostic_category.py index 9bf7d74e5641..12254857ac08 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/diagnostic_category.py +++ b/azure-mgmt-web/azure/mgmt/web/models/diagnostic_category.py @@ -45,6 +45,6 @@ class DiagnosticCategory(ProxyOnlyResource): 'description': {'key': 'properties.description', 'type': 'str'}, } - def __init__(self, kind=None): - super(DiagnosticCategory, self).__init__(kind=kind) + def __init__(self, **kwargs): + super(DiagnosticCategory, self).__init__(**kwargs) self.description = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/diagnostic_category_py3.py b/azure-mgmt-web/azure/mgmt/web/models/diagnostic_category_py3.py new file mode 100644 index 000000000000..f0d854dbf0a4 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/diagnostic_category_py3.py @@ -0,0 +1,50 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class DiagnosticCategory(ProxyOnlyResource): + """Class representing detector definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar description: Description of the diagnostic category + :vartype description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, *, kind: str=None, **kwargs) -> None: + super(DiagnosticCategory, self).__init__(kind=kind, **kwargs) + self.description = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/diagnostic_data.py b/azure-mgmt-web/azure/mgmt/web/models/diagnostic_data.py new file mode 100644 index 000000000000..96cd3ed7d5e2 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/diagnostic_data.py @@ -0,0 +1,33 @@ +# 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 msrest.serialization import Model + + +class DiagnosticData(Model): + """Set of data with rendering instructions. + + :param table: Data in table form + :type table: ~azure.mgmt.web.models.DataTableResponseObject + :param rendering_properties: Properties that describe how the table should + be rendered + :type rendering_properties: ~azure.mgmt.web.models.Rendering + """ + + _attribute_map = { + 'table': {'key': 'table', 'type': 'DataTableResponseObject'}, + 'rendering_properties': {'key': 'renderingProperties', 'type': 'Rendering'}, + } + + def __init__(self, **kwargs): + super(DiagnosticData, self).__init__(**kwargs) + self.table = kwargs.get('table', None) + self.rendering_properties = kwargs.get('rendering_properties', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/diagnostic_data_py3.py b/azure-mgmt-web/azure/mgmt/web/models/diagnostic_data_py3.py new file mode 100644 index 000000000000..bc45e433b578 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/diagnostic_data_py3.py @@ -0,0 +1,33 @@ +# 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 msrest.serialization import Model + + +class DiagnosticData(Model): + """Set of data with rendering instructions. + + :param table: Data in table form + :type table: ~azure.mgmt.web.models.DataTableResponseObject + :param rendering_properties: Properties that describe how the table should + be rendered + :type rendering_properties: ~azure.mgmt.web.models.Rendering + """ + + _attribute_map = { + 'table': {'key': 'table', 'type': 'DataTableResponseObject'}, + 'rendering_properties': {'key': 'renderingProperties', 'type': 'Rendering'}, + } + + def __init__(self, *, table=None, rendering_properties=None, **kwargs) -> None: + super(DiagnosticData, self).__init__(**kwargs) + self.table = table + self.rendering_properties = rendering_properties diff --git a/azure-mgmt-web/azure/mgmt/web/models/diagnostic_detector_response.py b/azure-mgmt-web/azure/mgmt/web/models/diagnostic_detector_response.py index 78d94e8718e5..54efec97da7b 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/diagnostic_detector_response.py +++ b/azure-mgmt-web/azure/mgmt/web/models/diagnostic_detector_response.py @@ -67,13 +67,13 @@ class DiagnosticDetectorResponse(ProxyOnlyResource): 'response_meta_data': {'key': 'properties.responseMetaData', 'type': 'ResponseMetaData'}, } - def __init__(self, kind=None, start_time=None, end_time=None, issue_detected=None, detector_definition=None, metrics=None, abnormal_time_periods=None, data=None, response_meta_data=None): - super(DiagnosticDetectorResponse, self).__init__(kind=kind) - self.start_time = start_time - self.end_time = end_time - self.issue_detected = issue_detected - self.detector_definition = detector_definition - self.metrics = metrics - self.abnormal_time_periods = abnormal_time_periods - self.data = data - self.response_meta_data = response_meta_data + def __init__(self, **kwargs): + super(DiagnosticDetectorResponse, self).__init__(**kwargs) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.issue_detected = kwargs.get('issue_detected', None) + self.detector_definition = kwargs.get('detector_definition', None) + self.metrics = kwargs.get('metrics', None) + self.abnormal_time_periods = kwargs.get('abnormal_time_periods', None) + self.data = kwargs.get('data', None) + self.response_meta_data = kwargs.get('response_meta_data', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/diagnostic_detector_response_py3.py b/azure-mgmt-web/azure/mgmt/web/models/diagnostic_detector_response_py3.py new file mode 100644 index 000000000000..ccdac14dffa7 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/diagnostic_detector_response_py3.py @@ -0,0 +1,79 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class DiagnosticDetectorResponse(ProxyOnlyResource): + """Class representing Reponse from Diagnostic Detectors. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param start_time: Start time of the period + :type start_time: datetime + :param end_time: End time of the period + :type end_time: datetime + :param issue_detected: Flag representing Issue was detected. + :type issue_detected: bool + :param detector_definition: Detector's definition + :type detector_definition: ~azure.mgmt.web.models.DetectorDefinition + :param metrics: Metrics provided by the detector + :type metrics: list[~azure.mgmt.web.models.DiagnosticMetricSet] + :param abnormal_time_periods: List of Correlated events found by the + detector + :type abnormal_time_periods: + list[~azure.mgmt.web.models.DetectorAbnormalTimePeriod] + :param data: Additional Data that detector wants to send. + :type data: list[list[~azure.mgmt.web.models.NameValuePair]] + :param response_meta_data: Meta Data + :type response_meta_data: ~azure.mgmt.web.models.ResponseMetaData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'issue_detected': {'key': 'properties.issueDetected', 'type': 'bool'}, + 'detector_definition': {'key': 'properties.detectorDefinition', 'type': 'DetectorDefinition'}, + 'metrics': {'key': 'properties.metrics', 'type': '[DiagnosticMetricSet]'}, + 'abnormal_time_periods': {'key': 'properties.abnormalTimePeriods', 'type': '[DetectorAbnormalTimePeriod]'}, + 'data': {'key': 'properties.data', 'type': '[[NameValuePair]]'}, + 'response_meta_data': {'key': 'properties.responseMetaData', 'type': 'ResponseMetaData'}, + } + + def __init__(self, *, kind: str=None, start_time=None, end_time=None, issue_detected: bool=None, detector_definition=None, metrics=None, abnormal_time_periods=None, data=None, response_meta_data=None, **kwargs) -> None: + super(DiagnosticDetectorResponse, self).__init__(kind=kind, **kwargs) + self.start_time = start_time + self.end_time = end_time + self.issue_detected = issue_detected + self.detector_definition = detector_definition + self.metrics = metrics + self.abnormal_time_periods = abnormal_time_periods + self.data = data + self.response_meta_data = response_meta_data diff --git a/azure-mgmt-web/azure/mgmt/web/models/diagnostic_metric_sample.py b/azure-mgmt-web/azure/mgmt/web/models/diagnostic_metric_sample.py index 3b43cd9a42d6..fba987dbfbb2 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/diagnostic_metric_sample.py +++ b/azure-mgmt-web/azure/mgmt/web/models/diagnostic_metric_sample.py @@ -46,11 +46,11 @@ class DiagnosticMetricSample(Model): 'is_aggregated': {'key': 'isAggregated', 'type': 'bool'}, } - def __init__(self, timestamp=None, role_instance=None, total=None, maximum=None, minimum=None, is_aggregated=None): - super(DiagnosticMetricSample, self).__init__() - self.timestamp = timestamp - self.role_instance = role_instance - self.total = total - self.maximum = maximum - self.minimum = minimum - self.is_aggregated = is_aggregated + def __init__(self, **kwargs): + super(DiagnosticMetricSample, self).__init__(**kwargs) + self.timestamp = kwargs.get('timestamp', None) + self.role_instance = kwargs.get('role_instance', None) + self.total = kwargs.get('total', None) + self.maximum = kwargs.get('maximum', None) + self.minimum = kwargs.get('minimum', None) + self.is_aggregated = kwargs.get('is_aggregated', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/diagnostic_metric_sample_py3.py b/azure-mgmt-web/azure/mgmt/web/models/diagnostic_metric_sample_py3.py new file mode 100644 index 000000000000..c558571a8ea9 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/diagnostic_metric_sample_py3.py @@ -0,0 +1,56 @@ +# 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 msrest.serialization import Model + + +class DiagnosticMetricSample(Model): + """Class representing Diagnostic Metric. + + :param timestamp: Time at which metric is measured + :type timestamp: datetime + :param role_instance: Role Instance. Null if this counter is not per + instance + This is returned and should be whichever instance name we desire to be + returned + i.e. CPU and Memory return RDWORKERNAME (LargeDed..._IN_0) + where RDWORKERNAME is Machine name below and RoleInstance name in + parenthesis + :type role_instance: str + :param total: Total value of the metric. If multiple measurements are made + this will have sum of all. + :type total: float + :param maximum: Maximum of the metric sampled during the time period + :type maximum: float + :param minimum: Minimum of the metric sampled during the time period + :type minimum: float + :param is_aggregated: Whether the values are aggregates across all workers + or not + :type is_aggregated: bool + """ + + _attribute_map = { + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'role_instance': {'key': 'roleInstance', 'type': 'str'}, + 'total': {'key': 'total', 'type': 'float'}, + 'maximum': {'key': 'maximum', 'type': 'float'}, + 'minimum': {'key': 'minimum', 'type': 'float'}, + 'is_aggregated': {'key': 'isAggregated', 'type': 'bool'}, + } + + def __init__(self, *, timestamp=None, role_instance: str=None, total: float=None, maximum: float=None, minimum: float=None, is_aggregated: bool=None, **kwargs) -> None: + super(DiagnosticMetricSample, self).__init__(**kwargs) + self.timestamp = timestamp + self.role_instance = role_instance + self.total = total + self.maximum = maximum + self.minimum = minimum + self.is_aggregated = is_aggregated diff --git a/azure-mgmt-web/azure/mgmt/web/models/diagnostic_metric_set.py b/azure-mgmt-web/azure/mgmt/web/models/diagnostic_metric_set.py index e6c97e7d4711..52f58b0931f9 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/diagnostic_metric_set.py +++ b/azure-mgmt-web/azure/mgmt/web/models/diagnostic_metric_set.py @@ -41,11 +41,11 @@ class DiagnosticMetricSet(Model): 'values': {'key': 'values', 'type': '[DiagnosticMetricSample]'}, } - def __init__(self, name=None, unit=None, start_time=None, end_time=None, time_grain=None, values=None): - super(DiagnosticMetricSet, self).__init__() - self.name = name - self.unit = unit - self.start_time = start_time - self.end_time = end_time - self.time_grain = time_grain - self.values = values + def __init__(self, **kwargs): + super(DiagnosticMetricSet, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.unit = kwargs.get('unit', None) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.time_grain = kwargs.get('time_grain', None) + self.values = kwargs.get('values', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/diagnostic_metric_set_py3.py b/azure-mgmt-web/azure/mgmt/web/models/diagnostic_metric_set_py3.py new file mode 100644 index 000000000000..1af57065bf85 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/diagnostic_metric_set_py3.py @@ -0,0 +1,51 @@ +# 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 msrest.serialization import Model + + +class DiagnosticMetricSet(Model): + """Class representing Diagnostic Metric information. + + :param name: Name of the metric + :type name: str + :param unit: Metric's unit + :type unit: str + :param start_time: Start time of the period + :type start_time: datetime + :param end_time: End time of the period + :type end_time: datetime + :param time_grain: Presented time grain. Supported grains at the moment + are PT1M, PT1H, P1D + :type time_grain: str + :param values: Collection of metric values for the selected period based + on the + {Microsoft.Web.Hosting.Administration.DiagnosticMetricSet.TimeGrain} + :type values: list[~azure.mgmt.web.models.DiagnosticMetricSample] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'time_grain': {'key': 'timeGrain', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[DiagnosticMetricSample]'}, + } + + def __init__(self, *, name: str=None, unit: str=None, start_time=None, end_time=None, time_grain: str=None, values=None, **kwargs) -> None: + super(DiagnosticMetricSet, self).__init__(**kwargs) + self.name = name + self.unit = unit + self.start_time = start_time + self.end_time = end_time + self.time_grain = time_grain + self.values = values diff --git a/azure-mgmt-web/azure/mgmt/web/models/dimension.py b/azure-mgmt-web/azure/mgmt/web/models/dimension.py index 4ae55e1a1931..d4c844f865ca 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/dimension.py +++ b/azure-mgmt-web/azure/mgmt/web/models/dimension.py @@ -34,9 +34,9 @@ class Dimension(Model): 'to_be_exported_for_shoebox': {'key': 'toBeExportedForShoebox', 'type': 'bool'}, } - def __init__(self, name=None, display_name=None, internal_name=None, to_be_exported_for_shoebox=None): - super(Dimension, self).__init__() - self.name = name - self.display_name = display_name - self.internal_name = internal_name - self.to_be_exported_for_shoebox = to_be_exported_for_shoebox + def __init__(self, **kwargs): + super(Dimension, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.internal_name = kwargs.get('internal_name', None) + self.to_be_exported_for_shoebox = kwargs.get('to_be_exported_for_shoebox', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/dimension_py3.py b/azure-mgmt-web/azure/mgmt/web/models/dimension_py3.py new file mode 100644 index 000000000000..6ea1212b77fb --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/dimension_py3.py @@ -0,0 +1,42 @@ +# 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 msrest.serialization import Model + + +class Dimension(Model): + """Dimension of a resource metric. For e.g. instance specific HTTP requests + for a web app, + where instance name is dimension of the metric HTTP request. + + :param name: + :type name: str + :param display_name: + :type display_name: str + :param internal_name: + :type internal_name: str + :param to_be_exported_for_shoebox: + :type to_be_exported_for_shoebox: bool + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'internal_name': {'key': 'internalName', 'type': 'str'}, + 'to_be_exported_for_shoebox': {'key': 'toBeExportedForShoebox', 'type': 'bool'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, internal_name: str=None, to_be_exported_for_shoebox: bool=None, **kwargs) -> None: + super(Dimension, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.internal_name = internal_name + self.to_be_exported_for_shoebox = to_be_exported_for_shoebox diff --git a/azure-mgmt-web/azure/mgmt/web/models/domain.py b/azure-mgmt-web/azure/mgmt/web/models/domain.py index e53ec56f2283..68526b10ca81 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/domain.py +++ b/azure-mgmt-web/azure/mgmt/web/models/domain.py @@ -18,25 +18,27 @@ class Domain(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 Azure. + :ivar id: Resource Id. :vartype id: str :ivar name: Resource Name. :vartype name: str :param kind: Kind of resource. :type kind: str - :param location: Resource Location. + :param location: Required. Resource Location. :type location: str :ivar type: Resource type. :vartype type: str :param tags: Resource tags. :type tags: dict[str, str] - :param contact_admin: Administrative contact. + :param contact_admin: Required. Administrative contact. :type contact_admin: ~azure.mgmt.web.models.Contact - :param contact_billing: Billing contact. + :param contact_billing: Required. Billing contact. :type contact_billing: ~azure.mgmt.web.models.Contact - :param contact_registrant: Registrant contact. + :param contact_registrant: Required. Registrant contact. :type contact_registrant: ~azure.mgmt.web.models.Contact - :param contact_tech: Technical contact. + :param contact_tech: Required. Technical contact. :type contact_tech: ~azure.mgmt.web.models.Contact :ivar registration_status: Domain registration status. Possible values include: 'Active', 'Awaiting', 'Cancelled', 'Confiscated', 'Disabled', @@ -71,7 +73,7 @@ class Domain(Resource): :ivar managed_host_names: All hostnames derived from the domain and assigned to Azure resources. :vartype managed_host_names: list[~azure.mgmt.web.models.HostName] - :param consent: Legal agreement consent. + :param consent: Required. Legal agreement consent. :type consent: ~azure.mgmt.web.models.DomainPurchaseConsent :ivar domain_not_renewable_reasons: Reasons why domain is not renewable. :vartype domain_not_renewable_reasons: list[str] @@ -137,25 +139,25 @@ class Domain(Resource): 'auth_code': {'key': 'properties.authCode', 'type': 'str'}, } - def __init__(self, location, contact_admin, contact_billing, contact_registrant, contact_tech, consent, kind=None, tags=None, privacy=None, auto_renew=True, dns_type=None, dns_zone_id=None, target_dns_type=None, auth_code=None): - super(Domain, self).__init__(kind=kind, location=location, tags=tags) - self.contact_admin = contact_admin - self.contact_billing = contact_billing - self.contact_registrant = contact_registrant - self.contact_tech = contact_tech + def __init__(self, **kwargs): + super(Domain, self).__init__(**kwargs) + self.contact_admin = kwargs.get('contact_admin', None) + self.contact_billing = kwargs.get('contact_billing', None) + self.contact_registrant = kwargs.get('contact_registrant', None) + self.contact_tech = kwargs.get('contact_tech', None) self.registration_status = None self.provisioning_state = None self.name_servers = None - self.privacy = privacy + self.privacy = kwargs.get('privacy', None) self.created_time = None self.expiration_time = None self.last_renewed_time = None - self.auto_renew = auto_renew + self.auto_renew = kwargs.get('auto_renew', True) self.ready_for_dns_record_management = None self.managed_host_names = None - self.consent = consent + self.consent = kwargs.get('consent', None) self.domain_not_renewable_reasons = None - self.dns_type = dns_type - self.dns_zone_id = dns_zone_id - self.target_dns_type = target_dns_type - self.auth_code = auth_code + self.dns_type = kwargs.get('dns_type', None) + self.dns_zone_id = kwargs.get('dns_zone_id', None) + self.target_dns_type = kwargs.get('target_dns_type', None) + self.auth_code = kwargs.get('auth_code', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/domain_availablility_check_result.py b/azure-mgmt-web/azure/mgmt/web/models/domain_availablility_check_result.py index 19132caf64e5..45ea1738a52f 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/domain_availablility_check_result.py +++ b/azure-mgmt-web/azure/mgmt/web/models/domain_availablility_check_result.py @@ -33,8 +33,8 @@ class DomainAvailablilityCheckResult(Model): 'domain_type': {'key': 'domainType', 'type': 'DomainType'}, } - def __init__(self, name=None, available=None, domain_type=None): - super(DomainAvailablilityCheckResult, self).__init__() - self.name = name - self.available = available - self.domain_type = domain_type + def __init__(self, **kwargs): + super(DomainAvailablilityCheckResult, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.available = kwargs.get('available', None) + self.domain_type = kwargs.get('domain_type', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/domain_availablility_check_result_py3.py b/azure-mgmt-web/azure/mgmt/web/models/domain_availablility_check_result_py3.py new file mode 100644 index 000000000000..58bc30851baf --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/domain_availablility_check_result_py3.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class DomainAvailablilityCheckResult(Model): + """Domain availablility check result. + + :param name: Name of the domain. + :type name: str + :param available: true if domain can be purchased using + CreateDomain API; otherwise, false. + :type available: bool + :param domain_type: Valid values are Regular domain: Azure will charge the + full price of domain registration, SoftDeleted: Purchasing this domain + will simply restore it and this operation will not cost anything. Possible + values include: 'Regular', 'SoftDeleted' + :type domain_type: str or ~azure.mgmt.web.models.DomainType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'available': {'key': 'available', 'type': 'bool'}, + 'domain_type': {'key': 'domainType', 'type': 'DomainType'}, + } + + def __init__(self, *, name: str=None, available: bool=None, domain_type=None, **kwargs) -> None: + super(DomainAvailablilityCheckResult, self).__init__(**kwargs) + self.name = name + self.available = available + self.domain_type = domain_type diff --git a/azure-mgmt-web/azure/mgmt/web/models/domain_control_center_sso_request.py b/azure-mgmt-web/azure/mgmt/web/models/domain_control_center_sso_request.py index 056e5420c991..f132412df926 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/domain_control_center_sso_request.py +++ b/azure-mgmt-web/azure/mgmt/web/models/domain_control_center_sso_request.py @@ -39,8 +39,8 @@ class DomainControlCenterSsoRequest(Model): 'post_parameter_value': {'key': 'postParameterValue', 'type': 'str'}, } - def __init__(self): - super(DomainControlCenterSsoRequest, self).__init__() + def __init__(self, **kwargs): + super(DomainControlCenterSsoRequest, self).__init__(**kwargs) self.url = None self.post_parameter_key = None self.post_parameter_value = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/domain_control_center_sso_request_py3.py b/azure-mgmt-web/azure/mgmt/web/models/domain_control_center_sso_request_py3.py new file mode 100644 index 000000000000..0e3c71311a22 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/domain_control_center_sso_request_py3.py @@ -0,0 +1,46 @@ +# 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 msrest.serialization import Model + + +class DomainControlCenterSsoRequest(Model): + """Single sign-on request information for domain management. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar url: URL where the single sign-on request is to be made. + :vartype url: str + :ivar post_parameter_key: Post parameter key. + :vartype post_parameter_key: str + :ivar post_parameter_value: Post parameter value. Client should use + 'application/x-www-form-urlencoded' encoding for this value. + :vartype post_parameter_value: str + """ + + _validation = { + 'url': {'readonly': True}, + 'post_parameter_key': {'readonly': True}, + 'post_parameter_value': {'readonly': True}, + } + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'}, + 'post_parameter_key': {'key': 'postParameterKey', 'type': 'str'}, + 'post_parameter_value': {'key': 'postParameterValue', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(DomainControlCenterSsoRequest, self).__init__(**kwargs) + self.url = None + self.post_parameter_key = None + self.post_parameter_value = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/domain_ownership_identifier.py b/azure-mgmt-web/azure/mgmt/web/models/domain_ownership_identifier.py index 14df644e0911..863d26cede05 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/domain_ownership_identifier.py +++ b/azure-mgmt-web/azure/mgmt/web/models/domain_ownership_identifier.py @@ -44,6 +44,6 @@ class DomainOwnershipIdentifier(ProxyOnlyResource): 'ownership_id': {'key': 'properties.ownershipId', 'type': 'str'}, } - def __init__(self, kind=None, ownership_id=None): - super(DomainOwnershipIdentifier, self).__init__(kind=kind) - self.ownership_id = ownership_id + def __init__(self, **kwargs): + super(DomainOwnershipIdentifier, self).__init__(**kwargs) + self.ownership_id = kwargs.get('ownership_id', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/domain_ownership_identifier_py3.py b/azure-mgmt-web/azure/mgmt/web/models/domain_ownership_identifier_py3.py new file mode 100644 index 000000000000..d631a6e7d605 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/domain_ownership_identifier_py3.py @@ -0,0 +1,49 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class DomainOwnershipIdentifier(ProxyOnlyResource): + """Domain ownership Identifier. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param ownership_id: Ownership Id. + :type ownership_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'ownership_id': {'key': 'properties.ownershipId', 'type': 'str'}, + } + + def __init__(self, *, kind: str=None, ownership_id: str=None, **kwargs) -> None: + super(DomainOwnershipIdentifier, self).__init__(kind=kind, **kwargs) + self.ownership_id = ownership_id diff --git a/azure-mgmt-web/azure/mgmt/web/models/domain_patch_resource.py b/azure-mgmt-web/azure/mgmt/web/models/domain_patch_resource.py index 1e14116bb04f..84a451a6ef12 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/domain_patch_resource.py +++ b/azure-mgmt-web/azure/mgmt/web/models/domain_patch_resource.py @@ -18,6 +18,8 @@ class DomainPatchResource(ProxyOnlyResource): 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 Azure. + :ivar id: Resource Id. :vartype id: str :ivar name: Resource Name. @@ -26,13 +28,13 @@ class DomainPatchResource(ProxyOnlyResource): :type kind: str :ivar type: Resource type. :vartype type: str - :param contact_admin: Administrative contact. + :param contact_admin: Required. Administrative contact. :type contact_admin: ~azure.mgmt.web.models.Contact - :param contact_billing: Billing contact. + :param contact_billing: Required. Billing contact. :type contact_billing: ~azure.mgmt.web.models.Contact - :param contact_registrant: Registrant contact. + :param contact_registrant: Required. Registrant contact. :type contact_registrant: ~azure.mgmt.web.models.Contact - :param contact_tech: Technical contact. + :param contact_tech: Required. Technical contact. :type contact_tech: ~azure.mgmt.web.models.Contact :ivar registration_status: Domain registration status. Possible values include: 'Active', 'Awaiting', 'Cancelled', 'Confiscated', 'Disabled', @@ -67,7 +69,7 @@ class DomainPatchResource(ProxyOnlyResource): :ivar managed_host_names: All hostnames derived from the domain and assigned to Azure resources. :vartype managed_host_names: list[~azure.mgmt.web.models.HostName] - :param consent: Legal agreement consent. + :param consent: Required. Legal agreement consent. :type consent: ~azure.mgmt.web.models.DomainPurchaseConsent :ivar domain_not_renewable_reasons: Reasons why domain is not renewable. :vartype domain_not_renewable_reasons: list[str] @@ -130,25 +132,25 @@ class DomainPatchResource(ProxyOnlyResource): 'auth_code': {'key': 'properties.authCode', 'type': 'str'}, } - def __init__(self, contact_admin, contact_billing, contact_registrant, contact_tech, consent, kind=None, privacy=None, auto_renew=True, dns_type=None, dns_zone_id=None, target_dns_type=None, auth_code=None): - super(DomainPatchResource, self).__init__(kind=kind) - self.contact_admin = contact_admin - self.contact_billing = contact_billing - self.contact_registrant = contact_registrant - self.contact_tech = contact_tech + def __init__(self, **kwargs): + super(DomainPatchResource, self).__init__(**kwargs) + self.contact_admin = kwargs.get('contact_admin', None) + self.contact_billing = kwargs.get('contact_billing', None) + self.contact_registrant = kwargs.get('contact_registrant', None) + self.contact_tech = kwargs.get('contact_tech', None) self.registration_status = None self.provisioning_state = None self.name_servers = None - self.privacy = privacy + self.privacy = kwargs.get('privacy', None) self.created_time = None self.expiration_time = None self.last_renewed_time = None - self.auto_renew = auto_renew + self.auto_renew = kwargs.get('auto_renew', True) self.ready_for_dns_record_management = None self.managed_host_names = None - self.consent = consent + self.consent = kwargs.get('consent', None) self.domain_not_renewable_reasons = None - self.dns_type = dns_type - self.dns_zone_id = dns_zone_id - self.target_dns_type = target_dns_type - self.auth_code = auth_code + self.dns_type = kwargs.get('dns_type', None) + self.dns_zone_id = kwargs.get('dns_zone_id', None) + self.target_dns_type = kwargs.get('target_dns_type', None) + self.auth_code = kwargs.get('auth_code', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/domain_patch_resource_py3.py b/azure-mgmt-web/azure/mgmt/web/models/domain_patch_resource_py3.py new file mode 100644 index 000000000000..e54861f238e5 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/domain_patch_resource_py3.py @@ -0,0 +1,156 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class DomainPatchResource(ProxyOnlyResource): + """ARM resource for a domain. + + 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 Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param contact_admin: Required. Administrative contact. + :type contact_admin: ~azure.mgmt.web.models.Contact + :param contact_billing: Required. Billing contact. + :type contact_billing: ~azure.mgmt.web.models.Contact + :param contact_registrant: Required. Registrant contact. + :type contact_registrant: ~azure.mgmt.web.models.Contact + :param contact_tech: Required. Technical contact. + :type contact_tech: ~azure.mgmt.web.models.Contact + :ivar registration_status: Domain registration status. Possible values + include: 'Active', 'Awaiting', 'Cancelled', 'Confiscated', 'Disabled', + 'Excluded', 'Expired', 'Failed', 'Held', 'Locked', 'Parked', 'Pending', + 'Reserved', 'Reverted', 'Suspended', 'Transferred', 'Unknown', 'Unlocked', + 'Unparked', 'Updated', 'JsonConverterFailed' + :vartype registration_status: str or ~azure.mgmt.web.models.DomainStatus + :ivar provisioning_state: Domain provisioning state. Possible values + include: 'Succeeded', 'Failed', 'Canceled', 'InProgress', 'Deleting' + :vartype provisioning_state: str or + ~azure.mgmt.web.models.ProvisioningState + :ivar name_servers: Name servers. + :vartype name_servers: list[str] + :param privacy: true if domain privacy is enabled for this + domain; otherwise, false. + :type privacy: bool + :ivar created_time: Domain creation timestamp. + :vartype created_time: datetime + :ivar expiration_time: Domain expiration timestamp. + :vartype expiration_time: datetime + :ivar last_renewed_time: Timestamp when the domain was renewed last time. + :vartype last_renewed_time: datetime + :param auto_renew: true if the domain should be automatically + renewed; otherwise, false. Default value: True . + :type auto_renew: bool + :ivar ready_for_dns_record_management: true if Azure can + assign this domain to App Service apps; otherwise, false. + This value will be true if domain registration status is + active and + it is hosted on name servers Azure has programmatic access to. + :vartype ready_for_dns_record_management: bool + :ivar managed_host_names: All hostnames derived from the domain and + assigned to Azure resources. + :vartype managed_host_names: list[~azure.mgmt.web.models.HostName] + :param consent: Required. Legal agreement consent. + :type consent: ~azure.mgmt.web.models.DomainPurchaseConsent + :ivar domain_not_renewable_reasons: Reasons why domain is not renewable. + :vartype domain_not_renewable_reasons: list[str] + :param dns_type: Current DNS type. Possible values include: 'AzureDns', + 'DefaultDomainRegistrarDns' + :type dns_type: str or ~azure.mgmt.web.models.DnsType + :param dns_zone_id: Azure DNS Zone to use + :type dns_zone_id: str + :param target_dns_type: Target DNS type (would be used for migration). + Possible values include: 'AzureDns', 'DefaultDomainRegistrarDns' + :type target_dns_type: str or ~azure.mgmt.web.models.DnsType + :param auth_code: + :type auth_code: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'contact_admin': {'required': True}, + 'contact_billing': {'required': True}, + 'contact_registrant': {'required': True}, + 'contact_tech': {'required': True}, + 'registration_status': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'name_servers': {'readonly': True}, + 'created_time': {'readonly': True}, + 'expiration_time': {'readonly': True}, + 'last_renewed_time': {'readonly': True}, + 'ready_for_dns_record_management': {'readonly': True}, + 'managed_host_names': {'readonly': True}, + 'consent': {'required': True}, + 'domain_not_renewable_reasons': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'contact_admin': {'key': 'properties.contactAdmin', 'type': 'Contact'}, + 'contact_billing': {'key': 'properties.contactBilling', 'type': 'Contact'}, + 'contact_registrant': {'key': 'properties.contactRegistrant', 'type': 'Contact'}, + 'contact_tech': {'key': 'properties.contactTech', 'type': 'Contact'}, + 'registration_status': {'key': 'properties.registrationStatus', 'type': 'DomainStatus'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, + 'name_servers': {'key': 'properties.nameServers', 'type': '[str]'}, + 'privacy': {'key': 'properties.privacy', 'type': 'bool'}, + 'created_time': {'key': 'properties.createdTime', 'type': 'iso-8601'}, + 'expiration_time': {'key': 'properties.expirationTime', 'type': 'iso-8601'}, + 'last_renewed_time': {'key': 'properties.lastRenewedTime', 'type': 'iso-8601'}, + 'auto_renew': {'key': 'properties.autoRenew', 'type': 'bool'}, + 'ready_for_dns_record_management': {'key': 'properties.readyForDnsRecordManagement', 'type': 'bool'}, + 'managed_host_names': {'key': 'properties.managedHostNames', 'type': '[HostName]'}, + 'consent': {'key': 'properties.consent', 'type': 'DomainPurchaseConsent'}, + 'domain_not_renewable_reasons': {'key': 'properties.domainNotRenewableReasons', 'type': '[str]'}, + 'dns_type': {'key': 'properties.dnsType', 'type': 'DnsType'}, + 'dns_zone_id': {'key': 'properties.dnsZoneId', 'type': 'str'}, + 'target_dns_type': {'key': 'properties.targetDnsType', 'type': 'DnsType'}, + 'auth_code': {'key': 'properties.authCode', 'type': 'str'}, + } + + def __init__(self, *, contact_admin, contact_billing, contact_registrant, contact_tech, consent, kind: str=None, privacy: bool=None, auto_renew: bool=True, dns_type=None, dns_zone_id: str=None, target_dns_type=None, auth_code: str=None, **kwargs) -> None: + super(DomainPatchResource, self).__init__(kind=kind, **kwargs) + self.contact_admin = contact_admin + self.contact_billing = contact_billing + self.contact_registrant = contact_registrant + self.contact_tech = contact_tech + self.registration_status = None + self.provisioning_state = None + self.name_servers = None + self.privacy = privacy + self.created_time = None + self.expiration_time = None + self.last_renewed_time = None + self.auto_renew = auto_renew + self.ready_for_dns_record_management = None + self.managed_host_names = None + self.consent = consent + self.domain_not_renewable_reasons = None + self.dns_type = dns_type + self.dns_zone_id = dns_zone_id + self.target_dns_type = target_dns_type + self.auth_code = auth_code diff --git a/azure-mgmt-web/azure/mgmt/web/models/domain_purchase_consent.py b/azure-mgmt-web/azure/mgmt/web/models/domain_purchase_consent.py index 856204af4921..af78bf0a076b 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/domain_purchase_consent.py +++ b/azure-mgmt-web/azure/mgmt/web/models/domain_purchase_consent.py @@ -32,8 +32,8 @@ class DomainPurchaseConsent(Model): 'agreed_at': {'key': 'agreedAt', 'type': 'iso-8601'}, } - def __init__(self, agreement_keys=None, agreed_by=None, agreed_at=None): - super(DomainPurchaseConsent, self).__init__() - self.agreement_keys = agreement_keys - self.agreed_by = agreed_by - self.agreed_at = agreed_at + def __init__(self, **kwargs): + super(DomainPurchaseConsent, self).__init__(**kwargs) + self.agreement_keys = kwargs.get('agreement_keys', None) + self.agreed_by = kwargs.get('agreed_by', None) + self.agreed_at = kwargs.get('agreed_at', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/domain_purchase_consent_py3.py b/azure-mgmt-web/azure/mgmt/web/models/domain_purchase_consent_py3.py new file mode 100644 index 000000000000..4a88053cccf3 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/domain_purchase_consent_py3.py @@ -0,0 +1,39 @@ +# 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 msrest.serialization import Model + + +class DomainPurchaseConsent(Model): + """Domain purchase consent object, representing acceptance of applicable legal + agreements. + + :param agreement_keys: List of applicable legal agreement keys. This list + can be retrieved using ListLegalAgreements API under + TopLevelDomain resource. + :type agreement_keys: list[str] + :param agreed_by: Client IP address. + :type agreed_by: str + :param agreed_at: Timestamp when the agreements were accepted. + :type agreed_at: datetime + """ + + _attribute_map = { + 'agreement_keys': {'key': 'agreementKeys', 'type': '[str]'}, + 'agreed_by': {'key': 'agreedBy', 'type': 'str'}, + 'agreed_at': {'key': 'agreedAt', 'type': 'iso-8601'}, + } + + def __init__(self, *, agreement_keys=None, agreed_by: str=None, agreed_at=None, **kwargs) -> None: + super(DomainPurchaseConsent, self).__init__(**kwargs) + self.agreement_keys = agreement_keys + self.agreed_by = agreed_by + self.agreed_at = agreed_at diff --git a/azure-mgmt-web/azure/mgmt/web/models/domain_py3.py b/azure-mgmt-web/azure/mgmt/web/models/domain_py3.py new file mode 100644 index 000000000000..4e92c18fac34 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/domain_py3.py @@ -0,0 +1,163 @@ +# 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 .resource import Resource + + +class Domain(Resource): + """Information about a domain. + + 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 Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param contact_admin: Required. Administrative contact. + :type contact_admin: ~azure.mgmt.web.models.Contact + :param contact_billing: Required. Billing contact. + :type contact_billing: ~azure.mgmt.web.models.Contact + :param contact_registrant: Required. Registrant contact. + :type contact_registrant: ~azure.mgmt.web.models.Contact + :param contact_tech: Required. Technical contact. + :type contact_tech: ~azure.mgmt.web.models.Contact + :ivar registration_status: Domain registration status. Possible values + include: 'Active', 'Awaiting', 'Cancelled', 'Confiscated', 'Disabled', + 'Excluded', 'Expired', 'Failed', 'Held', 'Locked', 'Parked', 'Pending', + 'Reserved', 'Reverted', 'Suspended', 'Transferred', 'Unknown', 'Unlocked', + 'Unparked', 'Updated', 'JsonConverterFailed' + :vartype registration_status: str or ~azure.mgmt.web.models.DomainStatus + :ivar provisioning_state: Domain provisioning state. Possible values + include: 'Succeeded', 'Failed', 'Canceled', 'InProgress', 'Deleting' + :vartype provisioning_state: str or + ~azure.mgmt.web.models.ProvisioningState + :ivar name_servers: Name servers. + :vartype name_servers: list[str] + :param privacy: true if domain privacy is enabled for this + domain; otherwise, false. + :type privacy: bool + :ivar created_time: Domain creation timestamp. + :vartype created_time: datetime + :ivar expiration_time: Domain expiration timestamp. + :vartype expiration_time: datetime + :ivar last_renewed_time: Timestamp when the domain was renewed last time. + :vartype last_renewed_time: datetime + :param auto_renew: true if the domain should be automatically + renewed; otherwise, false. Default value: True . + :type auto_renew: bool + :ivar ready_for_dns_record_management: true if Azure can + assign this domain to App Service apps; otherwise, false. + This value will be true if domain registration status is + active and + it is hosted on name servers Azure has programmatic access to. + :vartype ready_for_dns_record_management: bool + :ivar managed_host_names: All hostnames derived from the domain and + assigned to Azure resources. + :vartype managed_host_names: list[~azure.mgmt.web.models.HostName] + :param consent: Required. Legal agreement consent. + :type consent: ~azure.mgmt.web.models.DomainPurchaseConsent + :ivar domain_not_renewable_reasons: Reasons why domain is not renewable. + :vartype domain_not_renewable_reasons: list[str] + :param dns_type: Current DNS type. Possible values include: 'AzureDns', + 'DefaultDomainRegistrarDns' + :type dns_type: str or ~azure.mgmt.web.models.DnsType + :param dns_zone_id: Azure DNS Zone to use + :type dns_zone_id: str + :param target_dns_type: Target DNS type (would be used for migration). + Possible values include: 'AzureDns', 'DefaultDomainRegistrarDns' + :type target_dns_type: str or ~azure.mgmt.web.models.DnsType + :param auth_code: + :type auth_code: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'contact_admin': {'required': True}, + 'contact_billing': {'required': True}, + 'contact_registrant': {'required': True}, + 'contact_tech': {'required': True}, + 'registration_status': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'name_servers': {'readonly': True}, + 'created_time': {'readonly': True}, + 'expiration_time': {'readonly': True}, + 'last_renewed_time': {'readonly': True}, + 'ready_for_dns_record_management': {'readonly': True}, + 'managed_host_names': {'readonly': True}, + 'consent': {'required': True}, + 'domain_not_renewable_reasons': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'contact_admin': {'key': 'properties.contactAdmin', 'type': 'Contact'}, + 'contact_billing': {'key': 'properties.contactBilling', 'type': 'Contact'}, + 'contact_registrant': {'key': 'properties.contactRegistrant', 'type': 'Contact'}, + 'contact_tech': {'key': 'properties.contactTech', 'type': 'Contact'}, + 'registration_status': {'key': 'properties.registrationStatus', 'type': 'DomainStatus'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, + 'name_servers': {'key': 'properties.nameServers', 'type': '[str]'}, + 'privacy': {'key': 'properties.privacy', 'type': 'bool'}, + 'created_time': {'key': 'properties.createdTime', 'type': 'iso-8601'}, + 'expiration_time': {'key': 'properties.expirationTime', 'type': 'iso-8601'}, + 'last_renewed_time': {'key': 'properties.lastRenewedTime', 'type': 'iso-8601'}, + 'auto_renew': {'key': 'properties.autoRenew', 'type': 'bool'}, + 'ready_for_dns_record_management': {'key': 'properties.readyForDnsRecordManagement', 'type': 'bool'}, + 'managed_host_names': {'key': 'properties.managedHostNames', 'type': '[HostName]'}, + 'consent': {'key': 'properties.consent', 'type': 'DomainPurchaseConsent'}, + 'domain_not_renewable_reasons': {'key': 'properties.domainNotRenewableReasons', 'type': '[str]'}, + 'dns_type': {'key': 'properties.dnsType', 'type': 'DnsType'}, + 'dns_zone_id': {'key': 'properties.dnsZoneId', 'type': 'str'}, + 'target_dns_type': {'key': 'properties.targetDnsType', 'type': 'DnsType'}, + 'auth_code': {'key': 'properties.authCode', 'type': 'str'}, + } + + def __init__(self, *, location: str, contact_admin, contact_billing, contact_registrant, contact_tech, consent, kind: str=None, tags=None, privacy: bool=None, auto_renew: bool=True, dns_type=None, dns_zone_id: str=None, target_dns_type=None, auth_code: str=None, **kwargs) -> None: + super(Domain, self).__init__(kind=kind, location=location, tags=tags, **kwargs) + self.contact_admin = contact_admin + self.contact_billing = contact_billing + self.contact_registrant = contact_registrant + self.contact_tech = contact_tech + self.registration_status = None + self.provisioning_state = None + self.name_servers = None + self.privacy = privacy + self.created_time = None + self.expiration_time = None + self.last_renewed_time = None + self.auto_renew = auto_renew + self.ready_for_dns_record_management = None + self.managed_host_names = None + self.consent = consent + self.domain_not_renewable_reasons = None + self.dns_type = dns_type + self.dns_zone_id = dns_zone_id + self.target_dns_type = target_dns_type + self.auth_code = auth_code diff --git a/azure-mgmt-web/azure/mgmt/web/models/domain_recommendation_search_parameters.py b/azure-mgmt-web/azure/mgmt/web/models/domain_recommendation_search_parameters.py index 98a31de25204..fe006b4ba3e6 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/domain_recommendation_search_parameters.py +++ b/azure-mgmt-web/azure/mgmt/web/models/domain_recommendation_search_parameters.py @@ -27,7 +27,7 @@ class DomainRecommendationSearchParameters(Model): 'max_domain_recommendations': {'key': 'maxDomainRecommendations', 'type': 'int'}, } - def __init__(self, keywords=None, max_domain_recommendations=None): - super(DomainRecommendationSearchParameters, self).__init__() - self.keywords = keywords - self.max_domain_recommendations = max_domain_recommendations + def __init__(self, **kwargs): + super(DomainRecommendationSearchParameters, self).__init__(**kwargs) + self.keywords = kwargs.get('keywords', None) + self.max_domain_recommendations = kwargs.get('max_domain_recommendations', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/domain_recommendation_search_parameters_py3.py b/azure-mgmt-web/azure/mgmt/web/models/domain_recommendation_search_parameters_py3.py new file mode 100644 index 000000000000..8ea9729bb72e --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/domain_recommendation_search_parameters_py3.py @@ -0,0 +1,33 @@ +# 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 msrest.serialization import Model + + +class DomainRecommendationSearchParameters(Model): + """Domain recommendation search parameters. + + :param keywords: Keywords to be used for generating domain + recommendations. + :type keywords: str + :param max_domain_recommendations: Maximum number of recommendations. + :type max_domain_recommendations: int + """ + + _attribute_map = { + 'keywords': {'key': 'keywords', 'type': 'str'}, + 'max_domain_recommendations': {'key': 'maxDomainRecommendations', 'type': 'int'}, + } + + def __init__(self, *, keywords: str=None, max_domain_recommendations: int=None, **kwargs) -> None: + super(DomainRecommendationSearchParameters, self).__init__(**kwargs) + self.keywords = keywords + self.max_domain_recommendations = max_domain_recommendations diff --git a/azure-mgmt-web/azure/mgmt/web/models/enabled_config.py b/azure-mgmt-web/azure/mgmt/web/models/enabled_config.py index 5d44efc6b8ad..81b4f06c3045 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/enabled_config.py +++ b/azure-mgmt-web/azure/mgmt/web/models/enabled_config.py @@ -24,6 +24,6 @@ class EnabledConfig(Model): 'enabled': {'key': 'enabled', 'type': 'bool'}, } - def __init__(self, enabled=None): - super(EnabledConfig, self).__init__() - self.enabled = enabled + def __init__(self, **kwargs): + super(EnabledConfig, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/enabled_config_py3.py b/azure-mgmt-web/azure/mgmt/web/models/enabled_config_py3.py new file mode 100644 index 000000000000..226726aabf4c --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/enabled_config_py3.py @@ -0,0 +1,29 @@ +# 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 msrest.serialization import Model + + +class EnabledConfig(Model): + """Enabled configuration. + + :param enabled: True if configuration is enabled, false if it is disabled + and null if configuration is not set. + :type enabled: bool + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__(self, *, enabled: bool=None, **kwargs) -> None: + super(EnabledConfig, self).__init__(**kwargs) + self.enabled = enabled diff --git a/azure-mgmt-web/azure/mgmt/web/models/error_entity.py b/azure-mgmt-web/azure/mgmt/web/models/error_entity.py index f909bd59f684..08f037c599f2 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/error_entity.py +++ b/azure-mgmt-web/azure/mgmt/web/models/error_entity.py @@ -38,11 +38,11 @@ class ErrorEntity(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self, extended_code=None, message_template=None, parameters=None, inner_errors=None, code=None, message=None): - super(ErrorEntity, self).__init__() - self.extended_code = extended_code - self.message_template = message_template - self.parameters = parameters - self.inner_errors = inner_errors - self.code = code - self.message = message + def __init__(self, **kwargs): + super(ErrorEntity, self).__init__(**kwargs) + self.extended_code = kwargs.get('extended_code', None) + self.message_template = kwargs.get('message_template', None) + self.parameters = kwargs.get('parameters', None) + self.inner_errors = kwargs.get('inner_errors', None) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/error_entity_py3.py b/azure-mgmt-web/azure/mgmt/web/models/error_entity_py3.py new file mode 100644 index 000000000000..d60fe281db68 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/error_entity_py3.py @@ -0,0 +1,48 @@ +# 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 msrest.serialization import Model + + +class ErrorEntity(Model): + """Body of the error response returned from the API. + + :param extended_code: Type of error. + :type extended_code: str + :param message_template: Message template. + :type message_template: str + :param parameters: Parameters for the template. + :type parameters: list[str] + :param inner_errors: Inner errors. + :type inner_errors: list[~azure.mgmt.web.models.ErrorEntity] + :param code: Basic error code. + :type code: str + :param message: Any details of the error. + :type 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]'}, + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, extended_code: str=None, message_template: str=None, parameters=None, inner_errors=None, code: str=None, message: str=None, **kwargs) -> None: + super(ErrorEntity, self).__init__(**kwargs) + self.extended_code = extended_code + self.message_template = message_template + self.parameters = parameters + self.inner_errors = inner_errors + self.code = code + self.message = message diff --git a/azure-mgmt-web/azure/mgmt/web/models/error_response.py b/azure-mgmt-web/azure/mgmt/web/models/error_response.py index 97176b87f7b3..e20829bcf7b2 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/error_response.py +++ b/azure-mgmt-web/azure/mgmt/web/models/error_response.py @@ -27,10 +27,10 @@ class ErrorResponse(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self, code=None, message=None): - super(ErrorResponse, self).__init__() - self.code = code - self.message = message + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) class ErrorResponseException(HttpOperationError): diff --git a/azure-mgmt-web/azure/mgmt/web/models/error_response_py3.py b/azure-mgmt-web/azure/mgmt/web/models/error_response_py3.py new file mode 100644 index 000000000000..1b2f05f1d4d6 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/error_response_py3.py @@ -0,0 +1,45 @@ +# 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 msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class ErrorResponse(Model): + """Error Response. + + :param code: Error code. + :type code: str + :param message: Error message indicating why the operation failed. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, message: str=None, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.code = code + self.message = message + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/azure-mgmt-web/azure/mgmt/web/models/experiments.py b/azure-mgmt-web/azure/mgmt/web/models/experiments.py index 231d82f98a5d..4a74bcf8f935 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/experiments.py +++ b/azure-mgmt-web/azure/mgmt/web/models/experiments.py @@ -23,6 +23,6 @@ class Experiments(Model): 'ramp_up_rules': {'key': 'rampUpRules', 'type': '[RampUpRule]'}, } - def __init__(self, ramp_up_rules=None): - super(Experiments, self).__init__() - self.ramp_up_rules = ramp_up_rules + def __init__(self, **kwargs): + super(Experiments, self).__init__(**kwargs) + self.ramp_up_rules = kwargs.get('ramp_up_rules', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/experiments_py3.py b/azure-mgmt-web/azure/mgmt/web/models/experiments_py3.py new file mode 100644 index 000000000000..16bd1d5ccf09 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/experiments_py3.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class Experiments(Model): + """Routing rules in production experiments. + + :param ramp_up_rules: List of ramp-up rules. + :type ramp_up_rules: list[~azure.mgmt.web.models.RampUpRule] + """ + + _attribute_map = { + 'ramp_up_rules': {'key': 'rampUpRules', 'type': '[RampUpRule]'}, + } + + def __init__(self, *, ramp_up_rules=None, **kwargs) -> None: + super(Experiments, self).__init__(**kwargs) + self.ramp_up_rules = ramp_up_rules diff --git a/azure-mgmt-web/azure/mgmt/web/models/file_system_application_logs_config.py b/azure-mgmt-web/azure/mgmt/web/models/file_system_application_logs_config.py index b8ecc8372cc5..469a1bee8590 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/file_system_application_logs_config.py +++ b/azure-mgmt-web/azure/mgmt/web/models/file_system_application_logs_config.py @@ -24,6 +24,6 @@ class FileSystemApplicationLogsConfig(Model): 'level': {'key': 'level', 'type': 'LogLevel'}, } - def __init__(self, level="Off"): - super(FileSystemApplicationLogsConfig, self).__init__() - self.level = level + def __init__(self, **kwargs): + super(FileSystemApplicationLogsConfig, self).__init__(**kwargs) + self.level = kwargs.get('level', "Off") diff --git a/azure-mgmt-web/azure/mgmt/web/models/file_system_application_logs_config_py3.py b/azure-mgmt-web/azure/mgmt/web/models/file_system_application_logs_config_py3.py new file mode 100644 index 000000000000..d18bbfa42a33 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/file_system_application_logs_config_py3.py @@ -0,0 +1,29 @@ +# 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 msrest.serialization import Model + + +class FileSystemApplicationLogsConfig(Model): + """Application logs to file system configuration. + + :param level: Log level. Possible values include: 'Off', 'Verbose', + 'Information', 'Warning', 'Error'. Default value: "Off" . + :type level: str or ~azure.mgmt.web.models.LogLevel + """ + + _attribute_map = { + 'level': {'key': 'level', 'type': 'LogLevel'}, + } + + def __init__(self, *, level="Off", **kwargs) -> None: + super(FileSystemApplicationLogsConfig, self).__init__(**kwargs) + self.level = level diff --git a/azure-mgmt-web/azure/mgmt/web/models/file_system_http_logs_config.py b/azure-mgmt-web/azure/mgmt/web/models/file_system_http_logs_config.py index 0c38657cac46..d7be6474900f 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/file_system_http_logs_config.py +++ b/azure-mgmt-web/azure/mgmt/web/models/file_system_http_logs_config.py @@ -39,8 +39,8 @@ class FileSystemHttpLogsConfig(Model): 'enabled': {'key': 'enabled', 'type': 'bool'}, } - def __init__(self, retention_in_mb=None, retention_in_days=None, enabled=None): - super(FileSystemHttpLogsConfig, self).__init__() - self.retention_in_mb = retention_in_mb - self.retention_in_days = retention_in_days - self.enabled = enabled + def __init__(self, **kwargs): + super(FileSystemHttpLogsConfig, self).__init__(**kwargs) + self.retention_in_mb = kwargs.get('retention_in_mb', None) + self.retention_in_days = kwargs.get('retention_in_days', None) + self.enabled = kwargs.get('enabled', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/file_system_http_logs_config_py3.py b/azure-mgmt-web/azure/mgmt/web/models/file_system_http_logs_config_py3.py new file mode 100644 index 000000000000..b5101a8c103d --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/file_system_http_logs_config_py3.py @@ -0,0 +1,46 @@ +# 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 msrest.serialization import Model + + +class FileSystemHttpLogsConfig(Model): + """Http logs to file system configuration. + + :param retention_in_mb: Maximum size in megabytes that http log files can + use. + When reached old log files will be removed to make space for new ones. + Value can range between 25 and 100. + :type retention_in_mb: int + :param retention_in_days: Retention in days. + Remove files older than X days. + 0 or lower means no retention. + :type retention_in_days: int + :param enabled: True if configuration is enabled, false if it is disabled + and null if configuration is not set. + :type enabled: bool + """ + + _validation = { + 'retention_in_mb': {'maximum': 100, 'minimum': 25}, + } + + _attribute_map = { + 'retention_in_mb': {'key': 'retentionInMb', 'type': 'int'}, + 'retention_in_days': {'key': 'retentionInDays', 'type': 'int'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__(self, *, retention_in_mb: int=None, retention_in_days: int=None, enabled: bool=None, **kwargs) -> None: + super(FileSystemHttpLogsConfig, self).__init__(**kwargs) + self.retention_in_mb = retention_in_mb + self.retention_in_days = retention_in_days + self.enabled = enabled diff --git a/azure-mgmt-web/azure/mgmt/web/models/function_envelope.py b/azure-mgmt-web/azure/mgmt/web/models/function_envelope.py index e68f283aefb7..6e19dd9fb439 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/function_envelope.py +++ b/azure-mgmt-web/azure/mgmt/web/models/function_envelope.py @@ -73,15 +73,15 @@ class FunctionEnvelope(ProxyOnlyResource): 'test_data': {'key': 'properties.testData', 'type': 'str'}, } - def __init__(self, kind=None, script_root_path_href=None, script_href=None, config_href=None, secrets_file_href=None, href=None, config=None, files=None, test_data=None): - super(FunctionEnvelope, self).__init__(kind=kind) + def __init__(self, **kwargs): + super(FunctionEnvelope, self).__init__(**kwargs) self.function_envelope_name = None self.function_app_id = None - self.script_root_path_href = script_root_path_href - self.script_href = script_href - self.config_href = config_href - self.secrets_file_href = secrets_file_href - self.href = href - self.config = config - self.files = files - self.test_data = test_data + self.script_root_path_href = kwargs.get('script_root_path_href', None) + self.script_href = kwargs.get('script_href', None) + self.config_href = kwargs.get('config_href', None) + self.secrets_file_href = kwargs.get('secrets_file_href', None) + self.href = kwargs.get('href', None) + self.config = kwargs.get('config', None) + self.files = kwargs.get('files', None) + self.test_data = kwargs.get('test_data', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/function_envelope_py3.py b/azure-mgmt-web/azure/mgmt/web/models/function_envelope_py3.py new file mode 100644 index 000000000000..22b7ddd04531 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/function_envelope_py3.py @@ -0,0 +1,87 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class FunctionEnvelope(ProxyOnlyResource): + """Web Job Information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar function_envelope_name: Function name. + :vartype function_envelope_name: str + :ivar function_app_id: Function App ID. + :vartype function_app_id: str + :param script_root_path_href: Script root path URI. + :type script_root_path_href: str + :param script_href: Script URI. + :type script_href: str + :param config_href: Config URI. + :type config_href: str + :param secrets_file_href: Secrets file URI. + :type secrets_file_href: str + :param href: Function URI. + :type href: str + :param config: Config information. + :type config: object + :param files: File list. + :type files: dict[str, str] + :param test_data: Test data used when testing via the Azure Portal. + :type test_data: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'function_envelope_name': {'readonly': True}, + 'function_app_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'function_envelope_name': {'key': 'properties.name', 'type': 'str'}, + 'function_app_id': {'key': 'properties.functionAppId', 'type': 'str'}, + 'script_root_path_href': {'key': 'properties.scriptRootPathHref', 'type': 'str'}, + 'script_href': {'key': 'properties.scriptHref', 'type': 'str'}, + 'config_href': {'key': 'properties.configHref', 'type': 'str'}, + 'secrets_file_href': {'key': 'properties.secretsFileHref', 'type': 'str'}, + 'href': {'key': 'properties.href', 'type': 'str'}, + 'config': {'key': 'properties.config', 'type': 'object'}, + 'files': {'key': 'properties.files', 'type': '{str}'}, + 'test_data': {'key': 'properties.testData', 'type': 'str'}, + } + + def __init__(self, *, kind: str=None, script_root_path_href: str=None, script_href: str=None, config_href: str=None, secrets_file_href: str=None, href: str=None, config=None, files=None, test_data: str=None, **kwargs) -> None: + super(FunctionEnvelope, self).__init__(kind=kind, **kwargs) + self.function_envelope_name = None + self.function_app_id = None + self.script_root_path_href = script_root_path_href + self.script_href = script_href + self.config_href = config_href + self.secrets_file_href = secrets_file_href + self.href = href + self.config = config + self.files = files + self.test_data = test_data diff --git a/azure-mgmt-web/azure/mgmt/web/models/function_secrets.py b/azure-mgmt-web/azure/mgmt/web/models/function_secrets.py index 86cf03927c63..6f0746e1e7c8 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/function_secrets.py +++ b/azure-mgmt-web/azure/mgmt/web/models/function_secrets.py @@ -47,7 +47,7 @@ class FunctionSecrets(ProxyOnlyResource): 'trigger_url': {'key': 'properties.triggerUrl', 'type': 'str'}, } - def __init__(self, kind=None, key=None, trigger_url=None): - super(FunctionSecrets, self).__init__(kind=kind) - self.key = key - self.trigger_url = trigger_url + def __init__(self, **kwargs): + super(FunctionSecrets, self).__init__(**kwargs) + self.key = kwargs.get('key', None) + self.trigger_url = kwargs.get('trigger_url', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/function_secrets_py3.py b/azure-mgmt-web/azure/mgmt/web/models/function_secrets_py3.py new file mode 100644 index 000000000000..ae4113390af9 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/function_secrets_py3.py @@ -0,0 +1,53 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class FunctionSecrets(ProxyOnlyResource): + """Function secrets. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param key: Secret key. + :type key: str + :param trigger_url: Trigger URL. + :type trigger_url: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'key': {'key': 'properties.key', 'type': 'str'}, + 'trigger_url': {'key': 'properties.triggerUrl', 'type': 'str'}, + } + + def __init__(self, *, kind: str=None, key: str=None, trigger_url: str=None, **kwargs) -> None: + super(FunctionSecrets, self).__init__(kind=kind, **kwargs) + self.key = key + self.trigger_url = trigger_url diff --git a/azure-mgmt-web/azure/mgmt/web/models/geo_region.py b/azure-mgmt-web/azure/mgmt/web/models/geo_region.py index 0cd677eef4a6..c59c3987e0f5 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/geo_region.py +++ b/azure-mgmt-web/azure/mgmt/web/models/geo_region.py @@ -53,8 +53,8 @@ class GeoRegion(ProxyOnlyResource): 'display_name': {'key': 'properties.displayName', 'type': 'str'}, } - def __init__(self, kind=None): - super(GeoRegion, self).__init__(kind=kind) + def __init__(self, **kwargs): + super(GeoRegion, self).__init__(**kwargs) self.geo_region_name = None self.description = None self.display_name = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/geo_region_py3.py b/azure-mgmt-web/azure/mgmt/web/models/geo_region_py3.py new file mode 100644 index 000000000000..cbd749df464c --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/geo_region_py3.py @@ -0,0 +1,60 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class GeoRegion(ProxyOnlyResource): + """Geographical region. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar geo_region_name: Region name. + :vartype geo_region_name: str + :ivar description: Region description. + :vartype description: str + :ivar display_name: Display name for region. + :vartype display_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'geo_region_name': {'readonly': True}, + 'description': {'readonly': True}, + 'display_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'geo_region_name': {'key': 'properties.name', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + } + + def __init__(self, *, kind: str=None, **kwargs) -> None: + super(GeoRegion, self).__init__(kind=kind, **kwargs) + self.geo_region_name = None + self.description = None + self.display_name = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/global_csm_sku_description.py b/azure-mgmt-web/azure/mgmt/web/models/global_csm_sku_description.py index c47cd7e4511b..3e360b658faf 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/global_csm_sku_description.py +++ b/azure-mgmt-web/azure/mgmt/web/models/global_csm_sku_description.py @@ -42,12 +42,12 @@ class GlobalCsmSkuDescription(Model): 'capabilities': {'key': 'capabilities', 'type': '[Capability]'}, } - def __init__(self, name=None, tier=None, size=None, family=None, capacity=None, locations=None, capabilities=None): - super(GlobalCsmSkuDescription, self).__init__() - self.name = name - self.tier = tier - self.size = size - self.family = family - self.capacity = capacity - self.locations = locations - self.capabilities = capabilities + def __init__(self, **kwargs): + super(GlobalCsmSkuDescription, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.size = kwargs.get('size', None) + self.family = kwargs.get('family', None) + self.capacity = kwargs.get('capacity', None) + self.locations = kwargs.get('locations', None) + self.capabilities = kwargs.get('capabilities', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/global_csm_sku_description_py3.py b/azure-mgmt-web/azure/mgmt/web/models/global_csm_sku_description_py3.py new file mode 100644 index 000000000000..4ee7bee2a0f0 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/global_csm_sku_description_py3.py @@ -0,0 +1,53 @@ +# 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 msrest.serialization import Model + + +class GlobalCsmSkuDescription(Model): + """A Global SKU Description. + + :param name: Name of the resource SKU. + :type name: str + :param tier: Service Tier of the resource SKU. + :type tier: str + :param size: Size specifier of the resource SKU. + :type size: str + :param family: Family code of the resource SKU. + :type family: str + :param capacity: Min, max, and default scale values of the SKU. + :type capacity: ~azure.mgmt.web.models.SkuCapacity + :param locations: Locations of the SKU. + :type locations: list[str] + :param capabilities: Capabilities of the SKU, e.g., is traffic manager + enabled? + :type capabilities: list[~azure.mgmt.web.models.Capability] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'SkuCapacity'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[Capability]'}, + } + + def __init__(self, *, name: str=None, tier: str=None, size: str=None, family: str=None, capacity=None, locations=None, capabilities=None, **kwargs) -> None: + super(GlobalCsmSkuDescription, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.size = size + self.family = family + self.capacity = capacity + self.locations = locations + self.capabilities = capabilities diff --git a/azure-mgmt-web/azure/mgmt/web/models/handler_mapping.py b/azure-mgmt-web/azure/mgmt/web/models/handler_mapping.py index fd3819684997..842f09c77aa4 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/handler_mapping.py +++ b/azure-mgmt-web/azure/mgmt/web/models/handler_mapping.py @@ -34,8 +34,8 @@ class HandlerMapping(Model): 'arguments': {'key': 'arguments', 'type': 'str'}, } - def __init__(self, extension=None, script_processor=None, arguments=None): - super(HandlerMapping, self).__init__() - self.extension = extension - self.script_processor = script_processor - self.arguments = arguments + def __init__(self, **kwargs): + super(HandlerMapping, self).__init__(**kwargs) + self.extension = kwargs.get('extension', None) + self.script_processor = kwargs.get('script_processor', None) + self.arguments = kwargs.get('arguments', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/handler_mapping_py3.py b/azure-mgmt-web/azure/mgmt/web/models/handler_mapping_py3.py new file mode 100644 index 000000000000..a2facf93b3fa --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/handler_mapping_py3.py @@ -0,0 +1,41 @@ +# 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 msrest.serialization import Model + + +class HandlerMapping(Model): + """The IIS handler mappings used to define which handler processes HTTP + requests with certain extension. + For example, it is used to configure php-cgi.exe process to handle all HTTP + requests with *.php extension. + + :param extension: Requests with this extension will be handled using the + specified FastCGI application. + :type extension: str + :param script_processor: The absolute path to the FastCGI application. + :type script_processor: str + :param arguments: Command-line arguments to be passed to the script + processor. + :type arguments: str + """ + + _attribute_map = { + 'extension': {'key': 'extension', 'type': 'str'}, + 'script_processor': {'key': 'scriptProcessor', 'type': 'str'}, + 'arguments': {'key': 'arguments', 'type': 'str'}, + } + + def __init__(self, *, extension: str=None, script_processor: str=None, arguments: str=None, **kwargs) -> None: + super(HandlerMapping, self).__init__(**kwargs) + self.extension = extension + self.script_processor = script_processor + self.arguments = arguments diff --git a/azure-mgmt-web/azure/mgmt/web/models/host_name.py b/azure-mgmt-web/azure/mgmt/web/models/host_name.py index 3df8649876dd..35dd11a2ff51 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/host_name.py +++ b/azure-mgmt-web/azure/mgmt/web/models/host_name.py @@ -46,11 +46,11 @@ class HostName(Model): 'host_name_type': {'key': 'hostNameType', 'type': 'HostNameType'}, } - def __init__(self, name=None, site_names=None, azure_resource_name=None, azure_resource_type=None, custom_host_name_dns_record_type=None, host_name_type=None): - super(HostName, self).__init__() - self.name = name - self.site_names = site_names - self.azure_resource_name = azure_resource_name - self.azure_resource_type = azure_resource_type - self.custom_host_name_dns_record_type = custom_host_name_dns_record_type - self.host_name_type = host_name_type + def __init__(self, **kwargs): + super(HostName, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.site_names = kwargs.get('site_names', None) + self.azure_resource_name = kwargs.get('azure_resource_name', None) + self.azure_resource_type = kwargs.get('azure_resource_type', None) + self.custom_host_name_dns_record_type = kwargs.get('custom_host_name_dns_record_type', None) + self.host_name_type = kwargs.get('host_name_type', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/host_name_binding.py b/azure-mgmt-web/azure/mgmt/web/models/host_name_binding.py index a494c196dbe6..6d728d0a158b 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/host_name_binding.py +++ b/azure-mgmt-web/azure/mgmt/web/models/host_name_binding.py @@ -75,14 +75,14 @@ class HostNameBinding(ProxyOnlyResource): 'virtual_ip': {'key': 'properties.virtualIP', 'type': 'str'}, } - def __init__(self, kind=None, site_name=None, domain_id=None, azure_resource_name=None, azure_resource_type=None, custom_host_name_dns_record_type=None, host_name_type=None, ssl_state=None, thumbprint=None): - super(HostNameBinding, self).__init__(kind=kind) - self.site_name = site_name - self.domain_id = domain_id - self.azure_resource_name = azure_resource_name - self.azure_resource_type = azure_resource_type - self.custom_host_name_dns_record_type = custom_host_name_dns_record_type - self.host_name_type = host_name_type - self.ssl_state = ssl_state - self.thumbprint = thumbprint + def __init__(self, **kwargs): + super(HostNameBinding, self).__init__(**kwargs) + self.site_name = kwargs.get('site_name', None) + self.domain_id = kwargs.get('domain_id', None) + self.azure_resource_name = kwargs.get('azure_resource_name', None) + self.azure_resource_type = kwargs.get('azure_resource_type', None) + self.custom_host_name_dns_record_type = kwargs.get('custom_host_name_dns_record_type', None) + self.host_name_type = kwargs.get('host_name_type', None) + self.ssl_state = kwargs.get('ssl_state', None) + self.thumbprint = kwargs.get('thumbprint', None) self.virtual_ip = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/host_name_binding_py3.py b/azure-mgmt-web/azure/mgmt/web/models/host_name_binding_py3.py new file mode 100644 index 000000000000..42871a049b24 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/host_name_binding_py3.py @@ -0,0 +1,88 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class HostNameBinding(ProxyOnlyResource): + """A hostname binding object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param site_name: App Service app name. + :type site_name: str + :param domain_id: Fully qualified ARM domain resource URI. + :type domain_id: str + :param azure_resource_name: Azure resource name. + :type azure_resource_name: str + :param azure_resource_type: Azure resource type. Possible values include: + 'Website', 'TrafficManager' + :type azure_resource_type: str or ~azure.mgmt.web.models.AzureResourceType + :param custom_host_name_dns_record_type: Custom DNS record type. Possible + values include: 'CName', 'A' + :type custom_host_name_dns_record_type: str or + ~azure.mgmt.web.models.CustomHostNameDnsRecordType + :param host_name_type: Hostname type. Possible values include: 'Verified', + 'Managed' + :type host_name_type: str or ~azure.mgmt.web.models.HostNameType + :param ssl_state: SSL type. Possible values include: 'Disabled', + 'SniEnabled', 'IpBasedEnabled' + :type ssl_state: str or ~azure.mgmt.web.models.SslState + :param thumbprint: SSL certificate thumbprint + :type thumbprint: str + :ivar virtual_ip: Virtual IP address assigned to the hostname if IP based + SSL is enabled. + :vartype virtual_ip: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'virtual_ip': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'site_name': {'key': 'properties.siteName', 'type': 'str'}, + 'domain_id': {'key': 'properties.domainId', 'type': 'str'}, + 'azure_resource_name': {'key': 'properties.azureResourceName', 'type': 'str'}, + 'azure_resource_type': {'key': 'properties.azureResourceType', 'type': 'AzureResourceType'}, + 'custom_host_name_dns_record_type': {'key': 'properties.customHostNameDnsRecordType', 'type': 'CustomHostNameDnsRecordType'}, + 'host_name_type': {'key': 'properties.hostNameType', 'type': 'HostNameType'}, + 'ssl_state': {'key': 'properties.sslState', 'type': 'SslState'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'virtual_ip': {'key': 'properties.virtualIP', 'type': 'str'}, + } + + def __init__(self, *, kind: str=None, site_name: str=None, domain_id: str=None, azure_resource_name: str=None, azure_resource_type=None, custom_host_name_dns_record_type=None, host_name_type=None, ssl_state=None, thumbprint: str=None, **kwargs) -> None: + super(HostNameBinding, self).__init__(kind=kind, **kwargs) + self.site_name = site_name + self.domain_id = domain_id + self.azure_resource_name = azure_resource_name + self.azure_resource_type = azure_resource_type + self.custom_host_name_dns_record_type = custom_host_name_dns_record_type + self.host_name_type = host_name_type + self.ssl_state = ssl_state + self.thumbprint = thumbprint + self.virtual_ip = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/host_name_py3.py b/azure-mgmt-web/azure/mgmt/web/models/host_name_py3.py new file mode 100644 index 000000000000..7ba3d8375ff2 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/host_name_py3.py @@ -0,0 +1,56 @@ +# 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 msrest.serialization import Model + + +class HostName(Model): + """Details of a hostname derived from a domain. + + :param name: Name of the hostname. + :type name: str + :param site_names: List of apps the hostname is assigned to. This list + will have more than one app only if the hostname is pointing to a Traffic + Manager. + :type site_names: list[str] + :param azure_resource_name: Name of the Azure resource the hostname is + assigned to. If it is assigned to a Traffic Manager then it will be the + Traffic Manager name otherwise it will be the app name. + :type azure_resource_name: str + :param azure_resource_type: Type of the Azure resource the hostname is + assigned to. Possible values include: 'Website', 'TrafficManager' + :type azure_resource_type: str or ~azure.mgmt.web.models.AzureResourceType + :param custom_host_name_dns_record_type: Type of the DNS record. Possible + values include: 'CName', 'A' + :type custom_host_name_dns_record_type: str or + ~azure.mgmt.web.models.CustomHostNameDnsRecordType + :param host_name_type: Type of the hostname. Possible values include: + 'Verified', 'Managed' + :type host_name_type: str or ~azure.mgmt.web.models.HostNameType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'site_names': {'key': 'siteNames', 'type': '[str]'}, + 'azure_resource_name': {'key': 'azureResourceName', 'type': 'str'}, + 'azure_resource_type': {'key': 'azureResourceType', 'type': 'AzureResourceType'}, + 'custom_host_name_dns_record_type': {'key': 'customHostNameDnsRecordType', 'type': 'CustomHostNameDnsRecordType'}, + 'host_name_type': {'key': 'hostNameType', 'type': 'HostNameType'}, + } + + def __init__(self, *, name: str=None, site_names=None, azure_resource_name: str=None, azure_resource_type=None, custom_host_name_dns_record_type=None, host_name_type=None, **kwargs) -> None: + super(HostName, self).__init__(**kwargs) + self.name = name + self.site_names = site_names + self.azure_resource_name = azure_resource_name + self.azure_resource_type = azure_resource_type + self.custom_host_name_dns_record_type = custom_host_name_dns_record_type + self.host_name_type = host_name_type diff --git a/azure-mgmt-web/azure/mgmt/web/models/host_name_ssl_state.py b/azure-mgmt-web/azure/mgmt/web/models/host_name_ssl_state.py index 1a95322cf81e..3b0c32f1f108 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/host_name_ssl_state.py +++ b/azure-mgmt-web/azure/mgmt/web/models/host_name_ssl_state.py @@ -41,11 +41,11 @@ class HostNameSslState(Model): 'host_type': {'key': 'hostType', 'type': 'HostType'}, } - def __init__(self, name=None, ssl_state=None, virtual_ip=None, thumbprint=None, to_update=None, host_type=None): - super(HostNameSslState, self).__init__() - self.name = name - self.ssl_state = ssl_state - self.virtual_ip = virtual_ip - self.thumbprint = thumbprint - self.to_update = to_update - self.host_type = host_type + def __init__(self, **kwargs): + super(HostNameSslState, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.ssl_state = kwargs.get('ssl_state', None) + self.virtual_ip = kwargs.get('virtual_ip', None) + self.thumbprint = kwargs.get('thumbprint', None) + self.to_update = kwargs.get('to_update', None) + self.host_type = kwargs.get('host_type', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/host_name_ssl_state_py3.py b/azure-mgmt-web/azure/mgmt/web/models/host_name_ssl_state_py3.py new file mode 100644 index 000000000000..422e32c25371 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/host_name_ssl_state_py3.py @@ -0,0 +1,51 @@ +# 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 msrest.serialization import Model + + +class HostNameSslState(Model): + """SSL-enabled hostname. + + :param name: Hostname. + :type name: str + :param ssl_state: SSL type. Possible values include: 'Disabled', + 'SniEnabled', 'IpBasedEnabled' + :type ssl_state: str or ~azure.mgmt.web.models.SslState + :param virtual_ip: Virtual IP address assigned to the hostname if IP based + SSL is enabled. + :type virtual_ip: str + :param thumbprint: SSL certificate thumbprint. + :type thumbprint: str + :param to_update: Set to true to update existing hostname. + :type to_update: bool + :param host_type: Indicates whether the hostname is a standard or + repository hostname. Possible values include: 'Standard', 'Repository' + :type host_type: str or ~azure.mgmt.web.models.HostType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'ssl_state': {'key': 'sslState', 'type': 'SslState'}, + 'virtual_ip': {'key': 'virtualIP', 'type': 'str'}, + 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + 'to_update': {'key': 'toUpdate', 'type': 'bool'}, + 'host_type': {'key': 'hostType', 'type': 'HostType'}, + } + + def __init__(self, *, name: str=None, ssl_state=None, virtual_ip: str=None, thumbprint: str=None, to_update: bool=None, host_type=None, **kwargs) -> None: + super(HostNameSslState, self).__init__(**kwargs) + self.name = name + self.ssl_state = ssl_state + self.virtual_ip = virtual_ip + self.thumbprint = thumbprint + self.to_update = to_update + self.host_type = host_type diff --git a/azure-mgmt-web/azure/mgmt/web/models/hosting_environment_deployment_info.py b/azure-mgmt-web/azure/mgmt/web/models/hosting_environment_deployment_info.py index c625f9361fb9..d0d634503293 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/hosting_environment_deployment_info.py +++ b/azure-mgmt-web/azure/mgmt/web/models/hosting_environment_deployment_info.py @@ -26,7 +26,7 @@ class HostingEnvironmentDeploymentInfo(Model): 'location': {'key': 'location', 'type': 'str'}, } - def __init__(self, name=None, location=None): - super(HostingEnvironmentDeploymentInfo, self).__init__() - self.name = name - self.location = location + def __init__(self, **kwargs): + super(HostingEnvironmentDeploymentInfo, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.location = kwargs.get('location', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/hosting_environment_deployment_info_py3.py b/azure-mgmt-web/azure/mgmt/web/models/hosting_environment_deployment_info_py3.py new file mode 100644 index 000000000000..10e6b5a03d4e --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/hosting_environment_deployment_info_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class HostingEnvironmentDeploymentInfo(Model): + """Information needed to create resources on an App Service Environment. + + :param name: Name of the App Service Environment. + :type name: str + :param location: Location of the App Service Environment. + :type location: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, location: str=None, **kwargs) -> None: + super(HostingEnvironmentDeploymentInfo, self).__init__(**kwargs) + self.name = name + self.location = location diff --git a/azure-mgmt-web/azure/mgmt/web/models/hosting_environment_diagnostics.py b/azure-mgmt-web/azure/mgmt/web/models/hosting_environment_diagnostics.py index 648e8704252a..26dc8c283fc7 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/hosting_environment_diagnostics.py +++ b/azure-mgmt-web/azure/mgmt/web/models/hosting_environment_diagnostics.py @@ -26,7 +26,7 @@ class HostingEnvironmentDiagnostics(Model): 'diagnosics_output': {'key': 'diagnosicsOutput', 'type': 'str'}, } - def __init__(self, name=None, diagnosics_output=None): - super(HostingEnvironmentDiagnostics, self).__init__() - self.name = name - self.diagnosics_output = diagnosics_output + def __init__(self, **kwargs): + super(HostingEnvironmentDiagnostics, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.diagnosics_output = kwargs.get('diagnosics_output', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/hosting_environment_diagnostics_py3.py b/azure-mgmt-web/azure/mgmt/web/models/hosting_environment_diagnostics_py3.py new file mode 100644 index 000000000000..35ecd49c8939 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/hosting_environment_diagnostics_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class HostingEnvironmentDiagnostics(Model): + """Diagnostics for an App Service Environment. + + :param name: Name/identifier of the diagnostics. + :type name: str + :param diagnosics_output: Diagnostics output. + :type diagnosics_output: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'diagnosics_output': {'key': 'diagnosicsOutput', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, diagnosics_output: str=None, **kwargs) -> None: + super(HostingEnvironmentDiagnostics, self).__init__(**kwargs) + self.name = name + self.diagnosics_output = diagnosics_output diff --git a/azure-mgmt-web/azure/mgmt/web/models/hosting_environment_profile.py b/azure-mgmt-web/azure/mgmt/web/models/hosting_environment_profile.py index f40f022aba2b..de68d8bc558e 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/hosting_environment_profile.py +++ b/azure-mgmt-web/azure/mgmt/web/models/hosting_environment_profile.py @@ -37,8 +37,8 @@ class HostingEnvironmentProfile(Model): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None): - super(HostingEnvironmentProfile, self).__init__() - self.id = id + def __init__(self, **kwargs): + super(HostingEnvironmentProfile, self).__init__(**kwargs) + self.id = kwargs.get('id', None) self.name = None self.type = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/hosting_environment_profile_py3.py b/azure-mgmt-web/azure/mgmt/web/models/hosting_environment_profile_py3.py new file mode 100644 index 000000000000..1440d596bbdc --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/hosting_environment_profile_py3.py @@ -0,0 +1,44 @@ +# 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 msrest.serialization import Model + + +class HostingEnvironmentProfile(Model): + """Specification for an App Service Environment to use for this resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID of the App Service Environment. + :type id: str + :ivar name: Name of the App Service Environment. + :vartype name: str + :ivar type: Resource type of the App Service Environment. + :vartype type: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(HostingEnvironmentProfile, self).__init__(**kwargs) + self.id = id + self.name = None + self.type = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/http_logs_config.py b/azure-mgmt-web/azure/mgmt/web/models/http_logs_config.py index 95cb408652f5..505bf25e8aab 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/http_logs_config.py +++ b/azure-mgmt-web/azure/mgmt/web/models/http_logs_config.py @@ -27,7 +27,7 @@ class HttpLogsConfig(Model): 'azure_blob_storage': {'key': 'azureBlobStorage', 'type': 'AzureBlobStorageHttpLogsConfig'}, } - def __init__(self, file_system=None, azure_blob_storage=None): - super(HttpLogsConfig, self).__init__() - self.file_system = file_system - self.azure_blob_storage = azure_blob_storage + def __init__(self, **kwargs): + super(HttpLogsConfig, self).__init__(**kwargs) + self.file_system = kwargs.get('file_system', None) + self.azure_blob_storage = kwargs.get('azure_blob_storage', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/http_logs_config_py3.py b/azure-mgmt-web/azure/mgmt/web/models/http_logs_config_py3.py new file mode 100644 index 000000000000..5169867f67c3 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/http_logs_config_py3.py @@ -0,0 +1,33 @@ +# 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 msrest.serialization import Model + + +class HttpLogsConfig(Model): + """Http logs configuration. + + :param file_system: Http logs to file system configuration. + :type file_system: ~azure.mgmt.web.models.FileSystemHttpLogsConfig + :param azure_blob_storage: Http logs to azure blob storage configuration. + :type azure_blob_storage: + ~azure.mgmt.web.models.AzureBlobStorageHttpLogsConfig + """ + + _attribute_map = { + 'file_system': {'key': 'fileSystem', 'type': 'FileSystemHttpLogsConfig'}, + 'azure_blob_storage': {'key': 'azureBlobStorage', 'type': 'AzureBlobStorageHttpLogsConfig'}, + } + + def __init__(self, *, file_system=None, azure_blob_storage=None, **kwargs) -> None: + super(HttpLogsConfig, self).__init__(**kwargs) + self.file_system = file_system + self.azure_blob_storage = azure_blob_storage diff --git a/azure-mgmt-web/azure/mgmt/web/models/hybrid_connection.py b/azure-mgmt-web/azure/mgmt/web/models/hybrid_connection.py index 3f9b259f4082..7397552b22f8 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/hybrid_connection.py +++ b/azure-mgmt-web/azure/mgmt/web/models/hybrid_connection.py @@ -69,13 +69,13 @@ class HybridConnection(ProxyOnlyResource): 'service_bus_suffix': {'key': 'properties.serviceBusSuffix', 'type': 'str'}, } - def __init__(self, kind=None, service_bus_namespace=None, relay_name=None, relay_arm_uri=None, hostname=None, port=None, send_key_name=None, send_key_value=None, service_bus_suffix=None): - super(HybridConnection, self).__init__(kind=kind) - self.service_bus_namespace = service_bus_namespace - self.relay_name = relay_name - self.relay_arm_uri = relay_arm_uri - self.hostname = hostname - self.port = port - self.send_key_name = send_key_name - self.send_key_value = send_key_value - self.service_bus_suffix = service_bus_suffix + def __init__(self, **kwargs): + super(HybridConnection, self).__init__(**kwargs) + self.service_bus_namespace = kwargs.get('service_bus_namespace', None) + self.relay_name = kwargs.get('relay_name', None) + self.relay_arm_uri = kwargs.get('relay_arm_uri', None) + self.hostname = kwargs.get('hostname', None) + self.port = kwargs.get('port', None) + self.send_key_name = kwargs.get('send_key_name', None) + self.send_key_value = kwargs.get('send_key_value', None) + self.service_bus_suffix = kwargs.get('service_bus_suffix', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/hybrid_connection_key.py b/azure-mgmt-web/azure/mgmt/web/models/hybrid_connection_key.py index 6cf7f1f35bff..a0a0b0d9ac2e 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/hybrid_connection_key.py +++ b/azure-mgmt-web/azure/mgmt/web/models/hybrid_connection_key.py @@ -50,7 +50,7 @@ class HybridConnectionKey(ProxyOnlyResource): 'send_key_value': {'key': 'properties.sendKeyValue', 'type': 'str'}, } - def __init__(self, kind=None): - super(HybridConnectionKey, self).__init__(kind=kind) + def __init__(self, **kwargs): + super(HybridConnectionKey, self).__init__(**kwargs) self.send_key_name = None self.send_key_value = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/hybrid_connection_key_py3.py b/azure-mgmt-web/azure/mgmt/web/models/hybrid_connection_key_py3.py new file mode 100644 index 000000000000..7ff958fc2cab --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/hybrid_connection_key_py3.py @@ -0,0 +1,56 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class HybridConnectionKey(ProxyOnlyResource): + """Hybrid Connection key contract. This has the send key name and value for a + Hybrid Connection. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar send_key_name: The name of the send key. + :vartype send_key_name: str + :ivar send_key_value: The value of the send key. + :vartype send_key_value: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'send_key_name': {'readonly': True}, + 'send_key_value': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'send_key_name': {'key': 'properties.sendKeyName', 'type': 'str'}, + 'send_key_value': {'key': 'properties.sendKeyValue', 'type': 'str'}, + } + + def __init__(self, *, kind: str=None, **kwargs) -> None: + super(HybridConnectionKey, self).__init__(kind=kind, **kwargs) + self.send_key_name = None + self.send_key_value = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/hybrid_connection_limits.py b/azure-mgmt-web/azure/mgmt/web/models/hybrid_connection_limits.py index c0a32902b946..60a219ea069a 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/hybrid_connection_limits.py +++ b/azure-mgmt-web/azure/mgmt/web/models/hybrid_connection_limits.py @@ -50,7 +50,7 @@ class HybridConnectionLimits(ProxyOnlyResource): 'maximum': {'key': 'properties.maximum', 'type': 'int'}, } - def __init__(self, kind=None): - super(HybridConnectionLimits, self).__init__(kind=kind) + def __init__(self, **kwargs): + super(HybridConnectionLimits, self).__init__(**kwargs) self.current = None self.maximum = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/hybrid_connection_limits_py3.py b/azure-mgmt-web/azure/mgmt/web/models/hybrid_connection_limits_py3.py new file mode 100644 index 000000000000..b017dc44f31b --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/hybrid_connection_limits_py3.py @@ -0,0 +1,56 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class HybridConnectionLimits(ProxyOnlyResource): + """Hybrid Connection limits contract. This is used to return the plan limits + of Hybrid Connections. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar current: The current number of Hybrid Connections. + :vartype current: int + :ivar maximum: The maximum number of Hybrid Connections allowed. + :vartype maximum: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'current': {'readonly': True}, + 'maximum': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'current': {'key': 'properties.current', 'type': 'int'}, + 'maximum': {'key': 'properties.maximum', 'type': 'int'}, + } + + def __init__(self, *, kind: str=None, **kwargs) -> None: + super(HybridConnectionLimits, self).__init__(kind=kind, **kwargs) + self.current = None + self.maximum = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/hybrid_connection_py3.py b/azure-mgmt-web/azure/mgmt/web/models/hybrid_connection_py3.py new file mode 100644 index 000000000000..4642554b822f --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/hybrid_connection_py3.py @@ -0,0 +1,81 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class HybridConnection(ProxyOnlyResource): + """Hybrid Connection contract. This is used to configure a Hybrid Connection. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param service_bus_namespace: The name of the Service Bus namespace. + :type service_bus_namespace: str + :param relay_name: The name of the Service Bus relay. + :type relay_name: str + :param relay_arm_uri: The ARM URI to the Service Bus relay. + :type relay_arm_uri: str + :param hostname: The hostname of the endpoint. + :type hostname: str + :param port: The port of the endpoint. + :type port: int + :param send_key_name: The name of the Service Bus key which has Send + permissions. This is used to authenticate to Service Bus. + :type send_key_name: str + :param send_key_value: The value of the Service Bus key. This is used to + authenticate to Service Bus. In ARM this key will not be returned + normally, use the POST /listKeys API instead. + :type send_key_value: str + :param service_bus_suffix: The suffix for the service bus endpoint. By + default this is .servicebus.windows.net + :type service_bus_suffix: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'service_bus_namespace': {'key': 'properties.serviceBusNamespace', 'type': 'str'}, + 'relay_name': {'key': 'properties.relayName', 'type': 'str'}, + 'relay_arm_uri': {'key': 'properties.relayArmUri', 'type': 'str'}, + 'hostname': {'key': 'properties.hostname', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'send_key_name': {'key': 'properties.sendKeyName', 'type': 'str'}, + 'send_key_value': {'key': 'properties.sendKeyValue', 'type': 'str'}, + 'service_bus_suffix': {'key': 'properties.serviceBusSuffix', 'type': 'str'}, + } + + def __init__(self, *, kind: str=None, service_bus_namespace: str=None, relay_name: str=None, relay_arm_uri: str=None, hostname: str=None, port: int=None, send_key_name: str=None, send_key_value: str=None, service_bus_suffix: str=None, **kwargs) -> None: + super(HybridConnection, self).__init__(kind=kind, **kwargs) + self.service_bus_namespace = service_bus_namespace + self.relay_name = relay_name + self.relay_arm_uri = relay_arm_uri + self.hostname = hostname + self.port = port + self.send_key_name = send_key_name + self.send_key_value = send_key_value + self.service_bus_suffix = service_bus_suffix diff --git a/azure-mgmt-web/azure/mgmt/web/models/identifier.py b/azure-mgmt-web/azure/mgmt/web/models/identifier.py index e1c7f9e1b847..061636f5e53d 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/identifier.py +++ b/azure-mgmt-web/azure/mgmt/web/models/identifier.py @@ -44,6 +44,6 @@ class Identifier(ProxyOnlyResource): 'identifier_id': {'key': 'properties.id', 'type': 'str'}, } - def __init__(self, kind=None, identifier_id=None): - super(Identifier, self).__init__(kind=kind) - self.identifier_id = identifier_id + def __init__(self, **kwargs): + super(Identifier, self).__init__(**kwargs) + self.identifier_id = kwargs.get('identifier_id', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/identifier_py3.py b/azure-mgmt-web/azure/mgmt/web/models/identifier_py3.py new file mode 100644 index 000000000000..780641f47be0 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/identifier_py3.py @@ -0,0 +1,49 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class Identifier(ProxyOnlyResource): + """A domain specific resource identifier. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param identifier_id: String representation of the identity. + :type identifier_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'identifier_id': {'key': 'properties.id', 'type': 'str'}, + } + + def __init__(self, *, kind: str=None, identifier_id: str=None, **kwargs) -> None: + super(Identifier, self).__init__(kind=kind, **kwargs) + self.identifier_id = identifier_id diff --git a/azure-mgmt-web/azure/mgmt/web/models/ip_security_restriction.py b/azure-mgmt-web/azure/mgmt/web/models/ip_security_restriction.py index de6ad1d3c6ab..5a1b16ba64d4 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/ip_security_restriction.py +++ b/azure-mgmt-web/azure/mgmt/web/models/ip_security_restriction.py @@ -15,7 +15,10 @@ class IpSecurityRestriction(Model): """IP security restriction on an app. - :param ip_address: IP address the security restriction is valid for. + All required parameters must be populated in order to send to Azure. + + :param ip_address: Required. IP address the security restriction is valid + for. :type ip_address: str :param subnet_mask: Subnet mask for the range of IP addresses the restriction is valid for. @@ -31,7 +34,7 @@ class IpSecurityRestriction(Model): 'subnet_mask': {'key': 'subnetMask', 'type': 'str'}, } - def __init__(self, ip_address, subnet_mask=None): - super(IpSecurityRestriction, self).__init__() - self.ip_address = ip_address - self.subnet_mask = subnet_mask + def __init__(self, **kwargs): + super(IpSecurityRestriction, self).__init__(**kwargs) + self.ip_address = kwargs.get('ip_address', None) + self.subnet_mask = kwargs.get('subnet_mask', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/ip_security_restriction_py3.py b/azure-mgmt-web/azure/mgmt/web/models/ip_security_restriction_py3.py new file mode 100644 index 000000000000..1abf651f9978 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/ip_security_restriction_py3.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class IpSecurityRestriction(Model): + """IP security restriction on an app. + + All required parameters must be populated in order to send to Azure. + + :param ip_address: Required. IP address the security restriction is valid + for. + :type ip_address: str + :param subnet_mask: Subnet mask for the range of IP addresses the + restriction is valid for. + :type subnet_mask: str + """ + + _validation = { + 'ip_address': {'required': True}, + } + + _attribute_map = { + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'subnet_mask': {'key': 'subnetMask', 'type': 'str'}, + } + + def __init__(self, *, ip_address: str, subnet_mask: str=None, **kwargs) -> None: + super(IpSecurityRestriction, self).__init__(**kwargs) + self.ip_address = ip_address + self.subnet_mask = subnet_mask diff --git a/azure-mgmt-web/azure/mgmt/web/models/localizable_string.py b/azure-mgmt-web/azure/mgmt/web/models/localizable_string.py index 05f0ad489a22..528d58067000 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/localizable_string.py +++ b/azure-mgmt-web/azure/mgmt/web/models/localizable_string.py @@ -26,7 +26,7 @@ class LocalizableString(Model): 'localized_value': {'key': 'localizedValue', 'type': 'str'}, } - def __init__(self, value=None, localized_value=None): - super(LocalizableString, self).__init__() - self.value = value - self.localized_value = localized_value + def __init__(self, **kwargs): + super(LocalizableString, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.localized_value = kwargs.get('localized_value', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/localizable_string_py3.py b/azure-mgmt-web/azure/mgmt/web/models/localizable_string_py3.py new file mode 100644 index 000000000000..156fcfd26d33 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/localizable_string_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class LocalizableString(Model): + """Localizable string object containing the name and a localized value. + + :param value: Non-localized name. + :type value: str + :param localized_value: Localized name. + :type localized_value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, *, value: str=None, localized_value: str=None, **kwargs) -> None: + super(LocalizableString, self).__init__(**kwargs) + self.value = value + self.localized_value = localized_value diff --git a/azure-mgmt-web/azure/mgmt/web/models/managed_service_identity.py b/azure-mgmt-web/azure/mgmt/web/models/managed_service_identity.py index 1b611d7b49f2..3b89a39c5cc1 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/managed_service_identity.py +++ b/azure-mgmt-web/azure/mgmt/web/models/managed_service_identity.py @@ -18,8 +18,9 @@ class ManagedServiceIdentity(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param type: Type of managed service identity. - :type type: object + :param type: Type of managed service identity. Possible values include: + 'SystemAssigned' + :type type: str or ~azure.mgmt.web.models.ManagedServiceIdentityType :ivar tenant_id: Tenant of managed service identity. :vartype tenant_id: str :ivar principal_id: Principal Id of managed service identity. @@ -32,13 +33,13 @@ class ManagedServiceIdentity(Model): } _attribute_map = { - 'type': {'key': 'type', 'type': 'object'}, + 'type': {'key': 'type', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, 'principal_id': {'key': 'principalId', 'type': 'str'}, } - def __init__(self, type=None): - super(ManagedServiceIdentity, self).__init__() - self.type = type + def __init__(self, **kwargs): + super(ManagedServiceIdentity, self).__init__(**kwargs) + self.type = kwargs.get('type', None) self.tenant_id = None self.principal_id = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/managed_service_identity_py3.py b/azure-mgmt-web/azure/mgmt/web/models/managed_service_identity_py3.py new file mode 100644 index 000000000000..c174551d8f8f --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/managed_service_identity_py3.py @@ -0,0 +1,45 @@ +# 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 msrest.serialization import Model + + +class ManagedServiceIdentity(Model): + """Managed service identity. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param type: Type of managed service identity. Possible values include: + 'SystemAssigned' + :type type: str or ~azure.mgmt.web.models.ManagedServiceIdentityType + :ivar tenant_id: Tenant of managed service identity. + :vartype tenant_id: str + :ivar principal_id: Principal Id of managed service identity. + :vartype principal_id: str + """ + + _validation = { + 'tenant_id': {'readonly': True}, + 'principal_id': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, + } + + def __init__(self, *, type=None, **kwargs) -> None: + super(ManagedServiceIdentity, self).__init__(**kwargs) + self.type = type + self.tenant_id = None + self.principal_id = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/metric_availabilily.py b/azure-mgmt-web/azure/mgmt/web/models/metric_availabilily.py index 7524fb413748..2b6ea5bbedd4 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/metric_availabilily.py +++ b/azure-mgmt-web/azure/mgmt/web/models/metric_availabilily.py @@ -26,7 +26,7 @@ class MetricAvailabilily(Model): 'retention': {'key': 'retention', 'type': 'str'}, } - def __init__(self, time_grain=None, retention=None): - super(MetricAvailabilily, self).__init__() - self.time_grain = time_grain - self.retention = retention + def __init__(self, **kwargs): + super(MetricAvailabilily, self).__init__(**kwargs) + self.time_grain = kwargs.get('time_grain', None) + self.retention = kwargs.get('retention', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/metric_availabilily_py3.py b/azure-mgmt-web/azure/mgmt/web/models/metric_availabilily_py3.py new file mode 100644 index 000000000000..1e9eb6c69e48 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/metric_availabilily_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class MetricAvailabilily(Model): + """Metric availability and retention. + + :param time_grain: Time grain. + :type time_grain: str + :param retention: Retention period for the current time grain. + :type retention: str + """ + + _attribute_map = { + 'time_grain': {'key': 'timeGrain', 'type': 'str'}, + 'retention': {'key': 'retention', 'type': 'str'}, + } + + def __init__(self, *, time_grain: str=None, retention: str=None, **kwargs) -> None: + super(MetricAvailabilily, self).__init__(**kwargs) + self.time_grain = time_grain + self.retention = retention diff --git a/azure-mgmt-web/azure/mgmt/web/models/metric_availability.py b/azure-mgmt-web/azure/mgmt/web/models/metric_availability.py index 36213f96530a..895c406bbbee 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/metric_availability.py +++ b/azure-mgmt-web/azure/mgmt/web/models/metric_availability.py @@ -26,7 +26,7 @@ class MetricAvailability(Model): 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, } - def __init__(self, time_grain=None, blob_duration=None): - super(MetricAvailability, self).__init__() - self.time_grain = time_grain - self.blob_duration = blob_duration + def __init__(self, **kwargs): + super(MetricAvailability, self).__init__(**kwargs) + self.time_grain = kwargs.get('time_grain', None) + self.blob_duration = kwargs.get('blob_duration', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/metric_availability_py3.py b/azure-mgmt-web/azure/mgmt/web/models/metric_availability_py3.py new file mode 100644 index 000000000000..67057c02aa1f --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/metric_availability_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class MetricAvailability(Model): + """Retention policy of a resource metric. + + :param time_grain: + :type time_grain: str + :param blob_duration: + :type blob_duration: str + """ + + _attribute_map = { + 'time_grain': {'key': 'timeGrain', 'type': 'str'}, + 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, + } + + def __init__(self, *, time_grain: str=None, blob_duration: str=None, **kwargs) -> None: + super(MetricAvailability, self).__init__(**kwargs) + self.time_grain = time_grain + self.blob_duration = blob_duration diff --git a/azure-mgmt-web/azure/mgmt/web/models/metric_definition.py b/azure-mgmt-web/azure/mgmt/web/models/metric_definition.py index 2b1ca6a6fcd9..2c9c99bbc3c7 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/metric_definition.py +++ b/azure-mgmt-web/azure/mgmt/web/models/metric_definition.py @@ -63,8 +63,8 @@ class MetricDefinition(ProxyOnlyResource): 'display_name': {'key': 'properties.displayName', 'type': 'str'}, } - def __init__(self, kind=None): - super(MetricDefinition, self).__init__(kind=kind) + def __init__(self, **kwargs): + super(MetricDefinition, self).__init__(**kwargs) self.metric_definition_name = None self.unit = None self.primary_aggregation_type = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/metric_definition_py3.py b/azure-mgmt-web/azure/mgmt/web/models/metric_definition_py3.py new file mode 100644 index 000000000000..e663457691a0 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/metric_definition_py3.py @@ -0,0 +1,72 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class MetricDefinition(ProxyOnlyResource): + """Metadata for a metric. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar metric_definition_name: Name of the metric. + :vartype metric_definition_name: str + :ivar unit: Unit of the metric. + :vartype unit: str + :ivar primary_aggregation_type: Primary aggregation type. + :vartype primary_aggregation_type: str + :ivar metric_availabilities: List of time grains supported for the metric + together with retention period. + :vartype metric_availabilities: + list[~azure.mgmt.web.models.MetricAvailabilily] + :ivar display_name: Friendly name shown in the UI. + :vartype display_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'metric_definition_name': {'readonly': True}, + 'unit': {'readonly': True}, + 'primary_aggregation_type': {'readonly': True}, + 'metric_availabilities': {'readonly': True}, + 'display_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'metric_definition_name': {'key': 'properties.name', 'type': 'str'}, + 'unit': {'key': 'properties.unit', 'type': 'str'}, + 'primary_aggregation_type': {'key': 'properties.primaryAggregationType', 'type': 'str'}, + 'metric_availabilities': {'key': 'properties.metricAvailabilities', 'type': '[MetricAvailabilily]'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + } + + def __init__(self, *, kind: str=None, **kwargs) -> None: + super(MetricDefinition, self).__init__(kind=kind, **kwargs) + self.metric_definition_name = None + self.unit = None + self.primary_aggregation_type = None + self.metric_availabilities = None + self.display_name = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/metric_specification.py b/azure-mgmt-web/azure/mgmt/web/models/metric_specification.py index 5d7b06ad95cf..2238547b4a22 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/metric_specification.py +++ b/azure-mgmt-web/azure/mgmt/web/models/metric_specification.py @@ -65,20 +65,20 @@ class MetricSpecification(Model): 'availabilities': {'key': 'availabilities', 'type': '[MetricAvailability]'}, } - def __init__(self, name=None, display_name=None, display_description=None, unit=None, aggregation_type=None, supports_instance_level_aggregation=None, enable_regional_mdm_account=None, source_mdm_account=None, source_mdm_namespace=None, metric_filter_pattern=None, fill_gap_with_zero=None, is_internal=None, dimensions=None, category=None, availabilities=None): - super(MetricSpecification, self).__init__() - self.name = name - self.display_name = display_name - self.display_description = display_description - self.unit = unit - self.aggregation_type = aggregation_type - self.supports_instance_level_aggregation = supports_instance_level_aggregation - self.enable_regional_mdm_account = enable_regional_mdm_account - self.source_mdm_account = source_mdm_account - self.source_mdm_namespace = source_mdm_namespace - self.metric_filter_pattern = metric_filter_pattern - self.fill_gap_with_zero = fill_gap_with_zero - self.is_internal = is_internal - self.dimensions = dimensions - self.category = category - self.availabilities = availabilities + def __init__(self, **kwargs): + super(MetricSpecification, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.display_description = kwargs.get('display_description', None) + self.unit = kwargs.get('unit', None) + self.aggregation_type = kwargs.get('aggregation_type', None) + self.supports_instance_level_aggregation = kwargs.get('supports_instance_level_aggregation', None) + self.enable_regional_mdm_account = kwargs.get('enable_regional_mdm_account', None) + self.source_mdm_account = kwargs.get('source_mdm_account', None) + self.source_mdm_namespace = kwargs.get('source_mdm_namespace', None) + self.metric_filter_pattern = kwargs.get('metric_filter_pattern', None) + self.fill_gap_with_zero = kwargs.get('fill_gap_with_zero', None) + self.is_internal = kwargs.get('is_internal', None) + self.dimensions = kwargs.get('dimensions', None) + self.category = kwargs.get('category', None) + self.availabilities = kwargs.get('availabilities', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/metric_specification_py3.py b/azure-mgmt-web/azure/mgmt/web/models/metric_specification_py3.py new file mode 100644 index 000000000000..95e68beb7c4e --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/metric_specification_py3.py @@ -0,0 +1,84 @@ +# 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 msrest.serialization import Model + + +class MetricSpecification(Model): + """Definition of a single resource metric. + + :param name: + :type name: str + :param display_name: + :type display_name: str + :param display_description: + :type display_description: str + :param unit: + :type unit: str + :param aggregation_type: + :type aggregation_type: str + :param supports_instance_level_aggregation: + :type supports_instance_level_aggregation: bool + :param enable_regional_mdm_account: + :type enable_regional_mdm_account: bool + :param source_mdm_account: + :type source_mdm_account: str + :param source_mdm_namespace: + :type source_mdm_namespace: str + :param metric_filter_pattern: + :type metric_filter_pattern: str + :param fill_gap_with_zero: + :type fill_gap_with_zero: bool + :param is_internal: + :type is_internal: bool + :param dimensions: + :type dimensions: list[~azure.mgmt.web.models.Dimension] + :param category: + :type category: str + :param availabilities: + :type availabilities: list[~azure.mgmt.web.models.MetricAvailability] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'supports_instance_level_aggregation': {'key': 'supportsInstanceLevelAggregation', 'type': 'bool'}, + 'enable_regional_mdm_account': {'key': 'enableRegionalMdmAccount', 'type': 'bool'}, + 'source_mdm_account': {'key': 'sourceMdmAccount', 'type': 'str'}, + 'source_mdm_namespace': {'key': 'sourceMdmNamespace', 'type': 'str'}, + 'metric_filter_pattern': {'key': 'metricFilterPattern', 'type': 'str'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'is_internal': {'key': 'isInternal', 'type': 'bool'}, + 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, + 'category': {'key': 'category', 'type': 'str'}, + 'availabilities': {'key': 'availabilities', 'type': '[MetricAvailability]'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, display_description: str=None, unit: str=None, aggregation_type: str=None, supports_instance_level_aggregation: bool=None, enable_regional_mdm_account: bool=None, source_mdm_account: str=None, source_mdm_namespace: str=None, metric_filter_pattern: str=None, fill_gap_with_zero: bool=None, is_internal: bool=None, dimensions=None, category: str=None, availabilities=None, **kwargs) -> None: + super(MetricSpecification, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.display_description = display_description + self.unit = unit + self.aggregation_type = aggregation_type + self.supports_instance_level_aggregation = supports_instance_level_aggregation + self.enable_regional_mdm_account = enable_regional_mdm_account + self.source_mdm_account = source_mdm_account + self.source_mdm_namespace = source_mdm_namespace + self.metric_filter_pattern = metric_filter_pattern + self.fill_gap_with_zero = fill_gap_with_zero + self.is_internal = is_internal + self.dimensions = dimensions + self.category = category + self.availabilities = availabilities diff --git a/azure-mgmt-web/azure/mgmt/web/models/migrate_my_sql_request.py b/azure-mgmt-web/azure/mgmt/web/models/migrate_my_sql_request.py index b9a98043e997..92a54e815858 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/migrate_my_sql_request.py +++ b/azure-mgmt-web/azure/mgmt/web/models/migrate_my_sql_request.py @@ -18,6 +18,8 @@ class MigrateMySqlRequest(ProxyOnlyResource): 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 Azure. + :ivar id: Resource Id. :vartype id: str :ivar name: Resource Name. @@ -26,10 +28,11 @@ class MigrateMySqlRequest(ProxyOnlyResource): :type kind: str :ivar type: Resource type. :vartype type: str - :param connection_string: Connection string to the remote MySQL database. + :param connection_string: Required. Connection string to the remote MySQL + database. :type connection_string: str - :param migration_type: The type of migration operation to be done. - Possible values include: 'LocalToRemote', 'RemoteToLocal' + :param migration_type: Required. The type of migration operation to be + done. Possible values include: 'LocalToRemote', 'RemoteToLocal' :type migration_type: str or ~azure.mgmt.web.models.MySqlMigrationType """ @@ -50,7 +53,7 @@ class MigrateMySqlRequest(ProxyOnlyResource): 'migration_type': {'key': 'properties.migrationType', 'type': 'MySqlMigrationType'}, } - def __init__(self, connection_string, migration_type, kind=None): - super(MigrateMySqlRequest, self).__init__(kind=kind) - self.connection_string = connection_string - self.migration_type = migration_type + def __init__(self, **kwargs): + super(MigrateMySqlRequest, self).__init__(**kwargs) + self.connection_string = kwargs.get('connection_string', None) + self.migration_type = kwargs.get('migration_type', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/migrate_my_sql_request_py3.py b/azure-mgmt-web/azure/mgmt/web/models/migrate_my_sql_request_py3.py new file mode 100644 index 000000000000..0e7a4bb80d4f --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/migrate_my_sql_request_py3.py @@ -0,0 +1,59 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class MigrateMySqlRequest(ProxyOnlyResource): + """MySQL migration request. + + 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 Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param connection_string: Required. Connection string to the remote MySQL + database. + :type connection_string: str + :param migration_type: Required. The type of migration operation to be + done. Possible values include: 'LocalToRemote', 'RemoteToLocal' + :type migration_type: str or ~azure.mgmt.web.models.MySqlMigrationType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'connection_string': {'required': True}, + 'migration_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'connection_string': {'key': 'properties.connectionString', 'type': 'str'}, + 'migration_type': {'key': 'properties.migrationType', 'type': 'MySqlMigrationType'}, + } + + def __init__(self, *, connection_string: str, migration_type, kind: str=None, **kwargs) -> None: + super(MigrateMySqlRequest, self).__init__(kind=kind, **kwargs) + self.connection_string = connection_string + self.migration_type = migration_type diff --git a/azure-mgmt-web/azure/mgmt/web/models/migrate_my_sql_status.py b/azure-mgmt-web/azure/mgmt/web/models/migrate_my_sql_status.py index e0842f2b4f33..9970ba240603 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/migrate_my_sql_status.py +++ b/azure-mgmt-web/azure/mgmt/web/models/migrate_my_sql_status.py @@ -55,8 +55,8 @@ class MigrateMySqlStatus(ProxyOnlyResource): 'local_my_sql_enabled': {'key': 'properties.localMySqlEnabled', 'type': 'bool'}, } - def __init__(self, kind=None): - super(MigrateMySqlStatus, self).__init__(kind=kind) + def __init__(self, **kwargs): + super(MigrateMySqlStatus, self).__init__(**kwargs) self.migration_operation_status = None self.operation_id = None self.local_my_sql_enabled = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/migrate_my_sql_status_py3.py b/azure-mgmt-web/azure/mgmt/web/models/migrate_my_sql_status_py3.py new file mode 100644 index 000000000000..df44e15d2cf3 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/migrate_my_sql_status_py3.py @@ -0,0 +1,62 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class MigrateMySqlStatus(ProxyOnlyResource): + """MySQL migration status. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar migration_operation_status: Status of the migration task. Possible + values include: 'InProgress', 'Failed', 'Succeeded', 'TimedOut', 'Created' + :vartype migration_operation_status: str or + ~azure.mgmt.web.models.OperationStatus + :ivar operation_id: Operation ID for the migration task. + :vartype operation_id: str + :ivar local_my_sql_enabled: True if the web app has in app MySql enabled + :vartype local_my_sql_enabled: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'migration_operation_status': {'readonly': True}, + 'operation_id': {'readonly': True}, + 'local_my_sql_enabled': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'migration_operation_status': {'key': 'properties.migrationOperationStatus', 'type': 'OperationStatus'}, + 'operation_id': {'key': 'properties.operationId', 'type': 'str'}, + 'local_my_sql_enabled': {'key': 'properties.localMySqlEnabled', 'type': 'bool'}, + } + + def __init__(self, *, kind: str=None, **kwargs) -> None: + super(MigrateMySqlStatus, self).__init__(kind=kind, **kwargs) + self.migration_operation_status = None + self.operation_id = None + self.local_my_sql_enabled = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/ms_deploy.py b/azure-mgmt-web/azure/mgmt/web/models/ms_deploy.py index 28c4c4594ebd..1a481f2596fc 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/ms_deploy.py +++ b/azure-mgmt-web/azure/mgmt/web/models/ms_deploy.py @@ -72,12 +72,12 @@ class MSDeploy(ProxyOnlyResource): 'app_offline': {'key': 'properties.appOffline', 'type': 'bool'}, } - def __init__(self, kind=None, package_uri=None, connection_string=None, db_type=None, set_parameters_xml_file_uri=None, set_parameters=None, skip_app_data=None, app_offline=None): - super(MSDeploy, self).__init__(kind=kind) - self.package_uri = package_uri - self.connection_string = connection_string - self.db_type = db_type - self.set_parameters_xml_file_uri = set_parameters_xml_file_uri - self.set_parameters = set_parameters - self.skip_app_data = skip_app_data - self.app_offline = app_offline + def __init__(self, **kwargs): + super(MSDeploy, self).__init__(**kwargs) + self.package_uri = kwargs.get('package_uri', None) + self.connection_string = kwargs.get('connection_string', None) + self.db_type = kwargs.get('db_type', None) + self.set_parameters_xml_file_uri = kwargs.get('set_parameters_xml_file_uri', None) + self.set_parameters = kwargs.get('set_parameters', None) + self.skip_app_data = kwargs.get('skip_app_data', None) + self.app_offline = kwargs.get('app_offline', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/ms_deploy_log.py b/azure-mgmt-web/azure/mgmt/web/models/ms_deploy_log.py index df7088ddf559..59b147b5285f 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/ms_deploy_log.py +++ b/azure-mgmt-web/azure/mgmt/web/models/ms_deploy_log.py @@ -45,6 +45,6 @@ class MSDeployLog(ProxyOnlyResource): 'entries': {'key': 'properties.entries', 'type': '[MSDeployLogEntry]'}, } - def __init__(self, kind=None): - super(MSDeployLog, self).__init__(kind=kind) + def __init__(self, **kwargs): + super(MSDeployLog, self).__init__(**kwargs) self.entries = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/ms_deploy_log_entry.py b/azure-mgmt-web/azure/mgmt/web/models/ms_deploy_log_entry.py index 8037d67f531d..0995ed12ee4a 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/ms_deploy_log_entry.py +++ b/azure-mgmt-web/azure/mgmt/web/models/ms_deploy_log_entry.py @@ -39,8 +39,8 @@ class MSDeployLogEntry(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self): - super(MSDeployLogEntry, self).__init__() + def __init__(self, **kwargs): + super(MSDeployLogEntry, self).__init__(**kwargs) self.time = None self.type = None self.message = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/ms_deploy_log_entry_py3.py b/azure-mgmt-web/azure/mgmt/web/models/ms_deploy_log_entry_py3.py new file mode 100644 index 000000000000..5b45f11a6cbb --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/ms_deploy_log_entry_py3.py @@ -0,0 +1,46 @@ +# 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 msrest.serialization import Model + + +class MSDeployLogEntry(Model): + """MSDeploy log entry. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar time: Timestamp of log entry + :vartype time: datetime + :ivar type: Log entry type. Possible values include: 'Message', 'Warning', + 'Error' + :vartype type: str or ~azure.mgmt.web.models.MSDeployLogEntryType + :ivar message: Log entry message + :vartype message: str + """ + + _validation = { + 'time': {'readonly': True}, + 'type': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'time': {'key': 'time', 'type': 'iso-8601'}, + 'type': {'key': 'type', 'type': 'MSDeployLogEntryType'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(MSDeployLogEntry, self).__init__(**kwargs) + self.time = None + self.type = None + self.message = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/ms_deploy_log_py3.py b/azure-mgmt-web/azure/mgmt/web/models/ms_deploy_log_py3.py new file mode 100644 index 000000000000..3790df0e1acd --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/ms_deploy_log_py3.py @@ -0,0 +1,50 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class MSDeployLog(ProxyOnlyResource): + """MSDeploy log. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar entries: List of log entry messages + :vartype entries: list[~azure.mgmt.web.models.MSDeployLogEntry] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'entries': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'entries': {'key': 'properties.entries', 'type': '[MSDeployLogEntry]'}, + } + + def __init__(self, *, kind: str=None, **kwargs) -> None: + super(MSDeployLog, self).__init__(kind=kind, **kwargs) + self.entries = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/ms_deploy_py3.py b/azure-mgmt-web/azure/mgmt/web/models/ms_deploy_py3.py new file mode 100644 index 000000000000..5ad976a830f2 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/ms_deploy_py3.py @@ -0,0 +1,83 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class MSDeploy(ProxyOnlyResource): + """MSDeploy ARM PUT information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param package_uri: Package URI + :type package_uri: str + :param connection_string: SQL Connection String + :type connection_string: str + :param db_type: Database Type + :type db_type: str + :param set_parameters_xml_file_uri: URI of MSDeploy Parameters file. Must + not be set if SetParameters is used. + :type set_parameters_xml_file_uri: str + :param set_parameters: MSDeploy Parameters. Must not be set if + SetParametersXmlFileUri is used. + :type set_parameters: dict[str, str] + :param skip_app_data: Controls whether the MSDeploy operation skips the + App_Data directory. + If set to true, the existing App_Data directory on the + destination + will not be deleted, and any App_Data directory in the source will be + ignored. + Setting is false by default. + :type skip_app_data: bool + :param app_offline: Sets the AppOffline rule while the MSDeploy operation + executes. + Setting is false by default. + :type app_offline: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'package_uri': {'key': 'properties.packageUri', 'type': 'str'}, + 'connection_string': {'key': 'properties.connectionString', 'type': 'str'}, + 'db_type': {'key': 'properties.dbType', 'type': 'str'}, + 'set_parameters_xml_file_uri': {'key': 'properties.setParametersXmlFileUri', 'type': 'str'}, + 'set_parameters': {'key': 'properties.setParameters', 'type': '{str}'}, + 'skip_app_data': {'key': 'properties.skipAppData', 'type': 'bool'}, + 'app_offline': {'key': 'properties.appOffline', 'type': 'bool'}, + } + + def __init__(self, *, kind: str=None, package_uri: str=None, connection_string: str=None, db_type: str=None, set_parameters_xml_file_uri: str=None, set_parameters=None, skip_app_data: bool=None, app_offline: bool=None, **kwargs) -> None: + super(MSDeploy, self).__init__(kind=kind, **kwargs) + self.package_uri = package_uri + self.connection_string = connection_string + self.db_type = db_type + self.set_parameters_xml_file_uri = set_parameters_xml_file_uri + self.set_parameters = set_parameters + self.skip_app_data = skip_app_data + self.app_offline = app_offline diff --git a/azure-mgmt-web/azure/mgmt/web/models/ms_deploy_status.py b/azure-mgmt-web/azure/mgmt/web/models/ms_deploy_status.py index d18f357a754d..eecea2c691af 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/ms_deploy_status.py +++ b/azure-mgmt-web/azure/mgmt/web/models/ms_deploy_status.py @@ -63,8 +63,8 @@ class MSDeployStatus(ProxyOnlyResource): 'complete': {'key': 'properties.complete', 'type': 'bool'}, } - def __init__(self, kind=None): - super(MSDeployStatus, self).__init__(kind=kind) + def __init__(self, **kwargs): + super(MSDeployStatus, self).__init__(**kwargs) self.deployer = None self.provisioning_state = None self.start_time = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/ms_deploy_status_py3.py b/azure-mgmt-web/azure/mgmt/web/models/ms_deploy_status_py3.py new file mode 100644 index 000000000000..6e1c63f8f45a --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/ms_deploy_status_py3.py @@ -0,0 +1,72 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class MSDeployStatus(ProxyOnlyResource): + """MSDeploy ARM response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar deployer: Username of deployer + :vartype deployer: str + :ivar provisioning_state: Provisioning state. Possible values include: + 'accepted', 'running', 'succeeded', 'failed', 'canceled' + :vartype provisioning_state: str or + ~azure.mgmt.web.models.MSDeployProvisioningState + :ivar start_time: Start time of deploy operation + :vartype start_time: datetime + :ivar end_time: End time of deploy operation + :vartype end_time: datetime + :ivar complete: Whether the deployment operation has completed + :vartype complete: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'deployer': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'complete': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'deployer': {'key': 'properties.deployer', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'MSDeployProvisioningState'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'complete': {'key': 'properties.complete', 'type': 'bool'}, + } + + def __init__(self, *, kind: str=None, **kwargs) -> None: + super(MSDeployStatus, self).__init__(kind=kind, **kwargs) + self.deployer = None + self.provisioning_state = None + self.start_time = None + self.end_time = None + self.complete = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/name_identifier.py b/azure-mgmt-web/azure/mgmt/web/models/name_identifier.py index e539125ff5d2..cfc47d475f44 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/name_identifier.py +++ b/azure-mgmt-web/azure/mgmt/web/models/name_identifier.py @@ -23,6 +23,6 @@ class NameIdentifier(Model): 'name': {'key': 'name', 'type': 'str'}, } - def __init__(self, name=None): - super(NameIdentifier, self).__init__() - self.name = name + def __init__(self, **kwargs): + super(NameIdentifier, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/name_identifier_py3.py b/azure-mgmt-web/azure/mgmt/web/models/name_identifier_py3.py new file mode 100644 index 000000000000..5eb7d2fa73f1 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/name_identifier_py3.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class NameIdentifier(Model): + """Identifies an object. + + :param name: Name of the object. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, **kwargs) -> None: + super(NameIdentifier, self).__init__(**kwargs) + self.name = name diff --git a/azure-mgmt-web/azure/mgmt/web/models/name_value_pair.py b/azure-mgmt-web/azure/mgmt/web/models/name_value_pair.py index 649b62089621..c199f066bb33 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/name_value_pair.py +++ b/azure-mgmt-web/azure/mgmt/web/models/name_value_pair.py @@ -26,7 +26,7 @@ class NameValuePair(Model): 'value': {'key': 'value', 'type': 'str'}, } - def __init__(self, name=None, value=None): - super(NameValuePair, self).__init__() - self.name = name - self.value = value + def __init__(self, **kwargs): + super(NameValuePair, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/name_value_pair_py3.py b/azure-mgmt-web/azure/mgmt/web/models/name_value_pair_py3.py new file mode 100644 index 000000000000..5c5ff6300715 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/name_value_pair_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class NameValuePair(Model): + """Name value pair. + + :param name: Pair name. + :type name: str + :param value: Pair value. + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, value: str=None, **kwargs) -> None: + super(NameValuePair, self).__init__(**kwargs) + self.name = name + self.value = value diff --git a/azure-mgmt-web/azure/mgmt/web/models/network_access_control_entry.py b/azure-mgmt-web/azure/mgmt/web/models/network_access_control_entry.py index d6688e09ad4e..2a0409421970 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/network_access_control_entry.py +++ b/azure-mgmt-web/azure/mgmt/web/models/network_access_control_entry.py @@ -32,9 +32,9 @@ class NetworkAccessControlEntry(Model): 'remote_subnet': {'key': 'remoteSubnet', 'type': 'str'}, } - def __init__(self, action=None, description=None, order=None, remote_subnet=None): - super(NetworkAccessControlEntry, self).__init__() - self.action = action - self.description = description - self.order = order - self.remote_subnet = remote_subnet + def __init__(self, **kwargs): + super(NetworkAccessControlEntry, self).__init__(**kwargs) + self.action = kwargs.get('action', None) + self.description = kwargs.get('description', None) + self.order = kwargs.get('order', None) + self.remote_subnet = kwargs.get('remote_subnet', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/network_access_control_entry_py3.py b/azure-mgmt-web/azure/mgmt/web/models/network_access_control_entry_py3.py new file mode 100644 index 000000000000..7bec93865b8a --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/network_access_control_entry_py3.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class NetworkAccessControlEntry(Model): + """Network access control entry. + + :param action: Action object. Possible values include: 'Permit', 'Deny' + :type action: str or ~azure.mgmt.web.models.AccessControlEntryAction + :param description: Description of network access control entry. + :type description: str + :param order: Order of precedence. + :type order: int + :param remote_subnet: Remote subnet. + :type remote_subnet: str + """ + + _attribute_map = { + 'action': {'key': 'action', 'type': 'AccessControlEntryAction'}, + 'description': {'key': 'description', 'type': 'str'}, + 'order': {'key': 'order', 'type': 'int'}, + 'remote_subnet': {'key': 'remoteSubnet', 'type': 'str'}, + } + + def __init__(self, *, action=None, description: str=None, order: int=None, remote_subnet: str=None, **kwargs) -> None: + super(NetworkAccessControlEntry, self).__init__(**kwargs) + self.action = action + self.description = description + self.order = order + self.remote_subnet = remote_subnet diff --git a/azure-mgmt-web/azure/mgmt/web/models/network_features.py b/azure-mgmt-web/azure/mgmt/web/models/network_features.py index 332bde6a2de7..9e6e0472f730 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/network_features.py +++ b/azure-mgmt-web/azure/mgmt/web/models/network_features.py @@ -60,8 +60,8 @@ class NetworkFeatures(ProxyOnlyResource): 'hybrid_connections_v2': {'key': 'properties.hybridConnectionsV2', 'type': '[HybridConnection]'}, } - def __init__(self, kind=None): - super(NetworkFeatures, self).__init__(kind=kind) + def __init__(self, **kwargs): + super(NetworkFeatures, self).__init__(**kwargs) self.virtual_network_name = None self.virtual_network_connection = None self.hybrid_connections = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/network_features_py3.py b/azure-mgmt-web/azure/mgmt/web/models/network_features_py3.py new file mode 100644 index 000000000000..d92b8dbca303 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/network_features_py3.py @@ -0,0 +1,68 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class NetworkFeatures(ProxyOnlyResource): + """Full view of network features for an app (presently VNET integration and + Hybrid Connections). + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar virtual_network_name: The Virtual Network name. + :vartype virtual_network_name: str + :ivar virtual_network_connection: The Virtual Network summary view. + :vartype virtual_network_connection: ~azure.mgmt.web.models.VnetInfo + :ivar hybrid_connections: The Hybrid Connections summary view. + :vartype hybrid_connections: + list[~azure.mgmt.web.models.RelayServiceConnectionEntity] + :ivar hybrid_connections_v2: The Hybrid Connection V2 (Service Bus) view. + :vartype hybrid_connections_v2: + list[~azure.mgmt.web.models.HybridConnection] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'virtual_network_name': {'readonly': True}, + 'virtual_network_connection': {'readonly': True}, + 'hybrid_connections': {'readonly': True}, + 'hybrid_connections_v2': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'virtual_network_name': {'key': 'properties.virtualNetworkName', 'type': 'str'}, + 'virtual_network_connection': {'key': 'properties.virtualNetworkConnection', 'type': 'VnetInfo'}, + 'hybrid_connections': {'key': 'properties.hybridConnections', 'type': '[RelayServiceConnectionEntity]'}, + 'hybrid_connections_v2': {'key': 'properties.hybridConnectionsV2', 'type': '[HybridConnection]'}, + } + + def __init__(self, *, kind: str=None, **kwargs) -> None: + super(NetworkFeatures, self).__init__(kind=kind, **kwargs) + self.virtual_network_name = None + self.virtual_network_connection = None + self.hybrid_connections = None + self.hybrid_connections_v2 = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/operation.py b/azure-mgmt-web/azure/mgmt/web/models/operation.py index 36d0e4253d22..4decbf424068 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/operation.py +++ b/azure-mgmt-web/azure/mgmt/web/models/operation.py @@ -45,13 +45,13 @@ class Operation(Model): 'geo_master_operation_id': {'key': 'geoMasterOperationId', 'type': 'str'}, } - def __init__(self, id=None, name=None, status=None, errors=None, created_time=None, modified_time=None, expiration_time=None, geo_master_operation_id=None): - super(Operation, self).__init__() - self.id = id - self.name = name - self.status = status - self.errors = errors - self.created_time = created_time - self.modified_time = modified_time - self.expiration_time = expiration_time - self.geo_master_operation_id = geo_master_operation_id + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.status = kwargs.get('status', None) + self.errors = kwargs.get('errors', None) + self.created_time = kwargs.get('created_time', None) + self.modified_time = kwargs.get('modified_time', None) + self.expiration_time = kwargs.get('expiration_time', None) + self.geo_master_operation_id = kwargs.get('geo_master_operation_id', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/operation_py3.py b/azure-mgmt-web/azure/mgmt/web/models/operation_py3.py new file mode 100644 index 000000000000..2c22ca4513d3 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/operation_py3.py @@ -0,0 +1,57 @@ +# 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 msrest.serialization import Model + + +class Operation(Model): + """An operation on a resource. + + :param id: Operation ID. + :type id: str + :param name: Operation name. + :type name: str + :param status: The current status of the operation. Possible values + include: 'InProgress', 'Failed', 'Succeeded', 'TimedOut', 'Created' + :type status: str or ~azure.mgmt.web.models.OperationStatus + :param errors: Any errors associate with the operation. + :type errors: list[~azure.mgmt.web.models.ErrorEntity] + :param created_time: Time when operation has started. + :type created_time: datetime + :param modified_time: Time when operation has been updated. + :type modified_time: datetime + :param expiration_time: Time when operation will expire. + :type expiration_time: datetime + :param geo_master_operation_id: Applicable only for stamp operation ids. + :type geo_master_operation_id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'OperationStatus'}, + 'errors': {'key': 'errors', 'type': '[ErrorEntity]'}, + 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, + 'modified_time': {'key': 'modifiedTime', 'type': 'iso-8601'}, + 'expiration_time': {'key': 'expirationTime', 'type': 'iso-8601'}, + 'geo_master_operation_id': {'key': 'geoMasterOperationId', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, name: str=None, status=None, errors=None, created_time=None, modified_time=None, expiration_time=None, geo_master_operation_id: str=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.id = id + self.name = name + self.status = status + self.errors = errors + self.created_time = created_time + self.modified_time = modified_time + self.expiration_time = expiration_time + self.geo_master_operation_id = geo_master_operation_id diff --git a/azure-mgmt-web/azure/mgmt/web/models/perf_mon_response.py b/azure-mgmt-web/azure/mgmt/web/models/perf_mon_response.py index b3e8a5864d52..13b539362a90 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/perf_mon_response.py +++ b/azure-mgmt-web/azure/mgmt/web/models/perf_mon_response.py @@ -29,8 +29,8 @@ class PerfMonResponse(Model): 'data': {'key': 'data', 'type': 'PerfMonSet'}, } - def __init__(self, code=None, message=None, data=None): - super(PerfMonResponse, self).__init__() - self.code = code - self.message = message - self.data = data + def __init__(self, **kwargs): + super(PerfMonResponse, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.data = kwargs.get('data', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/perf_mon_response_py3.py b/azure-mgmt-web/azure/mgmt/web/models/perf_mon_response_py3.py new file mode 100644 index 000000000000..7c4f8a6d6026 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/perf_mon_response_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class PerfMonResponse(Model): + """Performance monitor API response. + + :param code: The response code. + :type code: str + :param message: The message. + :type message: str + :param data: The performance monitor counters. + :type data: ~azure.mgmt.web.models.PerfMonSet + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'data': {'key': 'data', 'type': 'PerfMonSet'}, + } + + def __init__(self, *, code: str=None, message: str=None, data=None, **kwargs) -> None: + super(PerfMonResponse, self).__init__(**kwargs) + self.code = code + self.message = message + self.data = data diff --git a/azure-mgmt-web/azure/mgmt/web/models/perf_mon_sample.py b/azure-mgmt-web/azure/mgmt/web/models/perf_mon_sample.py index bdff69d727cd..59350baef1e9 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/perf_mon_sample.py +++ b/azure-mgmt-web/azure/mgmt/web/models/perf_mon_sample.py @@ -32,9 +32,9 @@ class PerfMonSample(Model): 'core_count': {'key': 'coreCount', 'type': 'int'}, } - def __init__(self, time=None, instance_name=None, value=None, core_count=None): - super(PerfMonSample, self).__init__() - self.time = time - self.instance_name = instance_name - self.value = value - self.core_count = core_count + def __init__(self, **kwargs): + super(PerfMonSample, self).__init__(**kwargs) + self.time = kwargs.get('time', None) + self.instance_name = kwargs.get('instance_name', None) + self.value = kwargs.get('value', None) + self.core_count = kwargs.get('core_count', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/perf_mon_sample_py3.py b/azure-mgmt-web/azure/mgmt/web/models/perf_mon_sample_py3.py new file mode 100644 index 000000000000..ecd677f263f1 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/perf_mon_sample_py3.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class PerfMonSample(Model): + """Performance monitor sample in a set. + + :param time: Point in time for which counter was measured. + :type time: datetime + :param instance_name: Name of the server on which the measurement is made. + :type instance_name: str + :param value: Value of counter at a certain time. + :type value: float + :param core_count: Core Count of worker. Not a data member + :type core_count: int + """ + + _attribute_map = { + 'time': {'key': 'time', 'type': 'iso-8601'}, + 'instance_name': {'key': 'instanceName', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'float'}, + 'core_count': {'key': 'coreCount', 'type': 'int'}, + } + + def __init__(self, *, time=None, instance_name: str=None, value: float=None, core_count: int=None, **kwargs) -> None: + super(PerfMonSample, self).__init__(**kwargs) + self.time = time + self.instance_name = instance_name + self.value = value + self.core_count = core_count diff --git a/azure-mgmt-web/azure/mgmt/web/models/perf_mon_set.py b/azure-mgmt-web/azure/mgmt/web/models/perf_mon_set.py index 6325d0cf6cfd..dc21bb4f164a 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/perf_mon_set.py +++ b/azure-mgmt-web/azure/mgmt/web/models/perf_mon_set.py @@ -35,10 +35,10 @@ class PerfMonSet(Model): 'values': {'key': 'values', 'type': '[PerfMonSample]'}, } - def __init__(self, name=None, start_time=None, end_time=None, time_grain=None, values=None): - super(PerfMonSet, self).__init__() - self.name = name - self.start_time = start_time - self.end_time = end_time - self.time_grain = time_grain - self.values = values + def __init__(self, **kwargs): + super(PerfMonSet, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.time_grain = kwargs.get('time_grain', None) + self.values = kwargs.get('values', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/perf_mon_set_py3.py b/azure-mgmt-web/azure/mgmt/web/models/perf_mon_set_py3.py new file mode 100644 index 000000000000..18e840f54568 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/perf_mon_set_py3.py @@ -0,0 +1,44 @@ +# 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 msrest.serialization import Model + + +class PerfMonSet(Model): + """Metric information. + + :param name: Unique key name of the counter. + :type name: str + :param start_time: Start time of the period. + :type start_time: datetime + :param end_time: End time of the period. + :type end_time: datetime + :param time_grain: Presented time grain. + :type time_grain: str + :param values: Collection of workers that are active during this time. + :type values: list[~azure.mgmt.web.models.PerfMonSample] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'time_grain': {'key': 'timeGrain', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[PerfMonSample]'}, + } + + def __init__(self, *, name: str=None, start_time=None, end_time=None, time_grain: str=None, values=None, **kwargs) -> None: + super(PerfMonSet, self).__init__(**kwargs) + self.name = name + self.start_time = start_time + self.end_time = end_time + self.time_grain = time_grain + self.values = values diff --git a/azure-mgmt-web/azure/mgmt/web/models/premier_add_on.py b/azure-mgmt-web/azure/mgmt/web/models/premier_add_on.py index 7efae4b643eb..443ae16d40e1 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/premier_add_on.py +++ b/azure-mgmt-web/azure/mgmt/web/models/premier_add_on.py @@ -18,13 +18,15 @@ class PremierAddOn(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 Azure. + :ivar id: Resource Id. :vartype id: str :ivar name: Resource Name. :vartype name: str :param kind: Kind of resource. :type kind: str - :param location: Resource Location. + :param location: Required. Resource Location. :type location: str :ivar type: Resource type. :vartype type: str @@ -72,13 +74,13 @@ class PremierAddOn(Resource): 'marketplace_offer': {'key': 'properties.marketplaceOffer', 'type': 'str'}, } - def __init__(self, location, kind=None, tags=None, sku=None, product=None, vendor=None, premier_add_on_name=None, premier_add_on_location=None, premier_add_on_tags=None, marketplace_publisher=None, marketplace_offer=None): - super(PremierAddOn, self).__init__(kind=kind, location=location, tags=tags) - self.sku = sku - self.product = product - self.vendor = vendor - self.premier_add_on_name = premier_add_on_name - self.premier_add_on_location = premier_add_on_location - self.premier_add_on_tags = premier_add_on_tags - self.marketplace_publisher = marketplace_publisher - self.marketplace_offer = marketplace_offer + def __init__(self, **kwargs): + super(PremierAddOn, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.product = kwargs.get('product', None) + self.vendor = kwargs.get('vendor', None) + self.premier_add_on_name = kwargs.get('premier_add_on_name', None) + self.premier_add_on_location = kwargs.get('premier_add_on_location', None) + self.premier_add_on_tags = kwargs.get('premier_add_on_tags', None) + self.marketplace_publisher = kwargs.get('marketplace_publisher', None) + self.marketplace_offer = kwargs.get('marketplace_offer', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/premier_add_on_offer.py b/azure-mgmt-web/azure/mgmt/web/models/premier_add_on_offer.py index 4fb08ec1e518..cbd4e54f5a91 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/premier_add_on_offer.py +++ b/azure-mgmt-web/azure/mgmt/web/models/premier_add_on_offer.py @@ -78,16 +78,16 @@ class PremierAddOnOffer(ProxyOnlyResource): 'marketplace_offer': {'key': 'properties.marketplaceOffer', 'type': 'str'}, } - def __init__(self, kind=None, sku=None, product=None, vendor=None, premier_add_on_offer_name=None, promo_code_required=None, quota=None, web_hosting_plan_restrictions=None, privacy_policy_url=None, legal_terms_url=None, marketplace_publisher=None, marketplace_offer=None): - super(PremierAddOnOffer, self).__init__(kind=kind) - self.sku = sku - self.product = product - self.vendor = vendor - self.premier_add_on_offer_name = premier_add_on_offer_name - self.promo_code_required = promo_code_required - self.quota = quota - self.web_hosting_plan_restrictions = web_hosting_plan_restrictions - self.privacy_policy_url = privacy_policy_url - self.legal_terms_url = legal_terms_url - self.marketplace_publisher = marketplace_publisher - self.marketplace_offer = marketplace_offer + def __init__(self, **kwargs): + super(PremierAddOnOffer, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.product = kwargs.get('product', None) + self.vendor = kwargs.get('vendor', None) + self.premier_add_on_offer_name = kwargs.get('premier_add_on_offer_name', None) + self.promo_code_required = kwargs.get('promo_code_required', None) + self.quota = kwargs.get('quota', None) + self.web_hosting_plan_restrictions = kwargs.get('web_hosting_plan_restrictions', None) + self.privacy_policy_url = kwargs.get('privacy_policy_url', None) + self.legal_terms_url = kwargs.get('legal_terms_url', None) + self.marketplace_publisher = kwargs.get('marketplace_publisher', None) + self.marketplace_offer = kwargs.get('marketplace_offer', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/premier_add_on_offer_py3.py b/azure-mgmt-web/azure/mgmt/web/models/premier_add_on_offer_py3.py new file mode 100644 index 000000000000..05525e85e27c --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/premier_add_on_offer_py3.py @@ -0,0 +1,93 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class PremierAddOnOffer(ProxyOnlyResource): + """Premier add-on offer. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param sku: Premier add on SKU. + :type sku: str + :param product: Premier add on offer Product. + :type product: str + :param vendor: Premier add on offer Vendor. + :type vendor: str + :param premier_add_on_offer_name: Premier add on offer Name. + :type premier_add_on_offer_name: str + :param promo_code_required: true if promotion code is + required; otherwise, false. + :type promo_code_required: bool + :param quota: Premier add on offer Quota. + :type quota: int + :param web_hosting_plan_restrictions: App Service plans this offer is + restricted to. Possible values include: 'None', 'Free', 'Shared', 'Basic', + 'Standard', 'Premium' + :type web_hosting_plan_restrictions: str or + ~azure.mgmt.web.models.AppServicePlanRestrictions + :param privacy_policy_url: Privacy policy URL. + :type privacy_policy_url: str + :param legal_terms_url: Legal terms URL. + :type legal_terms_url: str + :param marketplace_publisher: Marketplace publisher. + :type marketplace_publisher: str + :param marketplace_offer: Marketplace offer. + :type marketplace_offer: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'sku': {'key': 'properties.sku', 'type': 'str'}, + 'product': {'key': 'properties.product', 'type': 'str'}, + 'vendor': {'key': 'properties.vendor', 'type': 'str'}, + 'premier_add_on_offer_name': {'key': 'properties.name', 'type': 'str'}, + 'promo_code_required': {'key': 'properties.promoCodeRequired', 'type': 'bool'}, + 'quota': {'key': 'properties.quota', 'type': 'int'}, + 'web_hosting_plan_restrictions': {'key': 'properties.webHostingPlanRestrictions', 'type': 'AppServicePlanRestrictions'}, + 'privacy_policy_url': {'key': 'properties.privacyPolicyUrl', 'type': 'str'}, + 'legal_terms_url': {'key': 'properties.legalTermsUrl', 'type': 'str'}, + 'marketplace_publisher': {'key': 'properties.marketplacePublisher', 'type': 'str'}, + 'marketplace_offer': {'key': 'properties.marketplaceOffer', 'type': 'str'}, + } + + def __init__(self, *, kind: str=None, sku: str=None, product: str=None, vendor: str=None, premier_add_on_offer_name: str=None, promo_code_required: bool=None, quota: int=None, web_hosting_plan_restrictions=None, privacy_policy_url: str=None, legal_terms_url: str=None, marketplace_publisher: str=None, marketplace_offer: str=None, **kwargs) -> None: + super(PremierAddOnOffer, self).__init__(kind=kind, **kwargs) + self.sku = sku + self.product = product + self.vendor = vendor + self.premier_add_on_offer_name = premier_add_on_offer_name + self.promo_code_required = promo_code_required + self.quota = quota + self.web_hosting_plan_restrictions = web_hosting_plan_restrictions + self.privacy_policy_url = privacy_policy_url + self.legal_terms_url = legal_terms_url + self.marketplace_publisher = marketplace_publisher + self.marketplace_offer = marketplace_offer diff --git a/azure-mgmt-web/azure/mgmt/web/models/premier_add_on_py3.py b/azure-mgmt-web/azure/mgmt/web/models/premier_add_on_py3.py new file mode 100644 index 000000000000..af2b36a1bd19 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/premier_add_on_py3.py @@ -0,0 +1,86 @@ +# 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 .resource import Resource + + +class PremierAddOn(Resource): + """Premier add-on. + + 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 Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param sku: Premier add on SKU. + :type sku: str + :param product: Premier add on Product. + :type product: str + :param vendor: Premier add on Vendor. + :type vendor: str + :param premier_add_on_name: Premier add on Name. + :type premier_add_on_name: str + :param premier_add_on_location: Premier add on Location. + :type premier_add_on_location: str + :param premier_add_on_tags: Premier add on Tags. + :type premier_add_on_tags: dict[str, str] + :param marketplace_publisher: Premier add on Marketplace publisher. + :type marketplace_publisher: str + :param marketplace_offer: Premier add on Marketplace offer. + :type marketplace_offer: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'properties.sku', 'type': 'str'}, + 'product': {'key': 'properties.product', 'type': 'str'}, + 'vendor': {'key': 'properties.vendor', 'type': 'str'}, + 'premier_add_on_name': {'key': 'properties.name', 'type': 'str'}, + 'premier_add_on_location': {'key': 'properties.location', 'type': 'str'}, + 'premier_add_on_tags': {'key': 'properties.tags', 'type': '{str}'}, + 'marketplace_publisher': {'key': 'properties.marketplacePublisher', 'type': 'str'}, + 'marketplace_offer': {'key': 'properties.marketplaceOffer', 'type': 'str'}, + } + + def __init__(self, *, location: str, kind: str=None, tags=None, sku: str=None, product: str=None, vendor: str=None, premier_add_on_name: str=None, premier_add_on_location: str=None, premier_add_on_tags=None, marketplace_publisher: str=None, marketplace_offer: str=None, **kwargs) -> None: + super(PremierAddOn, self).__init__(kind=kind, location=location, tags=tags, **kwargs) + self.sku = sku + self.product = product + self.vendor = vendor + self.premier_add_on_name = premier_add_on_name + self.premier_add_on_location = premier_add_on_location + self.premier_add_on_tags = premier_add_on_tags + self.marketplace_publisher = marketplace_publisher + self.marketplace_offer = marketplace_offer diff --git a/azure-mgmt-web/azure/mgmt/web/models/process_info.py b/azure-mgmt-web/azure/mgmt/web/models/process_info.py index ac9316ca7fb6..51cdae331682 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/process_info.py +++ b/azure-mgmt-web/azure/mgmt/web/models/process_info.py @@ -149,41 +149,41 @@ class ProcessInfo(ProxyOnlyResource): 'description': {'key': 'properties.description', 'type': 'str'}, } - def __init__(self, kind=None, process_info_id=None, process_info_name=None, href=None, mini_dump=None, is_profile_running=None, is_iis_profile_running=None, iis_profile_timeout_in_seconds=None, parent=None, children=None, threads=None, open_file_handles=None, modules=None, file_name=None, command_line=None, user_name=None, handle_count=None, module_count=None, thread_count=None, start_time=None, total_processor_time=None, user_processor_time=None, privileged_processor_time=None, working_set64=None, peak_working_set64=None, private_memory_size64=None, virtual_memory_size64=None, peak_virtual_memory_size64=None, paged_system_memory_size64=None, nonpaged_system_memory_size64=None, paged_memory_size64=None, peak_paged_memory_size64=None, time_stamp=None, environment_variables=None, is_scm_site=None, is_web_job=None, description=None): - super(ProcessInfo, self).__init__(kind=kind) - self.process_info_id = process_info_id - self.process_info_name = process_info_name - self.href = href - self.mini_dump = mini_dump - self.is_profile_running = is_profile_running - self.is_iis_profile_running = is_iis_profile_running - self.iis_profile_timeout_in_seconds = iis_profile_timeout_in_seconds - self.parent = parent - self.children = children - self.threads = threads - self.open_file_handles = open_file_handles - self.modules = modules - self.file_name = file_name - self.command_line = command_line - self.user_name = user_name - self.handle_count = handle_count - self.module_count = module_count - self.thread_count = thread_count - self.start_time = start_time - self.total_processor_time = total_processor_time - self.user_processor_time = user_processor_time - self.privileged_processor_time = privileged_processor_time - self.working_set64 = working_set64 - self.peak_working_set64 = peak_working_set64 - self.private_memory_size64 = private_memory_size64 - self.virtual_memory_size64 = virtual_memory_size64 - self.peak_virtual_memory_size64 = peak_virtual_memory_size64 - self.paged_system_memory_size64 = paged_system_memory_size64 - self.nonpaged_system_memory_size64 = nonpaged_system_memory_size64 - self.paged_memory_size64 = paged_memory_size64 - self.peak_paged_memory_size64 = peak_paged_memory_size64 - self.time_stamp = time_stamp - self.environment_variables = environment_variables - self.is_scm_site = is_scm_site - self.is_web_job = is_web_job - self.description = description + def __init__(self, **kwargs): + super(ProcessInfo, self).__init__(**kwargs) + self.process_info_id = kwargs.get('process_info_id', None) + self.process_info_name = kwargs.get('process_info_name', None) + self.href = kwargs.get('href', None) + self.mini_dump = kwargs.get('mini_dump', None) + self.is_profile_running = kwargs.get('is_profile_running', None) + self.is_iis_profile_running = kwargs.get('is_iis_profile_running', None) + self.iis_profile_timeout_in_seconds = kwargs.get('iis_profile_timeout_in_seconds', None) + self.parent = kwargs.get('parent', None) + self.children = kwargs.get('children', None) + self.threads = kwargs.get('threads', None) + self.open_file_handles = kwargs.get('open_file_handles', None) + self.modules = kwargs.get('modules', None) + self.file_name = kwargs.get('file_name', None) + self.command_line = kwargs.get('command_line', None) + self.user_name = kwargs.get('user_name', None) + self.handle_count = kwargs.get('handle_count', None) + self.module_count = kwargs.get('module_count', None) + self.thread_count = kwargs.get('thread_count', None) + self.start_time = kwargs.get('start_time', None) + self.total_processor_time = kwargs.get('total_processor_time', None) + self.user_processor_time = kwargs.get('user_processor_time', None) + self.privileged_processor_time = kwargs.get('privileged_processor_time', None) + self.working_set64 = kwargs.get('working_set64', None) + self.peak_working_set64 = kwargs.get('peak_working_set64', None) + self.private_memory_size64 = kwargs.get('private_memory_size64', None) + self.virtual_memory_size64 = kwargs.get('virtual_memory_size64', None) + self.peak_virtual_memory_size64 = kwargs.get('peak_virtual_memory_size64', None) + self.paged_system_memory_size64 = kwargs.get('paged_system_memory_size64', None) + self.nonpaged_system_memory_size64 = kwargs.get('nonpaged_system_memory_size64', None) + self.paged_memory_size64 = kwargs.get('paged_memory_size64', None) + self.peak_paged_memory_size64 = kwargs.get('peak_paged_memory_size64', None) + self.time_stamp = kwargs.get('time_stamp', None) + self.environment_variables = kwargs.get('environment_variables', None) + self.is_scm_site = kwargs.get('is_scm_site', None) + self.is_web_job = kwargs.get('is_web_job', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/process_info_py3.py b/azure-mgmt-web/azure/mgmt/web/models/process_info_py3.py new file mode 100644 index 000000000000..709f7a85b71c --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/process_info_py3.py @@ -0,0 +1,189 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class ProcessInfo(ProxyOnlyResource): + """Process Information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param process_info_id: ARM Identifier for deployment. + :type process_info_id: int + :param process_info_name: Deployment name. + :type process_info_name: str + :param href: HRef URI. + :type href: str + :param mini_dump: Minidump URI. + :type mini_dump: str + :param is_profile_running: Is profile running? + :type is_profile_running: bool + :param is_iis_profile_running: Is the IIS Profile running? + :type is_iis_profile_running: bool + :param iis_profile_timeout_in_seconds: IIS Profile timeout (seconds). + :type iis_profile_timeout_in_seconds: float + :param parent: Parent process. + :type parent: str + :param children: Child process list. + :type children: list[str] + :param threads: Thread list. + :type threads: list[~azure.mgmt.web.models.ProcessThreadInfo] + :param open_file_handles: List of open files. + :type open_file_handles: list[str] + :param modules: List of modules. + :type modules: list[~azure.mgmt.web.models.ProcessModuleInfo] + :param file_name: File name of this process. + :type file_name: str + :param command_line: Command line. + :type command_line: str + :param user_name: User name. + :type user_name: str + :param handle_count: Handle count. + :type handle_count: int + :param module_count: Module count. + :type module_count: int + :param thread_count: Thread count. + :type thread_count: int + :param start_time: Start time. + :type start_time: datetime + :param total_processor_time: Total CPU time. + :type total_processor_time: str + :param user_processor_time: User CPU time. + :type user_processor_time: str + :param privileged_processor_time: Privileged CPU time. + :type privileged_processor_time: str + :param working_set64: Working set. + :type working_set64: long + :param peak_working_set64: Peak working set. + :type peak_working_set64: long + :param private_memory_size64: Private memory size. + :type private_memory_size64: long + :param virtual_memory_size64: Virtual memory size. + :type virtual_memory_size64: long + :param peak_virtual_memory_size64: Peak virtual memory usage. + :type peak_virtual_memory_size64: long + :param paged_system_memory_size64: Paged system memory. + :type paged_system_memory_size64: long + :param nonpaged_system_memory_size64: Non-paged system memory. + :type nonpaged_system_memory_size64: long + :param paged_memory_size64: Paged memory. + :type paged_memory_size64: long + :param peak_paged_memory_size64: Peak paged memory. + :type peak_paged_memory_size64: long + :param time_stamp: Time stamp. + :type time_stamp: datetime + :param environment_variables: List of environment variables. + :type environment_variables: dict[str, str] + :param is_scm_site: Is this the SCM site? + :type is_scm_site: bool + :param is_web_job: Is this a Web Job? + :type is_web_job: bool + :param description: Description of process. + :type description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'process_info_id': {'key': 'properties.id', 'type': 'int'}, + 'process_info_name': {'key': 'properties.name', 'type': 'str'}, + 'href': {'key': 'properties.href', 'type': 'str'}, + 'mini_dump': {'key': 'properties.miniDump', 'type': 'str'}, + 'is_profile_running': {'key': 'properties.isProfileRunning', 'type': 'bool'}, + 'is_iis_profile_running': {'key': 'properties.isIisProfileRunning', 'type': 'bool'}, + 'iis_profile_timeout_in_seconds': {'key': 'properties.iisProfileTimeoutInSeconds', 'type': 'float'}, + 'parent': {'key': 'properties.parent', 'type': 'str'}, + 'children': {'key': 'properties.children', 'type': '[str]'}, + 'threads': {'key': 'properties.threads', 'type': '[ProcessThreadInfo]'}, + 'open_file_handles': {'key': 'properties.openFileHandles', 'type': '[str]'}, + 'modules': {'key': 'properties.modules', 'type': '[ProcessModuleInfo]'}, + 'file_name': {'key': 'properties.fileName', 'type': 'str'}, + 'command_line': {'key': 'properties.commandLine', 'type': 'str'}, + 'user_name': {'key': 'properties.userName', 'type': 'str'}, + 'handle_count': {'key': 'properties.handleCount', 'type': 'int'}, + 'module_count': {'key': 'properties.moduleCount', 'type': 'int'}, + 'thread_count': {'key': 'properties.threadCount', 'type': 'int'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'total_processor_time': {'key': 'properties.totalProcessorTime', 'type': 'str'}, + 'user_processor_time': {'key': 'properties.userProcessorTime', 'type': 'str'}, + 'privileged_processor_time': {'key': 'properties.privilegedProcessorTime', 'type': 'str'}, + 'working_set64': {'key': 'properties.workingSet64', 'type': 'long'}, + 'peak_working_set64': {'key': 'properties.peakWorkingSet64', 'type': 'long'}, + 'private_memory_size64': {'key': 'properties.privateMemorySize64', 'type': 'long'}, + 'virtual_memory_size64': {'key': 'properties.virtualMemorySize64', 'type': 'long'}, + 'peak_virtual_memory_size64': {'key': 'properties.peakVirtualMemorySize64', 'type': 'long'}, + 'paged_system_memory_size64': {'key': 'properties.pagedSystemMemorySize64', 'type': 'long'}, + 'nonpaged_system_memory_size64': {'key': 'properties.nonpagedSystemMemorySize64', 'type': 'long'}, + 'paged_memory_size64': {'key': 'properties.pagedMemorySize64', 'type': 'long'}, + 'peak_paged_memory_size64': {'key': 'properties.peakPagedMemorySize64', 'type': 'long'}, + 'time_stamp': {'key': 'properties.timeStamp', 'type': 'iso-8601'}, + 'environment_variables': {'key': 'properties.environmentVariables', 'type': '{str}'}, + 'is_scm_site': {'key': 'properties.isScmSite', 'type': 'bool'}, + 'is_web_job': {'key': 'properties.isWebJob', 'type': 'bool'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, *, kind: str=None, process_info_id: int=None, process_info_name: str=None, href: str=None, mini_dump: str=None, is_profile_running: bool=None, is_iis_profile_running: bool=None, iis_profile_timeout_in_seconds: float=None, parent: str=None, children=None, threads=None, open_file_handles=None, modules=None, file_name: str=None, command_line: str=None, user_name: str=None, handle_count: int=None, module_count: int=None, thread_count: int=None, start_time=None, total_processor_time: str=None, user_processor_time: str=None, privileged_processor_time: str=None, working_set64: int=None, peak_working_set64: int=None, private_memory_size64: int=None, virtual_memory_size64: int=None, peak_virtual_memory_size64: int=None, paged_system_memory_size64: int=None, nonpaged_system_memory_size64: int=None, paged_memory_size64: int=None, peak_paged_memory_size64: int=None, time_stamp=None, environment_variables=None, is_scm_site: bool=None, is_web_job: bool=None, description: str=None, **kwargs) -> None: + super(ProcessInfo, self).__init__(kind=kind, **kwargs) + self.process_info_id = process_info_id + self.process_info_name = process_info_name + self.href = href + self.mini_dump = mini_dump + self.is_profile_running = is_profile_running + self.is_iis_profile_running = is_iis_profile_running + self.iis_profile_timeout_in_seconds = iis_profile_timeout_in_seconds + self.parent = parent + self.children = children + self.threads = threads + self.open_file_handles = open_file_handles + self.modules = modules + self.file_name = file_name + self.command_line = command_line + self.user_name = user_name + self.handle_count = handle_count + self.module_count = module_count + self.thread_count = thread_count + self.start_time = start_time + self.total_processor_time = total_processor_time + self.user_processor_time = user_processor_time + self.privileged_processor_time = privileged_processor_time + self.working_set64 = working_set64 + self.peak_working_set64 = peak_working_set64 + self.private_memory_size64 = private_memory_size64 + self.virtual_memory_size64 = virtual_memory_size64 + self.peak_virtual_memory_size64 = peak_virtual_memory_size64 + self.paged_system_memory_size64 = paged_system_memory_size64 + self.nonpaged_system_memory_size64 = nonpaged_system_memory_size64 + self.paged_memory_size64 = paged_memory_size64 + self.peak_paged_memory_size64 = peak_paged_memory_size64 + self.time_stamp = time_stamp + self.environment_variables = environment_variables + self.is_scm_site = is_scm_site + self.is_web_job = is_web_job + self.description = description diff --git a/azure-mgmt-web/azure/mgmt/web/models/process_module_info.py b/azure-mgmt-web/azure/mgmt/web/models/process_module_info.py index 5607da524700..5a53481499e7 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/process_module_info.py +++ b/azure-mgmt-web/azure/mgmt/web/models/process_module_info.py @@ -75,16 +75,16 @@ class ProcessModuleInfo(ProxyOnlyResource): 'language': {'key': 'properties.language', 'type': 'str'}, } - def __init__(self, kind=None, base_address=None, file_name=None, href=None, file_path=None, module_memory_size=None, file_version=None, file_description=None, product=None, product_version=None, is_debug=None, language=None): - super(ProcessModuleInfo, self).__init__(kind=kind) - self.base_address = base_address - self.file_name = file_name - self.href = href - self.file_path = file_path - self.module_memory_size = module_memory_size - self.file_version = file_version - self.file_description = file_description - self.product = product - self.product_version = product_version - self.is_debug = is_debug - self.language = language + def __init__(self, **kwargs): + super(ProcessModuleInfo, self).__init__(**kwargs) + self.base_address = kwargs.get('base_address', None) + self.file_name = kwargs.get('file_name', None) + self.href = kwargs.get('href', None) + self.file_path = kwargs.get('file_path', None) + self.module_memory_size = kwargs.get('module_memory_size', None) + self.file_version = kwargs.get('file_version', None) + self.file_description = kwargs.get('file_description', None) + self.product = kwargs.get('product', None) + self.product_version = kwargs.get('product_version', None) + self.is_debug = kwargs.get('is_debug', None) + self.language = kwargs.get('language', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/process_module_info_py3.py b/azure-mgmt-web/azure/mgmt/web/models/process_module_info_py3.py new file mode 100644 index 000000000000..2817d31db171 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/process_module_info_py3.py @@ -0,0 +1,90 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class ProcessModuleInfo(ProxyOnlyResource): + """Process Module Information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param base_address: Base address. Used as module identifier in ARM + resource URI. + :type base_address: str + :param file_name: File name. + :type file_name: str + :param href: HRef URI. + :type href: str + :param file_path: File path. + :type file_path: str + :param module_memory_size: Module memory size. + :type module_memory_size: int + :param file_version: File version. + :type file_version: str + :param file_description: File description. + :type file_description: str + :param product: Product name. + :type product: str + :param product_version: Product version. + :type product_version: str + :param is_debug: Is debug? + :type is_debug: bool + :param language: Module language (locale). + :type language: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'base_address': {'key': 'properties.baseAddress', 'type': 'str'}, + 'file_name': {'key': 'properties.fileName', 'type': 'str'}, + 'href': {'key': 'properties.href', 'type': 'str'}, + 'file_path': {'key': 'properties.filePath', 'type': 'str'}, + 'module_memory_size': {'key': 'properties.moduleMemorySize', 'type': 'int'}, + 'file_version': {'key': 'properties.fileVersion', 'type': 'str'}, + 'file_description': {'key': 'properties.fileDescription', 'type': 'str'}, + 'product': {'key': 'properties.product', 'type': 'str'}, + 'product_version': {'key': 'properties.productVersion', 'type': 'str'}, + 'is_debug': {'key': 'properties.isDebug', 'type': 'bool'}, + 'language': {'key': 'properties.language', 'type': 'str'}, + } + + def __init__(self, *, kind: str=None, base_address: str=None, file_name: str=None, href: str=None, file_path: str=None, module_memory_size: int=None, file_version: str=None, file_description: str=None, product: str=None, product_version: str=None, is_debug: bool=None, language: str=None, **kwargs) -> None: + super(ProcessModuleInfo, self).__init__(kind=kind, **kwargs) + self.base_address = base_address + self.file_name = file_name + self.href = href + self.file_path = file_path + self.module_memory_size = module_memory_size + self.file_version = file_version + self.file_description = file_description + self.product = product + self.product_version = product_version + self.is_debug = is_debug + self.language = language diff --git a/azure-mgmt-web/azure/mgmt/web/models/process_thread_info.py b/azure-mgmt-web/azure/mgmt/web/models/process_thread_info.py index e7ba64aafca8..ca254312f6c1 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/process_thread_info.py +++ b/azure-mgmt-web/azure/mgmt/web/models/process_thread_info.py @@ -80,18 +80,18 @@ class ProcessThreadInfo(ProxyOnlyResource): 'wait_reason': {'key': 'properties.waitReason', 'type': 'str'}, } - def __init__(self, kind=None, process_thread_info_id=None, href=None, process=None, start_address=None, current_priority=None, priority_level=None, base_priority=None, start_time=None, total_processor_time=None, user_processor_time=None, priviledged_processor_time=None, state=None, wait_reason=None): - super(ProcessThreadInfo, self).__init__(kind=kind) - self.process_thread_info_id = process_thread_info_id - self.href = href - self.process = process - self.start_address = start_address - self.current_priority = current_priority - self.priority_level = priority_level - self.base_priority = base_priority - self.start_time = start_time - self.total_processor_time = total_processor_time - self.user_processor_time = user_processor_time - self.priviledged_processor_time = priviledged_processor_time - self.state = state - self.wait_reason = wait_reason + def __init__(self, **kwargs): + super(ProcessThreadInfo, self).__init__(**kwargs) + self.process_thread_info_id = kwargs.get('process_thread_info_id', None) + self.href = kwargs.get('href', None) + self.process = kwargs.get('process', None) + self.start_address = kwargs.get('start_address', None) + self.current_priority = kwargs.get('current_priority', None) + self.priority_level = kwargs.get('priority_level', None) + self.base_priority = kwargs.get('base_priority', None) + self.start_time = kwargs.get('start_time', None) + self.total_processor_time = kwargs.get('total_processor_time', None) + self.user_processor_time = kwargs.get('user_processor_time', None) + self.priviledged_processor_time = kwargs.get('priviledged_processor_time', None) + self.state = kwargs.get('state', None) + self.wait_reason = kwargs.get('wait_reason', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/process_thread_info_py3.py b/azure-mgmt-web/azure/mgmt/web/models/process_thread_info_py3.py new file mode 100644 index 000000000000..8f357b9535ae --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/process_thread_info_py3.py @@ -0,0 +1,97 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class ProcessThreadInfo(ProxyOnlyResource): + """Process Thread Information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param process_thread_info_id: ARM Identifier for deployment. + :type process_thread_info_id: int + :param href: HRef URI. + :type href: str + :param process: Process URI. + :type process: str + :param start_address: Start address. + :type start_address: str + :param current_priority: Current thread priority. + :type current_priority: int + :param priority_level: Thread priority level. + :type priority_level: str + :param base_priority: Base priority. + :type base_priority: int + :param start_time: Start time. + :type start_time: datetime + :param total_processor_time: Total processor time. + :type total_processor_time: str + :param user_processor_time: User processor time. + :type user_processor_time: str + :param priviledged_processor_time: Priviledged processor time. + :type priviledged_processor_time: str + :param state: Thread state. + :type state: str + :param wait_reason: Wait reason. + :type wait_reason: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'process_thread_info_id': {'key': 'properties.id', 'type': 'int'}, + 'href': {'key': 'properties.href', 'type': 'str'}, + 'process': {'key': 'properties.process', 'type': 'str'}, + 'start_address': {'key': 'properties.startAddress', 'type': 'str'}, + 'current_priority': {'key': 'properties.currentPriority', 'type': 'int'}, + 'priority_level': {'key': 'properties.priorityLevel', 'type': 'str'}, + 'base_priority': {'key': 'properties.basePriority', 'type': 'int'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'total_processor_time': {'key': 'properties.totalProcessorTime', 'type': 'str'}, + 'user_processor_time': {'key': 'properties.userProcessorTime', 'type': 'str'}, + 'priviledged_processor_time': {'key': 'properties.priviledgedProcessorTime', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'wait_reason': {'key': 'properties.waitReason', 'type': 'str'}, + } + + def __init__(self, *, kind: str=None, process_thread_info_id: int=None, href: str=None, process: str=None, start_address: str=None, current_priority: int=None, priority_level: str=None, base_priority: int=None, start_time=None, total_processor_time: str=None, user_processor_time: str=None, priviledged_processor_time: str=None, state: str=None, wait_reason: str=None, **kwargs) -> None: + super(ProcessThreadInfo, self).__init__(kind=kind, **kwargs) + self.process_thread_info_id = process_thread_info_id + self.href = href + self.process = process + self.start_address = start_address + self.current_priority = current_priority + self.priority_level = priority_level + self.base_priority = base_priority + self.start_time = start_time + self.total_processor_time = total_processor_time + self.user_processor_time = user_processor_time + self.priviledged_processor_time = priviledged_processor_time + self.state = state + self.wait_reason = wait_reason diff --git a/azure-mgmt-web/azure/mgmt/web/models/proxy_only_resource.py b/azure-mgmt-web/azure/mgmt/web/models/proxy_only_resource.py index 0a2fbf5b4f9d..88ed8c60bc89 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/proxy_only_resource.py +++ b/azure-mgmt-web/azure/mgmt/web/models/proxy_only_resource.py @@ -42,9 +42,9 @@ class ProxyOnlyResource(Model): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, kind=None): - super(ProxyOnlyResource, self).__init__() + def __init__(self, **kwargs): + super(ProxyOnlyResource, self).__init__(**kwargs) self.id = None self.name = None - self.kind = kind + self.kind = kwargs.get('kind', None) self.type = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/proxy_only_resource_py3.py b/azure-mgmt-web/azure/mgmt/web/models/proxy_only_resource_py3.py new file mode 100644 index 000000000000..a5566fb3e5fa --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/proxy_only_resource_py3.py @@ -0,0 +1,50 @@ +# 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 msrest.serialization import Model + + +class ProxyOnlyResource(Model): + """Azure proxy only resource. This resource is not tracked by Azure Resource + Manager. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, kind: str=None, **kwargs) -> None: + super(ProxyOnlyResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.kind = kind + self.type = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/public_certificate.py b/azure-mgmt-web/azure/mgmt/web/models/public_certificate.py index d58a48285391..effb23e18695 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/public_certificate.py +++ b/azure-mgmt-web/azure/mgmt/web/models/public_certificate.py @@ -53,8 +53,8 @@ class PublicCertificate(ProxyOnlyResource): 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, } - def __init__(self, kind=None, blob=None, public_certificate_location=None): - super(PublicCertificate, self).__init__(kind=kind) - self.blob = blob - self.public_certificate_location = public_certificate_location + def __init__(self, **kwargs): + super(PublicCertificate, self).__init__(**kwargs) + self.blob = kwargs.get('blob', None) + self.public_certificate_location = kwargs.get('public_certificate_location', None) self.thumbprint = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/public_certificate_py3.py b/azure-mgmt-web/azure/mgmt/web/models/public_certificate_py3.py new file mode 100644 index 000000000000..98272971a0c5 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/public_certificate_py3.py @@ -0,0 +1,60 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class PublicCertificate(ProxyOnlyResource): + """Public certificate object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param blob: Public Certificate byte array + :type blob: bytearray + :param public_certificate_location: Public Certificate Location. Possible + values include: 'CurrentUserMy', 'LocalMachineMy', 'Unknown' + :type public_certificate_location: str or + ~azure.mgmt.web.models.PublicCertificateLocation + :ivar thumbprint: Certificate Thumbprint + :vartype thumbprint: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'thumbprint': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'blob': {'key': 'properties.blob', 'type': 'bytearray'}, + 'public_certificate_location': {'key': 'properties.publicCertificateLocation', 'type': 'PublicCertificateLocation'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + } + + def __init__(self, *, kind: str=None, blob: bytearray=None, public_certificate_location=None, **kwargs) -> None: + super(PublicCertificate, self).__init__(kind=kind, **kwargs) + self.blob = blob + self.public_certificate_location = public_certificate_location + self.thumbprint = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/push_settings.py b/azure-mgmt-web/azure/mgmt/web/models/push_settings.py index 9c89aa6540ca..acb3cad6ac63 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/push_settings.py +++ b/azure-mgmt-web/azure/mgmt/web/models/push_settings.py @@ -18,6 +18,8 @@ class PushSettings(ProxyOnlyResource): 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 Azure. + :ivar id: Resource Id. :vartype id: str :ivar name: Resource Name. @@ -26,8 +28,8 @@ class PushSettings(ProxyOnlyResource): :type kind: str :ivar type: Resource type. :vartype type: str - :param is_push_enabled: Gets or sets a flag indicating whether the Push - endpoint is enabled. + :param is_push_enabled: Required. Gets or sets a flag indicating whether + the Push endpoint is enabled. :type is_push_enabled: bool :param tag_whitelist_json: Gets or sets a JSON string containing a list of tags that are whitelisted for use by the push registration endpoint. @@ -63,9 +65,9 @@ class PushSettings(ProxyOnlyResource): 'dynamic_tags_json': {'key': 'properties.dynamicTagsJson', 'type': 'str'}, } - def __init__(self, is_push_enabled, kind=None, tag_whitelist_json=None, tags_requiring_auth=None, dynamic_tags_json=None): - super(PushSettings, self).__init__(kind=kind) - self.is_push_enabled = is_push_enabled - self.tag_whitelist_json = tag_whitelist_json - self.tags_requiring_auth = tags_requiring_auth - self.dynamic_tags_json = dynamic_tags_json + def __init__(self, **kwargs): + super(PushSettings, self).__init__(**kwargs) + self.is_push_enabled = kwargs.get('is_push_enabled', None) + self.tag_whitelist_json = kwargs.get('tag_whitelist_json', None) + self.tags_requiring_auth = kwargs.get('tags_requiring_auth', None) + self.dynamic_tags_json = kwargs.get('dynamic_tags_json', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/push_settings_py3.py b/azure-mgmt-web/azure/mgmt/web/models/push_settings_py3.py new file mode 100644 index 000000000000..4f2c135d15c7 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/push_settings_py3.py @@ -0,0 +1,73 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class PushSettings(ProxyOnlyResource): + """Push settings for the 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 Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param is_push_enabled: Required. Gets or sets a flag indicating whether + the Push endpoint is enabled. + :type is_push_enabled: bool + :param tag_whitelist_json: Gets or sets a JSON string containing a list of + tags that are whitelisted for use by the push registration endpoint. + :type tag_whitelist_json: str + :param tags_requiring_auth: Gets or sets a JSON string containing a list + of tags that require user authentication to be used in the push + registration endpoint. + Tags can consist of alphanumeric characters and the following: + '_', '@', '#', '.', ':', '-'. + Validation should be performed at the PushRequestHandler. + :type tags_requiring_auth: str + :param dynamic_tags_json: Gets or sets a JSON string containing a list of + dynamic tags that will be evaluated from user claims in the push + registration endpoint. + :type dynamic_tags_json: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'is_push_enabled': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'is_push_enabled': {'key': 'properties.isPushEnabled', 'type': 'bool'}, + 'tag_whitelist_json': {'key': 'properties.tagWhitelistJson', 'type': 'str'}, + 'tags_requiring_auth': {'key': 'properties.tagsRequiringAuth', 'type': 'str'}, + 'dynamic_tags_json': {'key': 'properties.dynamicTagsJson', 'type': 'str'}, + } + + def __init__(self, *, is_push_enabled: bool, kind: str=None, tag_whitelist_json: str=None, tags_requiring_auth: str=None, dynamic_tags_json: str=None, **kwargs) -> None: + super(PushSettings, self).__init__(kind=kind, **kwargs) + self.is_push_enabled = is_push_enabled + self.tag_whitelist_json = tag_whitelist_json + self.tags_requiring_auth = tags_requiring_auth + self.dynamic_tags_json = dynamic_tags_json diff --git a/azure-mgmt-web/azure/mgmt/web/models/ramp_up_rule.py b/azure-mgmt-web/azure/mgmt/web/models/ramp_up_rule.py index ea9c98a44b32..beac73be59d5 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/ramp_up_rule.py +++ b/azure-mgmt-web/azure/mgmt/web/models/ramp_up_rule.py @@ -60,13 +60,13 @@ class RampUpRule(Model): 'name': {'key': 'name', 'type': 'str'}, } - def __init__(self, action_host_name=None, reroute_percentage=None, change_step=None, change_interval_in_minutes=None, min_reroute_percentage=None, max_reroute_percentage=None, change_decision_callback_url=None, name=None): - super(RampUpRule, self).__init__() - self.action_host_name = action_host_name - self.reroute_percentage = reroute_percentage - self.change_step = change_step - self.change_interval_in_minutes = change_interval_in_minutes - self.min_reroute_percentage = min_reroute_percentage - self.max_reroute_percentage = max_reroute_percentage - self.change_decision_callback_url = change_decision_callback_url - self.name = name + def __init__(self, **kwargs): + super(RampUpRule, self).__init__(**kwargs) + self.action_host_name = kwargs.get('action_host_name', None) + self.reroute_percentage = kwargs.get('reroute_percentage', None) + self.change_step = kwargs.get('change_step', None) + self.change_interval_in_minutes = kwargs.get('change_interval_in_minutes', None) + self.min_reroute_percentage = kwargs.get('min_reroute_percentage', None) + self.max_reroute_percentage = kwargs.get('max_reroute_percentage', None) + self.change_decision_callback_url = kwargs.get('change_decision_callback_url', None) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/ramp_up_rule_py3.py b/azure-mgmt-web/azure/mgmt/web/models/ramp_up_rule_py3.py new file mode 100644 index 000000000000..224fea9b4023 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/ramp_up_rule_py3.py @@ -0,0 +1,72 @@ +# 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 msrest.serialization import Model + + +class RampUpRule(Model): + """Routing rules for ramp up testing. This rule allows to redirect static + traffic % to a slot or to gradually change routing % based on performance. + + :param action_host_name: Hostname of a slot to which the traffic will be + redirected if decided to. E.g. myapp-stage.azurewebsites.net. + :type action_host_name: str + :param reroute_percentage: Percentage of the traffic which will be + redirected to ActionHostName. + :type reroute_percentage: float + :param change_step: In auto ramp up scenario this is the step to to + add/remove from ReroutePercentage until it reaches + MinReroutePercentage or MaxReroutePercentage. + Site metrics are checked every N minutes specificed in + ChangeIntervalInMinutes. + Custom decision algorithm can be provided in TiPCallback site extension + which URL can be specified in ChangeDecisionCallbackUrl. + :type change_step: float + :param change_interval_in_minutes: Specifies interval in mimuntes to + reevaluate ReroutePercentage. + :type change_interval_in_minutes: int + :param min_reroute_percentage: Specifies lower boundary above which + ReroutePercentage will stay. + :type min_reroute_percentage: float + :param max_reroute_percentage: Specifies upper boundary below which + ReroutePercentage will stay. + :type max_reroute_percentage: float + :param change_decision_callback_url: Custom decision algorithm can be + provided in TiPCallback site extension which URL can be specified. See + TiPCallback site extension for the scaffold and contracts. + https://www.siteextensions.net/packages/TiPCallback/ + :type change_decision_callback_url: str + :param name: Name of the routing rule. The recommended name would be to + point to the slot which will receive the traffic in the experiment. + :type name: str + """ + + _attribute_map = { + 'action_host_name': {'key': 'actionHostName', 'type': 'str'}, + 'reroute_percentage': {'key': 'reroutePercentage', 'type': 'float'}, + 'change_step': {'key': 'changeStep', 'type': 'float'}, + 'change_interval_in_minutes': {'key': 'changeIntervalInMinutes', 'type': 'int'}, + 'min_reroute_percentage': {'key': 'minReroutePercentage', 'type': 'float'}, + 'max_reroute_percentage': {'key': 'maxReroutePercentage', 'type': 'float'}, + 'change_decision_callback_url': {'key': 'changeDecisionCallbackUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, action_host_name: str=None, reroute_percentage: float=None, change_step: float=None, change_interval_in_minutes: int=None, min_reroute_percentage: float=None, max_reroute_percentage: float=None, change_decision_callback_url: str=None, name: str=None, **kwargs) -> None: + super(RampUpRule, self).__init__(**kwargs) + self.action_host_name = action_host_name + self.reroute_percentage = reroute_percentage + self.change_step = change_step + self.change_interval_in_minutes = change_interval_in_minutes + self.min_reroute_percentage = min_reroute_percentage + self.max_reroute_percentage = max_reroute_percentage + self.change_decision_callback_url = change_decision_callback_url + self.name = name diff --git a/azure-mgmt-web/azure/mgmt/web/models/recommendation.py b/azure-mgmt-web/azure/mgmt/web/models/recommendation.py index f53222b7f41d..060828030b7f 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/recommendation.py +++ b/azure-mgmt-web/azure/mgmt/web/models/recommendation.py @@ -9,12 +9,23 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model +from .proxy_only_resource import ProxyOnlyResource -class Recommendation(Model): +class Recommendation(ProxyOnlyResource): """Represents a recommendation result generated by the recommendation engine. + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str :param creation_time: Timestamp when this instance was created. :type creation_time: datetime :param recommendation_id: A GUID value that each recommendation object is @@ -74,50 +85,60 @@ class Recommendation(Model): :type forward_link: str """ + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + _attribute_map = { - 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, - 'recommendation_id': {'key': 'recommendationId', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'resource_scope': {'key': 'resourceScope', 'type': 'str'}, - 'rule_name': {'key': 'ruleName', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'level': {'key': 'level', 'type': 'NotificationLevel'}, - 'channels': {'key': 'channels', 'type': 'Channels'}, - 'tags': {'key': 'tags', 'type': '[str]'}, - 'action_name': {'key': 'actionName', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, - 'next_notification_time': {'key': 'nextNotificationTime', 'type': 'iso-8601'}, - 'notification_expiration_time': {'key': 'notificationExpirationTime', 'type': 'iso-8601'}, - 'notified_time': {'key': 'notifiedTime', 'type': 'iso-8601'}, - 'score': {'key': 'score', 'type': 'float'}, - 'is_dynamic': {'key': 'isDynamic', 'type': 'bool'}, - 'extension_name': {'key': 'extensionName', 'type': 'str'}, - 'blade_name': {'key': 'bladeName', 'type': 'str'}, - 'forward_link': {'key': 'forwardLink', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'recommendation_id': {'key': 'properties.recommendationId', 'type': 'str'}, + 'resource_id': {'key': 'properties.resourceId', 'type': 'str'}, + 'resource_scope': {'key': 'properties.resourceScope', 'type': 'str'}, + 'rule_name': {'key': 'properties.ruleName', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'message': {'key': 'properties.message', 'type': 'str'}, + 'level': {'key': 'properties.level', 'type': 'NotificationLevel'}, + 'channels': {'key': 'properties.channels', 'type': 'Channels'}, + 'tags': {'key': 'properties.tags', 'type': '[str]'}, + 'action_name': {'key': 'properties.actionName', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'next_notification_time': {'key': 'properties.nextNotificationTime', 'type': 'iso-8601'}, + 'notification_expiration_time': {'key': 'properties.notificationExpirationTime', 'type': 'iso-8601'}, + 'notified_time': {'key': 'properties.notifiedTime', 'type': 'iso-8601'}, + 'score': {'key': 'properties.score', 'type': 'float'}, + 'is_dynamic': {'key': 'properties.isDynamic', 'type': 'bool'}, + 'extension_name': {'key': 'properties.extensionName', 'type': 'str'}, + 'blade_name': {'key': 'properties.bladeName', 'type': 'str'}, + 'forward_link': {'key': 'properties.forwardLink', 'type': 'str'}, } - def __init__(self, creation_time=None, recommendation_id=None, resource_id=None, resource_scope=None, rule_name=None, display_name=None, message=None, level=None, channels=None, tags=None, action_name=None, start_time=None, end_time=None, next_notification_time=None, notification_expiration_time=None, notified_time=None, score=None, is_dynamic=None, extension_name=None, blade_name=None, forward_link=None): - super(Recommendation, self).__init__() - self.creation_time = creation_time - self.recommendation_id = recommendation_id - self.resource_id = resource_id - self.resource_scope = resource_scope - self.rule_name = rule_name - self.display_name = display_name - self.message = message - self.level = level - self.channels = channels - self.tags = tags - self.action_name = action_name - self.start_time = start_time - self.end_time = end_time - self.next_notification_time = next_notification_time - self.notification_expiration_time = notification_expiration_time - self.notified_time = notified_time - self.score = score - self.is_dynamic = is_dynamic - self.extension_name = extension_name - self.blade_name = blade_name - self.forward_link = forward_link + def __init__(self, **kwargs): + super(Recommendation, self).__init__(**kwargs) + self.creation_time = kwargs.get('creation_time', None) + self.recommendation_id = kwargs.get('recommendation_id', None) + self.resource_id = kwargs.get('resource_id', None) + self.resource_scope = kwargs.get('resource_scope', None) + self.rule_name = kwargs.get('rule_name', None) + self.display_name = kwargs.get('display_name', None) + self.message = kwargs.get('message', None) + self.level = kwargs.get('level', None) + self.channels = kwargs.get('channels', None) + self.tags = kwargs.get('tags', None) + self.action_name = kwargs.get('action_name', None) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.next_notification_time = kwargs.get('next_notification_time', None) + self.notification_expiration_time = kwargs.get('notification_expiration_time', None) + self.notified_time = kwargs.get('notified_time', None) + self.score = kwargs.get('score', None) + self.is_dynamic = kwargs.get('is_dynamic', None) + self.extension_name = kwargs.get('extension_name', None) + self.blade_name = kwargs.get('blade_name', None) + self.forward_link = kwargs.get('forward_link', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/recommendation_paged.py b/azure-mgmt-web/azure/mgmt/web/models/recommendation_paged.py new file mode 100644 index 000000000000..2eaf7b6d2ebd --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/recommendation_paged.py @@ -0,0 +1,27 @@ +# 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 msrest.paging import Paged + + +class RecommendationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Recommendation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Recommendation]'} + } + + def __init__(self, *args, **kwargs): + + super(RecommendationPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-web/azure/mgmt/web/models/recommendation_py3.py b/azure-mgmt-web/azure/mgmt/web/models/recommendation_py3.py new file mode 100644 index 000000000000..b95f51e0900d --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/recommendation_py3.py @@ -0,0 +1,144 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class Recommendation(ProxyOnlyResource): + """Represents a recommendation result generated by the recommendation engine. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param creation_time: Timestamp when this instance was created. + :type creation_time: datetime + :param recommendation_id: A GUID value that each recommendation object is + associated with. + :type recommendation_id: str + :param resource_id: Full ARM resource ID string that this recommendation + object is associated with. + :type resource_id: str + :param resource_scope: Name of a resource type this recommendation + applies, e.g. Subscription, ServerFarm, Site. Possible values include: + 'ServerFarm', 'Subscription', 'WebSite' + :type resource_scope: str or ~azure.mgmt.web.models.ResourceScopeType + :param rule_name: Unique name of the rule. + :type rule_name: str + :param display_name: UI friendly name of the rule (may not be unique). + :type display_name: str + :param message: Recommendation text. + :type message: str + :param level: Level indicating how critical this recommendation can + impact. Possible values include: 'Critical', 'Warning', 'Information', + 'NonUrgentSuggestion' + :type level: str or ~azure.mgmt.web.models.NotificationLevel + :param channels: List of channels that this recommendation can apply. + Possible values include: 'Notification', 'Api', 'Email', 'Webhook', 'All' + :type channels: str or ~azure.mgmt.web.models.Channels + :param tags: The list of category tags that this recommendation belongs + to. + :type tags: list[str] + :param action_name: Name of action recommended by this object. + :type action_name: str + :param start_time: The beginning time in UTC of a range that the + recommendation refers to. + :type start_time: datetime + :param end_time: The end time in UTC of a range that the recommendation + refers to. + :type end_time: datetime + :param next_notification_time: When to notify this recommendation next in + UTC. Null means that this will never be notified anymore. + :type next_notification_time: datetime + :param notification_expiration_time: Date and time in UTC when this + notification expires. + :type notification_expiration_time: datetime + :param notified_time: Last timestamp in UTC this instance was actually + notified. Null means that this recommendation hasn't been notified yet. + :type notified_time: datetime + :param score: A metric value measured by the rule. + :type score: float + :param is_dynamic: True if this is associated with a dynamically added + rule + :type is_dynamic: bool + :param extension_name: Extension name of the portal if exists. + :type extension_name: str + :param blade_name: Deep link to a blade on the portal. + :type blade_name: str + :param forward_link: Forward link to an external document associated with + the rule. + :type forward_link: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'recommendation_id': {'key': 'properties.recommendationId', 'type': 'str'}, + 'resource_id': {'key': 'properties.resourceId', 'type': 'str'}, + 'resource_scope': {'key': 'properties.resourceScope', 'type': 'str'}, + 'rule_name': {'key': 'properties.ruleName', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'message': {'key': 'properties.message', 'type': 'str'}, + 'level': {'key': 'properties.level', 'type': 'NotificationLevel'}, + 'channels': {'key': 'properties.channels', 'type': 'Channels'}, + 'tags': {'key': 'properties.tags', 'type': '[str]'}, + 'action_name': {'key': 'properties.actionName', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'next_notification_time': {'key': 'properties.nextNotificationTime', 'type': 'iso-8601'}, + 'notification_expiration_time': {'key': 'properties.notificationExpirationTime', 'type': 'iso-8601'}, + 'notified_time': {'key': 'properties.notifiedTime', 'type': 'iso-8601'}, + 'score': {'key': 'properties.score', 'type': 'float'}, + 'is_dynamic': {'key': 'properties.isDynamic', 'type': 'bool'}, + 'extension_name': {'key': 'properties.extensionName', 'type': 'str'}, + 'blade_name': {'key': 'properties.bladeName', 'type': 'str'}, + 'forward_link': {'key': 'properties.forwardLink', 'type': 'str'}, + } + + def __init__(self, *, kind: str=None, creation_time=None, recommendation_id: str=None, resource_id: str=None, resource_scope=None, rule_name: str=None, display_name: str=None, message: str=None, level=None, channels=None, tags=None, action_name: str=None, start_time=None, end_time=None, next_notification_time=None, notification_expiration_time=None, notified_time=None, score: float=None, is_dynamic: bool=None, extension_name: str=None, blade_name: str=None, forward_link: str=None, **kwargs) -> None: + super(Recommendation, self).__init__(kind=kind, **kwargs) + self.creation_time = creation_time + self.recommendation_id = recommendation_id + self.resource_id = resource_id + self.resource_scope = resource_scope + self.rule_name = rule_name + self.display_name = display_name + self.message = message + self.level = level + self.channels = channels + self.tags = tags + self.action_name = action_name + self.start_time = start_time + self.end_time = end_time + self.next_notification_time = next_notification_time + self.notification_expiration_time = notification_expiration_time + self.notified_time = notified_time + self.score = score + self.is_dynamic = is_dynamic + self.extension_name = extension_name + self.blade_name = blade_name + self.forward_link = forward_link diff --git a/azure-mgmt-web/azure/mgmt/web/models/recommendation_rule.py b/azure-mgmt-web/azure/mgmt/web/models/recommendation_rule.py index d8e666053a44..09d8a19b874f 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/recommendation_rule.py +++ b/azure-mgmt-web/azure/mgmt/web/models/recommendation_rule.py @@ -9,15 +9,26 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model +from .proxy_only_resource import ProxyOnlyResource -class RecommendationRule(Model): +class RecommendationRule(ProxyOnlyResource): """Represents a recommendation rule that the recommendation engine can perform. - :param name: Unique name of the rule. - :type name: str + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param recommendation_rule_name: Unique name of the rule. + :type recommendation_rule_name: str :param display_name: UI friendly name of the rule. :type display_name: str :param message: Localized name of the rule (Good for UI). @@ -54,34 +65,44 @@ class RecommendationRule(Model): :type forward_link: str """ + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'recommendation_id': {'key': 'recommendationId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'action_name': {'key': 'actionName', 'type': 'str'}, - 'level': {'key': 'level', 'type': 'NotificationLevel'}, - 'channels': {'key': 'channels', 'type': 'Channels'}, - 'tags': {'key': 'tags', 'type': '[str]'}, - 'is_dynamic': {'key': 'isDynamic', 'type': 'bool'}, - 'extension_name': {'key': 'extensionName', 'type': 'str'}, - 'blade_name': {'key': 'bladeName', 'type': 'str'}, - 'forward_link': {'key': 'forwardLink', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'recommendation_rule_name': {'key': 'properties.name', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'message': {'key': 'properties.message', 'type': 'str'}, + 'recommendation_id': {'key': 'properties.recommendationId', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'action_name': {'key': 'properties.actionName', 'type': 'str'}, + 'level': {'key': 'properties.level', 'type': 'NotificationLevel'}, + 'channels': {'key': 'properties.channels', 'type': 'Channels'}, + 'tags': {'key': 'properties.tags', 'type': '[str]'}, + 'is_dynamic': {'key': 'properties.isDynamic', 'type': 'bool'}, + 'extension_name': {'key': 'properties.extensionName', 'type': 'str'}, + 'blade_name': {'key': 'properties.bladeName', 'type': 'str'}, + 'forward_link': {'key': 'properties.forwardLink', 'type': 'str'}, } - def __init__(self, name=None, display_name=None, message=None, recommendation_id=None, description=None, action_name=None, level=None, channels=None, tags=None, is_dynamic=None, extension_name=None, blade_name=None, forward_link=None): - super(RecommendationRule, self).__init__() - self.name = name - self.display_name = display_name - self.message = message - self.recommendation_id = recommendation_id - self.description = description - self.action_name = action_name - self.level = level - self.channels = channels - self.tags = tags - self.is_dynamic = is_dynamic - self.extension_name = extension_name - self.blade_name = blade_name - self.forward_link = forward_link + def __init__(self, **kwargs): + super(RecommendationRule, self).__init__(**kwargs) + self.recommendation_rule_name = kwargs.get('recommendation_rule_name', None) + self.display_name = kwargs.get('display_name', None) + self.message = kwargs.get('message', None) + self.recommendation_id = kwargs.get('recommendation_id', None) + self.description = kwargs.get('description', None) + self.action_name = kwargs.get('action_name', None) + self.level = kwargs.get('level', None) + self.channels = kwargs.get('channels', None) + self.tags = kwargs.get('tags', None) + self.is_dynamic = kwargs.get('is_dynamic', None) + self.extension_name = kwargs.get('extension_name', None) + self.blade_name = kwargs.get('blade_name', None) + self.forward_link = kwargs.get('forward_link', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/recommendation_rule_py3.py b/azure-mgmt-web/azure/mgmt/web/models/recommendation_rule_py3.py new file mode 100644 index 000000000000..2214a32a0c3a --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/recommendation_rule_py3.py @@ -0,0 +1,108 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class RecommendationRule(ProxyOnlyResource): + """Represents a recommendation rule that the recommendation engine can + perform. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param recommendation_rule_name: Unique name of the rule. + :type recommendation_rule_name: str + :param display_name: UI friendly name of the rule. + :type display_name: str + :param message: Localized name of the rule (Good for UI). + :type message: str + :param recommendation_id: Recommendation ID of an associated + recommendation object tied to the rule, if exists. + If such an object doesn't exist, it is set to null. + :type recommendation_id: str + :param description: Localized detailed description of the rule. + :type description: str + :param action_name: Name of action that is recommended by this rule in + string. + :type action_name: str + :param level: Level of impact indicating how critical this rule is. + Possible values include: 'Critical', 'Warning', 'Information', + 'NonUrgentSuggestion' + :type level: str or ~azure.mgmt.web.models.NotificationLevel + :param channels: List of available channels that this rule applies. + Possible values include: 'Notification', 'Api', 'Email', 'Webhook', 'All' + :type channels: str or ~azure.mgmt.web.models.Channels + :param tags: An array of category tags that the rule contains. + :type tags: list[str] + :param is_dynamic: True if this is associated with a dynamically added + rule + :type is_dynamic: bool + :param extension_name: Extension name of the portal if exists. Applicable + to dynamic rule only. + :type extension_name: str + :param blade_name: Deep link to a blade on the portal. Applicable to + dynamic rule only. + :type blade_name: str + :param forward_link: Forward link to an external document associated with + the rule. Applicable to dynamic rule only. + :type forward_link: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'recommendation_rule_name': {'key': 'properties.name', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'message': {'key': 'properties.message', 'type': 'str'}, + 'recommendation_id': {'key': 'properties.recommendationId', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'action_name': {'key': 'properties.actionName', 'type': 'str'}, + 'level': {'key': 'properties.level', 'type': 'NotificationLevel'}, + 'channels': {'key': 'properties.channels', 'type': 'Channels'}, + 'tags': {'key': 'properties.tags', 'type': '[str]'}, + 'is_dynamic': {'key': 'properties.isDynamic', 'type': 'bool'}, + 'extension_name': {'key': 'properties.extensionName', 'type': 'str'}, + 'blade_name': {'key': 'properties.bladeName', 'type': 'str'}, + 'forward_link': {'key': 'properties.forwardLink', 'type': 'str'}, + } + + def __init__(self, *, kind: str=None, recommendation_rule_name: str=None, display_name: str=None, message: str=None, recommendation_id: str=None, description: str=None, action_name: str=None, level=None, channels=None, tags=None, is_dynamic: bool=None, extension_name: str=None, blade_name: str=None, forward_link: str=None, **kwargs) -> None: + super(RecommendationRule, self).__init__(kind=kind, **kwargs) + self.recommendation_rule_name = recommendation_rule_name + self.display_name = display_name + self.message = message + self.recommendation_id = recommendation_id + self.description = description + self.action_name = action_name + self.level = level + self.channels = channels + self.tags = tags + self.is_dynamic = is_dynamic + self.extension_name = extension_name + self.blade_name = blade_name + self.forward_link = forward_link diff --git a/azure-mgmt-web/azure/mgmt/web/models/reissue_certificate_order_request.py b/azure-mgmt-web/azure/mgmt/web/models/reissue_certificate_order_request.py index 3f7713649730..d2748321940a 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/reissue_certificate_order_request.py +++ b/azure-mgmt-web/azure/mgmt/web/models/reissue_certificate_order_request.py @@ -55,9 +55,9 @@ class ReissueCertificateOrderRequest(ProxyOnlyResource): 'is_private_key_external': {'key': 'properties.isPrivateKeyExternal', 'type': 'bool'}, } - def __init__(self, kind=None, key_size=None, delay_existing_revoke_in_hours=None, csr=None, is_private_key_external=None): - super(ReissueCertificateOrderRequest, self).__init__(kind=kind) - self.key_size = key_size - self.delay_existing_revoke_in_hours = delay_existing_revoke_in_hours - self.csr = csr - self.is_private_key_external = is_private_key_external + def __init__(self, **kwargs): + super(ReissueCertificateOrderRequest, self).__init__(**kwargs) + self.key_size = kwargs.get('key_size', None) + self.delay_existing_revoke_in_hours = kwargs.get('delay_existing_revoke_in_hours', None) + self.csr = kwargs.get('csr', None) + self.is_private_key_external = kwargs.get('is_private_key_external', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/reissue_certificate_order_request_py3.py b/azure-mgmt-web/azure/mgmt/web/models/reissue_certificate_order_request_py3.py new file mode 100644 index 000000000000..6165ad54b1e9 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/reissue_certificate_order_request_py3.py @@ -0,0 +1,63 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class ReissueCertificateOrderRequest(ProxyOnlyResource): + """Class representing certificate reissue request. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param key_size: Certificate Key Size. + :type key_size: int + :param delay_existing_revoke_in_hours: Delay in hours to revoke existing + certificate after the new certificate is issued. + :type delay_existing_revoke_in_hours: int + :param csr: Csr to be used for re-key operation. + :type csr: str + :param is_private_key_external: Should we change the ASC type (from + managed private key to external private key and vice versa). + :type is_private_key_external: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'key_size': {'key': 'properties.keySize', 'type': 'int'}, + 'delay_existing_revoke_in_hours': {'key': 'properties.delayExistingRevokeInHours', 'type': 'int'}, + 'csr': {'key': 'properties.csr', 'type': 'str'}, + 'is_private_key_external': {'key': 'properties.isPrivateKeyExternal', 'type': 'bool'}, + } + + def __init__(self, *, kind: str=None, key_size: int=None, delay_existing_revoke_in_hours: int=None, csr: str=None, is_private_key_external: bool=None, **kwargs) -> None: + super(ReissueCertificateOrderRequest, self).__init__(kind=kind, **kwargs) + self.key_size = key_size + self.delay_existing_revoke_in_hours = delay_existing_revoke_in_hours + self.csr = csr + self.is_private_key_external = is_private_key_external diff --git a/azure-mgmt-web/azure/mgmt/web/models/relay_service_connection_entity.py b/azure-mgmt-web/azure/mgmt/web/models/relay_service_connection_entity.py index a3dcf67f25c0..d67437d392e4 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/relay_service_connection_entity.py +++ b/azure-mgmt-web/azure/mgmt/web/models/relay_service_connection_entity.py @@ -62,12 +62,12 @@ class RelayServiceConnectionEntity(ProxyOnlyResource): 'biztalk_uri': {'key': 'properties.biztalkUri', 'type': 'str'}, } - def __init__(self, kind=None, entity_name=None, entity_connection_string=None, resource_type=None, resource_connection_string=None, hostname=None, port=None, biztalk_uri=None): - super(RelayServiceConnectionEntity, self).__init__(kind=kind) - self.entity_name = entity_name - self.entity_connection_string = entity_connection_string - self.resource_type = resource_type - self.resource_connection_string = resource_connection_string - self.hostname = hostname - self.port = port - self.biztalk_uri = biztalk_uri + def __init__(self, **kwargs): + super(RelayServiceConnectionEntity, self).__init__(**kwargs) + self.entity_name = kwargs.get('entity_name', None) + self.entity_connection_string = kwargs.get('entity_connection_string', None) + self.resource_type = kwargs.get('resource_type', None) + self.resource_connection_string = kwargs.get('resource_connection_string', None) + self.hostname = kwargs.get('hostname', None) + self.port = kwargs.get('port', None) + self.biztalk_uri = kwargs.get('biztalk_uri', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/relay_service_connection_entity_py3.py b/azure-mgmt-web/azure/mgmt/web/models/relay_service_connection_entity_py3.py new file mode 100644 index 000000000000..ed75adcfce04 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/relay_service_connection_entity_py3.py @@ -0,0 +1,73 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class RelayServiceConnectionEntity(ProxyOnlyResource): + """Hybrid Connection for an App Service app. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param entity_name: + :type entity_name: str + :param entity_connection_string: + :type entity_connection_string: str + :param resource_type: + :type resource_type: str + :param resource_connection_string: + :type resource_connection_string: str + :param hostname: + :type hostname: str + :param port: + :type port: int + :param biztalk_uri: + :type biztalk_uri: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'entity_name': {'key': 'properties.entityName', 'type': 'str'}, + 'entity_connection_string': {'key': 'properties.entityConnectionString', 'type': 'str'}, + 'resource_type': {'key': 'properties.resourceType', 'type': 'str'}, + 'resource_connection_string': {'key': 'properties.resourceConnectionString', 'type': 'str'}, + 'hostname': {'key': 'properties.hostname', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'biztalk_uri': {'key': 'properties.biztalkUri', 'type': 'str'}, + } + + def __init__(self, *, kind: str=None, entity_name: str=None, entity_connection_string: str=None, resource_type: str=None, resource_connection_string: str=None, hostname: str=None, port: int=None, biztalk_uri: str=None, **kwargs) -> None: + super(RelayServiceConnectionEntity, self).__init__(kind=kind, **kwargs) + self.entity_name = entity_name + self.entity_connection_string = entity_connection_string + self.resource_type = resource_type + self.resource_connection_string = resource_connection_string + self.hostname = hostname + self.port = port + self.biztalk_uri = biztalk_uri diff --git a/azure-mgmt-web/azure/mgmt/web/models/rendering.py b/azure-mgmt-web/azure/mgmt/web/models/rendering.py new file mode 100644 index 000000000000..3cf7f498121e --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/rendering.py @@ -0,0 +1,38 @@ +# 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 msrest.serialization import Model + + +class Rendering(Model): + """Instructions for rendering the data. + + :param rendering_type: Rendering Type. Possible values include: 'NoGraph', + 'Table', 'TimeSeries', 'TimeSeriesPerInstance' + :type rendering_type: str or ~azure.mgmt.web.models.RenderingType + :param title: Title of data + :type title: str + :param description: Description of the data that will help it be + interpreted + :type description: str + """ + + _attribute_map = { + 'rendering_type': {'key': 'renderingType', 'type': 'RenderingType'}, + 'title': {'key': 'title', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Rendering, self).__init__(**kwargs) + self.rendering_type = kwargs.get('rendering_type', None) + self.title = kwargs.get('title', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/rendering_py3.py b/azure-mgmt-web/azure/mgmt/web/models/rendering_py3.py new file mode 100644 index 000000000000..df9a5069f91f --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/rendering_py3.py @@ -0,0 +1,38 @@ +# 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 msrest.serialization import Model + + +class Rendering(Model): + """Instructions for rendering the data. + + :param rendering_type: Rendering Type. Possible values include: 'NoGraph', + 'Table', 'TimeSeries', 'TimeSeriesPerInstance' + :type rendering_type: str or ~azure.mgmt.web.models.RenderingType + :param title: Title of data + :type title: str + :param description: Description of the data that will help it be + interpreted + :type description: str + """ + + _attribute_map = { + 'rendering_type': {'key': 'renderingType', 'type': 'RenderingType'}, + 'title': {'key': 'title', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, rendering_type=None, title: str=None, description: str=None, **kwargs) -> None: + super(Rendering, self).__init__(**kwargs) + self.rendering_type = rendering_type + self.title = title + self.description = description diff --git a/azure-mgmt-web/azure/mgmt/web/models/renew_certificate_order_request.py b/azure-mgmt-web/azure/mgmt/web/models/renew_certificate_order_request.py index db5bb60f35b3..c7de239be427 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/renew_certificate_order_request.py +++ b/azure-mgmt-web/azure/mgmt/web/models/renew_certificate_order_request.py @@ -51,8 +51,8 @@ class RenewCertificateOrderRequest(ProxyOnlyResource): 'is_private_key_external': {'key': 'properties.isPrivateKeyExternal', 'type': 'bool'}, } - def __init__(self, kind=None, key_size=None, csr=None, is_private_key_external=None): - super(RenewCertificateOrderRequest, self).__init__(kind=kind) - self.key_size = key_size - self.csr = csr - self.is_private_key_external = is_private_key_external + def __init__(self, **kwargs): + super(RenewCertificateOrderRequest, self).__init__(**kwargs) + self.key_size = kwargs.get('key_size', None) + self.csr = kwargs.get('csr', None) + self.is_private_key_external = kwargs.get('is_private_key_external', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/renew_certificate_order_request_py3.py b/azure-mgmt-web/azure/mgmt/web/models/renew_certificate_order_request_py3.py new file mode 100644 index 000000000000..7d4c6ae5e94c --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/renew_certificate_order_request_py3.py @@ -0,0 +1,58 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class RenewCertificateOrderRequest(ProxyOnlyResource): + """Class representing certificate renew request. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param key_size: Certificate Key Size. + :type key_size: int + :param csr: Csr to be used for re-key operation. + :type csr: str + :param is_private_key_external: Should we change the ASC type (from + managed private key to external private key and vice versa). + :type is_private_key_external: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'key_size': {'key': 'properties.keySize', 'type': 'int'}, + 'csr': {'key': 'properties.csr', 'type': 'str'}, + 'is_private_key_external': {'key': 'properties.isPrivateKeyExternal', 'type': 'bool'}, + } + + def __init__(self, *, kind: str=None, key_size: int=None, csr: str=None, is_private_key_external: bool=None, **kwargs) -> None: + super(RenewCertificateOrderRequest, self).__init__(kind=kind, **kwargs) + self.key_size = key_size + self.csr = csr + self.is_private_key_external = is_private_key_external diff --git a/azure-mgmt-web/azure/mgmt/web/models/requests_based_trigger.py b/azure-mgmt-web/azure/mgmt/web/models/requests_based_trigger.py index 9452b8342824..ce0c0e4a16f7 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/requests_based_trigger.py +++ b/azure-mgmt-web/azure/mgmt/web/models/requests_based_trigger.py @@ -26,7 +26,7 @@ class RequestsBasedTrigger(Model): 'time_interval': {'key': 'timeInterval', 'type': 'str'}, } - def __init__(self, count=None, time_interval=None): - super(RequestsBasedTrigger, self).__init__() - self.count = count - self.time_interval = time_interval + def __init__(self, **kwargs): + super(RequestsBasedTrigger, self).__init__(**kwargs) + self.count = kwargs.get('count', None) + self.time_interval = kwargs.get('time_interval', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/requests_based_trigger_py3.py b/azure-mgmt-web/azure/mgmt/web/models/requests_based_trigger_py3.py new file mode 100644 index 000000000000..a729212c6372 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/requests_based_trigger_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class RequestsBasedTrigger(Model): + """Trigger based on total requests. + + :param count: Request Count. + :type count: int + :param time_interval: Time interval. + :type time_interval: str + """ + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + 'time_interval': {'key': 'timeInterval', 'type': 'str'}, + } + + def __init__(self, *, count: int=None, time_interval: str=None, **kwargs) -> None: + super(RequestsBasedTrigger, self).__init__(**kwargs) + self.count = count + self.time_interval = time_interval diff --git a/azure-mgmt-web/azure/mgmt/web/models/resource.py b/azure-mgmt-web/azure/mgmt/web/models/resource.py index 0f01dbf64c7c..cadebebdd489 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/resource.py +++ b/azure-mgmt-web/azure/mgmt/web/models/resource.py @@ -18,13 +18,15 @@ class Resource(Model): 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 Azure. + :ivar id: Resource Id. :vartype id: str :ivar name: Resource Name. :vartype name: str :param kind: Kind of resource. :type kind: str - :param location: Resource Location. + :param location: Required. Resource Location. :type location: str :ivar type: Resource type. :vartype type: str @@ -48,11 +50,11 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, location, kind=None, tags=None): - super(Resource, self).__init__() + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) self.id = None self.name = None - self.kind = kind - self.location = location + self.kind = kwargs.get('kind', None) + self.location = kwargs.get('location', None) self.type = None - self.tags = tags + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/resource_health_metadata.py b/azure-mgmt-web/azure/mgmt/web/models/resource_health_metadata.py new file mode 100644 index 000000000000..0c6c14f68dc4 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/resource_health_metadata.py @@ -0,0 +1,54 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class ResourceHealthMetadata(ProxyOnlyResource): + """Used for getting ResourceHealthCheck settings. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param category: The category that the resource matches in the RHC Policy + File + :type category: str + :param signal_availability: Is there a health signal for the resource + :type signal_availability: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'category': {'key': 'properties.category', 'type': 'str'}, + 'signal_availability': {'key': 'properties.signalAvailability', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(ResourceHealthMetadata, self).__init__(**kwargs) + self.category = kwargs.get('category', None) + self.signal_availability = kwargs.get('signal_availability', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/resource_health_metadata_paged.py b/azure-mgmt-web/azure/mgmt/web/models/resource_health_metadata_paged.py new file mode 100644 index 000000000000..45c9b8c4945b --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/resource_health_metadata_paged.py @@ -0,0 +1,27 @@ +# 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 msrest.paging import Paged + + +class ResourceHealthMetadataPaged(Paged): + """ + A paging container for iterating over a list of :class:`ResourceHealthMetadata ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ResourceHealthMetadata]'} + } + + def __init__(self, *args, **kwargs): + + super(ResourceHealthMetadataPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-web/azure/mgmt/web/models/resource_health_metadata_py3.py b/azure-mgmt-web/azure/mgmt/web/models/resource_health_metadata_py3.py new file mode 100644 index 000000000000..19f2fa1da274 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/resource_health_metadata_py3.py @@ -0,0 +1,54 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class ResourceHealthMetadata(ProxyOnlyResource): + """Used for getting ResourceHealthCheck settings. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param category: The category that the resource matches in the RHC Policy + File + :type category: str + :param signal_availability: Is there a health signal for the resource + :type signal_availability: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'category': {'key': 'properties.category', 'type': 'str'}, + 'signal_availability': {'key': 'properties.signalAvailability', 'type': 'bool'}, + } + + def __init__(self, *, kind: str=None, category: str=None, signal_availability: bool=None, **kwargs) -> None: + super(ResourceHealthMetadata, self).__init__(kind=kind, **kwargs) + self.category = category + self.signal_availability = signal_availability diff --git a/azure-mgmt-web/azure/mgmt/web/models/resource_metric.py b/azure-mgmt-web/azure/mgmt/web/models/resource_metric.py index e90d84de81f6..83510a981a62 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/resource_metric.py +++ b/azure-mgmt-web/azure/mgmt/web/models/resource_metric.py @@ -62,8 +62,8 @@ class ResourceMetric(Model): 'properties': {'key': 'properties', 'type': '[ResourceMetricProperty]'}, } - def __init__(self): - super(ResourceMetric, self).__init__() + def __init__(self, **kwargs): + super(ResourceMetric, self).__init__(**kwargs) self.name = None self.unit = None self.time_grain = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/resource_metric_availability.py b/azure-mgmt-web/azure/mgmt/web/models/resource_metric_availability.py index 7736a639de6e..b93c0c5b442e 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/resource_metric_availability.py +++ b/azure-mgmt-web/azure/mgmt/web/models/resource_metric_availability.py @@ -34,7 +34,7 @@ class ResourceMetricAvailability(Model): 'retention': {'key': 'retention', 'type': 'str'}, } - def __init__(self): - super(ResourceMetricAvailability, self).__init__() + def __init__(self, **kwargs): + super(ResourceMetricAvailability, self).__init__(**kwargs) self.time_grain = None self.retention = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/resource_metric_availability_py3.py b/azure-mgmt-web/azure/mgmt/web/models/resource_metric_availability_py3.py new file mode 100644 index 000000000000..abd5414ebb1b --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/resource_metric_availability_py3.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class ResourceMetricAvailability(Model): + """Metrics availability and retention. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar time_grain: Time grain . + :vartype time_grain: str + :ivar retention: Retention period for the current time grain. + :vartype retention: str + """ + + _validation = { + 'time_grain': {'readonly': True}, + 'retention': {'readonly': True}, + } + + _attribute_map = { + 'time_grain': {'key': 'timeGrain', 'type': 'str'}, + 'retention': {'key': 'retention', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ResourceMetricAvailability, self).__init__(**kwargs) + self.time_grain = None + self.retention = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/resource_metric_definition.py b/azure-mgmt-web/azure/mgmt/web/models/resource_metric_definition.py index bcfd2baf221b..4e0a78f03d0a 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/resource_metric_definition.py +++ b/azure-mgmt-web/azure/mgmt/web/models/resource_metric_definition.py @@ -72,8 +72,8 @@ class ResourceMetricDefinition(ProxyOnlyResource): 'properties': {'key': 'properties.properties', 'type': '{str}'}, } - def __init__(self, kind=None): - super(ResourceMetricDefinition, self).__init__(kind=kind) + def __init__(self, **kwargs): + super(ResourceMetricDefinition, self).__init__(**kwargs) self.resource_metric_definition_name = None self.unit = None self.primary_aggregation_type = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/resource_metric_definition_py3.py b/azure-mgmt-web/azure/mgmt/web/models/resource_metric_definition_py3.py new file mode 100644 index 000000000000..e6462898929c --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/resource_metric_definition_py3.py @@ -0,0 +1,83 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class ResourceMetricDefinition(ProxyOnlyResource): + """Metadata for the metrics. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar resource_metric_definition_name: Name of the metric. + :vartype resource_metric_definition_name: + ~azure.mgmt.web.models.ResourceMetricName + :ivar unit: Unit of the metric. + :vartype unit: str + :ivar primary_aggregation_type: Primary aggregation type. + :vartype primary_aggregation_type: str + :ivar metric_availabilities: List of time grains supported for the metric + together with retention period. + :vartype metric_availabilities: + list[~azure.mgmt.web.models.ResourceMetricAvailability] + :ivar resource_uri: Resource URI. + :vartype resource_uri: str + :ivar resource_metric_definition_id: Resource ID. + :vartype resource_metric_definition_id: str + :ivar properties: Resource metric definition properties. + :vartype properties: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'resource_metric_definition_name': {'readonly': True}, + 'unit': {'readonly': True}, + 'primary_aggregation_type': {'readonly': True}, + 'metric_availabilities': {'readonly': True}, + 'resource_uri': {'readonly': True}, + 'resource_metric_definition_id': {'readonly': True}, + 'properties': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'resource_metric_definition_name': {'key': 'properties.name', 'type': 'ResourceMetricName'}, + 'unit': {'key': 'properties.unit', 'type': 'str'}, + 'primary_aggregation_type': {'key': 'properties.primaryAggregationType', 'type': 'str'}, + 'metric_availabilities': {'key': 'properties.metricAvailabilities', 'type': '[ResourceMetricAvailability]'}, + 'resource_uri': {'key': 'properties.resourceUri', 'type': 'str'}, + 'resource_metric_definition_id': {'key': 'properties.id', 'type': 'str'}, + 'properties': {'key': 'properties.properties', 'type': '{str}'}, + } + + def __init__(self, *, kind: str=None, **kwargs) -> None: + super(ResourceMetricDefinition, self).__init__(kind=kind, **kwargs) + self.resource_metric_definition_name = None + self.unit = None + self.primary_aggregation_type = None + self.metric_availabilities = None + self.resource_uri = None + self.resource_metric_definition_id = None + self.properties = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/resource_metric_name.py b/azure-mgmt-web/azure/mgmt/web/models/resource_metric_name.py index fc3985dd48f7..a9bc7e08f9e0 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/resource_metric_name.py +++ b/azure-mgmt-web/azure/mgmt/web/models/resource_metric_name.py @@ -34,7 +34,7 @@ class ResourceMetricName(Model): 'localized_value': {'key': 'localizedValue', 'type': 'str'}, } - def __init__(self): - super(ResourceMetricName, self).__init__() + def __init__(self, **kwargs): + super(ResourceMetricName, self).__init__(**kwargs) self.value = None self.localized_value = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/resource_metric_name_py3.py b/azure-mgmt-web/azure/mgmt/web/models/resource_metric_name_py3.py new file mode 100644 index 000000000000..cefb840267a1 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/resource_metric_name_py3.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class ResourceMetricName(Model): + """Name of a metric for any resource . + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: metric name value. + :vartype value: str + :ivar localized_value: Localized metric name value. + :vartype localized_value: str + """ + + _validation = { + 'value': {'readonly': True}, + 'localized_value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ResourceMetricName, self).__init__(**kwargs) + self.value = None + self.localized_value = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/resource_metric_property.py b/azure-mgmt-web/azure/mgmt/web/models/resource_metric_property.py index f9bd040c6801..0a82e61acfe3 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/resource_metric_property.py +++ b/azure-mgmt-web/azure/mgmt/web/models/resource_metric_property.py @@ -26,7 +26,7 @@ class ResourceMetricProperty(Model): 'value': {'key': 'value', 'type': 'str'}, } - def __init__(self, key=None, value=None): - super(ResourceMetricProperty, self).__init__() - self.key = key - self.value = value + def __init__(self, **kwargs): + super(ResourceMetricProperty, self).__init__(**kwargs) + self.key = kwargs.get('key', None) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/resource_metric_property_py3.py b/azure-mgmt-web/azure/mgmt/web/models/resource_metric_property_py3.py new file mode 100644 index 000000000000..a31a4d44862d --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/resource_metric_property_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class ResourceMetricProperty(Model): + """Resource metric property. + + :param key: Key for resource metric property. + :type key: str + :param value: Value of pair. + :type value: str + """ + + _attribute_map = { + 'key': {'key': 'key', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, key: str=None, value: str=None, **kwargs) -> None: + super(ResourceMetricProperty, self).__init__(**kwargs) + self.key = key + self.value = value diff --git a/azure-mgmt-web/azure/mgmt/web/models/resource_metric_py3.py b/azure-mgmt-web/azure/mgmt/web/models/resource_metric_py3.py new file mode 100644 index 000000000000..e15c19f17b07 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/resource_metric_py3.py @@ -0,0 +1,75 @@ +# 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 msrest.serialization import Model + + +class ResourceMetric(Model): + """Object representing a metric for any resource . + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Name of metric. + :vartype name: ~azure.mgmt.web.models.ResourceMetricName + :ivar unit: Metric unit. + :vartype unit: str + :ivar time_grain: Metric granularity. E.g PT1H, PT5M, P1D + :vartype time_grain: str + :ivar start_time: Metric start time. + :vartype start_time: datetime + :ivar end_time: Metric end time. + :vartype end_time: datetime + :ivar resource_id: Metric resource Id. + :vartype resource_id: str + :ivar id: Resource Id. + :vartype id: str + :ivar metric_values: Metric values. + :vartype metric_values: list[~azure.mgmt.web.models.ResourceMetricValue] + :ivar properties: Resource metric properties collection. + :vartype properties: list[~azure.mgmt.web.models.ResourceMetricProperty] + """ + + _validation = { + 'name': {'readonly': True}, + 'unit': {'readonly': True}, + 'time_grain': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'resource_id': {'readonly': True}, + 'id': {'readonly': True}, + 'metric_values': {'readonly': True}, + 'properties': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'ResourceMetricName'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'time_grain': {'key': 'timeGrain', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'metric_values': {'key': 'metricValues', 'type': '[ResourceMetricValue]'}, + 'properties': {'key': 'properties', 'type': '[ResourceMetricProperty]'}, + } + + def __init__(self, **kwargs) -> None: + super(ResourceMetric, self).__init__(**kwargs) + self.name = None + self.unit = None + self.time_grain = None + self.start_time = None + self.end_time = None + self.resource_id = None + self.id = None + self.metric_values = None + self.properties = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/resource_metric_value.py b/azure-mgmt-web/azure/mgmt/web/models/resource_metric_value.py index fc4db86574cc..0253d46bebfc 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/resource_metric_value.py +++ b/azure-mgmt-web/azure/mgmt/web/models/resource_metric_value.py @@ -54,8 +54,8 @@ class ResourceMetricValue(Model): 'properties': {'key': 'properties', 'type': '[ResourceMetricProperty]'}, } - def __init__(self): - super(ResourceMetricValue, self).__init__() + def __init__(self, **kwargs): + super(ResourceMetricValue, self).__init__(**kwargs) self.timestamp = None self.average = None self.minimum = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/resource_metric_value_py3.py b/azure-mgmt-web/azure/mgmt/web/models/resource_metric_value_py3.py new file mode 100644 index 000000000000..4037a249c04f --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/resource_metric_value_py3.py @@ -0,0 +1,65 @@ +# 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 msrest.serialization import Model + + +class ResourceMetricValue(Model): + """Value of resource metric. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar timestamp: Value timestamp. + :vartype timestamp: str + :ivar average: Value average. + :vartype average: float + :ivar minimum: Value minimum. + :vartype minimum: float + :ivar maximum: Value maximum. + :vartype maximum: float + :ivar total: Value total. + :vartype total: float + :ivar count: Value count. + :vartype count: float + :ivar properties: Resource metric properties collection. + :vartype properties: list[~azure.mgmt.web.models.ResourceMetricProperty] + """ + + _validation = { + 'timestamp': {'readonly': True}, + 'average': {'readonly': True}, + 'minimum': {'readonly': True}, + 'maximum': {'readonly': True}, + 'total': {'readonly': True}, + 'count': {'readonly': True}, + 'properties': {'readonly': True}, + } + + _attribute_map = { + 'timestamp': {'key': 'timestamp', 'type': 'str'}, + 'average': {'key': 'average', 'type': 'float'}, + 'minimum': {'key': 'minimum', 'type': 'float'}, + 'maximum': {'key': 'maximum', 'type': 'float'}, + 'total': {'key': 'total', 'type': 'float'}, + 'count': {'key': 'count', 'type': 'float'}, + 'properties': {'key': 'properties', 'type': '[ResourceMetricProperty]'}, + } + + def __init__(self, **kwargs) -> None: + super(ResourceMetricValue, self).__init__(**kwargs) + self.timestamp = None + self.average = None + self.minimum = None + self.maximum = None + self.total = None + self.count = None + self.properties = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/resource_name_availability.py b/azure-mgmt-web/azure/mgmt/web/models/resource_name_availability.py index 456eb9416870..00e19a02dfe2 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/resource_name_availability.py +++ b/azure-mgmt-web/azure/mgmt/web/models/resource_name_availability.py @@ -38,8 +38,8 @@ class ResourceNameAvailability(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self, name_available=None, reason=None, message=None): - super(ResourceNameAvailability, self).__init__() - self.name_available = name_available - self.reason = reason - self.message = message + def __init__(self, **kwargs): + super(ResourceNameAvailability, self).__init__(**kwargs) + self.name_available = kwargs.get('name_available', None) + self.reason = kwargs.get('reason', None) + self.message = kwargs.get('message', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/resource_name_availability_py3.py b/azure-mgmt-web/azure/mgmt/web/models/resource_name_availability_py3.py new file mode 100644 index 000000000000..29684bed5cd3 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/resource_name_availability_py3.py @@ -0,0 +1,45 @@ +# 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 msrest.serialization import Model + + +class ResourceNameAvailability(Model): + """Information regarding availbility of a resource name. + + :param name_available: true indicates name is valid and + available. false indicates the name is invalid, unavailable, + or both. + :type name_available: bool + :param reason: Invalid indicates the name provided does not + match Azure App Service naming requirements. AlreadyExists + indicates that the name is already in use and is therefore unavailable. + Possible values include: 'Invalid', 'AlreadyExists' + :type reason: str or ~azure.mgmt.web.models.InAvailabilityReasonType + :param message: If reason == invalid, provide the user with the reason why + the given name is invalid, and provide the resource naming requirements so + that the user can select a valid name. If reason == AlreadyExists, explain + that resource name is already in use, and direct them to select a + different name. + :type message: str + """ + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, name_available: bool=None, reason=None, message: str=None, **kwargs) -> None: + super(ResourceNameAvailability, self).__init__(**kwargs) + self.name_available = name_available + self.reason = reason + self.message = message diff --git a/azure-mgmt-web/azure/mgmt/web/models/resource_name_availability_request.py b/azure-mgmt-web/azure/mgmt/web/models/resource_name_availability_request.py index 2f7ddebe9493..58bd2ae08060 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/resource_name_availability_request.py +++ b/azure-mgmt-web/azure/mgmt/web/models/resource_name_availability_request.py @@ -15,10 +15,12 @@ class ResourceNameAvailabilityRequest(Model): """Resource name availability request content. - :param name: Resource name to verify. + All required parameters must be populated in order to send to Azure. + + :param name: Required. Resource name to verify. :type name: str - :param type: Resource type used for verification. Possible values include: - 'Site', 'Slot', 'HostingEnvironment', 'PublishingUser', + :param type: Required. Resource type used for verification. Possible + values include: 'Site', 'Slot', 'HostingEnvironment', 'PublishingUser', 'Microsoft.Web/sites', 'Microsoft.Web/sites/slots', 'Microsoft.Web/hostingEnvironments', 'Microsoft.Web/publishingUsers' :type type: str or ~azure.mgmt.web.models.CheckNameResourceTypes @@ -37,8 +39,8 @@ class ResourceNameAvailabilityRequest(Model): 'is_fqdn': {'key': 'isFqdn', 'type': 'bool'}, } - def __init__(self, name, type, is_fqdn=None): - super(ResourceNameAvailabilityRequest, self).__init__() - self.name = name - self.type = type - self.is_fqdn = is_fqdn + def __init__(self, **kwargs): + super(ResourceNameAvailabilityRequest, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + self.is_fqdn = kwargs.get('is_fqdn', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/resource_name_availability_request_py3.py b/azure-mgmt-web/azure/mgmt/web/models/resource_name_availability_request_py3.py new file mode 100644 index 000000000000..52674f7583c9 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/resource_name_availability_request_py3.py @@ -0,0 +1,46 @@ +# 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 msrest.serialization import Model + + +class ResourceNameAvailabilityRequest(Model): + """Resource name availability request content. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Resource name to verify. + :type name: str + :param type: Required. Resource type used for verification. Possible + values include: 'Site', 'Slot', 'HostingEnvironment', 'PublishingUser', + 'Microsoft.Web/sites', 'Microsoft.Web/sites/slots', + 'Microsoft.Web/hostingEnvironments', 'Microsoft.Web/publishingUsers' + :type type: str or ~azure.mgmt.web.models.CheckNameResourceTypes + :param is_fqdn: Is fully qualified domain name. + :type is_fqdn: bool + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'is_fqdn': {'key': 'isFqdn', 'type': 'bool'}, + } + + def __init__(self, *, name: str, type, is_fqdn: bool=None, **kwargs) -> None: + super(ResourceNameAvailabilityRequest, self).__init__(**kwargs) + self.name = name + self.type = type + self.is_fqdn = is_fqdn diff --git a/azure-mgmt-web/azure/mgmt/web/models/resource_py3.py b/azure-mgmt-web/azure/mgmt/web/models/resource_py3.py new file mode 100644 index 000000000000..76c166da271d --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/resource_py3.py @@ -0,0 +1,60 @@ +# 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 msrest.serialization import Model + + +class Resource(Model): + """Azure resource. This resource is tracked in Azure Resource Manager. + + 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 Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str, kind: str=None, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.kind = kind + self.location = location + self.type = None + self.tags = tags diff --git a/azure-mgmt-web/azure/mgmt/web/models/response_meta_data.py b/azure-mgmt-web/azure/mgmt/web/models/response_meta_data.py index 308db7d8a619..00614b9e4ebb 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/response_meta_data.py +++ b/azure-mgmt-web/azure/mgmt/web/models/response_meta_data.py @@ -23,6 +23,6 @@ class ResponseMetaData(Model): 'data_source': {'key': 'dataSource', 'type': 'DataSource'}, } - def __init__(self, data_source=None): - super(ResponseMetaData, self).__init__() - self.data_source = data_source + def __init__(self, **kwargs): + super(ResponseMetaData, self).__init__(**kwargs) + self.data_source = kwargs.get('data_source', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/response_meta_data_py3.py b/azure-mgmt-web/azure/mgmt/web/models/response_meta_data_py3.py new file mode 100644 index 000000000000..2245b81dc0d2 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/response_meta_data_py3.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class ResponseMetaData(Model): + """ResponseMetaData. + + :param data_source: Source of the Data + :type data_source: ~azure.mgmt.web.models.DataSource + """ + + _attribute_map = { + 'data_source': {'key': 'dataSource', 'type': 'DataSource'}, + } + + def __init__(self, *, data_source=None, **kwargs) -> None: + super(ResponseMetaData, self).__init__(**kwargs) + self.data_source = data_source diff --git a/azure-mgmt-web/azure/mgmt/web/models/restore_request.py b/azure-mgmt-web/azure/mgmt/web/models/restore_request.py index 72c3ccec6db0..6ffd33cc679b 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/restore_request.py +++ b/azure-mgmt-web/azure/mgmt/web/models/restore_request.py @@ -18,6 +18,8 @@ class RestoreRequest(ProxyOnlyResource): 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 Azure. + :ivar id: Resource Id. :vartype id: str :ivar name: Resource Name. @@ -26,13 +28,13 @@ class RestoreRequest(ProxyOnlyResource): :type kind: str :ivar type: Resource type. :vartype type: str - :param storage_account_url: SAS URL to the container. + :param storage_account_url: Required. SAS URL to the container. :type storage_account_url: str :param blob_name: Name of a blob which contains the backup. :type blob_name: str - :param overwrite: true if the restore operation can overwrite - target app; otherwise, false. true is needed if - trying to restore over an existing app. + :param overwrite: Required. true if the restore operation can + overwrite target app; otherwise, false. true is + needed if trying to restore over an existing app. :type overwrite: bool :param site_name: Name of an app. :type site_name: str @@ -90,16 +92,16 @@ class RestoreRequest(ProxyOnlyResource): 'hosting_environment': {'key': 'properties.hostingEnvironment', 'type': 'str'}, } - def __init__(self, storage_account_url, overwrite, kind=None, blob_name=None, site_name=None, databases=None, ignore_conflicting_host_names=False, ignore_databases=False, app_service_plan=None, operation_type="Default", adjust_connection_strings=None, hosting_environment=None): - super(RestoreRequest, self).__init__(kind=kind) - self.storage_account_url = storage_account_url - self.blob_name = blob_name - self.overwrite = overwrite - self.site_name = site_name - self.databases = databases - self.ignore_conflicting_host_names = ignore_conflicting_host_names - self.ignore_databases = ignore_databases - self.app_service_plan = app_service_plan - self.operation_type = operation_type - self.adjust_connection_strings = adjust_connection_strings - self.hosting_environment = hosting_environment + def __init__(self, **kwargs): + super(RestoreRequest, self).__init__(**kwargs) + self.storage_account_url = kwargs.get('storage_account_url', None) + self.blob_name = kwargs.get('blob_name', None) + self.overwrite = kwargs.get('overwrite', None) + self.site_name = kwargs.get('site_name', None) + self.databases = kwargs.get('databases', None) + self.ignore_conflicting_host_names = kwargs.get('ignore_conflicting_host_names', False) + self.ignore_databases = kwargs.get('ignore_databases', False) + self.app_service_plan = kwargs.get('app_service_plan', None) + self.operation_type = kwargs.get('operation_type', "Default") + self.adjust_connection_strings = kwargs.get('adjust_connection_strings', None) + self.hosting_environment = kwargs.get('hosting_environment', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/restore_request_py3.py b/azure-mgmt-web/azure/mgmt/web/models/restore_request_py3.py new file mode 100644 index 000000000000..189e92f39f45 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/restore_request_py3.py @@ -0,0 +1,107 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class RestoreRequest(ProxyOnlyResource): + """Description of a restore request. + + 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 Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param storage_account_url: Required. SAS URL to the container. + :type storage_account_url: str + :param blob_name: Name of a blob which contains the backup. + :type blob_name: str + :param overwrite: Required. true if the restore operation can + overwrite target app; otherwise, false. true is + needed if trying to restore over an existing app. + :type overwrite: bool + :param site_name: Name of an app. + :type site_name: str + :param databases: Collection of databases which should be restored. This + list has to match the list of databases included in the backup. + :type databases: list[~azure.mgmt.web.models.DatabaseBackupSetting] + :param ignore_conflicting_host_names: Changes a logic when restoring an + app with custom domains. true to remove custom domains + automatically. If false, custom domains are added to + the app's object when it is being restored, but that might fail due to + conflicts during the operation. Default value: False . + :type ignore_conflicting_host_names: bool + :param ignore_databases: Ignore the databases and only restore the site + content. Default value: False . + :type ignore_databases: bool + :param app_service_plan: Specify app service plan that will own restored + site. + :type app_service_plan: str + :param operation_type: Operation type. Possible values include: 'Default', + 'Clone', 'Relocation', 'Snapshot'. Default value: "Default" . + :type operation_type: str or + ~azure.mgmt.web.models.BackupRestoreOperationType + :param adjust_connection_strings: true if + SiteConfig.ConnectionStrings should be set in new app; otherwise, + false. + :type adjust_connection_strings: bool + :param hosting_environment: App Service Environment name, if needed (only + when restoring an app to an App Service Environment). + :type hosting_environment: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'storage_account_url': {'required': True}, + 'overwrite': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'storage_account_url': {'key': 'properties.storageAccountUrl', 'type': 'str'}, + 'blob_name': {'key': 'properties.blobName', 'type': 'str'}, + 'overwrite': {'key': 'properties.overwrite', 'type': 'bool'}, + 'site_name': {'key': 'properties.siteName', 'type': 'str'}, + 'databases': {'key': 'properties.databases', 'type': '[DatabaseBackupSetting]'}, + 'ignore_conflicting_host_names': {'key': 'properties.ignoreConflictingHostNames', 'type': 'bool'}, + 'ignore_databases': {'key': 'properties.ignoreDatabases', 'type': 'bool'}, + 'app_service_plan': {'key': 'properties.appServicePlan', 'type': 'str'}, + 'operation_type': {'key': 'properties.operationType', 'type': 'BackupRestoreOperationType'}, + 'adjust_connection_strings': {'key': 'properties.adjustConnectionStrings', 'type': 'bool'}, + 'hosting_environment': {'key': 'properties.hostingEnvironment', 'type': 'str'}, + } + + def __init__(self, *, storage_account_url: str, overwrite: bool, kind: str=None, blob_name: str=None, site_name: str=None, databases=None, ignore_conflicting_host_names: bool=False, ignore_databases: bool=False, app_service_plan: str=None, operation_type="Default", adjust_connection_strings: bool=None, hosting_environment: str=None, **kwargs) -> None: + super(RestoreRequest, self).__init__(kind=kind, **kwargs) + self.storage_account_url = storage_account_url + self.blob_name = blob_name + self.overwrite = overwrite + self.site_name = site_name + self.databases = databases + self.ignore_conflicting_host_names = ignore_conflicting_host_names + self.ignore_databases = ignore_databases + self.app_service_plan = app_service_plan + self.operation_type = operation_type + self.adjust_connection_strings = adjust_connection_strings + self.hosting_environment = hosting_environment diff --git a/azure-mgmt-web/azure/mgmt/web/models/restore_response.py b/azure-mgmt-web/azure/mgmt/web/models/restore_response.py index 3be8e1f1a0a5..2650a39c521b 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/restore_response.py +++ b/azure-mgmt-web/azure/mgmt/web/models/restore_response.py @@ -46,6 +46,6 @@ class RestoreResponse(ProxyOnlyResource): 'operation_id': {'key': 'properties.operationId', 'type': 'str'}, } - def __init__(self, kind=None): - super(RestoreResponse, self).__init__(kind=kind) + def __init__(self, **kwargs): + super(RestoreResponse, self).__init__(**kwargs) self.operation_id = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/restore_response_py3.py b/azure-mgmt-web/azure/mgmt/web/models/restore_response_py3.py new file mode 100644 index 000000000000..725a2897dbb6 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/restore_response_py3.py @@ -0,0 +1,51 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class RestoreResponse(ProxyOnlyResource): + """Response for an app restore request. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar operation_id: When server starts the restore process, it will return + an operation ID identifying that particular restore operation. + :vartype operation_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'operation_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'operation_id': {'key': 'properties.operationId', 'type': 'str'}, + } + + def __init__(self, *, kind: str=None, **kwargs) -> None: + super(RestoreResponse, self).__init__(kind=kind, **kwargs) + self.operation_id = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/service_specification.py b/azure-mgmt-web/azure/mgmt/web/models/service_specification.py index 3dae8a238d72..fe2efb3d6d84 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/service_specification.py +++ b/azure-mgmt-web/azure/mgmt/web/models/service_specification.py @@ -24,6 +24,6 @@ class ServiceSpecification(Model): 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, } - def __init__(self, metric_specifications=None): - super(ServiceSpecification, self).__init__() - self.metric_specifications = metric_specifications + def __init__(self, **kwargs): + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = kwargs.get('metric_specifications', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/service_specification_py3.py b/azure-mgmt-web/azure/mgmt/web/models/service_specification_py3.py new file mode 100644 index 000000000000..ea5fcf80b034 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/service_specification_py3.py @@ -0,0 +1,29 @@ +# 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 msrest.serialization import Model + + +class ServiceSpecification(Model): + """Resource metrics service provided by Microsoft.Insights resource provider. + + :param metric_specifications: + :type metric_specifications: + list[~azure.mgmt.web.models.MetricSpecification] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + } + + def __init__(self, *, metric_specifications=None, **kwargs) -> None: + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = metric_specifications diff --git a/azure-mgmt-web/azure/mgmt/web/models/site.py b/azure-mgmt-web/azure/mgmt/web/models/site.py index 44ddd0d3ff08..177c71de2077 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/site.py +++ b/azure-mgmt-web/azure/mgmt/web/models/site.py @@ -18,13 +18,15 @@ class Site(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 Azure. + :ivar id: Resource Id. :vartype id: str :ivar name: Resource Name. :vartype name: str :param kind: Kind of resource. :type kind: str - :param location: Resource Location. + :param location: Required. Resource Location. :type location: str :ivar type: Resource type. :vartype type: str @@ -204,38 +206,38 @@ class Site(Resource): 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, } - def __init__(self, location, kind=None, tags=None, enabled=None, host_name_ssl_states=None, server_farm_id=None, reserved=False, site_config=None, scm_site_also_stopped=False, hosting_environment_profile=None, client_affinity_enabled=None, client_cert_enabled=None, host_names_disabled=None, container_size=None, daily_memory_time_quota=None, cloning_info=None, snapshot_info=None, https_only=None, identity=None): - super(Site, self).__init__(kind=kind, location=location, tags=tags) + def __init__(self, **kwargs): + super(Site, self).__init__(**kwargs) self.state = None self.host_names = None self.repository_site_name = None self.usage_state = None - self.enabled = enabled + self.enabled = kwargs.get('enabled', None) self.enabled_host_names = None self.availability_state = None - self.host_name_ssl_states = host_name_ssl_states - self.server_farm_id = server_farm_id - self.reserved = reserved + self.host_name_ssl_states = kwargs.get('host_name_ssl_states', None) + self.server_farm_id = kwargs.get('server_farm_id', None) + self.reserved = kwargs.get('reserved', False) self.last_modified_time_utc = None - self.site_config = site_config + self.site_config = kwargs.get('site_config', None) self.traffic_manager_host_names = None - self.scm_site_also_stopped = scm_site_also_stopped + self.scm_site_also_stopped = kwargs.get('scm_site_also_stopped', False) self.target_swap_slot = None - self.hosting_environment_profile = hosting_environment_profile - self.client_affinity_enabled = client_affinity_enabled - self.client_cert_enabled = client_cert_enabled - self.host_names_disabled = host_names_disabled + self.hosting_environment_profile = kwargs.get('hosting_environment_profile', None) + self.client_affinity_enabled = kwargs.get('client_affinity_enabled', None) + self.client_cert_enabled = kwargs.get('client_cert_enabled', None) + self.host_names_disabled = kwargs.get('host_names_disabled', None) self.outbound_ip_addresses = None self.possible_outbound_ip_addresses = None - self.container_size = container_size - self.daily_memory_time_quota = daily_memory_time_quota + self.container_size = kwargs.get('container_size', None) + self.daily_memory_time_quota = kwargs.get('daily_memory_time_quota', None) self.suspended_till = None self.max_number_of_workers = None - self.cloning_info = cloning_info - self.snapshot_info = snapshot_info + self.cloning_info = kwargs.get('cloning_info', None) + self.snapshot_info = kwargs.get('snapshot_info', None) self.resource_group = None self.is_default_container = None self.default_host_name = None self.slot_swap_status = None - self.https_only = https_only - self.identity = identity + self.https_only = kwargs.get('https_only', None) + self.identity = kwargs.get('identity', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/site_auth_settings.py b/azure-mgmt-web/azure/mgmt/web/models/site_auth_settings.py index ad9faca40f10..7418c31642f2 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/site_auth_settings.py +++ b/azure-mgmt-web/azure/mgmt/web/models/site_auth_settings.py @@ -203,28 +203,28 @@ class SiteAuthSettings(ProxyOnlyResource): 'microsoft_account_oauth_scopes': {'key': 'properties.microsoftAccountOAuthScopes', 'type': '[str]'}, } - def __init__(self, kind=None, enabled=None, runtime_version=None, unauthenticated_client_action=None, token_store_enabled=None, allowed_external_redirect_urls=None, default_provider=None, token_refresh_extension_hours=None, client_id=None, client_secret=None, issuer=None, allowed_audiences=None, additional_login_params=None, google_client_id=None, google_client_secret=None, google_oauth_scopes=None, facebook_app_id=None, facebook_app_secret=None, facebook_oauth_scopes=None, twitter_consumer_key=None, twitter_consumer_secret=None, microsoft_account_client_id=None, microsoft_account_client_secret=None, microsoft_account_oauth_scopes=None): - super(SiteAuthSettings, self).__init__(kind=kind) - self.enabled = enabled - self.runtime_version = runtime_version - self.unauthenticated_client_action = unauthenticated_client_action - self.token_store_enabled = token_store_enabled - self.allowed_external_redirect_urls = allowed_external_redirect_urls - self.default_provider = default_provider - self.token_refresh_extension_hours = token_refresh_extension_hours - self.client_id = client_id - self.client_secret = client_secret - self.issuer = issuer - self.allowed_audiences = allowed_audiences - self.additional_login_params = additional_login_params - self.google_client_id = google_client_id - self.google_client_secret = google_client_secret - self.google_oauth_scopes = google_oauth_scopes - self.facebook_app_id = facebook_app_id - self.facebook_app_secret = facebook_app_secret - self.facebook_oauth_scopes = facebook_oauth_scopes - self.twitter_consumer_key = twitter_consumer_key - self.twitter_consumer_secret = twitter_consumer_secret - self.microsoft_account_client_id = microsoft_account_client_id - self.microsoft_account_client_secret = microsoft_account_client_secret - self.microsoft_account_oauth_scopes = microsoft_account_oauth_scopes + def __init__(self, **kwargs): + super(SiteAuthSettings, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.runtime_version = kwargs.get('runtime_version', None) + self.unauthenticated_client_action = kwargs.get('unauthenticated_client_action', None) + self.token_store_enabled = kwargs.get('token_store_enabled', None) + self.allowed_external_redirect_urls = kwargs.get('allowed_external_redirect_urls', None) + self.default_provider = kwargs.get('default_provider', None) + self.token_refresh_extension_hours = kwargs.get('token_refresh_extension_hours', None) + self.client_id = kwargs.get('client_id', None) + self.client_secret = kwargs.get('client_secret', None) + self.issuer = kwargs.get('issuer', None) + self.allowed_audiences = kwargs.get('allowed_audiences', None) + self.additional_login_params = kwargs.get('additional_login_params', None) + self.google_client_id = kwargs.get('google_client_id', None) + self.google_client_secret = kwargs.get('google_client_secret', None) + self.google_oauth_scopes = kwargs.get('google_oauth_scopes', None) + self.facebook_app_id = kwargs.get('facebook_app_id', None) + self.facebook_app_secret = kwargs.get('facebook_app_secret', None) + self.facebook_oauth_scopes = kwargs.get('facebook_oauth_scopes', None) + self.twitter_consumer_key = kwargs.get('twitter_consumer_key', None) + self.twitter_consumer_secret = kwargs.get('twitter_consumer_secret', None) + self.microsoft_account_client_id = kwargs.get('microsoft_account_client_id', None) + self.microsoft_account_client_secret = kwargs.get('microsoft_account_client_secret', None) + self.microsoft_account_oauth_scopes = kwargs.get('microsoft_account_oauth_scopes', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/site_auth_settings_py3.py b/azure-mgmt-web/azure/mgmt/web/models/site_auth_settings_py3.py new file mode 100644 index 000000000000..cf20d6750f2b --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/site_auth_settings_py3.py @@ -0,0 +1,230 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class SiteAuthSettings(ProxyOnlyResource): + """Configuration settings for the Azure App Service Authentication / + Authorization feature. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param enabled: true if the Authentication / Authorization + feature is enabled for the current app; otherwise, false. + :type enabled: bool + :param runtime_version: The RuntimeVersion of the Authentication / + Authorization feature in use for the current app. + The setting in this value can control the behavior of certain features in + the Authentication / Authorization module. + :type runtime_version: str + :param unauthenticated_client_action: The action to take when an + unauthenticated client attempts to access the app. Possible values + include: 'RedirectToLoginPage', 'AllowAnonymous' + :type unauthenticated_client_action: str or + ~azure.mgmt.web.models.UnauthenticatedClientAction + :param token_store_enabled: true to durably store + platform-specific security tokens that are obtained during login flows; + otherwise, false. + The default is false. + :type token_store_enabled: bool + :param 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. + :type allowed_external_redirect_urls: list[str] + :param default_provider: The default authentication provider to use when + multiple providers are configured. + This setting is only needed if multiple providers are configured and the + unauthenticated client + action is set to "RedirectToLoginPage". Possible values include: + 'AzureActiveDirectory', 'Facebook', 'Google', 'MicrosoftAccount', + 'Twitter' + :type default_provider: str or + ~azure.mgmt.web.models.BuiltInAuthenticationProvider + :param token_refresh_extension_hours: The number of hours after session + token expiration that a session token can be used to + call the token refresh API. The default is 72 hours. + :type token_refresh_extension_hours: float + :param client_id: The Client ID of this relying party application, known + as the client_id. + This setting is required for enabling OpenID Connection authentication + with Azure Active Directory or + other 3rd party OpenID Connect providers. + More information on OpenID Connect: + http://openid.net/specs/openid-connect-core-1_0.html + :type client_id: str + :param client_secret: The Client Secret of this relying party application + (in Azure Active Directory, this is also referred to as the Key). + This setting is optional. If no client secret is configured, the OpenID + Connect implicit auth flow is used to authenticate end users. + Otherwise, the OpenID Connect Authorization Code Flow is used to + authenticate end users. + More information on OpenID Connect: + http://openid.net/specs/openid-connect-core-1_0.html + :type client_secret: str + :param issuer: The OpenID Connect Issuer URI that represents the entity + which issues access tokens for this application. + When using Azure Active Directory, this value is the URI of the directory + tenant, e.g. https://sts.windows.net/{tenant-guid}/. + This URI is a case-sensitive identifier for the token issuer. + More information on OpenID Connect Discovery: + http://openid.net/specs/openid-connect-discovery-1_0.html + :type issuer: str + :param allowed_audiences: Allowed audience values to consider when + validating JWTs issued by + Azure Active Directory. Note that the ClientID value is + always considered an + allowed audience, regardless of this setting. + :type allowed_audiences: list[str] + :param additional_login_params: Login parameters to send to the OpenID + Connect authorization endpoint when + a user logs in. Each parameter must be in the form "key=value". + :type additional_login_params: list[str] + :param google_client_id: The OpenID Connect Client ID for the Google web + application. + This setting is required for enabling Google Sign-In. + Google Sign-In documentation: + https://developers.google.com/identity/sign-in/web/ + :type google_client_id: str + :param google_client_secret: The client secret associated with the Google + web application. + This setting is required for enabling Google Sign-In. + Google Sign-In documentation: + https://developers.google.com/identity/sign-in/web/ + :type google_client_secret: str + :param google_oauth_scopes: The OAuth 2.0 scopes that will be requested as + part of Google Sign-In authentication. + This setting is optional. If not specified, "openid", "profile", and + "email" are used as default scopes. + Google Sign-In documentation: + https://developers.google.com/identity/sign-in/web/ + :type google_oauth_scopes: list[str] + :param facebook_app_id: The App ID of the Facebook app used for login. + This setting is required for enabling Facebook Login. + Facebook Login documentation: + https://developers.facebook.com/docs/facebook-login + :type facebook_app_id: str + :param facebook_app_secret: The App Secret of the Facebook app used for + Facebook Login. + This setting is required for enabling Facebook Login. + Facebook Login documentation: + https://developers.facebook.com/docs/facebook-login + :type facebook_app_secret: str + :param facebook_oauth_scopes: The OAuth 2.0 scopes that will be requested + as part of Facebook Login authentication. + This setting is optional. + Facebook Login documentation: + https://developers.facebook.com/docs/facebook-login + :type facebook_oauth_scopes: list[str] + :param twitter_consumer_key: The OAuth 1.0a consumer key of the Twitter + application used for sign-in. + This setting is required for enabling Twitter Sign-In. + Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in + :type twitter_consumer_key: str + :param twitter_consumer_secret: The OAuth 1.0a consumer secret of the + Twitter application used for sign-in. + This setting is required for enabling Twitter Sign-In. + Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in + :type twitter_consumer_secret: str + :param microsoft_account_client_id: The OAuth 2.0 client ID that was + created for the app used for authentication. + This setting is required for enabling Microsoft Account authentication. + Microsoft Account OAuth documentation: + https://dev.onedrive.com/auth/msa_oauth.htm + :type microsoft_account_client_id: str + :param microsoft_account_client_secret: The OAuth 2.0 client secret that + was created for the app used for authentication. + This setting is required for enabling Microsoft Account authentication. + Microsoft Account OAuth documentation: + https://dev.onedrive.com/auth/msa_oauth.htm + :type microsoft_account_client_secret: str + :param microsoft_account_oauth_scopes: The OAuth 2.0 scopes that will be + requested as part of Microsoft Account authentication. + This setting is optional. If not specified, "wl.basic" is used as the + default scope. + Microsoft Account Scopes and permissions documentation: + https://msdn.microsoft.com/en-us/library/dn631845.aspx + :type microsoft_account_oauth_scopes: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'runtime_version': {'key': 'properties.runtimeVersion', 'type': 'str'}, + 'unauthenticated_client_action': {'key': 'properties.unauthenticatedClientAction', 'type': 'UnauthenticatedClientAction'}, + 'token_store_enabled': {'key': 'properties.tokenStoreEnabled', 'type': 'bool'}, + 'allowed_external_redirect_urls': {'key': 'properties.allowedExternalRedirectUrls', 'type': '[str]'}, + 'default_provider': {'key': 'properties.defaultProvider', 'type': 'BuiltInAuthenticationProvider'}, + 'token_refresh_extension_hours': {'key': 'properties.tokenRefreshExtensionHours', 'type': 'float'}, + 'client_id': {'key': 'properties.clientId', 'type': 'str'}, + 'client_secret': {'key': 'properties.clientSecret', 'type': 'str'}, + 'issuer': {'key': 'properties.issuer', 'type': 'str'}, + 'allowed_audiences': {'key': 'properties.allowedAudiences', 'type': '[str]'}, + 'additional_login_params': {'key': 'properties.additionalLoginParams', 'type': '[str]'}, + 'google_client_id': {'key': 'properties.googleClientId', 'type': 'str'}, + 'google_client_secret': {'key': 'properties.googleClientSecret', 'type': 'str'}, + 'google_oauth_scopes': {'key': 'properties.googleOAuthScopes', 'type': '[str]'}, + 'facebook_app_id': {'key': 'properties.facebookAppId', 'type': 'str'}, + 'facebook_app_secret': {'key': 'properties.facebookAppSecret', 'type': 'str'}, + 'facebook_oauth_scopes': {'key': 'properties.facebookOAuthScopes', 'type': '[str]'}, + 'twitter_consumer_key': {'key': 'properties.twitterConsumerKey', 'type': 'str'}, + 'twitter_consumer_secret': {'key': 'properties.twitterConsumerSecret', 'type': 'str'}, + 'microsoft_account_client_id': {'key': 'properties.microsoftAccountClientId', 'type': 'str'}, + 'microsoft_account_client_secret': {'key': 'properties.microsoftAccountClientSecret', 'type': 'str'}, + 'microsoft_account_oauth_scopes': {'key': 'properties.microsoftAccountOAuthScopes', 'type': '[str]'}, + } + + def __init__(self, *, kind: str=None, enabled: bool=None, runtime_version: str=None, unauthenticated_client_action=None, token_store_enabled: bool=None, allowed_external_redirect_urls=None, default_provider=None, token_refresh_extension_hours: float=None, client_id: str=None, client_secret: str=None, issuer: str=None, allowed_audiences=None, additional_login_params=None, google_client_id: str=None, google_client_secret: str=None, google_oauth_scopes=None, facebook_app_id: str=None, facebook_app_secret: str=None, facebook_oauth_scopes=None, twitter_consumer_key: str=None, twitter_consumer_secret: str=None, microsoft_account_client_id: str=None, microsoft_account_client_secret: str=None, microsoft_account_oauth_scopes=None, **kwargs) -> None: + super(SiteAuthSettings, self).__init__(kind=kind, **kwargs) + self.enabled = enabled + self.runtime_version = runtime_version + self.unauthenticated_client_action = unauthenticated_client_action + self.token_store_enabled = token_store_enabled + self.allowed_external_redirect_urls = allowed_external_redirect_urls + self.default_provider = default_provider + self.token_refresh_extension_hours = token_refresh_extension_hours + self.client_id = client_id + self.client_secret = client_secret + self.issuer = issuer + self.allowed_audiences = allowed_audiences + self.additional_login_params = additional_login_params + self.google_client_id = google_client_id + self.google_client_secret = google_client_secret + self.google_oauth_scopes = google_oauth_scopes + self.facebook_app_id = facebook_app_id + self.facebook_app_secret = facebook_app_secret + self.facebook_oauth_scopes = facebook_oauth_scopes + self.twitter_consumer_key = twitter_consumer_key + self.twitter_consumer_secret = twitter_consumer_secret + self.microsoft_account_client_id = microsoft_account_client_id + self.microsoft_account_client_secret = microsoft_account_client_secret + self.microsoft_account_oauth_scopes = microsoft_account_oauth_scopes diff --git a/azure-mgmt-web/azure/mgmt/web/models/site_cloneability.py b/azure-mgmt-web/azure/mgmt/web/models/site_cloneability.py index b58b934354c4..37d68387f3b3 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/site_cloneability.py +++ b/azure-mgmt-web/azure/mgmt/web/models/site_cloneability.py @@ -40,9 +40,9 @@ class SiteCloneability(Model): 'blocking_characteristics': {'key': 'blockingCharacteristics', 'type': '[SiteCloneabilityCriterion]'}, } - def __init__(self, result=None, blocking_features=None, unsupported_features=None, blocking_characteristics=None): - super(SiteCloneability, self).__init__() - self.result = result - self.blocking_features = blocking_features - self.unsupported_features = unsupported_features - self.blocking_characteristics = blocking_characteristics + def __init__(self, **kwargs): + super(SiteCloneability, self).__init__(**kwargs) + self.result = kwargs.get('result', None) + self.blocking_features = kwargs.get('blocking_features', None) + self.unsupported_features = kwargs.get('unsupported_features', None) + self.blocking_characteristics = kwargs.get('blocking_characteristics', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/site_cloneability_criterion.py b/azure-mgmt-web/azure/mgmt/web/models/site_cloneability_criterion.py index 8e6bf29ccb39..619ec823c8a8 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/site_cloneability_criterion.py +++ b/azure-mgmt-web/azure/mgmt/web/models/site_cloneability_criterion.py @@ -26,7 +26,7 @@ class SiteCloneabilityCriterion(Model): 'description': {'key': 'description', 'type': 'str'}, } - def __init__(self, name=None, description=None): - super(SiteCloneabilityCriterion, self).__init__() - self.name = name - self.description = description + def __init__(self, **kwargs): + super(SiteCloneabilityCriterion, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/site_cloneability_criterion_py3.py b/azure-mgmt-web/azure/mgmt/web/models/site_cloneability_criterion_py3.py new file mode 100644 index 000000000000..fcca5c64c56f --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/site_cloneability_criterion_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class SiteCloneabilityCriterion(Model): + """An app cloneability criterion. + + :param name: Name of criterion. + :type name: str + :param description: Description of criterion. + :type description: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, description: str=None, **kwargs) -> None: + super(SiteCloneabilityCriterion, self).__init__(**kwargs) + self.name = name + self.description = description diff --git a/azure-mgmt-web/azure/mgmt/web/models/site_cloneability_py3.py b/azure-mgmt-web/azure/mgmt/web/models/site_cloneability_py3.py new file mode 100644 index 000000000000..87d084d5e5e4 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/site_cloneability_py3.py @@ -0,0 +1,48 @@ +# 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 msrest.serialization import Model + + +class SiteCloneability(Model): + """Represents whether or not an app is cloneable. + + :param result: Name of app. Possible values include: 'Cloneable', + 'PartiallyCloneable', 'NotCloneable' + :type result: str or ~azure.mgmt.web.models.CloneAbilityResult + :param blocking_features: List of features enabled on app that prevent + cloning. + :type blocking_features: + list[~azure.mgmt.web.models.SiteCloneabilityCriterion] + :param unsupported_features: List of features enabled on app that are + non-blocking but cannot be cloned. The app can still be cloned + but the features in this list will not be set up on cloned app. + :type unsupported_features: + list[~azure.mgmt.web.models.SiteCloneabilityCriterion] + :param blocking_characteristics: List of blocking application + characteristics. + :type blocking_characteristics: + list[~azure.mgmt.web.models.SiteCloneabilityCriterion] + """ + + _attribute_map = { + 'result': {'key': 'result', 'type': 'CloneAbilityResult'}, + 'blocking_features': {'key': 'blockingFeatures', 'type': '[SiteCloneabilityCriterion]'}, + 'unsupported_features': {'key': 'unsupportedFeatures', 'type': '[SiteCloneabilityCriterion]'}, + 'blocking_characteristics': {'key': 'blockingCharacteristics', 'type': '[SiteCloneabilityCriterion]'}, + } + + def __init__(self, *, result=None, blocking_features=None, unsupported_features=None, blocking_characteristics=None, **kwargs) -> None: + super(SiteCloneability, self).__init__(**kwargs) + self.result = result + self.blocking_features = blocking_features + self.unsupported_features = unsupported_features + self.blocking_characteristics = blocking_characteristics diff --git a/azure-mgmt-web/azure/mgmt/web/models/site_config.py b/azure-mgmt-web/azure/mgmt/web/models/site_config.py index 48b3fdb973a1..b598addfbdc0 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/site_config.py +++ b/azure-mgmt-web/azure/mgmt/web/models/site_config.py @@ -184,50 +184,50 @@ class SiteConfig(Model): 'min_tls_version': {'key': 'minTlsVersion', 'type': 'str'}, } - def __init__(self, number_of_workers=None, default_documents=None, net_framework_version="v4.6", php_version=None, python_version=None, node_version=None, linux_fx_version=None, request_tracing_enabled=None, request_tracing_expiration_time=None, remote_debugging_enabled=None, remote_debugging_version=None, http_logging_enabled=None, logs_directory_size_limit=None, detailed_error_logging_enabled=None, publishing_username=None, app_settings=None, connection_strings=None, handler_mappings=None, document_root=None, scm_type=None, use32_bit_worker_process=None, web_sockets_enabled=None, always_on=None, java_version=None, java_container=None, java_container_version=None, app_command_line=None, managed_pipeline_mode=None, virtual_applications=None, load_balancing=None, experiments=None, limits=None, auto_heal_enabled=None, auto_heal_rules=None, tracing_options=None, vnet_name=None, cors=None, push=None, api_definition=None, auto_swap_slot_name=None, local_my_sql_enabled=False, ip_security_restrictions=None, http20_enabled=True, min_tls_version=None): - super(SiteConfig, self).__init__() - self.number_of_workers = number_of_workers - self.default_documents = default_documents - self.net_framework_version = net_framework_version - self.php_version = php_version - self.python_version = python_version - self.node_version = node_version - self.linux_fx_version = linux_fx_version - self.request_tracing_enabled = request_tracing_enabled - self.request_tracing_expiration_time = request_tracing_expiration_time - self.remote_debugging_enabled = remote_debugging_enabled - self.remote_debugging_version = remote_debugging_version - self.http_logging_enabled = http_logging_enabled - self.logs_directory_size_limit = logs_directory_size_limit - self.detailed_error_logging_enabled = detailed_error_logging_enabled - self.publishing_username = publishing_username - self.app_settings = app_settings - self.connection_strings = connection_strings + def __init__(self, **kwargs): + super(SiteConfig, self).__init__(**kwargs) + self.number_of_workers = kwargs.get('number_of_workers', None) + self.default_documents = kwargs.get('default_documents', None) + self.net_framework_version = kwargs.get('net_framework_version', "v4.6") + self.php_version = kwargs.get('php_version', None) + self.python_version = kwargs.get('python_version', None) + self.node_version = kwargs.get('node_version', None) + self.linux_fx_version = kwargs.get('linux_fx_version', None) + self.request_tracing_enabled = kwargs.get('request_tracing_enabled', None) + self.request_tracing_expiration_time = kwargs.get('request_tracing_expiration_time', None) + self.remote_debugging_enabled = kwargs.get('remote_debugging_enabled', None) + self.remote_debugging_version = kwargs.get('remote_debugging_version', None) + self.http_logging_enabled = kwargs.get('http_logging_enabled', None) + self.logs_directory_size_limit = kwargs.get('logs_directory_size_limit', None) + self.detailed_error_logging_enabled = kwargs.get('detailed_error_logging_enabled', None) + self.publishing_username = kwargs.get('publishing_username', None) + self.app_settings = kwargs.get('app_settings', None) + self.connection_strings = kwargs.get('connection_strings', None) self.machine_key = None - self.handler_mappings = handler_mappings - self.document_root = document_root - self.scm_type = scm_type - self.use32_bit_worker_process = use32_bit_worker_process - self.web_sockets_enabled = web_sockets_enabled - self.always_on = always_on - self.java_version = java_version - self.java_container = java_container - self.java_container_version = java_container_version - self.app_command_line = app_command_line - self.managed_pipeline_mode = managed_pipeline_mode - self.virtual_applications = virtual_applications - self.load_balancing = load_balancing - self.experiments = experiments - self.limits = limits - self.auto_heal_enabled = auto_heal_enabled - self.auto_heal_rules = auto_heal_rules - self.tracing_options = tracing_options - self.vnet_name = vnet_name - self.cors = cors - self.push = push - self.api_definition = api_definition - self.auto_swap_slot_name = auto_swap_slot_name - self.local_my_sql_enabled = local_my_sql_enabled - self.ip_security_restrictions = ip_security_restrictions - self.http20_enabled = http20_enabled - self.min_tls_version = min_tls_version + self.handler_mappings = kwargs.get('handler_mappings', None) + self.document_root = kwargs.get('document_root', None) + self.scm_type = kwargs.get('scm_type', None) + self.use32_bit_worker_process = kwargs.get('use32_bit_worker_process', None) + self.web_sockets_enabled = kwargs.get('web_sockets_enabled', None) + self.always_on = kwargs.get('always_on', None) + self.java_version = kwargs.get('java_version', None) + self.java_container = kwargs.get('java_container', None) + self.java_container_version = kwargs.get('java_container_version', None) + self.app_command_line = kwargs.get('app_command_line', None) + self.managed_pipeline_mode = kwargs.get('managed_pipeline_mode', None) + self.virtual_applications = kwargs.get('virtual_applications', None) + self.load_balancing = kwargs.get('load_balancing', None) + self.experiments = kwargs.get('experiments', None) + self.limits = kwargs.get('limits', None) + self.auto_heal_enabled = kwargs.get('auto_heal_enabled', None) + self.auto_heal_rules = kwargs.get('auto_heal_rules', None) + self.tracing_options = kwargs.get('tracing_options', None) + self.vnet_name = kwargs.get('vnet_name', None) + self.cors = kwargs.get('cors', None) + self.push = kwargs.get('push', None) + self.api_definition = kwargs.get('api_definition', None) + self.auto_swap_slot_name = kwargs.get('auto_swap_slot_name', None) + self.local_my_sql_enabled = kwargs.get('local_my_sql_enabled', False) + self.ip_security_restrictions = kwargs.get('ip_security_restrictions', None) + self.http20_enabled = kwargs.get('http20_enabled', True) + self.min_tls_version = kwargs.get('min_tls_version', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/site_config_py3.py b/azure-mgmt-web/azure/mgmt/web/models/site_config_py3.py new file mode 100644 index 000000000000..fad1c217018c --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/site_config_py3.py @@ -0,0 +1,233 @@ +# 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 msrest.serialization import Model + + +class SiteConfig(Model): + """Configuration of an App Service app. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param number_of_workers: Number of workers. + :type number_of_workers: int + :param default_documents: Default documents. + :type default_documents: list[str] + :param net_framework_version: .NET Framework version. Default value: + "v4.6" . + :type net_framework_version: str + :param php_version: Version of PHP. + :type php_version: str + :param python_version: Version of Python. + :type python_version: str + :param node_version: Version of Node.js. + :type node_version: str + :param linux_fx_version: Linux App Framework and version + :type linux_fx_version: str + :param request_tracing_enabled: true if request tracing is + enabled; otherwise, false. + :type request_tracing_enabled: bool + :param request_tracing_expiration_time: Request tracing expiration time. + :type request_tracing_expiration_time: datetime + :param remote_debugging_enabled: true if remote debugging is + enabled; otherwise, false. + :type remote_debugging_enabled: bool + :param remote_debugging_version: Remote debugging version. + :type remote_debugging_version: str + :param http_logging_enabled: true if HTTP logging is enabled; + otherwise, false. + :type http_logging_enabled: bool + :param logs_directory_size_limit: HTTP logs directory size limit. + :type logs_directory_size_limit: int + :param detailed_error_logging_enabled: true if detailed error + logging is enabled; otherwise, false. + :type detailed_error_logging_enabled: bool + :param publishing_username: Publishing user name. + :type publishing_username: str + :param app_settings: Application settings. + :type app_settings: list[~azure.mgmt.web.models.NameValuePair] + :param connection_strings: Connection strings. + :type connection_strings: list[~azure.mgmt.web.models.ConnStringInfo] + :ivar machine_key: Site MachineKey. + :vartype machine_key: ~azure.mgmt.web.models.SiteMachineKey + :param handler_mappings: Handler mappings. + :type handler_mappings: list[~azure.mgmt.web.models.HandlerMapping] + :param document_root: Document root. + :type document_root: str + :param scm_type: SCM type. Possible values include: 'None', 'Dropbox', + 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', 'CodePlexHg', 'BitbucketGit', + 'BitbucketHg', 'ExternalGit', 'ExternalHg', 'OneDrive', 'VSO' + :type scm_type: str or ~azure.mgmt.web.models.ScmType + :param use32_bit_worker_process: true to use 32-bit worker + process; otherwise, false. + :type use32_bit_worker_process: bool + :param web_sockets_enabled: true if WebSocket is enabled; + otherwise, false. + :type web_sockets_enabled: bool + :param always_on: true if Always On is enabled; otherwise, + false. + :type always_on: bool + :param java_version: Java version. + :type java_version: str + :param java_container: Java container. + :type java_container: str + :param java_container_version: Java container version. + :type java_container_version: str + :param app_command_line: App command line to launch. + :type app_command_line: str + :param managed_pipeline_mode: Managed pipeline mode. Possible values + include: 'Integrated', 'Classic' + :type managed_pipeline_mode: str or + ~azure.mgmt.web.models.ManagedPipelineMode + :param virtual_applications: Virtual applications. + :type virtual_applications: + list[~azure.mgmt.web.models.VirtualApplication] + :param load_balancing: Site load balancing. Possible values include: + 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', + 'WeightedTotalTraffic', 'RequestHash' + :type load_balancing: str or ~azure.mgmt.web.models.SiteLoadBalancing + :param experiments: This is work around for polymophic types. + :type experiments: ~azure.mgmt.web.models.Experiments + :param limits: Site limits. + :type limits: ~azure.mgmt.web.models.SiteLimits + :param auto_heal_enabled: true if Auto Heal is enabled; + otherwise, false. + :type auto_heal_enabled: bool + :param auto_heal_rules: Auto Heal rules. + :type auto_heal_rules: ~azure.mgmt.web.models.AutoHealRules + :param tracing_options: Tracing options. + :type tracing_options: str + :param vnet_name: Virtual Network name. + :type vnet_name: str + :param cors: Cross-Origin Resource Sharing (CORS) settings. + :type cors: ~azure.mgmt.web.models.CorsSettings + :param push: Push endpoint settings. + :type push: ~azure.mgmt.web.models.PushSettings + :param api_definition: Information about the formal API definition for the + app. + :type api_definition: ~azure.mgmt.web.models.ApiDefinitionInfo + :param auto_swap_slot_name: Auto-swap slot name. + :type auto_swap_slot_name: str + :param local_my_sql_enabled: true to enable local MySQL; + otherwise, false. Default value: False . + :type local_my_sql_enabled: bool + :param ip_security_restrictions: IP security restrictions. + :type ip_security_restrictions: + list[~azure.mgmt.web.models.IpSecurityRestriction] + :param http20_enabled: Http20Enabled: configures a web site to allow + clients to connect over http2.0. Default value: True . + :type http20_enabled: bool + :param min_tls_version: MinTlsVersion: configures the minimum version of + TLS required for SSL requests. Possible values include: '1.0', '1.1', + '1.2' + :type min_tls_version: str or ~azure.mgmt.web.models.SupportedTlsVersions + """ + + _validation = { + 'machine_key': {'readonly': True}, + } + + _attribute_map = { + 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, + 'default_documents': {'key': 'defaultDocuments', 'type': '[str]'}, + 'net_framework_version': {'key': 'netFrameworkVersion', 'type': 'str'}, + 'php_version': {'key': 'phpVersion', 'type': 'str'}, + 'python_version': {'key': 'pythonVersion', 'type': 'str'}, + 'node_version': {'key': 'nodeVersion', 'type': 'str'}, + 'linux_fx_version': {'key': 'linuxFxVersion', 'type': 'str'}, + 'request_tracing_enabled': {'key': 'requestTracingEnabled', 'type': 'bool'}, + 'request_tracing_expiration_time': {'key': 'requestTracingExpirationTime', 'type': 'iso-8601'}, + 'remote_debugging_enabled': {'key': 'remoteDebuggingEnabled', 'type': 'bool'}, + 'remote_debugging_version': {'key': 'remoteDebuggingVersion', 'type': 'str'}, + 'http_logging_enabled': {'key': 'httpLoggingEnabled', 'type': 'bool'}, + 'logs_directory_size_limit': {'key': 'logsDirectorySizeLimit', 'type': 'int'}, + 'detailed_error_logging_enabled': {'key': 'detailedErrorLoggingEnabled', 'type': 'bool'}, + 'publishing_username': {'key': 'publishingUsername', 'type': 'str'}, + 'app_settings': {'key': 'appSettings', 'type': '[NameValuePair]'}, + 'connection_strings': {'key': 'connectionStrings', 'type': '[ConnStringInfo]'}, + 'machine_key': {'key': 'machineKey', 'type': 'SiteMachineKey'}, + 'handler_mappings': {'key': 'handlerMappings', 'type': '[HandlerMapping]'}, + 'document_root': {'key': 'documentRoot', 'type': 'str'}, + 'scm_type': {'key': 'scmType', 'type': 'str'}, + 'use32_bit_worker_process': {'key': 'use32BitWorkerProcess', 'type': 'bool'}, + 'web_sockets_enabled': {'key': 'webSocketsEnabled', 'type': 'bool'}, + 'always_on': {'key': 'alwaysOn', 'type': 'bool'}, + 'java_version': {'key': 'javaVersion', 'type': 'str'}, + 'java_container': {'key': 'javaContainer', 'type': 'str'}, + 'java_container_version': {'key': 'javaContainerVersion', 'type': 'str'}, + 'app_command_line': {'key': 'appCommandLine', 'type': 'str'}, + 'managed_pipeline_mode': {'key': 'managedPipelineMode', 'type': 'ManagedPipelineMode'}, + 'virtual_applications': {'key': 'virtualApplications', 'type': '[VirtualApplication]'}, + 'load_balancing': {'key': 'loadBalancing', 'type': 'SiteLoadBalancing'}, + 'experiments': {'key': 'experiments', 'type': 'Experiments'}, + 'limits': {'key': 'limits', 'type': 'SiteLimits'}, + 'auto_heal_enabled': {'key': 'autoHealEnabled', 'type': 'bool'}, + 'auto_heal_rules': {'key': 'autoHealRules', 'type': 'AutoHealRules'}, + 'tracing_options': {'key': 'tracingOptions', 'type': 'str'}, + 'vnet_name': {'key': 'vnetName', 'type': 'str'}, + 'cors': {'key': 'cors', 'type': 'CorsSettings'}, + 'push': {'key': 'push', 'type': 'PushSettings'}, + 'api_definition': {'key': 'apiDefinition', 'type': 'ApiDefinitionInfo'}, + 'auto_swap_slot_name': {'key': 'autoSwapSlotName', 'type': 'str'}, + 'local_my_sql_enabled': {'key': 'localMySqlEnabled', 'type': 'bool'}, + 'ip_security_restrictions': {'key': 'ipSecurityRestrictions', 'type': '[IpSecurityRestriction]'}, + 'http20_enabled': {'key': 'http20Enabled', 'type': 'bool'}, + 'min_tls_version': {'key': 'minTlsVersion', 'type': 'str'}, + } + + def __init__(self, *, number_of_workers: int=None, default_documents=None, net_framework_version: str="v4.6", php_version: str=None, python_version: str=None, node_version: str=None, linux_fx_version: str=None, request_tracing_enabled: bool=None, request_tracing_expiration_time=None, remote_debugging_enabled: bool=None, remote_debugging_version: str=None, http_logging_enabled: bool=None, logs_directory_size_limit: int=None, detailed_error_logging_enabled: bool=None, publishing_username: str=None, app_settings=None, connection_strings=None, handler_mappings=None, document_root: str=None, scm_type=None, use32_bit_worker_process: bool=None, web_sockets_enabled: bool=None, always_on: bool=None, java_version: str=None, java_container: str=None, java_container_version: str=None, app_command_line: str=None, managed_pipeline_mode=None, virtual_applications=None, load_balancing=None, experiments=None, limits=None, auto_heal_enabled: bool=None, auto_heal_rules=None, tracing_options: str=None, vnet_name: str=None, cors=None, push=None, api_definition=None, auto_swap_slot_name: str=None, local_my_sql_enabled: bool=False, ip_security_restrictions=None, http20_enabled: bool=True, min_tls_version=None, **kwargs) -> None: + super(SiteConfig, self).__init__(**kwargs) + self.number_of_workers = number_of_workers + self.default_documents = default_documents + self.net_framework_version = net_framework_version + self.php_version = php_version + self.python_version = python_version + self.node_version = node_version + self.linux_fx_version = linux_fx_version + self.request_tracing_enabled = request_tracing_enabled + self.request_tracing_expiration_time = request_tracing_expiration_time + self.remote_debugging_enabled = remote_debugging_enabled + self.remote_debugging_version = remote_debugging_version + self.http_logging_enabled = http_logging_enabled + self.logs_directory_size_limit = logs_directory_size_limit + self.detailed_error_logging_enabled = detailed_error_logging_enabled + self.publishing_username = publishing_username + self.app_settings = app_settings + self.connection_strings = connection_strings + self.machine_key = None + self.handler_mappings = handler_mappings + self.document_root = document_root + self.scm_type = scm_type + self.use32_bit_worker_process = use32_bit_worker_process + self.web_sockets_enabled = web_sockets_enabled + self.always_on = always_on + self.java_version = java_version + self.java_container = java_container + self.java_container_version = java_container_version + self.app_command_line = app_command_line + self.managed_pipeline_mode = managed_pipeline_mode + self.virtual_applications = virtual_applications + self.load_balancing = load_balancing + self.experiments = experiments + self.limits = limits + self.auto_heal_enabled = auto_heal_enabled + self.auto_heal_rules = auto_heal_rules + self.tracing_options = tracing_options + self.vnet_name = vnet_name + self.cors = cors + self.push = push + self.api_definition = api_definition + self.auto_swap_slot_name = auto_swap_slot_name + self.local_my_sql_enabled = local_my_sql_enabled + self.ip_security_restrictions = ip_security_restrictions + self.http20_enabled = http20_enabled + self.min_tls_version = min_tls_version diff --git a/azure-mgmt-web/azure/mgmt/web/models/site_config_resource.py b/azure-mgmt-web/azure/mgmt/web/models/site_config_resource.py index 23a88e94d737..2023ff28665e 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/site_config_resource.py +++ b/azure-mgmt-web/azure/mgmt/web/models/site_config_resource.py @@ -199,50 +199,50 @@ class SiteConfigResource(ProxyOnlyResource): 'min_tls_version': {'key': 'properties.minTlsVersion', 'type': 'str'}, } - def __init__(self, kind=None, number_of_workers=None, default_documents=None, net_framework_version="v4.6", php_version=None, python_version=None, node_version=None, linux_fx_version=None, request_tracing_enabled=None, request_tracing_expiration_time=None, remote_debugging_enabled=None, remote_debugging_version=None, http_logging_enabled=None, logs_directory_size_limit=None, detailed_error_logging_enabled=None, publishing_username=None, app_settings=None, connection_strings=None, handler_mappings=None, document_root=None, scm_type=None, use32_bit_worker_process=None, web_sockets_enabled=None, always_on=None, java_version=None, java_container=None, java_container_version=None, app_command_line=None, managed_pipeline_mode=None, virtual_applications=None, load_balancing=None, experiments=None, limits=None, auto_heal_enabled=None, auto_heal_rules=None, tracing_options=None, vnet_name=None, cors=None, push=None, api_definition=None, auto_swap_slot_name=None, local_my_sql_enabled=False, ip_security_restrictions=None, http20_enabled=True, min_tls_version=None): - super(SiteConfigResource, self).__init__(kind=kind) - self.number_of_workers = number_of_workers - self.default_documents = default_documents - self.net_framework_version = net_framework_version - self.php_version = php_version - self.python_version = python_version - self.node_version = node_version - self.linux_fx_version = linux_fx_version - self.request_tracing_enabled = request_tracing_enabled - self.request_tracing_expiration_time = request_tracing_expiration_time - self.remote_debugging_enabled = remote_debugging_enabled - self.remote_debugging_version = remote_debugging_version - self.http_logging_enabled = http_logging_enabled - self.logs_directory_size_limit = logs_directory_size_limit - self.detailed_error_logging_enabled = detailed_error_logging_enabled - self.publishing_username = publishing_username - self.app_settings = app_settings - self.connection_strings = connection_strings + def __init__(self, **kwargs): + super(SiteConfigResource, self).__init__(**kwargs) + self.number_of_workers = kwargs.get('number_of_workers', None) + self.default_documents = kwargs.get('default_documents', None) + self.net_framework_version = kwargs.get('net_framework_version', "v4.6") + self.php_version = kwargs.get('php_version', None) + self.python_version = kwargs.get('python_version', None) + self.node_version = kwargs.get('node_version', None) + self.linux_fx_version = kwargs.get('linux_fx_version', None) + self.request_tracing_enabled = kwargs.get('request_tracing_enabled', None) + self.request_tracing_expiration_time = kwargs.get('request_tracing_expiration_time', None) + self.remote_debugging_enabled = kwargs.get('remote_debugging_enabled', None) + self.remote_debugging_version = kwargs.get('remote_debugging_version', None) + self.http_logging_enabled = kwargs.get('http_logging_enabled', None) + self.logs_directory_size_limit = kwargs.get('logs_directory_size_limit', None) + self.detailed_error_logging_enabled = kwargs.get('detailed_error_logging_enabled', None) + self.publishing_username = kwargs.get('publishing_username', None) + self.app_settings = kwargs.get('app_settings', None) + self.connection_strings = kwargs.get('connection_strings', None) self.machine_key = None - self.handler_mappings = handler_mappings - self.document_root = document_root - self.scm_type = scm_type - self.use32_bit_worker_process = use32_bit_worker_process - self.web_sockets_enabled = web_sockets_enabled - self.always_on = always_on - self.java_version = java_version - self.java_container = java_container - self.java_container_version = java_container_version - self.app_command_line = app_command_line - self.managed_pipeline_mode = managed_pipeline_mode - self.virtual_applications = virtual_applications - self.load_balancing = load_balancing - self.experiments = experiments - self.limits = limits - self.auto_heal_enabled = auto_heal_enabled - self.auto_heal_rules = auto_heal_rules - self.tracing_options = tracing_options - self.vnet_name = vnet_name - self.cors = cors - self.push = push - self.api_definition = api_definition - self.auto_swap_slot_name = auto_swap_slot_name - self.local_my_sql_enabled = local_my_sql_enabled - self.ip_security_restrictions = ip_security_restrictions - self.http20_enabled = http20_enabled - self.min_tls_version = min_tls_version + self.handler_mappings = kwargs.get('handler_mappings', None) + self.document_root = kwargs.get('document_root', None) + self.scm_type = kwargs.get('scm_type', None) + self.use32_bit_worker_process = kwargs.get('use32_bit_worker_process', None) + self.web_sockets_enabled = kwargs.get('web_sockets_enabled', None) + self.always_on = kwargs.get('always_on', None) + self.java_version = kwargs.get('java_version', None) + self.java_container = kwargs.get('java_container', None) + self.java_container_version = kwargs.get('java_container_version', None) + self.app_command_line = kwargs.get('app_command_line', None) + self.managed_pipeline_mode = kwargs.get('managed_pipeline_mode', None) + self.virtual_applications = kwargs.get('virtual_applications', None) + self.load_balancing = kwargs.get('load_balancing', None) + self.experiments = kwargs.get('experiments', None) + self.limits = kwargs.get('limits', None) + self.auto_heal_enabled = kwargs.get('auto_heal_enabled', None) + self.auto_heal_rules = kwargs.get('auto_heal_rules', None) + self.tracing_options = kwargs.get('tracing_options', None) + self.vnet_name = kwargs.get('vnet_name', None) + self.cors = kwargs.get('cors', None) + self.push = kwargs.get('push', None) + self.api_definition = kwargs.get('api_definition', None) + self.auto_swap_slot_name = kwargs.get('auto_swap_slot_name', None) + self.local_my_sql_enabled = kwargs.get('local_my_sql_enabled', False) + self.ip_security_restrictions = kwargs.get('ip_security_restrictions', None) + self.http20_enabled = kwargs.get('http20_enabled', True) + self.min_tls_version = kwargs.get('min_tls_version', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/site_config_resource_py3.py b/azure-mgmt-web/azure/mgmt/web/models/site_config_resource_py3.py new file mode 100644 index 000000000000..4af916a3961d --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/site_config_resource_py3.py @@ -0,0 +1,248 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class SiteConfigResource(ProxyOnlyResource): + """Web app configuration ARM resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param number_of_workers: Number of workers. + :type number_of_workers: int + :param default_documents: Default documents. + :type default_documents: list[str] + :param net_framework_version: .NET Framework version. Default value: + "v4.6" . + :type net_framework_version: str + :param php_version: Version of PHP. + :type php_version: str + :param python_version: Version of Python. + :type python_version: str + :param node_version: Version of Node.js. + :type node_version: str + :param linux_fx_version: Linux App Framework and version + :type linux_fx_version: str + :param request_tracing_enabled: true if request tracing is + enabled; otherwise, false. + :type request_tracing_enabled: bool + :param request_tracing_expiration_time: Request tracing expiration time. + :type request_tracing_expiration_time: datetime + :param remote_debugging_enabled: true if remote debugging is + enabled; otherwise, false. + :type remote_debugging_enabled: bool + :param remote_debugging_version: Remote debugging version. + :type remote_debugging_version: str + :param http_logging_enabled: true if HTTP logging is enabled; + otherwise, false. + :type http_logging_enabled: bool + :param logs_directory_size_limit: HTTP logs directory size limit. + :type logs_directory_size_limit: int + :param detailed_error_logging_enabled: true if detailed error + logging is enabled; otherwise, false. + :type detailed_error_logging_enabled: bool + :param publishing_username: Publishing user name. + :type publishing_username: str + :param app_settings: Application settings. + :type app_settings: list[~azure.mgmt.web.models.NameValuePair] + :param connection_strings: Connection strings. + :type connection_strings: list[~azure.mgmt.web.models.ConnStringInfo] + :ivar machine_key: Site MachineKey. + :vartype machine_key: ~azure.mgmt.web.models.SiteMachineKey + :param handler_mappings: Handler mappings. + :type handler_mappings: list[~azure.mgmt.web.models.HandlerMapping] + :param document_root: Document root. + :type document_root: str + :param scm_type: SCM type. Possible values include: 'None', 'Dropbox', + 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', 'CodePlexHg', 'BitbucketGit', + 'BitbucketHg', 'ExternalGit', 'ExternalHg', 'OneDrive', 'VSO' + :type scm_type: str or ~azure.mgmt.web.models.ScmType + :param use32_bit_worker_process: true to use 32-bit worker + process; otherwise, false. + :type use32_bit_worker_process: bool + :param web_sockets_enabled: true if WebSocket is enabled; + otherwise, false. + :type web_sockets_enabled: bool + :param always_on: true if Always On is enabled; otherwise, + false. + :type always_on: bool + :param java_version: Java version. + :type java_version: str + :param java_container: Java container. + :type java_container: str + :param java_container_version: Java container version. + :type java_container_version: str + :param app_command_line: App command line to launch. + :type app_command_line: str + :param managed_pipeline_mode: Managed pipeline mode. Possible values + include: 'Integrated', 'Classic' + :type managed_pipeline_mode: str or + ~azure.mgmt.web.models.ManagedPipelineMode + :param virtual_applications: Virtual applications. + :type virtual_applications: + list[~azure.mgmt.web.models.VirtualApplication] + :param load_balancing: Site load balancing. Possible values include: + 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', + 'WeightedTotalTraffic', 'RequestHash' + :type load_balancing: str or ~azure.mgmt.web.models.SiteLoadBalancing + :param experiments: This is work around for polymophic types. + :type experiments: ~azure.mgmt.web.models.Experiments + :param limits: Site limits. + :type limits: ~azure.mgmt.web.models.SiteLimits + :param auto_heal_enabled: true if Auto Heal is enabled; + otherwise, false. + :type auto_heal_enabled: bool + :param auto_heal_rules: Auto Heal rules. + :type auto_heal_rules: ~azure.mgmt.web.models.AutoHealRules + :param tracing_options: Tracing options. + :type tracing_options: str + :param vnet_name: Virtual Network name. + :type vnet_name: str + :param cors: Cross-Origin Resource Sharing (CORS) settings. + :type cors: ~azure.mgmt.web.models.CorsSettings + :param push: Push endpoint settings. + :type push: ~azure.mgmt.web.models.PushSettings + :param api_definition: Information about the formal API definition for the + app. + :type api_definition: ~azure.mgmt.web.models.ApiDefinitionInfo + :param auto_swap_slot_name: Auto-swap slot name. + :type auto_swap_slot_name: str + :param local_my_sql_enabled: true to enable local MySQL; + otherwise, false. Default value: False . + :type local_my_sql_enabled: bool + :param ip_security_restrictions: IP security restrictions. + :type ip_security_restrictions: + list[~azure.mgmt.web.models.IpSecurityRestriction] + :param http20_enabled: Http20Enabled: configures a web site to allow + clients to connect over http2.0. Default value: True . + :type http20_enabled: bool + :param min_tls_version: MinTlsVersion: configures the minimum version of + TLS required for SSL requests. Possible values include: '1.0', '1.1', + '1.2' + :type min_tls_version: str or ~azure.mgmt.web.models.SupportedTlsVersions + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'machine_key': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'number_of_workers': {'key': 'properties.numberOfWorkers', 'type': 'int'}, + 'default_documents': {'key': 'properties.defaultDocuments', 'type': '[str]'}, + 'net_framework_version': {'key': 'properties.netFrameworkVersion', 'type': 'str'}, + 'php_version': {'key': 'properties.phpVersion', 'type': 'str'}, + 'python_version': {'key': 'properties.pythonVersion', 'type': 'str'}, + 'node_version': {'key': 'properties.nodeVersion', 'type': 'str'}, + 'linux_fx_version': {'key': 'properties.linuxFxVersion', 'type': 'str'}, + 'request_tracing_enabled': {'key': 'properties.requestTracingEnabled', 'type': 'bool'}, + 'request_tracing_expiration_time': {'key': 'properties.requestTracingExpirationTime', 'type': 'iso-8601'}, + 'remote_debugging_enabled': {'key': 'properties.remoteDebuggingEnabled', 'type': 'bool'}, + 'remote_debugging_version': {'key': 'properties.remoteDebuggingVersion', 'type': 'str'}, + 'http_logging_enabled': {'key': 'properties.httpLoggingEnabled', 'type': 'bool'}, + 'logs_directory_size_limit': {'key': 'properties.logsDirectorySizeLimit', 'type': 'int'}, + 'detailed_error_logging_enabled': {'key': 'properties.detailedErrorLoggingEnabled', 'type': 'bool'}, + 'publishing_username': {'key': 'properties.publishingUsername', 'type': 'str'}, + 'app_settings': {'key': 'properties.appSettings', 'type': '[NameValuePair]'}, + 'connection_strings': {'key': 'properties.connectionStrings', 'type': '[ConnStringInfo]'}, + 'machine_key': {'key': 'properties.machineKey', 'type': 'SiteMachineKey'}, + 'handler_mappings': {'key': 'properties.handlerMappings', 'type': '[HandlerMapping]'}, + 'document_root': {'key': 'properties.documentRoot', 'type': 'str'}, + 'scm_type': {'key': 'properties.scmType', 'type': 'str'}, + 'use32_bit_worker_process': {'key': 'properties.use32BitWorkerProcess', 'type': 'bool'}, + 'web_sockets_enabled': {'key': 'properties.webSocketsEnabled', 'type': 'bool'}, + 'always_on': {'key': 'properties.alwaysOn', 'type': 'bool'}, + 'java_version': {'key': 'properties.javaVersion', 'type': 'str'}, + 'java_container': {'key': 'properties.javaContainer', 'type': 'str'}, + 'java_container_version': {'key': 'properties.javaContainerVersion', 'type': 'str'}, + 'app_command_line': {'key': 'properties.appCommandLine', 'type': 'str'}, + 'managed_pipeline_mode': {'key': 'properties.managedPipelineMode', 'type': 'ManagedPipelineMode'}, + 'virtual_applications': {'key': 'properties.virtualApplications', 'type': '[VirtualApplication]'}, + 'load_balancing': {'key': 'properties.loadBalancing', 'type': 'SiteLoadBalancing'}, + 'experiments': {'key': 'properties.experiments', 'type': 'Experiments'}, + 'limits': {'key': 'properties.limits', 'type': 'SiteLimits'}, + 'auto_heal_enabled': {'key': 'properties.autoHealEnabled', 'type': 'bool'}, + 'auto_heal_rules': {'key': 'properties.autoHealRules', 'type': 'AutoHealRules'}, + 'tracing_options': {'key': 'properties.tracingOptions', 'type': 'str'}, + 'vnet_name': {'key': 'properties.vnetName', 'type': 'str'}, + 'cors': {'key': 'properties.cors', 'type': 'CorsSettings'}, + 'push': {'key': 'properties.push', 'type': 'PushSettings'}, + 'api_definition': {'key': 'properties.apiDefinition', 'type': 'ApiDefinitionInfo'}, + 'auto_swap_slot_name': {'key': 'properties.autoSwapSlotName', 'type': 'str'}, + 'local_my_sql_enabled': {'key': 'properties.localMySqlEnabled', 'type': 'bool'}, + 'ip_security_restrictions': {'key': 'properties.ipSecurityRestrictions', 'type': '[IpSecurityRestriction]'}, + 'http20_enabled': {'key': 'properties.http20Enabled', 'type': 'bool'}, + 'min_tls_version': {'key': 'properties.minTlsVersion', 'type': 'str'}, + } + + def __init__(self, *, kind: str=None, number_of_workers: int=None, default_documents=None, net_framework_version: str="v4.6", php_version: str=None, python_version: str=None, node_version: str=None, linux_fx_version: str=None, request_tracing_enabled: bool=None, request_tracing_expiration_time=None, remote_debugging_enabled: bool=None, remote_debugging_version: str=None, http_logging_enabled: bool=None, logs_directory_size_limit: int=None, detailed_error_logging_enabled: bool=None, publishing_username: str=None, app_settings=None, connection_strings=None, handler_mappings=None, document_root: str=None, scm_type=None, use32_bit_worker_process: bool=None, web_sockets_enabled: bool=None, always_on: bool=None, java_version: str=None, java_container: str=None, java_container_version: str=None, app_command_line: str=None, managed_pipeline_mode=None, virtual_applications=None, load_balancing=None, experiments=None, limits=None, auto_heal_enabled: bool=None, auto_heal_rules=None, tracing_options: str=None, vnet_name: str=None, cors=None, push=None, api_definition=None, auto_swap_slot_name: str=None, local_my_sql_enabled: bool=False, ip_security_restrictions=None, http20_enabled: bool=True, min_tls_version=None, **kwargs) -> None: + super(SiteConfigResource, self).__init__(kind=kind, **kwargs) + self.number_of_workers = number_of_workers + self.default_documents = default_documents + self.net_framework_version = net_framework_version + self.php_version = php_version + self.python_version = python_version + self.node_version = node_version + self.linux_fx_version = linux_fx_version + self.request_tracing_enabled = request_tracing_enabled + self.request_tracing_expiration_time = request_tracing_expiration_time + self.remote_debugging_enabled = remote_debugging_enabled + self.remote_debugging_version = remote_debugging_version + self.http_logging_enabled = http_logging_enabled + self.logs_directory_size_limit = logs_directory_size_limit + self.detailed_error_logging_enabled = detailed_error_logging_enabled + self.publishing_username = publishing_username + self.app_settings = app_settings + self.connection_strings = connection_strings + self.machine_key = None + self.handler_mappings = handler_mappings + self.document_root = document_root + self.scm_type = scm_type + self.use32_bit_worker_process = use32_bit_worker_process + self.web_sockets_enabled = web_sockets_enabled + self.always_on = always_on + self.java_version = java_version + self.java_container = java_container + self.java_container_version = java_container_version + self.app_command_line = app_command_line + self.managed_pipeline_mode = managed_pipeline_mode + self.virtual_applications = virtual_applications + self.load_balancing = load_balancing + self.experiments = experiments + self.limits = limits + self.auto_heal_enabled = auto_heal_enabled + self.auto_heal_rules = auto_heal_rules + self.tracing_options = tracing_options + self.vnet_name = vnet_name + self.cors = cors + self.push = push + self.api_definition = api_definition + self.auto_swap_slot_name = auto_swap_slot_name + self.local_my_sql_enabled = local_my_sql_enabled + self.ip_security_restrictions = ip_security_restrictions + self.http20_enabled = http20_enabled + self.min_tls_version = min_tls_version diff --git a/azure-mgmt-web/azure/mgmt/web/models/site_configuration_snapshot_info.py b/azure-mgmt-web/azure/mgmt/web/models/site_configuration_snapshot_info.py index 6cb6fb32764f..3e73e8b95d20 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/site_configuration_snapshot_info.py +++ b/azure-mgmt-web/azure/mgmt/web/models/site_configuration_snapshot_info.py @@ -49,7 +49,7 @@ class SiteConfigurationSnapshotInfo(ProxyOnlyResource): 'site_configuration_snapshot_info_id': {'key': 'properties.id', 'type': 'int'}, } - def __init__(self, kind=None): - super(SiteConfigurationSnapshotInfo, self).__init__(kind=kind) + def __init__(self, **kwargs): + super(SiteConfigurationSnapshotInfo, self).__init__(**kwargs) self.time = None self.site_configuration_snapshot_info_id = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/site_configuration_snapshot_info_py3.py b/azure-mgmt-web/azure/mgmt/web/models/site_configuration_snapshot_info_py3.py new file mode 100644 index 000000000000..972073873d0b --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/site_configuration_snapshot_info_py3.py @@ -0,0 +1,55 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class SiteConfigurationSnapshotInfo(ProxyOnlyResource): + """A snapshot of a web app configuration. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar time: The time the snapshot was taken. + :vartype time: datetime + :ivar site_configuration_snapshot_info_id: The id of the snapshot + :vartype site_configuration_snapshot_info_id: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'time': {'readonly': True}, + 'site_configuration_snapshot_info_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'time': {'key': 'properties.time', 'type': 'iso-8601'}, + 'site_configuration_snapshot_info_id': {'key': 'properties.id', 'type': 'int'}, + } + + def __init__(self, *, kind: str=None, **kwargs) -> None: + super(SiteConfigurationSnapshotInfo, self).__init__(kind=kind, **kwargs) + self.time = None + self.site_configuration_snapshot_info_id = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/site_extension_info.py b/azure-mgmt-web/azure/mgmt/web/models/site_extension_info.py index f09fd23f9e9e..d00ab6c3dbfe 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/site_extension_info.py +++ b/azure-mgmt-web/azure/mgmt/web/models/site_extension_info.py @@ -104,25 +104,25 @@ class SiteExtensionInfo(ProxyOnlyResource): 'comment': {'key': 'properties.comment', 'type': 'str'}, } - def __init__(self, kind=None, site_extension_info_id=None, title=None, site_extension_info_type=None, summary=None, description=None, version=None, extension_url=None, project_url=None, icon_url=None, license_url=None, feed_url=None, authors=None, installation_args=None, published_date_time=None, download_count=None, local_is_latest_version=None, local_path=None, installed_date_time=None, provisioning_state=None, comment=None): - super(SiteExtensionInfo, self).__init__(kind=kind) - self.site_extension_info_id = site_extension_info_id - self.title = title - self.site_extension_info_type = site_extension_info_type - self.summary = summary - self.description = description - self.version = version - self.extension_url = extension_url - self.project_url = project_url - self.icon_url = icon_url - self.license_url = license_url - self.feed_url = feed_url - self.authors = authors - self.installation_args = installation_args - self.published_date_time = published_date_time - self.download_count = download_count - self.local_is_latest_version = local_is_latest_version - self.local_path = local_path - self.installed_date_time = installed_date_time - self.provisioning_state = provisioning_state - self.comment = comment + def __init__(self, **kwargs): + super(SiteExtensionInfo, self).__init__(**kwargs) + self.site_extension_info_id = kwargs.get('site_extension_info_id', None) + self.title = kwargs.get('title', None) + self.site_extension_info_type = kwargs.get('site_extension_info_type', None) + self.summary = kwargs.get('summary', None) + self.description = kwargs.get('description', None) + self.version = kwargs.get('version', None) + self.extension_url = kwargs.get('extension_url', None) + self.project_url = kwargs.get('project_url', None) + self.icon_url = kwargs.get('icon_url', None) + self.license_url = kwargs.get('license_url', None) + self.feed_url = kwargs.get('feed_url', None) + self.authors = kwargs.get('authors', None) + self.installation_args = kwargs.get('installation_args', None) + self.published_date_time = kwargs.get('published_date_time', None) + self.download_count = kwargs.get('download_count', None) + self.local_is_latest_version = kwargs.get('local_is_latest_version', None) + self.local_path = kwargs.get('local_path', None) + self.installed_date_time = kwargs.get('installed_date_time', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.comment = kwargs.get('comment', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/site_extension_info_py3.py b/azure-mgmt-web/azure/mgmt/web/models/site_extension_info_py3.py new file mode 100644 index 000000000000..0da72800bfff --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/site_extension_info_py3.py @@ -0,0 +1,128 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class SiteExtensionInfo(ProxyOnlyResource): + """Site Extension Information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param site_extension_info_id: Site extension ID. + :type site_extension_info_id: str + :param title: Site extension title. + :type title: str + :param site_extension_info_type: Site extension type. Possible values + include: 'Gallery', 'WebRoot' + :type site_extension_info_type: str or + ~azure.mgmt.web.models.SiteExtensionType + :param summary: Summary description. + :type summary: str + :param description: Detailed description. + :type description: str + :param version: Version information. + :type version: str + :param extension_url: Extension URL. + :type extension_url: str + :param project_url: Project URL. + :type project_url: str + :param icon_url: Icon URL. + :type icon_url: str + :param license_url: License URL. + :type license_url: str + :param feed_url: Feed URL. + :type feed_url: str + :param authors: List of authors. + :type authors: list[str] + :param installation_args: Installer command line parameters. + :type installation_args: str + :param published_date_time: Published timestamp. + :type published_date_time: datetime + :param download_count: Count of downloads. + :type download_count: int + :param local_is_latest_version: true if the local version is + the latest version; false otherwise. + :type local_is_latest_version: bool + :param local_path: Local path. + :type local_path: str + :param installed_date_time: Installed timestamp. + :type installed_date_time: datetime + :param provisioning_state: Provisioning state. + :type provisioning_state: str + :param comment: Site Extension comment. + :type comment: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'site_extension_info_id': {'key': 'properties.id', 'type': 'str'}, + 'title': {'key': 'properties.title', 'type': 'str'}, + 'site_extension_info_type': {'key': 'properties.type', 'type': 'SiteExtensionType'}, + 'summary': {'key': 'properties.summary', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'extension_url': {'key': 'properties.extensionUrl', 'type': 'str'}, + 'project_url': {'key': 'properties.projectUrl', 'type': 'str'}, + 'icon_url': {'key': 'properties.iconUrl', 'type': 'str'}, + 'license_url': {'key': 'properties.licenseUrl', 'type': 'str'}, + 'feed_url': {'key': 'properties.feedUrl', 'type': 'str'}, + 'authors': {'key': 'properties.authors', 'type': '[str]'}, + 'installation_args': {'key': 'properties.installationArgs', 'type': 'str'}, + 'published_date_time': {'key': 'properties.publishedDateTime', 'type': 'iso-8601'}, + 'download_count': {'key': 'properties.downloadCount', 'type': 'int'}, + 'local_is_latest_version': {'key': 'properties.localIsLatestVersion', 'type': 'bool'}, + 'local_path': {'key': 'properties.localPath', 'type': 'str'}, + 'installed_date_time': {'key': 'properties.installedDateTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'comment': {'key': 'properties.comment', 'type': 'str'}, + } + + def __init__(self, *, kind: str=None, site_extension_info_id: str=None, title: str=None, site_extension_info_type=None, summary: str=None, description: str=None, version: str=None, extension_url: str=None, project_url: str=None, icon_url: str=None, license_url: str=None, feed_url: str=None, authors=None, installation_args: str=None, published_date_time=None, download_count: int=None, local_is_latest_version: bool=None, local_path: str=None, installed_date_time=None, provisioning_state: str=None, comment: str=None, **kwargs) -> None: + super(SiteExtensionInfo, self).__init__(kind=kind, **kwargs) + self.site_extension_info_id = site_extension_info_id + self.title = title + self.site_extension_info_type = site_extension_info_type + self.summary = summary + self.description = description + self.version = version + self.extension_url = extension_url + self.project_url = project_url + self.icon_url = icon_url + self.license_url = license_url + self.feed_url = feed_url + self.authors = authors + self.installation_args = installation_args + self.published_date_time = published_date_time + self.download_count = download_count + self.local_is_latest_version = local_is_latest_version + self.local_path = local_path + self.installed_date_time = installed_date_time + self.provisioning_state = provisioning_state + self.comment = comment diff --git a/azure-mgmt-web/azure/mgmt/web/models/site_instance.py b/azure-mgmt-web/azure/mgmt/web/models/site_instance.py index dfd3fc7c4fd3..fa25964c4357 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/site_instance.py +++ b/azure-mgmt-web/azure/mgmt/web/models/site_instance.py @@ -45,6 +45,6 @@ class SiteInstance(ProxyOnlyResource): 'site_instance_name': {'key': 'properties.name', 'type': 'str'}, } - def __init__(self, kind=None): - super(SiteInstance, self).__init__(kind=kind) + def __init__(self, **kwargs): + super(SiteInstance, self).__init__(**kwargs) self.site_instance_name = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/site_instance_py3.py b/azure-mgmt-web/azure/mgmt/web/models/site_instance_py3.py new file mode 100644 index 000000000000..1a4bba4e38b6 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/site_instance_py3.py @@ -0,0 +1,50 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class SiteInstance(ProxyOnlyResource): + """Instance of an app. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar site_instance_name: Name of instance. + :vartype site_instance_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'site_instance_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'site_instance_name': {'key': 'properties.name', 'type': 'str'}, + } + + def __init__(self, *, kind: str=None, **kwargs) -> None: + super(SiteInstance, self).__init__(kind=kind, **kwargs) + self.site_instance_name = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/site_limits.py b/azure-mgmt-web/azure/mgmt/web/models/site_limits.py index f1e9cca487a1..d56d77d48e01 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/site_limits.py +++ b/azure-mgmt-web/azure/mgmt/web/models/site_limits.py @@ -29,8 +29,8 @@ class SiteLimits(Model): 'max_disk_size_in_mb': {'key': 'maxDiskSizeInMb', 'type': 'long'}, } - def __init__(self, max_percentage_cpu=None, max_memory_in_mb=None, max_disk_size_in_mb=None): - super(SiteLimits, self).__init__() - self.max_percentage_cpu = max_percentage_cpu - self.max_memory_in_mb = max_memory_in_mb - self.max_disk_size_in_mb = max_disk_size_in_mb + def __init__(self, **kwargs): + super(SiteLimits, self).__init__(**kwargs) + self.max_percentage_cpu = kwargs.get('max_percentage_cpu', None) + self.max_memory_in_mb = kwargs.get('max_memory_in_mb', None) + self.max_disk_size_in_mb = kwargs.get('max_disk_size_in_mb', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/site_limits_py3.py b/azure-mgmt-web/azure/mgmt/web/models/site_limits_py3.py new file mode 100644 index 000000000000..2f58a349bca9 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/site_limits_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class SiteLimits(Model): + """Metric limits set on an app. + + :param max_percentage_cpu: Maximum allowed CPU usage percentage. + :type max_percentage_cpu: float + :param max_memory_in_mb: Maximum allowed memory usage in MB. + :type max_memory_in_mb: long + :param max_disk_size_in_mb: Maximum allowed disk size usage in MB. + :type max_disk_size_in_mb: long + """ + + _attribute_map = { + 'max_percentage_cpu': {'key': 'maxPercentageCpu', 'type': 'float'}, + 'max_memory_in_mb': {'key': 'maxMemoryInMb', 'type': 'long'}, + 'max_disk_size_in_mb': {'key': 'maxDiskSizeInMb', 'type': 'long'}, + } + + def __init__(self, *, max_percentage_cpu: float=None, max_memory_in_mb: int=None, max_disk_size_in_mb: int=None, **kwargs) -> None: + super(SiteLimits, self).__init__(**kwargs) + self.max_percentage_cpu = max_percentage_cpu + self.max_memory_in_mb = max_memory_in_mb + self.max_disk_size_in_mb = max_disk_size_in_mb diff --git a/azure-mgmt-web/azure/mgmt/web/models/site_logs_config.py b/azure-mgmt-web/azure/mgmt/web/models/site_logs_config.py index 8a5be995652d..c637d918bb78 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/site_logs_config.py +++ b/azure-mgmt-web/azure/mgmt/web/models/site_logs_config.py @@ -53,9 +53,9 @@ class SiteLogsConfig(ProxyOnlyResource): 'detailed_error_messages': {'key': 'properties.detailedErrorMessages', 'type': 'EnabledConfig'}, } - def __init__(self, kind=None, application_logs=None, http_logs=None, failed_requests_tracing=None, detailed_error_messages=None): - super(SiteLogsConfig, self).__init__(kind=kind) - self.application_logs = application_logs - self.http_logs = http_logs - self.failed_requests_tracing = failed_requests_tracing - self.detailed_error_messages = detailed_error_messages + def __init__(self, **kwargs): + super(SiteLogsConfig, self).__init__(**kwargs) + self.application_logs = kwargs.get('application_logs', None) + self.http_logs = kwargs.get('http_logs', None) + self.failed_requests_tracing = kwargs.get('failed_requests_tracing', None) + self.detailed_error_messages = kwargs.get('detailed_error_messages', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/site_logs_config_py3.py b/azure-mgmt-web/azure/mgmt/web/models/site_logs_config_py3.py new file mode 100644 index 000000000000..27b9dbeacf0a --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/site_logs_config_py3.py @@ -0,0 +1,61 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class SiteLogsConfig(ProxyOnlyResource): + """Configuration of App Service site logs. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param application_logs: Application logs configuration. + :type application_logs: ~azure.mgmt.web.models.ApplicationLogsConfig + :param http_logs: HTTP logs configuration. + :type http_logs: ~azure.mgmt.web.models.HttpLogsConfig + :param failed_requests_tracing: Failed requests tracing configuration. + :type failed_requests_tracing: ~azure.mgmt.web.models.EnabledConfig + :param detailed_error_messages: Detailed error messages configuration. + :type detailed_error_messages: ~azure.mgmt.web.models.EnabledConfig + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'application_logs': {'key': 'properties.applicationLogs', 'type': 'ApplicationLogsConfig'}, + 'http_logs': {'key': 'properties.httpLogs', 'type': 'HttpLogsConfig'}, + 'failed_requests_tracing': {'key': 'properties.failedRequestsTracing', 'type': 'EnabledConfig'}, + 'detailed_error_messages': {'key': 'properties.detailedErrorMessages', 'type': 'EnabledConfig'}, + } + + def __init__(self, *, kind: str=None, application_logs=None, http_logs=None, failed_requests_tracing=None, detailed_error_messages=None, **kwargs) -> None: + super(SiteLogsConfig, self).__init__(kind=kind, **kwargs) + self.application_logs = application_logs + self.http_logs = http_logs + self.failed_requests_tracing = failed_requests_tracing + self.detailed_error_messages = detailed_error_messages diff --git a/azure-mgmt-web/azure/mgmt/web/models/site_machine_key.py b/azure-mgmt-web/azure/mgmt/web/models/site_machine_key.py index 4da2087e595d..46c20e72b102 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/site_machine_key.py +++ b/azure-mgmt-web/azure/mgmt/web/models/site_machine_key.py @@ -32,9 +32,9 @@ class SiteMachineKey(Model): 'decryption_key': {'key': 'decryptionKey', 'type': 'str'}, } - def __init__(self, validation=None, validation_key=None, decryption=None, decryption_key=None): - super(SiteMachineKey, self).__init__() - self.validation = validation - self.validation_key = validation_key - self.decryption = decryption - self.decryption_key = decryption_key + def __init__(self, **kwargs): + super(SiteMachineKey, self).__init__(**kwargs) + self.validation = kwargs.get('validation', None) + self.validation_key = kwargs.get('validation_key', None) + self.decryption = kwargs.get('decryption', None) + self.decryption_key = kwargs.get('decryption_key', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/site_machine_key_py3.py b/azure-mgmt-web/azure/mgmt/web/models/site_machine_key_py3.py new file mode 100644 index 000000000000..55b1f1f0798f --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/site_machine_key_py3.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class SiteMachineKey(Model): + """MachineKey of an app. + + :param validation: MachineKey validation. + :type validation: str + :param validation_key: Validation key. + :type validation_key: str + :param decryption: Algorithm used for decryption. + :type decryption: str + :param decryption_key: Decryption key. + :type decryption_key: str + """ + + _attribute_map = { + 'validation': {'key': 'validation', 'type': 'str'}, + 'validation_key': {'key': 'validationKey', 'type': 'str'}, + 'decryption': {'key': 'decryption', 'type': 'str'}, + 'decryption_key': {'key': 'decryptionKey', 'type': 'str'}, + } + + def __init__(self, *, validation: str=None, validation_key: str=None, decryption: str=None, decryption_key: str=None, **kwargs) -> None: + super(SiteMachineKey, self).__init__(**kwargs) + self.validation = validation + self.validation_key = validation_key + self.decryption = decryption + self.decryption_key = decryption_key diff --git a/azure-mgmt-web/azure/mgmt/web/models/site_patch_resource.py b/azure-mgmt-web/azure/mgmt/web/models/site_patch_resource.py index 02d64d06af90..029f78ffa8dc 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/site_patch_resource.py +++ b/azure-mgmt-web/azure/mgmt/web/models/site_patch_resource.py @@ -194,37 +194,37 @@ class SitePatchResource(ProxyOnlyResource): 'https_only': {'key': 'properties.httpsOnly', 'type': 'bool'}, } - def __init__(self, kind=None, enabled=None, host_name_ssl_states=None, server_farm_id=None, reserved=False, site_config=None, scm_site_also_stopped=False, hosting_environment_profile=None, client_affinity_enabled=None, client_cert_enabled=None, host_names_disabled=None, container_size=None, daily_memory_time_quota=None, cloning_info=None, snapshot_info=None, https_only=None): - super(SitePatchResource, self).__init__(kind=kind) + def __init__(self, **kwargs): + super(SitePatchResource, self).__init__(**kwargs) self.state = None self.host_names = None self.repository_site_name = None self.usage_state = None - self.enabled = enabled + self.enabled = kwargs.get('enabled', None) self.enabled_host_names = None self.availability_state = None - self.host_name_ssl_states = host_name_ssl_states - self.server_farm_id = server_farm_id - self.reserved = reserved + self.host_name_ssl_states = kwargs.get('host_name_ssl_states', None) + self.server_farm_id = kwargs.get('server_farm_id', None) + self.reserved = kwargs.get('reserved', False) self.last_modified_time_utc = None - self.site_config = site_config + self.site_config = kwargs.get('site_config', None) self.traffic_manager_host_names = None - self.scm_site_also_stopped = scm_site_also_stopped + self.scm_site_also_stopped = kwargs.get('scm_site_also_stopped', False) self.target_swap_slot = None - self.hosting_environment_profile = hosting_environment_profile - self.client_affinity_enabled = client_affinity_enabled - self.client_cert_enabled = client_cert_enabled - self.host_names_disabled = host_names_disabled + self.hosting_environment_profile = kwargs.get('hosting_environment_profile', None) + self.client_affinity_enabled = kwargs.get('client_affinity_enabled', None) + self.client_cert_enabled = kwargs.get('client_cert_enabled', None) + self.host_names_disabled = kwargs.get('host_names_disabled', None) self.outbound_ip_addresses = None self.possible_outbound_ip_addresses = None - self.container_size = container_size - self.daily_memory_time_quota = daily_memory_time_quota + self.container_size = kwargs.get('container_size', None) + self.daily_memory_time_quota = kwargs.get('daily_memory_time_quota', None) self.suspended_till = None self.max_number_of_workers = None - self.cloning_info = cloning_info - self.snapshot_info = snapshot_info + self.cloning_info = kwargs.get('cloning_info', None) + self.snapshot_info = kwargs.get('snapshot_info', None) self.resource_group = None self.is_default_container = None self.default_host_name = None self.slot_swap_status = None - self.https_only = https_only + self.https_only = kwargs.get('https_only', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/site_patch_resource_py3.py b/azure-mgmt-web/azure/mgmt/web/models/site_patch_resource_py3.py new file mode 100644 index 000000000000..f5c9cfdf54af --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/site_patch_resource_py3.py @@ -0,0 +1,230 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class SitePatchResource(ProxyOnlyResource): + """ARM resource for a site. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar state: Current state of the app. + :vartype state: str + :ivar host_names: Hostnames associated with the app. + :vartype host_names: list[str] + :ivar repository_site_name: Name of the repository site. + :vartype repository_site_name: str + :ivar usage_state: State indicating whether the app has exceeded its quota + usage. Read-only. Possible values include: 'Normal', 'Exceeded' + :vartype usage_state: str or ~azure.mgmt.web.models.UsageState + :param enabled: true if the app is enabled; otherwise, + false. Setting this value to false disables the app (takes + the app offline). + :type enabled: bool + :ivar enabled_host_names: Enabled hostnames for the app.Hostnames need to + be assigned (see HostNames) AND enabled. Otherwise, + the app is not served on those hostnames. + :vartype enabled_host_names: list[str] + :ivar availability_state: Management information availability state for + the app. Possible values include: 'Normal', 'Limited', + 'DisasterRecoveryMode' + :vartype availability_state: str or + ~azure.mgmt.web.models.SiteAvailabilityState + :param host_name_ssl_states: Hostname SSL states are used to manage the + SSL bindings for app's hostnames. + :type host_name_ssl_states: list[~azure.mgmt.web.models.HostNameSslState] + :param server_farm_id: Resource ID of the associated App Service plan, + formatted as: + "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + :type server_farm_id: str + :param reserved: true if reserved; otherwise, + false. Default value: False . + :type reserved: bool + :ivar last_modified_time_utc: Last time the app was modified, in UTC. + Read-only. + :vartype last_modified_time_utc: datetime + :param site_config: Configuration of the app. + :type site_config: ~azure.mgmt.web.models.SiteConfig + :ivar traffic_manager_host_names: Azure Traffic Manager hostnames + associated with the app. Read-only. + :vartype traffic_manager_host_names: list[str] + :param scm_site_also_stopped: true to stop SCM (KUDU) site + when the app is stopped; otherwise, false. The default is + false. Default value: False . + :type scm_site_also_stopped: bool + :ivar target_swap_slot: Specifies which deployment slot this app will swap + into. Read-only. + :vartype target_swap_slot: str + :param hosting_environment_profile: App Service Environment to use for the + app. + :type hosting_environment_profile: + ~azure.mgmt.web.models.HostingEnvironmentProfile + :param client_affinity_enabled: true to enable client + affinity; false to stop sending session affinity cookies, + which route client requests in the same session to the same instance. + Default is true. + :type client_affinity_enabled: bool + :param client_cert_enabled: true to enable client certificate + authentication (TLS mutual authentication); otherwise, false. + Default is false. + :type client_cert_enabled: bool + :param host_names_disabled: true to disable the public + hostnames of the app; otherwise, false. + If true, the app is only accessible via API management + process. + :type host_names_disabled: bool + :ivar outbound_ip_addresses: List of IP addresses that the app uses for + outbound connections (e.g. database access). Includes VIPs from tenants + that site can be hosted with current settings. Read-only. + :vartype outbound_ip_addresses: str + :ivar possible_outbound_ip_addresses: List of IP addresses that the app + uses for outbound connections (e.g. database access). Includes VIPs from + all tenants. Read-only. + :vartype possible_outbound_ip_addresses: str + :param container_size: Size of the function container. + :type container_size: int + :param daily_memory_time_quota: Maximum allowed daily memory-time quota + (applicable on dynamic apps only). + :type daily_memory_time_quota: int + :ivar suspended_till: App suspended till in case memory-time quota is + exceeded. + :vartype suspended_till: datetime + :ivar max_number_of_workers: Maximum number of workers. + This only applies to Functions container. + :vartype max_number_of_workers: int + :param cloning_info: If specified during app creation, the app is cloned + from a source app. + :type cloning_info: ~azure.mgmt.web.models.CloningInfo + :param snapshot_info: If specified during app creation, the app is created + from a previous snapshot. + :type snapshot_info: ~azure.mgmt.web.models.SnapshotRecoveryRequest + :ivar resource_group: Name of the resource group the app belongs to. + Read-only. + :vartype resource_group: str + :ivar is_default_container: true if the app is a default + container; otherwise, false. + :vartype is_default_container: bool + :ivar default_host_name: Default hostname of the app. Read-only. + :vartype default_host_name: str + :ivar slot_swap_status: Status of the last deployment slot swap operation. + :vartype slot_swap_status: ~azure.mgmt.web.models.SlotSwapStatus + :param https_only: HttpsOnly: configures a web site to accept only https + requests. Issues redirect for + http requests + :type https_only: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'state': {'readonly': True}, + 'host_names': {'readonly': True}, + 'repository_site_name': {'readonly': True}, + 'usage_state': {'readonly': True}, + 'enabled_host_names': {'readonly': True}, + 'availability_state': {'readonly': True}, + 'last_modified_time_utc': {'readonly': True}, + 'traffic_manager_host_names': {'readonly': True}, + 'target_swap_slot': {'readonly': True}, + 'outbound_ip_addresses': {'readonly': True}, + 'possible_outbound_ip_addresses': {'readonly': True}, + 'suspended_till': {'readonly': True}, + 'max_number_of_workers': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'is_default_container': {'readonly': True}, + 'default_host_name': {'readonly': True}, + 'slot_swap_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'host_names': {'key': 'properties.hostNames', 'type': '[str]'}, + 'repository_site_name': {'key': 'properties.repositorySiteName', 'type': 'str'}, + 'usage_state': {'key': 'properties.usageState', 'type': 'UsageState'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'enabled_host_names': {'key': 'properties.enabledHostNames', 'type': '[str]'}, + 'availability_state': {'key': 'properties.availabilityState', 'type': 'SiteAvailabilityState'}, + 'host_name_ssl_states': {'key': 'properties.hostNameSslStates', 'type': '[HostNameSslState]'}, + 'server_farm_id': {'key': 'properties.serverFarmId', 'type': 'str'}, + 'reserved': {'key': 'properties.reserved', 'type': 'bool'}, + 'last_modified_time_utc': {'key': 'properties.lastModifiedTimeUtc', 'type': 'iso-8601'}, + 'site_config': {'key': 'properties.siteConfig', 'type': 'SiteConfig'}, + 'traffic_manager_host_names': {'key': 'properties.trafficManagerHostNames', 'type': '[str]'}, + 'scm_site_also_stopped': {'key': 'properties.scmSiteAlsoStopped', 'type': 'bool'}, + 'target_swap_slot': {'key': 'properties.targetSwapSlot', 'type': 'str'}, + 'hosting_environment_profile': {'key': 'properties.hostingEnvironmentProfile', 'type': 'HostingEnvironmentProfile'}, + 'client_affinity_enabled': {'key': 'properties.clientAffinityEnabled', 'type': 'bool'}, + 'client_cert_enabled': {'key': 'properties.clientCertEnabled', 'type': 'bool'}, + 'host_names_disabled': {'key': 'properties.hostNamesDisabled', 'type': 'bool'}, + 'outbound_ip_addresses': {'key': 'properties.outboundIpAddresses', 'type': 'str'}, + 'possible_outbound_ip_addresses': {'key': 'properties.possibleOutboundIpAddresses', 'type': 'str'}, + 'container_size': {'key': 'properties.containerSize', 'type': 'int'}, + 'daily_memory_time_quota': {'key': 'properties.dailyMemoryTimeQuota', 'type': 'int'}, + 'suspended_till': {'key': 'properties.suspendedTill', 'type': 'iso-8601'}, + 'max_number_of_workers': {'key': 'properties.maxNumberOfWorkers', 'type': 'int'}, + 'cloning_info': {'key': 'properties.cloningInfo', 'type': 'CloningInfo'}, + 'snapshot_info': {'key': 'properties.snapshotInfo', 'type': 'SnapshotRecoveryRequest'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'is_default_container': {'key': 'properties.isDefaultContainer', 'type': 'bool'}, + 'default_host_name': {'key': 'properties.defaultHostName', 'type': 'str'}, + 'slot_swap_status': {'key': 'properties.slotSwapStatus', 'type': 'SlotSwapStatus'}, + 'https_only': {'key': 'properties.httpsOnly', 'type': 'bool'}, + } + + def __init__(self, *, kind: str=None, enabled: bool=None, host_name_ssl_states=None, server_farm_id: str=None, reserved: bool=False, site_config=None, scm_site_also_stopped: bool=False, hosting_environment_profile=None, client_affinity_enabled: bool=None, client_cert_enabled: bool=None, host_names_disabled: bool=None, container_size: int=None, daily_memory_time_quota: int=None, cloning_info=None, snapshot_info=None, https_only: bool=None, **kwargs) -> None: + super(SitePatchResource, self).__init__(kind=kind, **kwargs) + self.state = None + self.host_names = None + self.repository_site_name = None + self.usage_state = None + self.enabled = enabled + self.enabled_host_names = None + self.availability_state = None + self.host_name_ssl_states = host_name_ssl_states + self.server_farm_id = server_farm_id + self.reserved = reserved + self.last_modified_time_utc = None + self.site_config = site_config + self.traffic_manager_host_names = None + self.scm_site_also_stopped = scm_site_also_stopped + self.target_swap_slot = None + self.hosting_environment_profile = hosting_environment_profile + self.client_affinity_enabled = client_affinity_enabled + self.client_cert_enabled = client_cert_enabled + self.host_names_disabled = host_names_disabled + self.outbound_ip_addresses = None + self.possible_outbound_ip_addresses = None + self.container_size = container_size + self.daily_memory_time_quota = daily_memory_time_quota + self.suspended_till = None + self.max_number_of_workers = None + self.cloning_info = cloning_info + self.snapshot_info = snapshot_info + self.resource_group = None + self.is_default_container = None + self.default_host_name = None + self.slot_swap_status = None + self.https_only = https_only diff --git a/azure-mgmt-web/azure/mgmt/web/models/site_php_error_log_flag.py b/azure-mgmt-web/azure/mgmt/web/models/site_php_error_log_flag.py index b957e542f038..717ea82d2c8a 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/site_php_error_log_flag.py +++ b/azure-mgmt-web/azure/mgmt/web/models/site_php_error_log_flag.py @@ -53,9 +53,9 @@ class SitePhpErrorLogFlag(ProxyOnlyResource): 'master_log_errors_max_length': {'key': 'properties.masterLogErrorsMaxLength', 'type': 'str'}, } - def __init__(self, kind=None, local_log_errors=None, master_log_errors=None, local_log_errors_max_length=None, master_log_errors_max_length=None): - super(SitePhpErrorLogFlag, self).__init__(kind=kind) - self.local_log_errors = local_log_errors - self.master_log_errors = master_log_errors - self.local_log_errors_max_length = local_log_errors_max_length - self.master_log_errors_max_length = master_log_errors_max_length + def __init__(self, **kwargs): + super(SitePhpErrorLogFlag, self).__init__(**kwargs) + self.local_log_errors = kwargs.get('local_log_errors', None) + self.master_log_errors = kwargs.get('master_log_errors', None) + self.local_log_errors_max_length = kwargs.get('local_log_errors_max_length', None) + self.master_log_errors_max_length = kwargs.get('master_log_errors_max_length', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/site_php_error_log_flag_py3.py b/azure-mgmt-web/azure/mgmt/web/models/site_php_error_log_flag_py3.py new file mode 100644 index 000000000000..74d5ed2c0287 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/site_php_error_log_flag_py3.py @@ -0,0 +1,61 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class SitePhpErrorLogFlag(ProxyOnlyResource): + """Used for getting PHP error logging flag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param local_log_errors: Local log_errors setting. + :type local_log_errors: str + :param master_log_errors: Master log_errors setting. + :type master_log_errors: str + :param local_log_errors_max_length: Local log_errors_max_len setting. + :type local_log_errors_max_length: str + :param master_log_errors_max_length: Master log_errors_max_len setting. + :type master_log_errors_max_length: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'local_log_errors': {'key': 'properties.localLogErrors', 'type': 'str'}, + 'master_log_errors': {'key': 'properties.masterLogErrors', 'type': 'str'}, + 'local_log_errors_max_length': {'key': 'properties.localLogErrorsMaxLength', 'type': 'str'}, + 'master_log_errors_max_length': {'key': 'properties.masterLogErrorsMaxLength', 'type': 'str'}, + } + + def __init__(self, *, kind: str=None, local_log_errors: str=None, master_log_errors: str=None, local_log_errors_max_length: str=None, master_log_errors_max_length: str=None, **kwargs) -> None: + super(SitePhpErrorLogFlag, self).__init__(kind=kind, **kwargs) + self.local_log_errors = local_log_errors + self.master_log_errors = master_log_errors + self.local_log_errors_max_length = local_log_errors_max_length + self.master_log_errors_max_length = master_log_errors_max_length diff --git a/azure-mgmt-web/azure/mgmt/web/models/site_py3.py b/azure-mgmt-web/azure/mgmt/web/models/site_py3.py new file mode 100644 index 000000000000..97551eb8ef4a --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/site_py3.py @@ -0,0 +1,243 @@ +# 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 .resource import Resource + + +class Site(Resource): + """A web app, a mobile app backend, or an API 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 Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :ivar state: Current state of the app. + :vartype state: str + :ivar host_names: Hostnames associated with the app. + :vartype host_names: list[str] + :ivar repository_site_name: Name of the repository site. + :vartype repository_site_name: str + :ivar usage_state: State indicating whether the app has exceeded its quota + usage. Read-only. Possible values include: 'Normal', 'Exceeded' + :vartype usage_state: str or ~azure.mgmt.web.models.UsageState + :param enabled: true if the app is enabled; otherwise, + false. Setting this value to false disables the app (takes + the app offline). + :type enabled: bool + :ivar enabled_host_names: Enabled hostnames for the app.Hostnames need to + be assigned (see HostNames) AND enabled. Otherwise, + the app is not served on those hostnames. + :vartype enabled_host_names: list[str] + :ivar availability_state: Management information availability state for + the app. Possible values include: 'Normal', 'Limited', + 'DisasterRecoveryMode' + :vartype availability_state: str or + ~azure.mgmt.web.models.SiteAvailabilityState + :param host_name_ssl_states: Hostname SSL states are used to manage the + SSL bindings for app's hostnames. + :type host_name_ssl_states: list[~azure.mgmt.web.models.HostNameSslState] + :param server_farm_id: Resource ID of the associated App Service plan, + formatted as: + "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + :type server_farm_id: str + :param reserved: true if reserved; otherwise, + false. Default value: False . + :type reserved: bool + :ivar last_modified_time_utc: Last time the app was modified, in UTC. + Read-only. + :vartype last_modified_time_utc: datetime + :param site_config: Configuration of the app. + :type site_config: ~azure.mgmt.web.models.SiteConfig + :ivar traffic_manager_host_names: Azure Traffic Manager hostnames + associated with the app. Read-only. + :vartype traffic_manager_host_names: list[str] + :param scm_site_also_stopped: true to stop SCM (KUDU) site + when the app is stopped; otherwise, false. The default is + false. Default value: False . + :type scm_site_also_stopped: bool + :ivar target_swap_slot: Specifies which deployment slot this app will swap + into. Read-only. + :vartype target_swap_slot: str + :param hosting_environment_profile: App Service Environment to use for the + app. + :type hosting_environment_profile: + ~azure.mgmt.web.models.HostingEnvironmentProfile + :param client_affinity_enabled: true to enable client + affinity; false to stop sending session affinity cookies, + which route client requests in the same session to the same instance. + Default is true. + :type client_affinity_enabled: bool + :param client_cert_enabled: true to enable client certificate + authentication (TLS mutual authentication); otherwise, false. + Default is false. + :type client_cert_enabled: bool + :param host_names_disabled: true to disable the public + hostnames of the app; otherwise, false. + If true, the app is only accessible via API management + process. + :type host_names_disabled: bool + :ivar outbound_ip_addresses: List of IP addresses that the app uses for + outbound connections (e.g. database access). Includes VIPs from tenants + that site can be hosted with current settings. Read-only. + :vartype outbound_ip_addresses: str + :ivar possible_outbound_ip_addresses: List of IP addresses that the app + uses for outbound connections (e.g. database access). Includes VIPs from + all tenants. Read-only. + :vartype possible_outbound_ip_addresses: str + :param container_size: Size of the function container. + :type container_size: int + :param daily_memory_time_quota: Maximum allowed daily memory-time quota + (applicable on dynamic apps only). + :type daily_memory_time_quota: int + :ivar suspended_till: App suspended till in case memory-time quota is + exceeded. + :vartype suspended_till: datetime + :ivar max_number_of_workers: Maximum number of workers. + This only applies to Functions container. + :vartype max_number_of_workers: int + :param cloning_info: If specified during app creation, the app is cloned + from a source app. + :type cloning_info: ~azure.mgmt.web.models.CloningInfo + :param snapshot_info: If specified during app creation, the app is created + from a previous snapshot. + :type snapshot_info: ~azure.mgmt.web.models.SnapshotRecoveryRequest + :ivar resource_group: Name of the resource group the app belongs to. + Read-only. + :vartype resource_group: str + :ivar is_default_container: true if the app is a default + container; otherwise, false. + :vartype is_default_container: bool + :ivar default_host_name: Default hostname of the app. Read-only. + :vartype default_host_name: str + :ivar slot_swap_status: Status of the last deployment slot swap operation. + :vartype slot_swap_status: ~azure.mgmt.web.models.SlotSwapStatus + :param https_only: HttpsOnly: configures a web site to accept only https + requests. Issues redirect for + http requests + :type https_only: bool + :param identity: + :type identity: ~azure.mgmt.web.models.ManagedServiceIdentity + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'state': {'readonly': True}, + 'host_names': {'readonly': True}, + 'repository_site_name': {'readonly': True}, + 'usage_state': {'readonly': True}, + 'enabled_host_names': {'readonly': True}, + 'availability_state': {'readonly': True}, + 'last_modified_time_utc': {'readonly': True}, + 'traffic_manager_host_names': {'readonly': True}, + 'target_swap_slot': {'readonly': True}, + 'outbound_ip_addresses': {'readonly': True}, + 'possible_outbound_ip_addresses': {'readonly': True}, + 'suspended_till': {'readonly': True}, + 'max_number_of_workers': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'is_default_container': {'readonly': True}, + 'default_host_name': {'readonly': True}, + 'slot_swap_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'host_names': {'key': 'properties.hostNames', 'type': '[str]'}, + 'repository_site_name': {'key': 'properties.repositorySiteName', 'type': 'str'}, + 'usage_state': {'key': 'properties.usageState', 'type': 'UsageState'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'enabled_host_names': {'key': 'properties.enabledHostNames', 'type': '[str]'}, + 'availability_state': {'key': 'properties.availabilityState', 'type': 'SiteAvailabilityState'}, + 'host_name_ssl_states': {'key': 'properties.hostNameSslStates', 'type': '[HostNameSslState]'}, + 'server_farm_id': {'key': 'properties.serverFarmId', 'type': 'str'}, + 'reserved': {'key': 'properties.reserved', 'type': 'bool'}, + 'last_modified_time_utc': {'key': 'properties.lastModifiedTimeUtc', 'type': 'iso-8601'}, + 'site_config': {'key': 'properties.siteConfig', 'type': 'SiteConfig'}, + 'traffic_manager_host_names': {'key': 'properties.trafficManagerHostNames', 'type': '[str]'}, + 'scm_site_also_stopped': {'key': 'properties.scmSiteAlsoStopped', 'type': 'bool'}, + 'target_swap_slot': {'key': 'properties.targetSwapSlot', 'type': 'str'}, + 'hosting_environment_profile': {'key': 'properties.hostingEnvironmentProfile', 'type': 'HostingEnvironmentProfile'}, + 'client_affinity_enabled': {'key': 'properties.clientAffinityEnabled', 'type': 'bool'}, + 'client_cert_enabled': {'key': 'properties.clientCertEnabled', 'type': 'bool'}, + 'host_names_disabled': {'key': 'properties.hostNamesDisabled', 'type': 'bool'}, + 'outbound_ip_addresses': {'key': 'properties.outboundIpAddresses', 'type': 'str'}, + 'possible_outbound_ip_addresses': {'key': 'properties.possibleOutboundIpAddresses', 'type': 'str'}, + 'container_size': {'key': 'properties.containerSize', 'type': 'int'}, + 'daily_memory_time_quota': {'key': 'properties.dailyMemoryTimeQuota', 'type': 'int'}, + 'suspended_till': {'key': 'properties.suspendedTill', 'type': 'iso-8601'}, + 'max_number_of_workers': {'key': 'properties.maxNumberOfWorkers', 'type': 'int'}, + 'cloning_info': {'key': 'properties.cloningInfo', 'type': 'CloningInfo'}, + 'snapshot_info': {'key': 'properties.snapshotInfo', 'type': 'SnapshotRecoveryRequest'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'is_default_container': {'key': 'properties.isDefaultContainer', 'type': 'bool'}, + 'default_host_name': {'key': 'properties.defaultHostName', 'type': 'str'}, + 'slot_swap_status': {'key': 'properties.slotSwapStatus', 'type': 'SlotSwapStatus'}, + 'https_only': {'key': 'properties.httpsOnly', 'type': 'bool'}, + 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, + } + + def __init__(self, *, location: str, kind: str=None, tags=None, enabled: bool=None, host_name_ssl_states=None, server_farm_id: str=None, reserved: bool=False, site_config=None, scm_site_also_stopped: bool=False, hosting_environment_profile=None, client_affinity_enabled: bool=None, client_cert_enabled: bool=None, host_names_disabled: bool=None, container_size: int=None, daily_memory_time_quota: int=None, cloning_info=None, snapshot_info=None, https_only: bool=None, identity=None, **kwargs) -> None: + super(Site, self).__init__(kind=kind, location=location, tags=tags, **kwargs) + self.state = None + self.host_names = None + self.repository_site_name = None + self.usage_state = None + self.enabled = enabled + self.enabled_host_names = None + self.availability_state = None + self.host_name_ssl_states = host_name_ssl_states + self.server_farm_id = server_farm_id + self.reserved = reserved + self.last_modified_time_utc = None + self.site_config = site_config + self.traffic_manager_host_names = None + self.scm_site_also_stopped = scm_site_also_stopped + self.target_swap_slot = None + self.hosting_environment_profile = hosting_environment_profile + self.client_affinity_enabled = client_affinity_enabled + self.client_cert_enabled = client_cert_enabled + self.host_names_disabled = host_names_disabled + self.outbound_ip_addresses = None + self.possible_outbound_ip_addresses = None + self.container_size = container_size + self.daily_memory_time_quota = daily_memory_time_quota + self.suspended_till = None + self.max_number_of_workers = None + self.cloning_info = cloning_info + self.snapshot_info = snapshot_info + self.resource_group = None + self.is_default_container = None + self.default_host_name = None + self.slot_swap_status = None + self.https_only = https_only + self.identity = identity diff --git a/azure-mgmt-web/azure/mgmt/web/models/site_seal.py b/azure-mgmt-web/azure/mgmt/web/models/site_seal.py index 8512e5255443..c06f92634aaa 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/site_seal.py +++ b/azure-mgmt-web/azure/mgmt/web/models/site_seal.py @@ -15,7 +15,9 @@ class SiteSeal(Model): """Site seal. - :param html: HTML snippet + All required parameters must be populated in order to send to Azure. + + :param html: Required. HTML snippet :type html: str """ @@ -27,6 +29,6 @@ class SiteSeal(Model): 'html': {'key': 'html', 'type': 'str'}, } - def __init__(self, html): - super(SiteSeal, self).__init__() - self.html = html + def __init__(self, **kwargs): + super(SiteSeal, self).__init__(**kwargs) + self.html = kwargs.get('html', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/site_seal_py3.py b/azure-mgmt-web/azure/mgmt/web/models/site_seal_py3.py new file mode 100644 index 000000000000..141f0f214753 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/site_seal_py3.py @@ -0,0 +1,34 @@ +# 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 msrest.serialization import Model + + +class SiteSeal(Model): + """Site seal. + + All required parameters must be populated in order to send to Azure. + + :param html: Required. HTML snippet + :type html: str + """ + + _validation = { + 'html': {'required': True}, + } + + _attribute_map = { + 'html': {'key': 'html', 'type': 'str'}, + } + + def __init__(self, *, html: str, **kwargs) -> None: + super(SiteSeal, self).__init__(**kwargs) + self.html = html diff --git a/azure-mgmt-web/azure/mgmt/web/models/site_seal_request.py b/azure-mgmt-web/azure/mgmt/web/models/site_seal_request.py index d2bbd785edeb..039baebd82e9 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/site_seal_request.py +++ b/azure-mgmt-web/azure/mgmt/web/models/site_seal_request.py @@ -27,7 +27,7 @@ class SiteSealRequest(Model): 'locale': {'key': 'locale', 'type': 'str'}, } - def __init__(self, light_theme=None, locale=None): - super(SiteSealRequest, self).__init__() - self.light_theme = light_theme - self.locale = locale + def __init__(self, **kwargs): + super(SiteSealRequest, self).__init__(**kwargs) + self.light_theme = kwargs.get('light_theme', None) + self.locale = kwargs.get('locale', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/site_seal_request_py3.py b/azure-mgmt-web/azure/mgmt/web/models/site_seal_request_py3.py new file mode 100644 index 000000000000..033e32201928 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/site_seal_request_py3.py @@ -0,0 +1,33 @@ +# 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 msrest.serialization import Model + + +class SiteSealRequest(Model): + """Site seal request. + + :param light_theme: If true use the light color theme for + site seal; otherwise, use the default color theme. + :type light_theme: bool + :param locale: Locale of site seal. + :type locale: str + """ + + _attribute_map = { + 'light_theme': {'key': 'lightTheme', 'type': 'bool'}, + 'locale': {'key': 'locale', 'type': 'str'}, + } + + def __init__(self, *, light_theme: bool=None, locale: str=None, **kwargs) -> None: + super(SiteSealRequest, self).__init__(**kwargs) + self.light_theme = light_theme + self.locale = locale diff --git a/azure-mgmt-web/azure/mgmt/web/models/site_source_control.py b/azure-mgmt-web/azure/mgmt/web/models/site_source_control.py index 5d296b1d9ccc..97e16982b305 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/site_source_control.py +++ b/azure-mgmt-web/azure/mgmt/web/models/site_source_control.py @@ -60,10 +60,10 @@ class SiteSourceControl(ProxyOnlyResource): 'is_mercurial': {'key': 'properties.isMercurial', 'type': 'bool'}, } - def __init__(self, kind=None, repo_url=None, branch=None, is_manual_integration=None, deployment_rollback_enabled=None, is_mercurial=None): - super(SiteSourceControl, self).__init__(kind=kind) - self.repo_url = repo_url - self.branch = branch - self.is_manual_integration = is_manual_integration - self.deployment_rollback_enabled = deployment_rollback_enabled - self.is_mercurial = is_mercurial + def __init__(self, **kwargs): + super(SiteSourceControl, self).__init__(**kwargs) + self.repo_url = kwargs.get('repo_url', None) + self.branch = kwargs.get('branch', None) + self.is_manual_integration = kwargs.get('is_manual_integration', None) + self.deployment_rollback_enabled = kwargs.get('deployment_rollback_enabled', None) + self.is_mercurial = kwargs.get('is_mercurial', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/site_source_control_py3.py b/azure-mgmt-web/azure/mgmt/web/models/site_source_control_py3.py new file mode 100644 index 000000000000..18f6879380f2 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/site_source_control_py3.py @@ -0,0 +1,69 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class SiteSourceControl(ProxyOnlyResource): + """Source control configuration for an app. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param repo_url: Repository or source control URL. + :type repo_url: str + :param branch: Name of branch to use for deployment. + :type branch: str + :param is_manual_integration: true to limit to manual + integration; false to enable continuous integration (which + configures webhooks into online repos like GitHub). + :type is_manual_integration: bool + :param deployment_rollback_enabled: true to enable deployment + rollback; otherwise, false. + :type deployment_rollback_enabled: bool + :param is_mercurial: true for a Mercurial repository; + false for a Git repository. + :type is_mercurial: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'repo_url': {'key': 'properties.repoUrl', 'type': 'str'}, + 'branch': {'key': 'properties.branch', 'type': 'str'}, + 'is_manual_integration': {'key': 'properties.isManualIntegration', 'type': 'bool'}, + 'deployment_rollback_enabled': {'key': 'properties.deploymentRollbackEnabled', 'type': 'bool'}, + 'is_mercurial': {'key': 'properties.isMercurial', 'type': 'bool'}, + } + + def __init__(self, *, kind: str=None, repo_url: str=None, branch: str=None, is_manual_integration: bool=None, deployment_rollback_enabled: bool=None, is_mercurial: bool=None, **kwargs) -> None: + super(SiteSourceControl, self).__init__(kind=kind, **kwargs) + self.repo_url = repo_url + self.branch = branch + self.is_manual_integration = is_manual_integration + self.deployment_rollback_enabled = deployment_rollback_enabled + self.is_mercurial = is_mercurial diff --git a/azure-mgmt-web/azure/mgmt/web/models/sku_capacity.py b/azure-mgmt-web/azure/mgmt/web/models/sku_capacity.py index 6e3ca3b8378c..1badcfdc803c 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/sku_capacity.py +++ b/azure-mgmt-web/azure/mgmt/web/models/sku_capacity.py @@ -32,9 +32,9 @@ class SkuCapacity(Model): 'scale_type': {'key': 'scaleType', 'type': 'str'}, } - def __init__(self, minimum=None, maximum=None, default=None, scale_type=None): - super(SkuCapacity, self).__init__() - self.minimum = minimum - self.maximum = maximum - self.default = default - self.scale_type = scale_type + def __init__(self, **kwargs): + super(SkuCapacity, self).__init__(**kwargs) + self.minimum = kwargs.get('minimum', None) + self.maximum = kwargs.get('maximum', None) + self.default = kwargs.get('default', None) + self.scale_type = kwargs.get('scale_type', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/sku_capacity_py3.py b/azure-mgmt-web/azure/mgmt/web/models/sku_capacity_py3.py new file mode 100644 index 000000000000..527a1414a2d5 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/sku_capacity_py3.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class SkuCapacity(Model): + """Description of the App Service plan scale options. + + :param minimum: Minimum number of workers for this App Service plan SKU. + :type minimum: int + :param maximum: Maximum number of workers for this App Service plan SKU. + :type maximum: int + :param default: Default number of workers for this App Service plan SKU. + :type default: int + :param scale_type: Available scale configurations for an App Service plan. + :type scale_type: str + """ + + _attribute_map = { + 'minimum': {'key': 'minimum', 'type': 'int'}, + 'maximum': {'key': 'maximum', 'type': 'int'}, + 'default': {'key': 'default', 'type': 'int'}, + 'scale_type': {'key': 'scaleType', 'type': 'str'}, + } + + def __init__(self, *, minimum: int=None, maximum: int=None, default: int=None, scale_type: str=None, **kwargs) -> None: + super(SkuCapacity, self).__init__(**kwargs) + self.minimum = minimum + self.maximum = maximum + self.default = default + self.scale_type = scale_type diff --git a/azure-mgmt-web/azure/mgmt/web/models/sku_description.py b/azure-mgmt-web/azure/mgmt/web/models/sku_description.py index 4e5ac3fc4498..3e086dfb73d9 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/sku_description.py +++ b/azure-mgmt-web/azure/mgmt/web/models/sku_description.py @@ -45,13 +45,13 @@ class SkuDescription(Model): 'capabilities': {'key': 'capabilities', 'type': '[Capability]'}, } - def __init__(self, name=None, tier=None, size=None, family=None, capacity=None, sku_capacity=None, locations=None, capabilities=None): - super(SkuDescription, self).__init__() - self.name = name - self.tier = tier - self.size = size - self.family = family - self.capacity = capacity - self.sku_capacity = sku_capacity - self.locations = locations - self.capabilities = capabilities + def __init__(self, **kwargs): + super(SkuDescription, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.size = kwargs.get('size', None) + self.family = kwargs.get('family', None) + self.capacity = kwargs.get('capacity', None) + self.sku_capacity = kwargs.get('sku_capacity', None) + self.locations = kwargs.get('locations', None) + self.capabilities = kwargs.get('capabilities', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/sku_description_py3.py b/azure-mgmt-web/azure/mgmt/web/models/sku_description_py3.py new file mode 100644 index 000000000000..1c23aeb7e2c5 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/sku_description_py3.py @@ -0,0 +1,57 @@ +# 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 msrest.serialization import Model + + +class SkuDescription(Model): + """Description of a SKU for a scalable resource. + + :param name: Name of the resource SKU. + :type name: str + :param tier: Service tier of the resource SKU. + :type tier: str + :param size: Size specifier of the resource SKU. + :type size: str + :param family: Family code of the resource SKU. + :type family: str + :param capacity: Current number of instances assigned to the resource. + :type capacity: int + :param sku_capacity: Min, max, and default scale values of the SKU. + :type sku_capacity: ~azure.mgmt.web.models.SkuCapacity + :param locations: Locations of the SKU. + :type locations: list[str] + :param capabilities: Capabilities of the SKU, e.g., is traffic manager + enabled? + :type capabilities: list[~azure.mgmt.web.models.Capability] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + 'sku_capacity': {'key': 'skuCapacity', 'type': 'SkuCapacity'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[Capability]'}, + } + + def __init__(self, *, name: str=None, tier: str=None, size: str=None, family: str=None, capacity: int=None, sku_capacity=None, locations=None, capabilities=None, **kwargs) -> None: + super(SkuDescription, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.size = size + self.family = family + self.capacity = capacity + self.sku_capacity = sku_capacity + self.locations = locations + self.capabilities = capabilities diff --git a/azure-mgmt-web/azure/mgmt/web/models/sku_info.py b/azure-mgmt-web/azure/mgmt/web/models/sku_info.py index 04431f22a4a1..b4935ef3a0e8 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/sku_info.py +++ b/azure-mgmt-web/azure/mgmt/web/models/sku_info.py @@ -29,8 +29,8 @@ class SkuInfo(Model): 'capacity': {'key': 'capacity', 'type': 'SkuCapacity'}, } - def __init__(self, resource_type=None, sku=None, capacity=None): - super(SkuInfo, self).__init__() - self.resource_type = resource_type - self.sku = sku - self.capacity = capacity + def __init__(self, **kwargs): + super(SkuInfo, self).__init__(**kwargs) + self.resource_type = kwargs.get('resource_type', None) + self.sku = kwargs.get('sku', None) + self.capacity = kwargs.get('capacity', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/sku_info_py3.py b/azure-mgmt-web/azure/mgmt/web/models/sku_info_py3.py new file mode 100644 index 000000000000..58c940e0c367 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/sku_info_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class SkuInfo(Model): + """SKU discovery information. + + :param resource_type: Resource type that this SKU applies to. + :type resource_type: str + :param sku: Name and tier of the SKU. + :type sku: ~azure.mgmt.web.models.SkuDescription + :param capacity: Min, max, and default scale values of the SKU. + :type capacity: ~azure.mgmt.web.models.SkuCapacity + """ + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'SkuDescription'}, + 'capacity': {'key': 'capacity', 'type': 'SkuCapacity'}, + } + + def __init__(self, *, resource_type: str=None, sku=None, capacity=None, **kwargs) -> None: + super(SkuInfo, self).__init__(**kwargs) + self.resource_type = resource_type + self.sku = sku + self.capacity = capacity diff --git a/azure-mgmt-web/azure/mgmt/web/models/sku_infos.py b/azure-mgmt-web/azure/mgmt/web/models/sku_infos.py index f5f9fbadd447..3c1c17aa7392 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/sku_infos.py +++ b/azure-mgmt-web/azure/mgmt/web/models/sku_infos.py @@ -26,7 +26,7 @@ class SkuInfos(Model): 'skus': {'key': 'skus', 'type': '[GlobalCsmSkuDescription]'}, } - def __init__(self, resource_type=None, skus=None): - super(SkuInfos, self).__init__() - self.resource_type = resource_type - self.skus = skus + def __init__(self, **kwargs): + super(SkuInfos, self).__init__(**kwargs) + self.resource_type = kwargs.get('resource_type', None) + self.skus = kwargs.get('skus', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/sku_infos_py3.py b/azure-mgmt-web/azure/mgmt/web/models/sku_infos_py3.py new file mode 100644 index 000000000000..e51bc7df9809 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/sku_infos_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class SkuInfos(Model): + """Collection of SKU information. + + :param resource_type: Resource type that this SKU applies to. + :type resource_type: str + :param skus: List of SKUs the subscription is able to use. + :type skus: list[~azure.mgmt.web.models.GlobalCsmSkuDescription] + """ + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'skus': {'key': 'skus', 'type': '[GlobalCsmSkuDescription]'}, + } + + def __init__(self, *, resource_type: str=None, skus=None, **kwargs) -> None: + super(SkuInfos, self).__init__(**kwargs) + self.resource_type = resource_type + self.skus = skus diff --git a/azure-mgmt-web/azure/mgmt/web/models/slot_config_names_resource.py b/azure-mgmt-web/azure/mgmt/web/models/slot_config_names_resource.py index 1bb9f07e671b..6c21dc922423 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/slot_config_names_resource.py +++ b/azure-mgmt-web/azure/mgmt/web/models/slot_config_names_resource.py @@ -47,7 +47,7 @@ class SlotConfigNamesResource(ProxyOnlyResource): 'app_setting_names': {'key': 'properties.appSettingNames', 'type': '[str]'}, } - def __init__(self, kind=None, connection_string_names=None, app_setting_names=None): - super(SlotConfigNamesResource, self).__init__(kind=kind) - self.connection_string_names = connection_string_names - self.app_setting_names = app_setting_names + def __init__(self, **kwargs): + super(SlotConfigNamesResource, self).__init__(**kwargs) + self.connection_string_names = kwargs.get('connection_string_names', None) + self.app_setting_names = kwargs.get('app_setting_names', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/slot_config_names_resource_py3.py b/azure-mgmt-web/azure/mgmt/web/models/slot_config_names_resource_py3.py new file mode 100644 index 000000000000..584f762b671e --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/slot_config_names_resource_py3.py @@ -0,0 +1,53 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class SlotConfigNamesResource(ProxyOnlyResource): + """Slot Config names azure resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param connection_string_names: List of connection string names. + :type connection_string_names: list[str] + :param app_setting_names: List of application settings names. + :type app_setting_names: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'connection_string_names': {'key': 'properties.connectionStringNames', 'type': '[str]'}, + 'app_setting_names': {'key': 'properties.appSettingNames', 'type': '[str]'}, + } + + def __init__(self, *, kind: str=None, connection_string_names=None, app_setting_names=None, **kwargs) -> None: + super(SlotConfigNamesResource, self).__init__(kind=kind, **kwargs) + self.connection_string_names = connection_string_names + self.app_setting_names = app_setting_names diff --git a/azure-mgmt-web/azure/mgmt/web/models/slot_difference.py b/azure-mgmt-web/azure/mgmt/web/models/slot_difference.py index 58b2c975a0a3..cc203a46d259 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/slot_difference.py +++ b/azure-mgmt-web/azure/mgmt/web/models/slot_difference.py @@ -72,8 +72,8 @@ class SlotDifference(ProxyOnlyResource): 'description': {'key': 'properties.description', 'type': 'str'}, } - def __init__(self, kind=None): - super(SlotDifference, self).__init__(kind=kind) + def __init__(self, **kwargs): + super(SlotDifference, self).__init__(**kwargs) self.slot_difference_type = None self.setting_type = None self.diff_rule = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/slot_difference_py3.py b/azure-mgmt-web/azure/mgmt/web/models/slot_difference_py3.py new file mode 100644 index 000000000000..1048274cc5c3 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/slot_difference_py3.py @@ -0,0 +1,83 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class SlotDifference(ProxyOnlyResource): + """A setting difference between two deployment slots of an app. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar slot_difference_type: Type of the difference: Information, Warning + or Error. + :vartype slot_difference_type: str + :ivar setting_type: The type of the setting: General, AppSetting or + ConnectionString. + :vartype setting_type: str + :ivar diff_rule: Rule that describes how to process the setting difference + during a slot swap. + :vartype diff_rule: str + :ivar setting_name: Name of the setting. + :vartype setting_name: str + :ivar value_in_current_slot: Value of the setting in the current slot. + :vartype value_in_current_slot: str + :ivar value_in_target_slot: Value of the setting in the target slot. + :vartype value_in_target_slot: str + :ivar description: Description of the setting difference. + :vartype description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'slot_difference_type': {'readonly': True}, + 'setting_type': {'readonly': True}, + 'diff_rule': {'readonly': True}, + 'setting_name': {'readonly': True}, + 'value_in_current_slot': {'readonly': True}, + 'value_in_target_slot': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'slot_difference_type': {'key': 'properties.type', 'type': 'str'}, + 'setting_type': {'key': 'properties.settingType', 'type': 'str'}, + 'diff_rule': {'key': 'properties.diffRule', 'type': 'str'}, + 'setting_name': {'key': 'properties.settingName', 'type': 'str'}, + 'value_in_current_slot': {'key': 'properties.valueInCurrentSlot', 'type': 'str'}, + 'value_in_target_slot': {'key': 'properties.valueInTargetSlot', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, *, kind: str=None, **kwargs) -> None: + super(SlotDifference, self).__init__(kind=kind, **kwargs) + self.slot_difference_type = None + self.setting_type = None + self.diff_rule = None + self.setting_name = None + self.value_in_current_slot = None + self.value_in_target_slot = None + self.description = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/slot_swap_status.py b/azure-mgmt-web/azure/mgmt/web/models/slot_swap_status.py index fa0589c5c1d3..73c238d3fd5b 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/slot_swap_status.py +++ b/azure-mgmt-web/azure/mgmt/web/models/slot_swap_status.py @@ -39,8 +39,8 @@ class SlotSwapStatus(Model): 'destination_slot_name': {'key': 'destinationSlotName', 'type': 'str'}, } - def __init__(self): - super(SlotSwapStatus, self).__init__() + def __init__(self, **kwargs): + super(SlotSwapStatus, self).__init__(**kwargs) self.timestamp_utc = None self.source_slot_name = None self.destination_slot_name = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/slot_swap_status_py3.py b/azure-mgmt-web/azure/mgmt/web/models/slot_swap_status_py3.py new file mode 100644 index 000000000000..9d555a5fe6f2 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/slot_swap_status_py3.py @@ -0,0 +1,46 @@ +# 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 msrest.serialization import Model + + +class SlotSwapStatus(Model): + """The status of the last successfull slot swap operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar timestamp_utc: The time the last successful slot swap completed. + :vartype timestamp_utc: datetime + :ivar source_slot_name: The source slot of the last swap operation. + :vartype source_slot_name: str + :ivar destination_slot_name: The destination slot of the last swap + operation. + :vartype destination_slot_name: str + """ + + _validation = { + 'timestamp_utc': {'readonly': True}, + 'source_slot_name': {'readonly': True}, + 'destination_slot_name': {'readonly': True}, + } + + _attribute_map = { + 'timestamp_utc': {'key': 'timestampUtc', 'type': 'iso-8601'}, + 'source_slot_name': {'key': 'sourceSlotName', 'type': 'str'}, + 'destination_slot_name': {'key': 'destinationSlotName', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(SlotSwapStatus, self).__init__(**kwargs) + self.timestamp_utc = None + self.source_slot_name = None + self.destination_slot_name = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/slow_requests_based_trigger.py b/azure-mgmt-web/azure/mgmt/web/models/slow_requests_based_trigger.py index 3995123a0e1d..b2e7cb1168f3 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/slow_requests_based_trigger.py +++ b/azure-mgmt-web/azure/mgmt/web/models/slow_requests_based_trigger.py @@ -29,8 +29,8 @@ class SlowRequestsBasedTrigger(Model): 'time_interval': {'key': 'timeInterval', 'type': 'str'}, } - def __init__(self, time_taken=None, count=None, time_interval=None): - super(SlowRequestsBasedTrigger, self).__init__() - self.time_taken = time_taken - self.count = count - self.time_interval = time_interval + def __init__(self, **kwargs): + super(SlowRequestsBasedTrigger, self).__init__(**kwargs) + self.time_taken = kwargs.get('time_taken', None) + self.count = kwargs.get('count', None) + self.time_interval = kwargs.get('time_interval', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/slow_requests_based_trigger_py3.py b/azure-mgmt-web/azure/mgmt/web/models/slow_requests_based_trigger_py3.py new file mode 100644 index 000000000000..5288e5b100d6 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/slow_requests_based_trigger_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class SlowRequestsBasedTrigger(Model): + """Trigger based on request execution time. + + :param time_taken: Time taken. + :type time_taken: str + :param count: Request Count. + :type count: int + :param time_interval: Time interval. + :type time_interval: str + """ + + _attribute_map = { + 'time_taken': {'key': 'timeTaken', 'type': 'str'}, + 'count': {'key': 'count', 'type': 'int'}, + 'time_interval': {'key': 'timeInterval', 'type': 'str'}, + } + + def __init__(self, *, time_taken: str=None, count: int=None, time_interval: str=None, **kwargs) -> None: + super(SlowRequestsBasedTrigger, self).__init__(**kwargs) + self.time_taken = time_taken + self.count = count + self.time_interval = time_interval diff --git a/azure-mgmt-web/azure/mgmt/web/models/snapshot.py b/azure-mgmt-web/azure/mgmt/web/models/snapshot.py index 066eae59ceb1..fb9d95fd5ff7 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/snapshot.py +++ b/azure-mgmt-web/azure/mgmt/web/models/snapshot.py @@ -45,6 +45,6 @@ class Snapshot(ProxyOnlyResource): 'time': {'key': 'properties.time', 'type': 'str'}, } - def __init__(self, kind=None): - super(Snapshot, self).__init__(kind=kind) + def __init__(self, **kwargs): + super(Snapshot, self).__init__(**kwargs) self.time = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/snapshot_py3.py b/azure-mgmt-web/azure/mgmt/web/models/snapshot_py3.py new file mode 100644 index 000000000000..daa4e5f6d5fe --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/snapshot_py3.py @@ -0,0 +1,50 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class Snapshot(ProxyOnlyResource): + """A snapshot of an app. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar time: The time the snapshot was taken. + :vartype time: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'time': {'key': 'properties.time', 'type': 'str'}, + } + + def __init__(self, *, kind: str=None, **kwargs) -> None: + super(Snapshot, self).__init__(kind=kind, **kwargs) + self.time = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/snapshot_recovery_request.py b/azure-mgmt-web/azure/mgmt/web/models/snapshot_recovery_request.py index 594a87aa73ac..73f8ff371733 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/snapshot_recovery_request.py +++ b/azure-mgmt-web/azure/mgmt/web/models/snapshot_recovery_request.py @@ -18,6 +18,8 @@ class SnapshotRecoveryRequest(ProxyOnlyResource): 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 Azure. + :ivar id: Resource Id. :vartype id: str :ivar name: Resource Name. @@ -32,8 +34,8 @@ class SnapshotRecoveryRequest(ProxyOnlyResource): :param recovery_target: Specifies the web app that snapshot contents will be written to. :type recovery_target: ~azure.mgmt.web.models.SnapshotRecoveryTarget - :param overwrite: If true the recovery operation can - overwrite source app; otherwise, false. + :param overwrite: Required. If true the recovery operation + can overwrite source app; otherwise, false. :type overwrite: bool :param recover_configuration: If true, site configuration, in addition to content, will be reverted. @@ -63,10 +65,10 @@ class SnapshotRecoveryRequest(ProxyOnlyResource): 'ignore_conflicting_host_names': {'key': 'properties.ignoreConflictingHostNames', 'type': 'bool'}, } - def __init__(self, overwrite, kind=None, snapshot_time=None, recovery_target=None, recover_configuration=None, ignore_conflicting_host_names=None): - super(SnapshotRecoveryRequest, self).__init__(kind=kind) - self.snapshot_time = snapshot_time - self.recovery_target = recovery_target - self.overwrite = overwrite - self.recover_configuration = recover_configuration - self.ignore_conflicting_host_names = ignore_conflicting_host_names + def __init__(self, **kwargs): + super(SnapshotRecoveryRequest, self).__init__(**kwargs) + self.snapshot_time = kwargs.get('snapshot_time', None) + self.recovery_target = kwargs.get('recovery_target', None) + self.overwrite = kwargs.get('overwrite', None) + self.recover_configuration = kwargs.get('recover_configuration', None) + self.ignore_conflicting_host_names = kwargs.get('ignore_conflicting_host_names', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/snapshot_recovery_request_py3.py b/azure-mgmt-web/azure/mgmt/web/models/snapshot_recovery_request_py3.py new file mode 100644 index 000000000000..c4e59bc0f702 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/snapshot_recovery_request_py3.py @@ -0,0 +1,74 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class SnapshotRecoveryRequest(ProxyOnlyResource): + """Details about app recovery operation. + + 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 Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param snapshot_time: Point in time in which the app recovery should be + attempted, formatted as a DateTime string. + :type snapshot_time: str + :param recovery_target: Specifies the web app that snapshot contents will + be written to. + :type recovery_target: ~azure.mgmt.web.models.SnapshotRecoveryTarget + :param overwrite: Required. If true the recovery operation + can overwrite source app; otherwise, false. + :type overwrite: bool + :param recover_configuration: If true, site configuration, in addition to + content, will be reverted. + :type recover_configuration: bool + :param ignore_conflicting_host_names: If true, custom hostname conflicts + will be ignored when recovering to a target web app. + This setting is only necessary when RecoverConfiguration is enabled. + :type ignore_conflicting_host_names: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'overwrite': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'snapshot_time': {'key': 'properties.snapshotTime', 'type': 'str'}, + 'recovery_target': {'key': 'properties.recoveryTarget', 'type': 'SnapshotRecoveryTarget'}, + 'overwrite': {'key': 'properties.overwrite', 'type': 'bool'}, + 'recover_configuration': {'key': 'properties.recoverConfiguration', 'type': 'bool'}, + 'ignore_conflicting_host_names': {'key': 'properties.ignoreConflictingHostNames', 'type': 'bool'}, + } + + def __init__(self, *, overwrite: bool, kind: str=None, snapshot_time: str=None, recovery_target=None, recover_configuration: bool=None, ignore_conflicting_host_names: bool=None, **kwargs) -> None: + super(SnapshotRecoveryRequest, self).__init__(kind=kind, **kwargs) + self.snapshot_time = snapshot_time + self.recovery_target = recovery_target + self.overwrite = overwrite + self.recover_configuration = recover_configuration + self.ignore_conflicting_host_names = ignore_conflicting_host_names diff --git a/azure-mgmt-web/azure/mgmt/web/models/snapshot_recovery_target.py b/azure-mgmt-web/azure/mgmt/web/models/snapshot_recovery_target.py index 86e831e9a8b7..38f3c267bc68 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/snapshot_recovery_target.py +++ b/azure-mgmt-web/azure/mgmt/web/models/snapshot_recovery_target.py @@ -31,7 +31,7 @@ class SnapshotRecoveryTarget(Model): 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self, location=None, id=None): - super(SnapshotRecoveryTarget, self).__init__() - self.location = location - self.id = id + def __init__(self, **kwargs): + super(SnapshotRecoveryTarget, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/snapshot_recovery_target_py3.py b/azure-mgmt-web/azure/mgmt/web/models/snapshot_recovery_target_py3.py new file mode 100644 index 000000000000..07035487add4 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/snapshot_recovery_target_py3.py @@ -0,0 +1,37 @@ +# 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 msrest.serialization import Model + + +class SnapshotRecoveryTarget(Model): + """Specifies the web app that snapshot contents will be written to. + + :param location: Geographical location of the target web app, e.g. + SouthEastAsia, SouthCentralUS + :type location: str + :param id: ARM resource ID of the target app. + /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + for production slots and + /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + for other slots. + :type id: str + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, location: str=None, id: str=None, **kwargs) -> None: + super(SnapshotRecoveryTarget, self).__init__(**kwargs) + self.location = location + self.id = id diff --git a/azure-mgmt-web/azure/mgmt/web/models/solution.py b/azure-mgmt-web/azure/mgmt/web/models/solution.py index 931fdc999138..cca3a08776a4 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/solution.py +++ b/azure-mgmt-web/azure/mgmt/web/models/solution.py @@ -42,12 +42,12 @@ class Solution(Model): 'metadata': {'key': 'metadata', 'type': '[[NameValuePair]]'}, } - def __init__(self, id=None, display_name=None, order=None, description=None, type=None, data=None, metadata=None): - super(Solution, self).__init__() - self.id = id - self.display_name = display_name - self.order = order - self.description = description - self.type = type - self.data = data - self.metadata = metadata + def __init__(self, **kwargs): + super(Solution, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.display_name = kwargs.get('display_name', None) + self.order = kwargs.get('order', None) + self.description = kwargs.get('description', None) + self.type = kwargs.get('type', None) + self.data = kwargs.get('data', None) + self.metadata = kwargs.get('metadata', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/solution_py3.py b/azure-mgmt-web/azure/mgmt/web/models/solution_py3.py new file mode 100644 index 000000000000..ebc38ca34a18 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/solution_py3.py @@ -0,0 +1,53 @@ +# 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 msrest.serialization import Model + + +class Solution(Model): + """Class Representing Solution for problems detected. + + :param id: Solution Id. + :type id: float + :param display_name: Display Name of the solution + :type display_name: str + :param order: Order of the solution. + :type order: float + :param description: Description of the solution + :type description: str + :param type: Type of Solution. Possible values include: 'QuickSolution', + 'DeepInvestigation', 'BestPractices' + :type type: str or ~azure.mgmt.web.models.SolutionType + :param data: Solution Data. + :type data: list[list[~azure.mgmt.web.models.NameValuePair]] + :param metadata: Solution Metadata. + :type metadata: list[list[~azure.mgmt.web.models.NameValuePair]] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'float'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'order': {'key': 'order', 'type': 'float'}, + 'description': {'key': 'description', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'SolutionType'}, + 'data': {'key': 'data', 'type': '[[NameValuePair]]'}, + 'metadata': {'key': 'metadata', 'type': '[[NameValuePair]]'}, + } + + def __init__(self, *, id: float=None, display_name: str=None, order: float=None, description: str=None, type=None, data=None, metadata=None, **kwargs) -> None: + super(Solution, self).__init__(**kwargs) + self.id = id + self.display_name = display_name + self.order = order + self.description = description + self.type = type + self.data = data + self.metadata = metadata diff --git a/azure-mgmt-web/azure/mgmt/web/models/source_control.py b/azure-mgmt-web/azure/mgmt/web/models/source_control.py index 154659566101..6f018d16e3f0 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/source_control.py +++ b/azure-mgmt-web/azure/mgmt/web/models/source_control.py @@ -56,10 +56,10 @@ class SourceControl(ProxyOnlyResource): 'expiration_time': {'key': 'properties.expirationTime', 'type': 'iso-8601'}, } - def __init__(self, kind=None, source_control_name=None, token=None, token_secret=None, refresh_token=None, expiration_time=None): - super(SourceControl, self).__init__(kind=kind) - self.source_control_name = source_control_name - self.token = token - self.token_secret = token_secret - self.refresh_token = refresh_token - self.expiration_time = expiration_time + def __init__(self, **kwargs): + super(SourceControl, self).__init__(**kwargs) + self.source_control_name = kwargs.get('source_control_name', None) + self.token = kwargs.get('token', None) + self.token_secret = kwargs.get('token_secret', None) + self.refresh_token = kwargs.get('refresh_token', None) + self.expiration_time = kwargs.get('expiration_time', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/source_control_py3.py b/azure-mgmt-web/azure/mgmt/web/models/source_control_py3.py new file mode 100644 index 000000000000..4ce8631e41a7 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/source_control_py3.py @@ -0,0 +1,65 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class SourceControl(ProxyOnlyResource): + """The source control OAuth token. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param source_control_name: Name or source control type. + :type source_control_name: str + :param token: OAuth access token. + :type token: str + :param token_secret: OAuth access token secret. + :type token_secret: str + :param refresh_token: OAuth refresh token. + :type refresh_token: str + :param expiration_time: OAuth token expiration. + :type expiration_time: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'source_control_name': {'key': 'properties.name', 'type': 'str'}, + 'token': {'key': 'properties.token', 'type': 'str'}, + 'token_secret': {'key': 'properties.tokenSecret', 'type': 'str'}, + 'refresh_token': {'key': 'properties.refreshToken', 'type': 'str'}, + 'expiration_time': {'key': 'properties.expirationTime', 'type': 'iso-8601'}, + } + + def __init__(self, *, kind: str=None, source_control_name: str=None, token: str=None, token_secret: str=None, refresh_token: str=None, expiration_time=None, **kwargs) -> None: + super(SourceControl, self).__init__(kind=kind, **kwargs) + self.source_control_name = source_control_name + self.token = token + self.token_secret = token_secret + self.refresh_token = refresh_token + self.expiration_time = expiration_time diff --git a/azure-mgmt-web/azure/mgmt/web/models/stack_major_version.py b/azure-mgmt-web/azure/mgmt/web/models/stack_major_version.py index 6ed47577e8ec..d5faa48be425 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/stack_major_version.py +++ b/azure-mgmt-web/azure/mgmt/web/models/stack_major_version.py @@ -33,9 +33,9 @@ class StackMajorVersion(Model): 'minor_versions': {'key': 'minorVersions', 'type': '[StackMinorVersion]'}, } - def __init__(self, display_version=None, runtime_version=None, is_default=None, minor_versions=None): - super(StackMajorVersion, self).__init__() - self.display_version = display_version - self.runtime_version = runtime_version - self.is_default = is_default - self.minor_versions = minor_versions + def __init__(self, **kwargs): + super(StackMajorVersion, self).__init__(**kwargs) + self.display_version = kwargs.get('display_version', None) + self.runtime_version = kwargs.get('runtime_version', None) + self.is_default = kwargs.get('is_default', None) + self.minor_versions = kwargs.get('minor_versions', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/stack_major_version_py3.py b/azure-mgmt-web/azure/mgmt/web/models/stack_major_version_py3.py new file mode 100644 index 000000000000..d53e57163b0d --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/stack_major_version_py3.py @@ -0,0 +1,41 @@ +# 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 msrest.serialization import Model + + +class StackMajorVersion(Model): + """Application stack major version. + + :param display_version: Application stack major version (display only). + :type display_version: str + :param runtime_version: Application stack major version (runtime only). + :type runtime_version: str + :param is_default: true if this is the default major version; + otherwise, false. + :type is_default: bool + :param minor_versions: Minor versions associated with the major version. + :type minor_versions: list[~azure.mgmt.web.models.StackMinorVersion] + """ + + _attribute_map = { + 'display_version': {'key': 'displayVersion', 'type': 'str'}, + 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, + 'is_default': {'key': 'isDefault', 'type': 'bool'}, + 'minor_versions': {'key': 'minorVersions', 'type': '[StackMinorVersion]'}, + } + + def __init__(self, *, display_version: str=None, runtime_version: str=None, is_default: bool=None, minor_versions=None, **kwargs) -> None: + super(StackMajorVersion, self).__init__(**kwargs) + self.display_version = display_version + self.runtime_version = runtime_version + self.is_default = is_default + self.minor_versions = minor_versions diff --git a/azure-mgmt-web/azure/mgmt/web/models/stack_minor_version.py b/azure-mgmt-web/azure/mgmt/web/models/stack_minor_version.py index 543fd44a5f23..f732bbb506a0 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/stack_minor_version.py +++ b/azure-mgmt-web/azure/mgmt/web/models/stack_minor_version.py @@ -30,8 +30,8 @@ class StackMinorVersion(Model): 'is_default': {'key': 'isDefault', 'type': 'bool'}, } - def __init__(self, display_version=None, runtime_version=None, is_default=None): - super(StackMinorVersion, self).__init__() - self.display_version = display_version - self.runtime_version = runtime_version - self.is_default = is_default + def __init__(self, **kwargs): + super(StackMinorVersion, self).__init__(**kwargs) + self.display_version = kwargs.get('display_version', None) + self.runtime_version = kwargs.get('runtime_version', None) + self.is_default = kwargs.get('is_default', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/stack_minor_version_py3.py b/azure-mgmt-web/azure/mgmt/web/models/stack_minor_version_py3.py new file mode 100644 index 000000000000..3d1d4741da2c --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/stack_minor_version_py3.py @@ -0,0 +1,37 @@ +# 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 msrest.serialization import Model + + +class StackMinorVersion(Model): + """Application stack minor version. + + :param display_version: Application stack minor version (display only). + :type display_version: str + :param runtime_version: Application stack minor version (runtime only). + :type runtime_version: str + :param is_default: true if this is the default minor version; + otherwise, false. + :type is_default: bool + """ + + _attribute_map = { + 'display_version': {'key': 'displayVersion', 'type': 'str'}, + 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, + 'is_default': {'key': 'isDefault', 'type': 'bool'}, + } + + def __init__(self, *, display_version: str=None, runtime_version: str=None, is_default: bool=None, **kwargs) -> None: + super(StackMinorVersion, self).__init__(**kwargs) + self.display_version = display_version + self.runtime_version = runtime_version + self.is_default = is_default diff --git a/azure-mgmt-web/azure/mgmt/web/models/stamp_capacity.py b/azure-mgmt-web/azure/mgmt/web/models/stamp_capacity.py index 8ee3fa14d24b..bb62863d4176 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/stamp_capacity.py +++ b/azure-mgmt-web/azure/mgmt/web/models/stamp_capacity.py @@ -60,15 +60,15 @@ class StampCapacity(Model): 'site_mode': {'key': 'siteMode', 'type': 'str'}, } - def __init__(self, name=None, available_capacity=None, total_capacity=None, unit=None, compute_mode=None, worker_size=None, worker_size_id=None, exclude_from_capacity_allocation=None, is_applicable_for_all_compute_modes=None, site_mode=None): - super(StampCapacity, self).__init__() - self.name = name - self.available_capacity = available_capacity - self.total_capacity = total_capacity - self.unit = unit - self.compute_mode = compute_mode - self.worker_size = worker_size - self.worker_size_id = worker_size_id - self.exclude_from_capacity_allocation = exclude_from_capacity_allocation - self.is_applicable_for_all_compute_modes = is_applicable_for_all_compute_modes - self.site_mode = site_mode + def __init__(self, **kwargs): + super(StampCapacity, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.available_capacity = kwargs.get('available_capacity', None) + self.total_capacity = kwargs.get('total_capacity', None) + self.unit = kwargs.get('unit', None) + self.compute_mode = kwargs.get('compute_mode', None) + self.worker_size = kwargs.get('worker_size', None) + self.worker_size_id = kwargs.get('worker_size_id', None) + self.exclude_from_capacity_allocation = kwargs.get('exclude_from_capacity_allocation', None) + self.is_applicable_for_all_compute_modes = kwargs.get('is_applicable_for_all_compute_modes', None) + self.site_mode = kwargs.get('site_mode', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/stamp_capacity_py3.py b/azure-mgmt-web/azure/mgmt/web/models/stamp_capacity_py3.py new file mode 100644 index 000000000000..f9135aa4057c --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/stamp_capacity_py3.py @@ -0,0 +1,74 @@ +# 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 msrest.serialization import Model + + +class StampCapacity(Model): + """Stamp capacity information. + + :param name: Name of the stamp. + :type name: str + :param available_capacity: Available capacity (# of machines, bytes of + storage etc...). + :type available_capacity: long + :param total_capacity: Total capacity (# of machines, bytes of storage + etc...). + :type total_capacity: long + :param unit: Name of the unit. + :type unit: str + :param compute_mode: Shared/dedicated workers. Possible values include: + 'Shared', 'Dedicated', 'Dynamic' + :type compute_mode: str or ~azure.mgmt.web.models.ComputeModeOptions + :param worker_size: Size of the machines. Possible values include: + 'Default', 'Small', 'Medium', 'Large', 'D1', 'D2', 'D3' + :type worker_size: str or ~azure.mgmt.web.models.WorkerSizeOptions + :param worker_size_id: Size ID of machines: + 0 - Small + 1 - Medium + 2 - Large + :type worker_size_id: int + :param exclude_from_capacity_allocation: If true, it includes + basic apps. + Basic apps are not used for capacity allocation. + :type exclude_from_capacity_allocation: bool + :param is_applicable_for_all_compute_modes: true if capacity + is applicable for all apps; otherwise, false. + :type is_applicable_for_all_compute_modes: bool + :param site_mode: Shared or Dedicated. + :type site_mode: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'available_capacity': {'key': 'availableCapacity', 'type': 'long'}, + 'total_capacity': {'key': 'totalCapacity', 'type': 'long'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'compute_mode': {'key': 'computeMode', 'type': 'ComputeModeOptions'}, + 'worker_size': {'key': 'workerSize', 'type': 'WorkerSizeOptions'}, + 'worker_size_id': {'key': 'workerSizeId', 'type': 'int'}, + 'exclude_from_capacity_allocation': {'key': 'excludeFromCapacityAllocation', 'type': 'bool'}, + 'is_applicable_for_all_compute_modes': {'key': 'isApplicableForAllComputeModes', 'type': 'bool'}, + 'site_mode': {'key': 'siteMode', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, available_capacity: int=None, total_capacity: int=None, unit: str=None, compute_mode=None, worker_size=None, worker_size_id: int=None, exclude_from_capacity_allocation: bool=None, is_applicable_for_all_compute_modes: bool=None, site_mode: str=None, **kwargs) -> None: + super(StampCapacity, self).__init__(**kwargs) + self.name = name + self.available_capacity = available_capacity + self.total_capacity = total_capacity + self.unit = unit + self.compute_mode = compute_mode + self.worker_size = worker_size + self.worker_size_id = worker_size_id + self.exclude_from_capacity_allocation = exclude_from_capacity_allocation + self.is_applicable_for_all_compute_modes = is_applicable_for_all_compute_modes + self.site_mode = site_mode diff --git a/azure-mgmt-web/azure/mgmt/web/models/status_codes_based_trigger.py b/azure-mgmt-web/azure/mgmt/web/models/status_codes_based_trigger.py index 32389ee7253d..d1776ce91bc0 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/status_codes_based_trigger.py +++ b/azure-mgmt-web/azure/mgmt/web/models/status_codes_based_trigger.py @@ -35,10 +35,10 @@ class StatusCodesBasedTrigger(Model): 'time_interval': {'key': 'timeInterval', 'type': 'str'}, } - def __init__(self, status=None, sub_status=None, win32_status=None, count=None, time_interval=None): - super(StatusCodesBasedTrigger, self).__init__() - self.status = status - self.sub_status = sub_status - self.win32_status = win32_status - self.count = count - self.time_interval = time_interval + def __init__(self, **kwargs): + super(StatusCodesBasedTrigger, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.sub_status = kwargs.get('sub_status', None) + self.win32_status = kwargs.get('win32_status', None) + self.count = kwargs.get('count', None) + self.time_interval = kwargs.get('time_interval', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/status_codes_based_trigger_py3.py b/azure-mgmt-web/azure/mgmt/web/models/status_codes_based_trigger_py3.py new file mode 100644 index 000000000000..939a950c1d37 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/status_codes_based_trigger_py3.py @@ -0,0 +1,44 @@ +# 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 msrest.serialization import Model + + +class StatusCodesBasedTrigger(Model): + """Trigger based on status code. + + :param status: HTTP status code. + :type status: int + :param sub_status: Request Sub Status. + :type sub_status: int + :param win32_status: Win32 error code. + :type win32_status: int + :param count: Request Count. + :type count: int + :param time_interval: Time interval. + :type time_interval: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'int'}, + 'sub_status': {'key': 'subStatus', 'type': 'int'}, + 'win32_status': {'key': 'win32Status', 'type': 'int'}, + 'count': {'key': 'count', 'type': 'int'}, + 'time_interval': {'key': 'timeInterval', 'type': 'str'}, + } + + def __init__(self, *, status: int=None, sub_status: int=None, win32_status: int=None, count: int=None, time_interval: str=None, **kwargs) -> None: + super(StatusCodesBasedTrigger, self).__init__(**kwargs) + self.status = status + self.sub_status = sub_status + self.win32_status = win32_status + self.count = count + self.time_interval = time_interval diff --git a/azure-mgmt-web/azure/mgmt/web/models/storage_migration_options.py b/azure-mgmt-web/azure/mgmt/web/models/storage_migration_options.py index e92a9f06c9b2..faaeabd58089 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/storage_migration_options.py +++ b/azure-mgmt-web/azure/mgmt/web/models/storage_migration_options.py @@ -18,6 +18,8 @@ class StorageMigrationOptions(ProxyOnlyResource): 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 Azure. + :ivar id: Resource Id. :vartype id: str :ivar name: Resource Name. @@ -26,9 +28,10 @@ class StorageMigrationOptions(ProxyOnlyResource): :type kind: str :ivar type: Resource type. :vartype type: str - :param azurefiles_connection_string: AzureFiles connection string. + :param azurefiles_connection_string: Required. AzureFiles connection + string. :type azurefiles_connection_string: str - :param azurefiles_share: AzureFiles share. + :param azurefiles_share: Required. AzureFiles share. :type azurefiles_share: str :param switch_site_after_migration: trueif the app should be switched over; otherwise, false. Default value: False . @@ -58,9 +61,9 @@ class StorageMigrationOptions(ProxyOnlyResource): 'block_write_access_to_site': {'key': 'properties.blockWriteAccessToSite', 'type': 'bool'}, } - def __init__(self, azurefiles_connection_string, azurefiles_share, kind=None, switch_site_after_migration=False, block_write_access_to_site=False): - super(StorageMigrationOptions, self).__init__(kind=kind) - self.azurefiles_connection_string = azurefiles_connection_string - self.azurefiles_share = azurefiles_share - self.switch_site_after_migration = switch_site_after_migration - self.block_write_access_to_site = block_write_access_to_site + def __init__(self, **kwargs): + super(StorageMigrationOptions, self).__init__(**kwargs) + self.azurefiles_connection_string = kwargs.get('azurefiles_connection_string', None) + self.azurefiles_share = kwargs.get('azurefiles_share', None) + self.switch_site_after_migration = kwargs.get('switch_site_after_migration', False) + self.block_write_access_to_site = kwargs.get('block_write_access_to_site', False) diff --git a/azure-mgmt-web/azure/mgmt/web/models/storage_migration_options_py3.py b/azure-mgmt-web/azure/mgmt/web/models/storage_migration_options_py3.py new file mode 100644 index 000000000000..ca613a6dc003 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/storage_migration_options_py3.py @@ -0,0 +1,69 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class StorageMigrationOptions(ProxyOnlyResource): + """Options for app content migration. + + 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 Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param azurefiles_connection_string: Required. AzureFiles connection + string. + :type azurefiles_connection_string: str + :param azurefiles_share: Required. AzureFiles share. + :type azurefiles_share: str + :param switch_site_after_migration: trueif the app should be + switched over; otherwise, false. Default value: False . + :type switch_site_after_migration: bool + :param block_write_access_to_site: true if the app should be + read only during copy operation; otherwise, false. Default + value: False . + :type block_write_access_to_site: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'azurefiles_connection_string': {'required': True}, + 'azurefiles_share': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'azurefiles_connection_string': {'key': 'properties.azurefilesConnectionString', 'type': 'str'}, + 'azurefiles_share': {'key': 'properties.azurefilesShare', 'type': 'str'}, + 'switch_site_after_migration': {'key': 'properties.switchSiteAfterMigration', 'type': 'bool'}, + 'block_write_access_to_site': {'key': 'properties.blockWriteAccessToSite', 'type': 'bool'}, + } + + def __init__(self, *, azurefiles_connection_string: str, azurefiles_share: str, kind: str=None, switch_site_after_migration: bool=False, block_write_access_to_site: bool=False, **kwargs) -> None: + super(StorageMigrationOptions, self).__init__(kind=kind, **kwargs) + self.azurefiles_connection_string = azurefiles_connection_string + self.azurefiles_share = azurefiles_share + self.switch_site_after_migration = switch_site_after_migration + self.block_write_access_to_site = block_write_access_to_site diff --git a/azure-mgmt-web/azure/mgmt/web/models/storage_migration_response.py b/azure-mgmt-web/azure/mgmt/web/models/storage_migration_response.py index eda75c3f5171..f528db53bae5 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/storage_migration_response.py +++ b/azure-mgmt-web/azure/mgmt/web/models/storage_migration_response.py @@ -46,6 +46,6 @@ class StorageMigrationResponse(ProxyOnlyResource): 'operation_id': {'key': 'properties.operationId', 'type': 'str'}, } - def __init__(self, kind=None): - super(StorageMigrationResponse, self).__init__(kind=kind) + def __init__(self, **kwargs): + super(StorageMigrationResponse, self).__init__(**kwargs) self.operation_id = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/storage_migration_response_py3.py b/azure-mgmt-web/azure/mgmt/web/models/storage_migration_response_py3.py new file mode 100644 index 000000000000..e16f6dac41d1 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/storage_migration_response_py3.py @@ -0,0 +1,51 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class StorageMigrationResponse(ProxyOnlyResource): + """Response for a migration of app content request. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar operation_id: When server starts the migration process, it will + return an operation ID identifying that particular migration operation. + :vartype operation_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'operation_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'operation_id': {'key': 'properties.operationId', 'type': 'str'}, + } + + def __init__(self, *, kind: str=None, **kwargs) -> None: + super(StorageMigrationResponse, self).__init__(kind=kind, **kwargs) + self.operation_id = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/string_dictionary.py b/azure-mgmt-web/azure/mgmt/web/models/string_dictionary.py index 875d8325abaf..de492106f79c 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/string_dictionary.py +++ b/azure-mgmt-web/azure/mgmt/web/models/string_dictionary.py @@ -44,6 +44,6 @@ class StringDictionary(ProxyOnlyResource): 'properties': {'key': 'properties', 'type': '{str}'}, } - def __init__(self, kind=None, properties=None): - super(StringDictionary, self).__init__(kind=kind) - self.properties = properties + def __init__(self, **kwargs): + super(StringDictionary, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/string_dictionary_py3.py b/azure-mgmt-web/azure/mgmt/web/models/string_dictionary_py3.py new file mode 100644 index 000000000000..2458d7a36f46 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/string_dictionary_py3.py @@ -0,0 +1,49 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class StringDictionary(ProxyOnlyResource): + """String dictionary resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param properties: Settings. + :type properties: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': '{str}'}, + } + + def __init__(self, *, kind: str=None, properties=None, **kwargs) -> None: + super(StringDictionary, self).__init__(kind=kind, **kwargs) + self.properties = properties diff --git a/azure-mgmt-web/azure/mgmt/web/models/tld_legal_agreement.py b/azure-mgmt-web/azure/mgmt/web/models/tld_legal_agreement.py index c7ac735feb00..ebe9ca9add5c 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/tld_legal_agreement.py +++ b/azure-mgmt-web/azure/mgmt/web/models/tld_legal_agreement.py @@ -15,11 +15,13 @@ class TldLegalAgreement(Model): """Legal agreement for a top level domain. - :param agreement_key: Unique identifier for the agreement. + All required parameters must be populated in order to send to Azure. + + :param agreement_key: Required. Unique identifier for the agreement. :type agreement_key: str - :param title: Agreement title. + :param title: Required. Agreement title. :type title: str - :param content: Agreement details. + :param content: Required. Agreement details. :type content: str :param url: URL where a copy of the agreement details is hosted. :type url: str @@ -38,9 +40,9 @@ class TldLegalAgreement(Model): 'url': {'key': 'url', 'type': 'str'}, } - def __init__(self, agreement_key, title, content, url=None): - super(TldLegalAgreement, self).__init__() - self.agreement_key = agreement_key - self.title = title - self.content = content - self.url = url + def __init__(self, **kwargs): + super(TldLegalAgreement, self).__init__(**kwargs) + self.agreement_key = kwargs.get('agreement_key', None) + self.title = kwargs.get('title', None) + self.content = kwargs.get('content', None) + self.url = kwargs.get('url', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/tld_legal_agreement_py3.py b/azure-mgmt-web/azure/mgmt/web/models/tld_legal_agreement_py3.py new file mode 100644 index 000000000000..a32633d0e8d6 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/tld_legal_agreement_py3.py @@ -0,0 +1,48 @@ +# 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 msrest.serialization import Model + + +class TldLegalAgreement(Model): + """Legal agreement for a top level domain. + + All required parameters must be populated in order to send to Azure. + + :param agreement_key: Required. Unique identifier for the agreement. + :type agreement_key: str + :param title: Required. Agreement title. + :type title: str + :param content: Required. Agreement details. + :type content: str + :param url: URL where a copy of the agreement details is hosted. + :type url: str + """ + + _validation = { + 'agreement_key': {'required': True}, + 'title': {'required': True}, + 'content': {'required': True}, + } + + _attribute_map = { + 'agreement_key': {'key': 'agreementKey', 'type': 'str'}, + 'title': {'key': 'title', 'type': 'str'}, + 'content': {'key': 'content', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + } + + def __init__(self, *, agreement_key: str, title: str, content: str, url: str=None, **kwargs) -> None: + super(TldLegalAgreement, self).__init__(**kwargs) + self.agreement_key = agreement_key + self.title = title + self.content = content + self.url = url diff --git a/azure-mgmt-web/azure/mgmt/web/models/top_level_domain.py b/azure-mgmt-web/azure/mgmt/web/models/top_level_domain.py index c5b5397e3d90..cdd7cbd07acd 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/top_level_domain.py +++ b/azure-mgmt-web/azure/mgmt/web/models/top_level_domain.py @@ -49,7 +49,7 @@ class TopLevelDomain(ProxyOnlyResource): 'privacy': {'key': 'properties.privacy', 'type': 'bool'}, } - def __init__(self, kind=None, privacy=None): - super(TopLevelDomain, self).__init__(kind=kind) + def __init__(self, **kwargs): + super(TopLevelDomain, self).__init__(**kwargs) self.domain_name = None - self.privacy = privacy + self.privacy = kwargs.get('privacy', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/top_level_domain_agreement_option.py b/azure-mgmt-web/azure/mgmt/web/models/top_level_domain_agreement_option.py index c22b5dfd1948..94be4b55cfd3 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/top_level_domain_agreement_option.py +++ b/azure-mgmt-web/azure/mgmt/web/models/top_level_domain_agreement_option.py @@ -30,7 +30,7 @@ class TopLevelDomainAgreementOption(Model): 'for_transfer': {'key': 'forTransfer', 'type': 'bool'}, } - def __init__(self, include_privacy=None, for_transfer=None): - super(TopLevelDomainAgreementOption, self).__init__() - self.include_privacy = include_privacy - self.for_transfer = for_transfer + def __init__(self, **kwargs): + super(TopLevelDomainAgreementOption, self).__init__(**kwargs) + self.include_privacy = kwargs.get('include_privacy', None) + self.for_transfer = kwargs.get('for_transfer', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/top_level_domain_agreement_option_py3.py b/azure-mgmt-web/azure/mgmt/web/models/top_level_domain_agreement_option_py3.py new file mode 100644 index 000000000000..88bde7894d0f --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/top_level_domain_agreement_option_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class TopLevelDomainAgreementOption(Model): + """Options for retrieving the list of top level domain legal agreements. + + :param include_privacy: If true, then the list of agreements + will include agreements for domain privacy as well; otherwise, + false. + :type include_privacy: bool + :param for_transfer: If true, then the list of agreements + will include agreements for domain transfer as well; otherwise, + false. + :type for_transfer: bool + """ + + _attribute_map = { + 'include_privacy': {'key': 'includePrivacy', 'type': 'bool'}, + 'for_transfer': {'key': 'forTransfer', 'type': 'bool'}, + } + + def __init__(self, *, include_privacy: bool=None, for_transfer: bool=None, **kwargs) -> None: + super(TopLevelDomainAgreementOption, self).__init__(**kwargs) + self.include_privacy = include_privacy + self.for_transfer = for_transfer diff --git a/azure-mgmt-web/azure/mgmt/web/models/top_level_domain_py3.py b/azure-mgmt-web/azure/mgmt/web/models/top_level_domain_py3.py new file mode 100644 index 000000000000..06d07ae5473f --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/top_level_domain_py3.py @@ -0,0 +1,55 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class TopLevelDomain(ProxyOnlyResource): + """A top level domain object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar domain_name: Name of the top level domain. + :vartype domain_name: str + :param privacy: If true, then the top level domain supports + domain privacy; otherwise, false. + :type privacy: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'domain_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'domain_name': {'key': 'properties.name', 'type': 'str'}, + 'privacy': {'key': 'properties.privacy', 'type': 'bool'}, + } + + def __init__(self, *, kind: str=None, privacy: bool=None, **kwargs) -> None: + super(TopLevelDomain, self).__init__(kind=kind, **kwargs) + self.domain_name = None + self.privacy = privacy diff --git a/azure-mgmt-web/azure/mgmt/web/models/triggered_job_history.py b/azure-mgmt-web/azure/mgmt/web/models/triggered_job_history.py index 52afa075ca28..4bd86dd9efe2 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/triggered_job_history.py +++ b/azure-mgmt-web/azure/mgmt/web/models/triggered_job_history.py @@ -45,6 +45,6 @@ class TriggeredJobHistory(ProxyOnlyResource): 'triggered_job_runs': {'key': 'properties.triggeredJobRuns', 'type': '[TriggeredJobRun]'}, } - def __init__(self, kind=None, triggered_job_runs=None): - super(TriggeredJobHistory, self).__init__(kind=kind) - self.triggered_job_runs = triggered_job_runs + def __init__(self, **kwargs): + super(TriggeredJobHistory, self).__init__(**kwargs) + self.triggered_job_runs = kwargs.get('triggered_job_runs', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/triggered_job_history_py3.py b/azure-mgmt-web/azure/mgmt/web/models/triggered_job_history_py3.py new file mode 100644 index 000000000000..22ab4242c2ec --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/triggered_job_history_py3.py @@ -0,0 +1,50 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class TriggeredJobHistory(ProxyOnlyResource): + """Triggered Web Job History. List of Triggered Web Job Run Information + elements. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param triggered_job_runs: List of triggered web job runs. + :type triggered_job_runs: list[~azure.mgmt.web.models.TriggeredJobRun] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'triggered_job_runs': {'key': 'properties.triggeredJobRuns', 'type': '[TriggeredJobRun]'}, + } + + def __init__(self, *, kind: str=None, triggered_job_runs=None, **kwargs) -> None: + super(TriggeredJobHistory, self).__init__(kind=kind, **kwargs) + self.triggered_job_runs = triggered_job_runs diff --git a/azure-mgmt-web/azure/mgmt/web/models/triggered_job_run.py b/azure-mgmt-web/azure/mgmt/web/models/triggered_job_run.py index 3b9bef7b7671..e0d3653c3690 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/triggered_job_run.py +++ b/azure-mgmt-web/azure/mgmt/web/models/triggered_job_run.py @@ -76,16 +76,16 @@ class TriggeredJobRun(ProxyOnlyResource): 'trigger': {'key': 'properties.trigger', 'type': 'str'}, } - def __init__(self, kind=None, triggered_job_run_id=None, status=None, start_time=None, end_time=None, duration=None, output_url=None, error_url=None, url=None, job_name=None, trigger=None): - super(TriggeredJobRun, self).__init__(kind=kind) - self.triggered_job_run_id = triggered_job_run_id + def __init__(self, **kwargs): + super(TriggeredJobRun, self).__init__(**kwargs) + self.triggered_job_run_id = kwargs.get('triggered_job_run_id', None) self.triggered_job_run_name = None - self.status = status - self.start_time = start_time - self.end_time = end_time - self.duration = duration - self.output_url = output_url - self.error_url = error_url - self.url = url - self.job_name = job_name - self.trigger = trigger + self.status = kwargs.get('status', None) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.duration = kwargs.get('duration', None) + self.output_url = kwargs.get('output_url', None) + self.error_url = kwargs.get('error_url', None) + self.url = kwargs.get('url', None) + self.job_name = kwargs.get('job_name', None) + self.trigger = kwargs.get('trigger', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/triggered_job_run_py3.py b/azure-mgmt-web/azure/mgmt/web/models/triggered_job_run_py3.py new file mode 100644 index 000000000000..11099877244f --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/triggered_job_run_py3.py @@ -0,0 +1,91 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class TriggeredJobRun(ProxyOnlyResource): + """Triggered Web Job Run Information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param triggered_job_run_id: Job ID. + :type triggered_job_run_id: str + :ivar triggered_job_run_name: Job name. + :vartype triggered_job_run_name: str + :param status: Job status. Possible values include: 'Success', 'Failed', + 'Error' + :type status: str or ~azure.mgmt.web.models.TriggeredWebJobStatus + :param start_time: Start time. + :type start_time: datetime + :param end_time: End time. + :type end_time: datetime + :param duration: Job duration. + :type duration: str + :param output_url: Output URL. + :type output_url: str + :param error_url: Error URL. + :type error_url: str + :param url: Job URL. + :type url: str + :param job_name: Job name. + :type job_name: str + :param trigger: Job trigger. + :type trigger: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'triggered_job_run_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'triggered_job_run_id': {'key': 'properties.id', 'type': 'str'}, + 'triggered_job_run_name': {'key': 'properties.name', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'TriggeredWebJobStatus'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'duration': {'key': 'properties.duration', 'type': 'str'}, + 'output_url': {'key': 'properties.outputUrl', 'type': 'str'}, + 'error_url': {'key': 'properties.errorUrl', 'type': 'str'}, + 'url': {'key': 'properties.url', 'type': 'str'}, + 'job_name': {'key': 'properties.jobName', 'type': 'str'}, + 'trigger': {'key': 'properties.trigger', 'type': 'str'}, + } + + def __init__(self, *, kind: str=None, triggered_job_run_id: str=None, status=None, start_time=None, end_time=None, duration: str=None, output_url: str=None, error_url: str=None, url: str=None, job_name: str=None, trigger: str=None, **kwargs) -> None: + super(TriggeredJobRun, self).__init__(kind=kind, **kwargs) + self.triggered_job_run_id = triggered_job_run_id + self.triggered_job_run_name = None + self.status = status + self.start_time = start_time + self.end_time = end_time + self.duration = duration + self.output_url = output_url + self.error_url = error_url + self.url = url + self.job_name = job_name + self.trigger = trigger diff --git a/azure-mgmt-web/azure/mgmt/web/models/triggered_web_job.py b/azure-mgmt-web/azure/mgmt/web/models/triggered_web_job.py index a64ffb9c9bb9..f3a58d01e26c 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/triggered_web_job.py +++ b/azure-mgmt-web/azure/mgmt/web/models/triggered_web_job.py @@ -77,16 +77,16 @@ class TriggeredWebJob(ProxyOnlyResource): 'settings': {'key': 'properties.settings', 'type': '{object}'}, } - def __init__(self, kind=None, latest_run=None, history_url=None, scheduler_logs_url=None, run_command=None, url=None, extra_info_url=None, job_type=None, error=None, using_sdk=None, settings=None): - super(TriggeredWebJob, self).__init__(kind=kind) - self.latest_run = latest_run - self.history_url = history_url - self.scheduler_logs_url = scheduler_logs_url + def __init__(self, **kwargs): + super(TriggeredWebJob, self).__init__(**kwargs) + self.latest_run = kwargs.get('latest_run', None) + self.history_url = kwargs.get('history_url', None) + self.scheduler_logs_url = kwargs.get('scheduler_logs_url', None) self.triggered_web_job_name = None - self.run_command = run_command - self.url = url - self.extra_info_url = extra_info_url - self.job_type = job_type - self.error = error - self.using_sdk = using_sdk - self.settings = settings + self.run_command = kwargs.get('run_command', None) + self.url = kwargs.get('url', None) + self.extra_info_url = kwargs.get('extra_info_url', None) + self.job_type = kwargs.get('job_type', None) + self.error = kwargs.get('error', None) + self.using_sdk = kwargs.get('using_sdk', None) + self.settings = kwargs.get('settings', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/triggered_web_job_py3.py b/azure-mgmt-web/azure/mgmt/web/models/triggered_web_job_py3.py new file mode 100644 index 000000000000..4a705b6cf70f --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/triggered_web_job_py3.py @@ -0,0 +1,92 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class TriggeredWebJob(ProxyOnlyResource): + """Triggered Web Job Information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param latest_run: Latest job run information. + :type latest_run: ~azure.mgmt.web.models.TriggeredJobRun + :param history_url: History URL. + :type history_url: str + :param scheduler_logs_url: Scheduler Logs URL. + :type scheduler_logs_url: str + :ivar triggered_web_job_name: Job name. Used as job identifier in ARM + resource URI. + :vartype triggered_web_job_name: str + :param run_command: Run command. + :type run_command: str + :param url: Job URL. + :type url: str + :param extra_info_url: Extra Info URL. + :type extra_info_url: str + :param job_type: Job type. Possible values include: 'Continuous', + 'Triggered' + :type job_type: str or ~azure.mgmt.web.models.WebJobType + :param error: Error information. + :type error: str + :param using_sdk: Using SDK? + :type using_sdk: bool + :param settings: Job settings. + :type settings: dict[str, object] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'triggered_web_job_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'latest_run': {'key': 'properties.latestRun', 'type': 'TriggeredJobRun'}, + 'history_url': {'key': 'properties.historyUrl', 'type': 'str'}, + 'scheduler_logs_url': {'key': 'properties.schedulerLogsUrl', 'type': 'str'}, + 'triggered_web_job_name': {'key': 'properties.name', 'type': 'str'}, + 'run_command': {'key': 'properties.runCommand', 'type': 'str'}, + 'url': {'key': 'properties.url', 'type': 'str'}, + 'extra_info_url': {'key': 'properties.extraInfoUrl', 'type': 'str'}, + 'job_type': {'key': 'properties.jobType', 'type': 'WebJobType'}, + 'error': {'key': 'properties.error', 'type': 'str'}, + 'using_sdk': {'key': 'properties.usingSdk', 'type': 'bool'}, + 'settings': {'key': 'properties.settings', 'type': '{object}'}, + } + + def __init__(self, *, kind: str=None, latest_run=None, history_url: str=None, scheduler_logs_url: str=None, run_command: str=None, url: str=None, extra_info_url: str=None, job_type=None, error: str=None, using_sdk: bool=None, settings=None, **kwargs) -> None: + super(TriggeredWebJob, self).__init__(kind=kind, **kwargs) + self.latest_run = latest_run + self.history_url = history_url + self.scheduler_logs_url = scheduler_logs_url + self.triggered_web_job_name = None + self.run_command = run_command + self.url = url + self.extra_info_url = extra_info_url + self.job_type = job_type + self.error = error + self.using_sdk = using_sdk + self.settings = settings diff --git a/azure-mgmt-web/azure/mgmt/web/models/usage.py b/azure-mgmt-web/azure/mgmt/web/models/usage.py index 7ae5ab1dba10..8cc6e379603e 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/usage.py +++ b/azure-mgmt-web/azure/mgmt/web/models/usage.py @@ -78,8 +78,8 @@ class Usage(ProxyOnlyResource): 'site_mode': {'key': 'properties.siteMode', 'type': 'str'}, } - def __init__(self, kind=None): - super(Usage, self).__init__(kind=kind) + def __init__(self, **kwargs): + super(Usage, self).__init__(**kwargs) self.display_name = None self.usage_name = None self.resource_name = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/usage_py3.py b/azure-mgmt-web/azure/mgmt/web/models/usage_py3.py new file mode 100644 index 000000000000..4bdaa25336f6 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/usage_py3.py @@ -0,0 +1,91 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class Usage(ProxyOnlyResource): + """Usage of the quota resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar display_name: Friendly name shown in the UI. + :vartype display_name: str + :ivar usage_name: Name of the quota. + :vartype usage_name: str + :ivar resource_name: Name of the quota resource. + :vartype resource_name: str + :ivar unit: Units of measurement for the quota resource. + :vartype unit: str + :ivar current_value: The current value of the resource counter. + :vartype current_value: long + :ivar limit: The resource limit. + :vartype limit: long + :ivar next_reset_time: Next reset time for the resource counter. + :vartype next_reset_time: datetime + :ivar compute_mode: Compute mode used for this usage. Possible values + include: 'Shared', 'Dedicated', 'Dynamic' + :vartype compute_mode: str or ~azure.mgmt.web.models.ComputeModeOptions + :ivar site_mode: Site mode used for this usage. + :vartype site_mode: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'display_name': {'readonly': True}, + 'usage_name': {'readonly': True}, + 'resource_name': {'readonly': True}, + 'unit': {'readonly': True}, + 'current_value': {'readonly': True}, + 'limit': {'readonly': True}, + 'next_reset_time': {'readonly': True}, + 'compute_mode': {'readonly': True}, + 'site_mode': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'usage_name': {'key': 'properties.name', 'type': 'str'}, + 'resource_name': {'key': 'properties.resourceName', 'type': 'str'}, + 'unit': {'key': 'properties.unit', 'type': 'str'}, + 'current_value': {'key': 'properties.currentValue', 'type': 'long'}, + 'limit': {'key': 'properties.limit', 'type': 'long'}, + 'next_reset_time': {'key': 'properties.nextResetTime', 'type': 'iso-8601'}, + 'compute_mode': {'key': 'properties.computeMode', 'type': 'ComputeModeOptions'}, + 'site_mode': {'key': 'properties.siteMode', 'type': 'str'}, + } + + def __init__(self, *, kind: str=None, **kwargs) -> None: + super(Usage, self).__init__(kind=kind, **kwargs) + self.display_name = None + self.usage_name = None + self.resource_name = None + self.unit = None + self.current_value = None + self.limit = None + self.next_reset_time = None + self.compute_mode = None + self.site_mode = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/user.py b/azure-mgmt-web/azure/mgmt/web/models/user.py index bb48fef75395..d34af225db0b 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/user.py +++ b/azure-mgmt-web/azure/mgmt/web/models/user.py @@ -18,6 +18,8 @@ class User(ProxyOnlyResource): 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 Azure. + :ivar id: Resource Id. :vartype id: str :ivar name: Resource Name. @@ -28,7 +30,7 @@ class User(ProxyOnlyResource): :vartype type: str :param user_name: Username :type user_name: str - :param publishing_user_name: Username used for publishing. + :param publishing_user_name: Required. Username used for publishing. :type publishing_user_name: str :param publishing_password: Password used for publishing. :type publishing_password: str @@ -58,10 +60,10 @@ class User(ProxyOnlyResource): 'publishing_password_hash_salt': {'key': 'properties.publishingPasswordHashSalt', 'type': 'str'}, } - def __init__(self, publishing_user_name, kind=None, user_name=None, publishing_password=None, publishing_password_hash=None, publishing_password_hash_salt=None): - super(User, self).__init__(kind=kind) - self.user_name = user_name - self.publishing_user_name = publishing_user_name - self.publishing_password = publishing_password - self.publishing_password_hash = publishing_password_hash - self.publishing_password_hash_salt = publishing_password_hash_salt + def __init__(self, **kwargs): + super(User, self).__init__(**kwargs) + self.user_name = kwargs.get('user_name', None) + self.publishing_user_name = kwargs.get('publishing_user_name', None) + self.publishing_password = kwargs.get('publishing_password', None) + self.publishing_password_hash = kwargs.get('publishing_password_hash', None) + self.publishing_password_hash_salt = kwargs.get('publishing_password_hash_salt', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/user_py3.py b/azure-mgmt-web/azure/mgmt/web/models/user_py3.py new file mode 100644 index 000000000000..77a1093826e0 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/user_py3.py @@ -0,0 +1,69 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class User(ProxyOnlyResource): + """User crendentials used for publishing activity. + + 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 Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param user_name: Username + :type user_name: str + :param publishing_user_name: Required. Username used for publishing. + :type publishing_user_name: str + :param publishing_password: Password used for publishing. + :type publishing_password: str + :param publishing_password_hash: Password hash used for publishing. + :type publishing_password_hash: str + :param publishing_password_hash_salt: Password hash salt used for + publishing. + :type publishing_password_hash_salt: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'publishing_user_name': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'user_name': {'key': 'properties.name', 'type': 'str'}, + 'publishing_user_name': {'key': 'properties.publishingUserName', 'type': 'str'}, + 'publishing_password': {'key': 'properties.publishingPassword', 'type': 'str'}, + 'publishing_password_hash': {'key': 'properties.publishingPasswordHash', 'type': 'str'}, + 'publishing_password_hash_salt': {'key': 'properties.publishingPasswordHashSalt', 'type': 'str'}, + } + + def __init__(self, *, publishing_user_name: str, kind: str=None, user_name: str=None, publishing_password: str=None, publishing_password_hash: str=None, publishing_password_hash_salt: str=None, **kwargs) -> None: + super(User, self).__init__(kind=kind, **kwargs) + self.user_name = user_name + self.publishing_user_name = publishing_user_name + self.publishing_password = publishing_password + self.publishing_password_hash = publishing_password_hash + self.publishing_password_hash_salt = publishing_password_hash_salt diff --git a/azure-mgmt-web/azure/mgmt/web/models/validate_request.py b/azure-mgmt-web/azure/mgmt/web/models/validate_request.py index d34b163fd640..472cbbc7612b 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/validate_request.py +++ b/azure-mgmt-web/azure/mgmt/web/models/validate_request.py @@ -15,12 +15,14 @@ class ValidateRequest(Model): """Resource validation request content. - :param name: Resource name to verify. + All required parameters must be populated in order to send to Azure. + + :param name: Required. Resource name to verify. :type name: str - :param type: Resource type used for verification. Possible values include: - 'ServerFarm', 'Site' + :param type: Required. Resource type used for verification. Possible + values include: 'ServerFarm', 'Site' :type type: str or ~azure.mgmt.web.models.ValidateResourceTypes - :param location: Expected location of the resource. + :param location: Required. Expected location of the resource. :type location: str :param server_farm_id: ARM resource ID of an App Service plan that would host the app. @@ -59,14 +61,14 @@ class ValidateRequest(Model): 'hosting_environment': {'key': 'properties.hostingEnvironment', 'type': 'str'}, } - def __init__(self, name, type, location, server_farm_id=None, sku_name=None, need_linux_workers=None, is_spot=None, capacity=None, hosting_environment=None): - super(ValidateRequest, self).__init__() - self.name = name - self.type = type - self.location = location - self.server_farm_id = server_farm_id - self.sku_name = sku_name - self.need_linux_workers = need_linux_workers - self.is_spot = is_spot - self.capacity = capacity - self.hosting_environment = hosting_environment + def __init__(self, **kwargs): + super(ValidateRequest, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + self.location = kwargs.get('location', None) + self.server_farm_id = kwargs.get('server_farm_id', None) + self.sku_name = kwargs.get('sku_name', None) + self.need_linux_workers = kwargs.get('need_linux_workers', None) + self.is_spot = kwargs.get('is_spot', None) + self.capacity = kwargs.get('capacity', None) + self.hosting_environment = kwargs.get('hosting_environment', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/validate_request_py3.py b/azure-mgmt-web/azure/mgmt/web/models/validate_request_py3.py new file mode 100644 index 000000000000..711a94575335 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/validate_request_py3.py @@ -0,0 +1,74 @@ +# 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 msrest.serialization import Model + + +class ValidateRequest(Model): + """Resource validation request content. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Resource name to verify. + :type name: str + :param type: Required. Resource type used for verification. Possible + values include: 'ServerFarm', 'Site' + :type type: str or ~azure.mgmt.web.models.ValidateResourceTypes + :param location: Required. Expected location of the resource. + :type location: str + :param server_farm_id: ARM resource ID of an App Service plan that would + host the app. + :type server_farm_id: str + :param sku_name: Name of the target SKU for the App Service plan. + :type sku_name: str + :param need_linux_workers: true if App Service plan is for + Linux workers; otherwise, false. + :type need_linux_workers: bool + :param is_spot: true if App Service plan is for Spot + instances; otherwise, false. + :type is_spot: bool + :param capacity: Target capacity of the App Service plan (number of VM's). + :type capacity: int + :param hosting_environment: Name of App Service Environment where app or + App Service plan should be created. + :type hosting_environment: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + 'location': {'required': True}, + 'capacity': {'minimum': 1}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'server_farm_id': {'key': 'properties.serverFarmId', 'type': 'str'}, + 'sku_name': {'key': 'properties.skuName', 'type': 'str'}, + 'need_linux_workers': {'key': 'properties.needLinuxWorkers', 'type': 'bool'}, + 'is_spot': {'key': 'properties.isSpot', 'type': 'bool'}, + 'capacity': {'key': 'properties.capacity', 'type': 'int'}, + 'hosting_environment': {'key': 'properties.hostingEnvironment', 'type': 'str'}, + } + + def __init__(self, *, name: str, type, location: str, server_farm_id: str=None, sku_name: str=None, need_linux_workers: bool=None, is_spot: bool=None, capacity: int=None, hosting_environment: str=None, **kwargs) -> None: + super(ValidateRequest, self).__init__(**kwargs) + self.name = name + self.type = type + self.location = location + self.server_farm_id = server_farm_id + self.sku_name = sku_name + self.need_linux_workers = need_linux_workers + self.is_spot = is_spot + self.capacity = capacity + self.hosting_environment = hosting_environment diff --git a/azure-mgmt-web/azure/mgmt/web/models/validate_response.py b/azure-mgmt-web/azure/mgmt/web/models/validate_response.py index 72e3aebdcb3b..473d45b816ca 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/validate_response.py +++ b/azure-mgmt-web/azure/mgmt/web/models/validate_response.py @@ -26,7 +26,7 @@ class ValidateResponse(Model): 'error': {'key': 'error', 'type': 'ValidateResponseError'}, } - def __init__(self, status=None, error=None): - super(ValidateResponse, self).__init__() - self.status = status - self.error = error + def __init__(self, **kwargs): + super(ValidateResponse, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.error = kwargs.get('error', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/validate_response_error.py b/azure-mgmt-web/azure/mgmt/web/models/validate_response_error.py index 6186f924e892..3d265a67be07 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/validate_response_error.py +++ b/azure-mgmt-web/azure/mgmt/web/models/validate_response_error.py @@ -26,7 +26,7 @@ class ValidateResponseError(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self, code=None, message=None): - super(ValidateResponseError, self).__init__() - self.code = code - self.message = message + def __init__(self, **kwargs): + super(ValidateResponseError, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/validate_response_error_py3.py b/azure-mgmt-web/azure/mgmt/web/models/validate_response_error_py3.py new file mode 100644 index 000000000000..8c52675c3356 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/validate_response_error_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class ValidateResponseError(Model): + """Error details for when validation fails. + + :param code: Validation error code. + :type code: str + :param message: Validation error message. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, message: str=None, **kwargs) -> None: + super(ValidateResponseError, self).__init__(**kwargs) + self.code = code + self.message = message diff --git a/azure-mgmt-web/azure/mgmt/web/models/validate_response_py3.py b/azure-mgmt-web/azure/mgmt/web/models/validate_response_py3.py new file mode 100644 index 000000000000..7c21b066f7cc --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/validate_response_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class ValidateResponse(Model): + """Describes the result of resource validation. + + :param status: Result of validation. + :type status: str + :param error: Error details for the case when validation fails. + :type error: ~azure.mgmt.web.models.ValidateResponseError + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'ValidateResponseError'}, + } + + def __init__(self, *, status: str=None, error=None, **kwargs) -> None: + super(ValidateResponse, self).__init__(**kwargs) + self.status = status + self.error = error diff --git a/azure-mgmt-web/azure/mgmt/web/models/virtual_application.py b/azure-mgmt-web/azure/mgmt/web/models/virtual_application.py index 6394e8f4a0dd..7b5538859ff9 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/virtual_application.py +++ b/azure-mgmt-web/azure/mgmt/web/models/virtual_application.py @@ -33,9 +33,9 @@ class VirtualApplication(Model): 'virtual_directories': {'key': 'virtualDirectories', 'type': '[VirtualDirectory]'}, } - def __init__(self, virtual_path=None, physical_path=None, preload_enabled=None, virtual_directories=None): - super(VirtualApplication, self).__init__() - self.virtual_path = virtual_path - self.physical_path = physical_path - self.preload_enabled = preload_enabled - self.virtual_directories = virtual_directories + def __init__(self, **kwargs): + super(VirtualApplication, self).__init__(**kwargs) + self.virtual_path = kwargs.get('virtual_path', None) + self.physical_path = kwargs.get('physical_path', None) + self.preload_enabled = kwargs.get('preload_enabled', None) + self.virtual_directories = kwargs.get('virtual_directories', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/virtual_application_py3.py b/azure-mgmt-web/azure/mgmt/web/models/virtual_application_py3.py new file mode 100644 index 000000000000..9fb6d7595fb6 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/virtual_application_py3.py @@ -0,0 +1,41 @@ +# 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 msrest.serialization import Model + + +class VirtualApplication(Model): + """Virtual application in an app. + + :param virtual_path: Virtual path. + :type virtual_path: str + :param physical_path: Physical path. + :type physical_path: str + :param preload_enabled: true if preloading is enabled; + otherwise, false. + :type preload_enabled: bool + :param virtual_directories: Virtual directories for virtual application. + :type virtual_directories: list[~azure.mgmt.web.models.VirtualDirectory] + """ + + _attribute_map = { + 'virtual_path': {'key': 'virtualPath', 'type': 'str'}, + 'physical_path': {'key': 'physicalPath', 'type': 'str'}, + 'preload_enabled': {'key': 'preloadEnabled', 'type': 'bool'}, + 'virtual_directories': {'key': 'virtualDirectories', 'type': '[VirtualDirectory]'}, + } + + def __init__(self, *, virtual_path: str=None, physical_path: str=None, preload_enabled: bool=None, virtual_directories=None, **kwargs) -> None: + super(VirtualApplication, self).__init__(**kwargs) + self.virtual_path = virtual_path + self.physical_path = physical_path + self.preload_enabled = preload_enabled + self.virtual_directories = virtual_directories diff --git a/azure-mgmt-web/azure/mgmt/web/models/virtual_directory.py b/azure-mgmt-web/azure/mgmt/web/models/virtual_directory.py index 8742aa28ba2d..e29d6e124afe 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/virtual_directory.py +++ b/azure-mgmt-web/azure/mgmt/web/models/virtual_directory.py @@ -26,7 +26,7 @@ class VirtualDirectory(Model): 'physical_path': {'key': 'physicalPath', 'type': 'str'}, } - def __init__(self, virtual_path=None, physical_path=None): - super(VirtualDirectory, self).__init__() - self.virtual_path = virtual_path - self.physical_path = physical_path + def __init__(self, **kwargs): + super(VirtualDirectory, self).__init__(**kwargs) + self.virtual_path = kwargs.get('virtual_path', None) + self.physical_path = kwargs.get('physical_path', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/virtual_directory_py3.py b/azure-mgmt-web/azure/mgmt/web/models/virtual_directory_py3.py new file mode 100644 index 000000000000..d24e93b8e0e4 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/virtual_directory_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class VirtualDirectory(Model): + """Directory for virtual application. + + :param virtual_path: Path to virtual application. + :type virtual_path: str + :param physical_path: Physical path. + :type physical_path: str + """ + + _attribute_map = { + 'virtual_path': {'key': 'virtualPath', 'type': 'str'}, + 'physical_path': {'key': 'physicalPath', 'type': 'str'}, + } + + def __init__(self, *, virtual_path: str=None, physical_path: str=None, **kwargs) -> None: + super(VirtualDirectory, self).__init__(**kwargs) + self.virtual_path = virtual_path + self.physical_path = physical_path diff --git a/azure-mgmt-web/azure/mgmt/web/models/virtual_ip_mapping.py b/azure-mgmt-web/azure/mgmt/web/models/virtual_ip_mapping.py index 6a8674d29b36..60c9a80fd16a 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/virtual_ip_mapping.py +++ b/azure-mgmt-web/azure/mgmt/web/models/virtual_ip_mapping.py @@ -32,9 +32,9 @@ class VirtualIPMapping(Model): 'in_use': {'key': 'inUse', 'type': 'bool'}, } - def __init__(self, virtual_ip=None, internal_http_port=None, internal_https_port=None, in_use=None): - super(VirtualIPMapping, self).__init__() - self.virtual_ip = virtual_ip - self.internal_http_port = internal_http_port - self.internal_https_port = internal_https_port - self.in_use = in_use + def __init__(self, **kwargs): + super(VirtualIPMapping, self).__init__(**kwargs) + self.virtual_ip = kwargs.get('virtual_ip', None) + self.internal_http_port = kwargs.get('internal_http_port', None) + self.internal_https_port = kwargs.get('internal_https_port', None) + self.in_use = kwargs.get('in_use', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/virtual_ip_mapping_py3.py b/azure-mgmt-web/azure/mgmt/web/models/virtual_ip_mapping_py3.py new file mode 100644 index 000000000000..5f77859f5068 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/virtual_ip_mapping_py3.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class VirtualIPMapping(Model): + """Virtual IP mapping. + + :param virtual_ip: Virtual IP address. + :type virtual_ip: str + :param internal_http_port: Internal HTTP port. + :type internal_http_port: int + :param internal_https_port: Internal HTTPS port. + :type internal_https_port: int + :param in_use: Is virtual IP mapping in use. + :type in_use: bool + """ + + _attribute_map = { + 'virtual_ip': {'key': 'virtualIP', 'type': 'str'}, + 'internal_http_port': {'key': 'internalHttpPort', 'type': 'int'}, + 'internal_https_port': {'key': 'internalHttpsPort', 'type': 'int'}, + 'in_use': {'key': 'inUse', 'type': 'bool'}, + } + + def __init__(self, *, virtual_ip: str=None, internal_http_port: int=None, internal_https_port: int=None, in_use: bool=None, **kwargs) -> None: + super(VirtualIPMapping, self).__init__(**kwargs) + self.virtual_ip = virtual_ip + self.internal_http_port = internal_http_port + self.internal_https_port = internal_https_port + self.in_use = in_use diff --git a/azure-mgmt-web/azure/mgmt/web/models/virtual_network_profile.py b/azure-mgmt-web/azure/mgmt/web/models/virtual_network_profile.py index f4d62a216f3c..decb7f8737c8 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/virtual_network_profile.py +++ b/azure-mgmt-web/azure/mgmt/web/models/virtual_network_profile.py @@ -40,9 +40,9 @@ class VirtualNetworkProfile(Model): 'subnet': {'key': 'subnet', 'type': 'str'}, } - def __init__(self, id=None, subnet=None): - super(VirtualNetworkProfile, self).__init__() - self.id = id + def __init__(self, **kwargs): + super(VirtualNetworkProfile, self).__init__(**kwargs) + self.id = kwargs.get('id', None) self.name = None self.type = None - self.subnet = subnet + self.subnet = kwargs.get('subnet', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/virtual_network_profile_py3.py b/azure-mgmt-web/azure/mgmt/web/models/virtual_network_profile_py3.py new file mode 100644 index 000000000000..a45c1060294e --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/virtual_network_profile_py3.py @@ -0,0 +1,48 @@ +# 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 msrest.serialization import Model + + +class VirtualNetworkProfile(Model): + """Specification for using a Virtual Network. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource id of the Virtual Network. + :type id: str + :ivar name: Name of the Virtual Network (read-only). + :vartype name: str + :ivar type: Resource type of the Virtual Network (read-only). + :vartype type: str + :param subnet: Subnet within the Virtual Network. + :type subnet: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'subnet': {'key': 'subnet', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, subnet: str=None, **kwargs) -> None: + super(VirtualNetworkProfile, self).__init__(**kwargs) + self.id = id + self.name = None + self.type = None + self.subnet = subnet diff --git a/azure-mgmt-web/azure/mgmt/web/models/vnet_gateway.py b/azure-mgmt-web/azure/mgmt/web/models/vnet_gateway.py index 2f48fa8b30cf..104f9bab1405 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/vnet_gateway.py +++ b/azure-mgmt-web/azure/mgmt/web/models/vnet_gateway.py @@ -19,6 +19,8 @@ class VnetGateway(ProxyOnlyResource): 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 Azure. + :ivar id: Resource Id. :vartype id: str :ivar name: Resource Name. @@ -29,7 +31,8 @@ class VnetGateway(ProxyOnlyResource): :vartype type: str :param vnet_name: The Virtual Network name. :type vnet_name: str - :param vpn_package_uri: The URI where the VPN package can be downloaded. + :param vpn_package_uri: Required. The URI where the VPN package can be + downloaded. :type vpn_package_uri: str """ @@ -49,7 +52,7 @@ class VnetGateway(ProxyOnlyResource): 'vpn_package_uri': {'key': 'properties.vpnPackageUri', 'type': 'str'}, } - def __init__(self, vpn_package_uri, kind=None, vnet_name=None): - super(VnetGateway, self).__init__(kind=kind) - self.vnet_name = vnet_name - self.vpn_package_uri = vpn_package_uri + def __init__(self, **kwargs): + super(VnetGateway, self).__init__(**kwargs) + self.vnet_name = kwargs.get('vnet_name', None) + self.vpn_package_uri = kwargs.get('vpn_package_uri', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/vnet_gateway_py3.py b/azure-mgmt-web/azure/mgmt/web/models/vnet_gateway_py3.py new file mode 100644 index 000000000000..6adc37cec0bf --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/vnet_gateway_py3.py @@ -0,0 +1,58 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class VnetGateway(ProxyOnlyResource): + """The Virtual Network gateway contract. This is used to give the Virtual + Network gateway access to the VPN package. + + 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 Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param vnet_name: The Virtual Network name. + :type vnet_name: str + :param vpn_package_uri: Required. The URI where the VPN package can be + downloaded. + :type vpn_package_uri: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'vpn_package_uri': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'vnet_name': {'key': 'properties.vnetName', 'type': 'str'}, + 'vpn_package_uri': {'key': 'properties.vpnPackageUri', 'type': 'str'}, + } + + def __init__(self, *, vpn_package_uri: str, kind: str=None, vnet_name: str=None, **kwargs) -> None: + super(VnetGateway, self).__init__(kind=kind, **kwargs) + self.vnet_name = vnet_name + self.vpn_package_uri = vpn_package_uri diff --git a/azure-mgmt-web/azure/mgmt/web/models/vnet_info.py b/azure-mgmt-web/azure/mgmt/web/models/vnet_info.py index 14915ba9a7fd..2a6527234b04 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/vnet_info.py +++ b/azure-mgmt-web/azure/mgmt/web/models/vnet_info.py @@ -66,11 +66,11 @@ class VnetInfo(ProxyOnlyResource): 'dns_servers': {'key': 'properties.dnsServers', 'type': 'str'}, } - def __init__(self, kind=None, vnet_resource_id=None, cert_blob=None, dns_servers=None): - super(VnetInfo, self).__init__(kind=kind) - self.vnet_resource_id = vnet_resource_id + def __init__(self, **kwargs): + super(VnetInfo, self).__init__(**kwargs) + self.vnet_resource_id = kwargs.get('vnet_resource_id', None) self.cert_thumbprint = None - self.cert_blob = cert_blob + self.cert_blob = kwargs.get('cert_blob', None) self.routes = None self.resync_required = None - self.dns_servers = dns_servers + self.dns_servers = kwargs.get('dns_servers', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/vnet_info_py3.py b/azure-mgmt-web/azure/mgmt/web/models/vnet_info_py3.py new file mode 100644 index 000000000000..f04734e4cee3 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/vnet_info_py3.py @@ -0,0 +1,76 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class VnetInfo(ProxyOnlyResource): + """Virtual Network information contract. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param vnet_resource_id: The Virtual Network's resource ID. + :type vnet_resource_id: str + :ivar cert_thumbprint: The client certificate thumbprint. + :vartype cert_thumbprint: str + :param cert_blob: A certificate file (.cer) blob containing the public key + of the private key used to authenticate a + Point-To-Site VPN connection. + :type cert_blob: bytearray + :ivar routes: The routes that this Virtual Network connection uses. + :vartype routes: list[~azure.mgmt.web.models.VnetRoute] + :ivar resync_required: true if a resync is required; + otherwise, false. + :vartype resync_required: bool + :param dns_servers: DNS servers to be used by this Virtual Network. This + should be a comma-separated list of IP addresses. + :type dns_servers: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'cert_thumbprint': {'readonly': True}, + 'routes': {'readonly': True}, + 'resync_required': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'vnet_resource_id': {'key': 'properties.vnetResourceId', 'type': 'str'}, + 'cert_thumbprint': {'key': 'properties.certThumbprint', 'type': 'str'}, + 'cert_blob': {'key': 'properties.certBlob', 'type': 'bytearray'}, + 'routes': {'key': 'properties.routes', 'type': '[VnetRoute]'}, + 'resync_required': {'key': 'properties.resyncRequired', 'type': 'bool'}, + 'dns_servers': {'key': 'properties.dnsServers', 'type': 'str'}, + } + + def __init__(self, *, kind: str=None, vnet_resource_id: str=None, cert_blob: bytearray=None, dns_servers: str=None, **kwargs) -> None: + super(VnetInfo, self).__init__(kind=kind, **kwargs) + self.vnet_resource_id = vnet_resource_id + self.cert_thumbprint = None + self.cert_blob = cert_blob + self.routes = None + self.resync_required = None + self.dns_servers = dns_servers diff --git a/azure-mgmt-web/azure/mgmt/web/models/vnet_parameters.py b/azure-mgmt-web/azure/mgmt/web/models/vnet_parameters.py index 1226c3ef1b27..493b96c7daa1 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/vnet_parameters.py +++ b/azure-mgmt-web/azure/mgmt/web/models/vnet_parameters.py @@ -50,8 +50,8 @@ class VnetParameters(ProxyOnlyResource): 'vnet_subnet_name': {'key': 'properties.vnetSubnetName', 'type': 'str'}, } - def __init__(self, kind=None, vnet_resource_group=None, vnet_name=None, vnet_subnet_name=None): - super(VnetParameters, self).__init__(kind=kind) - self.vnet_resource_group = vnet_resource_group - self.vnet_name = vnet_name - self.vnet_subnet_name = vnet_subnet_name + def __init__(self, **kwargs): + super(VnetParameters, self).__init__(**kwargs) + self.vnet_resource_group = kwargs.get('vnet_resource_group', None) + self.vnet_name = kwargs.get('vnet_name', None) + self.vnet_subnet_name = kwargs.get('vnet_subnet_name', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/vnet_parameters_py3.py b/azure-mgmt-web/azure/mgmt/web/models/vnet_parameters_py3.py new file mode 100644 index 000000000000..14ba43d31d20 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/vnet_parameters_py3.py @@ -0,0 +1,57 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class VnetParameters(ProxyOnlyResource): + """The required set of inputs to validate a VNET. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param vnet_resource_group: The Resource Group of the VNET to be validated + :type vnet_resource_group: str + :param vnet_name: The name of the VNET to be validated + :type vnet_name: str + :param vnet_subnet_name: The subnet name to be validated + :type vnet_subnet_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'vnet_resource_group': {'key': 'properties.vnetResourceGroup', 'type': 'str'}, + 'vnet_name': {'key': 'properties.vnetName', 'type': 'str'}, + 'vnet_subnet_name': {'key': 'properties.vnetSubnetName', 'type': 'str'}, + } + + def __init__(self, *, kind: str=None, vnet_resource_group: str=None, vnet_name: str=None, vnet_subnet_name: str=None, **kwargs) -> None: + super(VnetParameters, self).__init__(kind=kind, **kwargs) + self.vnet_resource_group = vnet_resource_group + self.vnet_name = vnet_name + self.vnet_subnet_name = vnet_subnet_name diff --git a/azure-mgmt-web/azure/mgmt/web/models/vnet_route.py b/azure-mgmt-web/azure/mgmt/web/models/vnet_route.py index ef511e8fb23b..43a33b9d117e 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/vnet_route.py +++ b/azure-mgmt-web/azure/mgmt/web/models/vnet_route.py @@ -64,9 +64,9 @@ class VnetRoute(ProxyOnlyResource): 'route_type': {'key': 'properties.routeType', 'type': 'str'}, } - def __init__(self, kind=None, vnet_route_name=None, start_address=None, end_address=None, route_type=None): - super(VnetRoute, self).__init__(kind=kind) - self.vnet_route_name = vnet_route_name - self.start_address = start_address - self.end_address = end_address - self.route_type = route_type + def __init__(self, **kwargs): + super(VnetRoute, self).__init__(**kwargs) + self.vnet_route_name = kwargs.get('vnet_route_name', None) + self.start_address = kwargs.get('start_address', None) + self.end_address = kwargs.get('end_address', None) + self.route_type = kwargs.get('route_type', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/vnet_route_py3.py b/azure-mgmt-web/azure/mgmt/web/models/vnet_route_py3.py new file mode 100644 index 000000000000..60d6fa8b3b16 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/vnet_route_py3.py @@ -0,0 +1,72 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class VnetRoute(ProxyOnlyResource): + """Virtual Network route contract used to pass routing information for a + Virtual Network. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param vnet_route_name: The name of this route. This is only returned by + the server and does not need to be set by the client. + :type vnet_route_name: str + :param start_address: The starting address for this route. This may also + include a CIDR notation, in which case the end address must not be + specified. + :type start_address: str + :param end_address: The ending address for this route. If the start + address is specified in CIDR notation, this must be omitted. + :type end_address: str + :param route_type: The type of route this is: + DEFAULT - By default, every app has routes to the local address ranges + specified by RFC1918 + INHERITED - Routes inherited from the real Virtual Network routes + STATIC - Static route set on the app only + These values will be used for syncing an app's routes with those from a + Virtual Network. Possible values include: 'DEFAULT', 'INHERITED', 'STATIC' + :type route_type: str or ~azure.mgmt.web.models.RouteType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'vnet_route_name': {'key': 'properties.name', 'type': 'str'}, + 'start_address': {'key': 'properties.startAddress', 'type': 'str'}, + 'end_address': {'key': 'properties.endAddress', 'type': 'str'}, + 'route_type': {'key': 'properties.routeType', 'type': 'str'}, + } + + def __init__(self, *, kind: str=None, vnet_route_name: str=None, start_address: str=None, end_address: str=None, route_type=None, **kwargs) -> None: + super(VnetRoute, self).__init__(kind=kind, **kwargs) + self.vnet_route_name = vnet_route_name + self.start_address = start_address + self.end_address = end_address + self.route_type = route_type diff --git a/azure-mgmt-web/azure/mgmt/web/models/vnet_validation_failure_details.py b/azure-mgmt-web/azure/mgmt/web/models/vnet_validation_failure_details.py index 4ac9adf0d201..f980264509d3 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/vnet_validation_failure_details.py +++ b/azure-mgmt-web/azure/mgmt/web/models/vnet_validation_failure_details.py @@ -47,7 +47,7 @@ class VnetValidationFailureDetails(ProxyOnlyResource): 'failed_tests': {'key': 'properties.failedTests', 'type': '[VnetValidationTestFailure]'}, } - def __init__(self, kind=None, failed=None, failed_tests=None): - super(VnetValidationFailureDetails, self).__init__(kind=kind) - self.failed = failed - self.failed_tests = failed_tests + def __init__(self, **kwargs): + super(VnetValidationFailureDetails, self).__init__(**kwargs) + self.failed = kwargs.get('failed', None) + self.failed_tests = kwargs.get('failed_tests', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/vnet_validation_failure_details_py3.py b/azure-mgmt-web/azure/mgmt/web/models/vnet_validation_failure_details_py3.py new file mode 100644 index 000000000000..9efc74919ae8 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/vnet_validation_failure_details_py3.py @@ -0,0 +1,53 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class VnetValidationFailureDetails(ProxyOnlyResource): + """A class that describes the reason for a validation failure. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param failed: A flag describing whether or not validation failed. + :type failed: bool + :param failed_tests: A list of tests that failed in the validation. + :type failed_tests: list[~azure.mgmt.web.models.VnetValidationTestFailure] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'failed': {'key': 'properties.failed', 'type': 'bool'}, + 'failed_tests': {'key': 'properties.failedTests', 'type': '[VnetValidationTestFailure]'}, + } + + def __init__(self, *, kind: str=None, failed: bool=None, failed_tests=None, **kwargs) -> None: + super(VnetValidationFailureDetails, self).__init__(kind=kind, **kwargs) + self.failed = failed + self.failed_tests = failed_tests diff --git a/azure-mgmt-web/azure/mgmt/web/models/vnet_validation_test_failure.py b/azure-mgmt-web/azure/mgmt/web/models/vnet_validation_test_failure.py index c0d453c1b53a..25326a68951a 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/vnet_validation_test_failure.py +++ b/azure-mgmt-web/azure/mgmt/web/models/vnet_validation_test_failure.py @@ -48,7 +48,7 @@ class VnetValidationTestFailure(ProxyOnlyResource): 'details': {'key': 'properties.details', 'type': 'str'}, } - def __init__(self, kind=None, test_name=None, details=None): - super(VnetValidationTestFailure, self).__init__(kind=kind) - self.test_name = test_name - self.details = details + def __init__(self, **kwargs): + super(VnetValidationTestFailure, self).__init__(**kwargs) + self.test_name = kwargs.get('test_name', None) + self.details = kwargs.get('details', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/vnet_validation_test_failure_py3.py b/azure-mgmt-web/azure/mgmt/web/models/vnet_validation_test_failure_py3.py new file mode 100644 index 000000000000..102c3d80007c --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/vnet_validation_test_failure_py3.py @@ -0,0 +1,54 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class VnetValidationTestFailure(ProxyOnlyResource): + """A class that describes a test that failed during NSG and UDR validation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param test_name: The name of the test that failed. + :type test_name: str + :param details: The details of what caused the failure, e.g. the blocking + rule name, etc. + :type details: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'test_name': {'key': 'properties.testName', 'type': 'str'}, + 'details': {'key': 'properties.details', 'type': 'str'}, + } + + def __init__(self, *, kind: str=None, test_name: str=None, details: str=None, **kwargs) -> None: + super(VnetValidationTestFailure, self).__init__(kind=kind, **kwargs) + self.test_name = test_name + self.details = details diff --git a/azure-mgmt-web/azure/mgmt/web/models/web_app_collection.py b/azure-mgmt-web/azure/mgmt/web/models/web_app_collection.py index 3c53315ca4e7..a74350b0d7a4 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/web_app_collection.py +++ b/azure-mgmt-web/azure/mgmt/web/models/web_app_collection.py @@ -18,7 +18,9 @@ class WebAppCollection(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: Collection of resources. + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. :type value: list[~azure.mgmt.web.models.Site] :ivar next_link: Link to next page of resources. :vartype next_link: str @@ -34,7 +36,7 @@ class WebAppCollection(Model): 'next_link': {'key': 'nextLink', 'type': 'str'}, } - def __init__(self, value): - super(WebAppCollection, self).__init__() - self.value = value + def __init__(self, **kwargs): + super(WebAppCollection, self).__init__(**kwargs) + self.value = kwargs.get('value', None) self.next_link = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/web_app_collection_py3.py b/azure-mgmt-web/azure/mgmt/web/models/web_app_collection_py3.py new file mode 100644 index 000000000000..855f2095a1a3 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/web_app_collection_py3.py @@ -0,0 +1,42 @@ +# 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 msrest.serialization import Model + + +class WebAppCollection(Model): + """Collection of App Service 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 Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.models.Site] + :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': '[Site]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value, **kwargs) -> None: + super(WebAppCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/web_job.py b/azure-mgmt-web/azure/mgmt/web/models/web_job.py index 5a3caa921631..5454d02ccbe7 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/web_job.py +++ b/azure-mgmt-web/azure/mgmt/web/models/web_job.py @@ -67,13 +67,13 @@ class WebJob(ProxyOnlyResource): 'settings': {'key': 'properties.settings', 'type': '{object}'}, } - def __init__(self, kind=None, run_command=None, url=None, extra_info_url=None, job_type=None, error=None, using_sdk=None, settings=None): - super(WebJob, self).__init__(kind=kind) + def __init__(self, **kwargs): + super(WebJob, self).__init__(**kwargs) self.web_job_name = None - self.run_command = run_command - self.url = url - self.extra_info_url = extra_info_url - self.job_type = job_type - self.error = error - self.using_sdk = using_sdk - self.settings = settings + self.run_command = kwargs.get('run_command', None) + self.url = kwargs.get('url', None) + self.extra_info_url = kwargs.get('extra_info_url', None) + self.job_type = kwargs.get('job_type', None) + self.error = kwargs.get('error', None) + self.using_sdk = kwargs.get('using_sdk', None) + self.settings = kwargs.get('settings', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/web_job_py3.py b/azure-mgmt-web/azure/mgmt/web/models/web_job_py3.py new file mode 100644 index 000000000000..9ed19f42eaa4 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/web_job_py3.py @@ -0,0 +1,79 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class WebJob(ProxyOnlyResource): + """Web Job Information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar web_job_name: Job name. Used as job identifier in ARM resource URI. + :vartype web_job_name: str + :param run_command: Run command. + :type run_command: str + :param url: Job URL. + :type url: str + :param extra_info_url: Extra Info URL. + :type extra_info_url: str + :param job_type: Job type. Possible values include: 'Continuous', + 'Triggered' + :type job_type: str or ~azure.mgmt.web.models.WebJobType + :param error: Error information. + :type error: str + :param using_sdk: Using SDK? + :type using_sdk: bool + :param settings: Job settings. + :type settings: dict[str, object] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'web_job_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'web_job_name': {'key': 'properties.name', 'type': 'str'}, + 'run_command': {'key': 'properties.runCommand', 'type': 'str'}, + 'url': {'key': 'properties.url', 'type': 'str'}, + 'extra_info_url': {'key': 'properties.extraInfoUrl', 'type': 'str'}, + 'job_type': {'key': 'properties.jobType', 'type': 'WebJobType'}, + 'error': {'key': 'properties.error', 'type': 'str'}, + 'using_sdk': {'key': 'properties.usingSdk', 'type': 'bool'}, + 'settings': {'key': 'properties.settings', 'type': '{object}'}, + } + + def __init__(self, *, kind: str=None, run_command: str=None, url: str=None, extra_info_url: str=None, job_type=None, error: str=None, using_sdk: bool=None, settings=None, **kwargs) -> None: + super(WebJob, self).__init__(kind=kind, **kwargs) + self.web_job_name = None + self.run_command = run_command + self.url = url + self.extra_info_url = extra_info_url + self.job_type = job_type + self.error = error + self.using_sdk = using_sdk + self.settings = settings diff --git a/azure-mgmt-web/azure/mgmt/web/models/web_site_management_client_enums.py b/azure-mgmt-web/azure/mgmt/web/models/web_site_management_client_enums.py index 732822bd5a3f..bfaeda5eb909 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/web_site_management_client_enums.py +++ b/azure-mgmt-web/azure/mgmt/web/models/web_site_management_client_enums.py @@ -12,7 +12,7 @@ from enum import Enum -class KeyVaultSecretStatus(Enum): +class KeyVaultSecretStatus(str, Enum): initialized = "Initialized" waiting_on_certificate_order = "WaitingOnCertificateOrder" @@ -27,13 +27,13 @@ class KeyVaultSecretStatus(Enum): unknown = "Unknown" -class CertificateProductType(Enum): +class CertificateProductType(str, Enum): standard_domain_validated_ssl = "StandardDomainValidatedSsl" standard_domain_validated_wild_card_ssl = "StandardDomainValidatedWildCardSsl" -class ProvisioningState(Enum): +class ProvisioningState(str, Enum): succeeded = "Succeeded" failed = "Failed" @@ -42,7 +42,7 @@ class ProvisioningState(Enum): deleting = "Deleting" -class CertificateOrderStatus(Enum): +class CertificateOrderStatus(str, Enum): pendingissuance = "Pendingissuance" issued = "Issued" @@ -56,7 +56,7 @@ class CertificateOrderStatus(Enum): not_submitted = "NotSubmitted" -class CertificateOrderActionType(Enum): +class CertificateOrderActionType(str, Enum): certificate_issued = "CertificateIssued" certificate_order_canceled = "CertificateOrderCanceled" @@ -74,21 +74,26 @@ class CertificateOrderActionType(Enum): unknown = "Unknown" -class RouteType(Enum): +class RouteType(str, Enum): default = "DEFAULT" inherited = "INHERITED" static = "STATIC" -class AutoHealActionType(Enum): +class ManagedServiceIdentityType(str, Enum): + + system_assigned = "SystemAssigned" + + +class AutoHealActionType(str, Enum): recycle = "Recycle" log_event = "LogEvent" custom_action = "CustomAction" -class ConnectionStringType(Enum): +class ConnectionStringType(str, Enum): my_sql = "MySql" sql_server = "SQLServer" @@ -103,7 +108,7 @@ class ConnectionStringType(Enum): postgre_sql = "PostgreSQL" -class ScmType(Enum): +class ScmType(str, Enum): none = "None" dropbox = "Dropbox" @@ -120,13 +125,13 @@ class ScmType(Enum): vso = "VSO" -class ManagedPipelineMode(Enum): +class ManagedPipelineMode(str, Enum): integrated = "Integrated" classic = "Classic" -class SiteLoadBalancing(Enum): +class SiteLoadBalancing(str, Enum): weighted_round_robin = "WeightedRoundRobin" least_requests = "LeastRequests" @@ -135,47 +140,47 @@ class SiteLoadBalancing(Enum): request_hash = "RequestHash" -class SupportedTlsVersions(Enum): +class SupportedTlsVersions(str, Enum): one_full_stop_zero = "1.0" one_full_stop_one = "1.1" one_full_stop_two = "1.2" -class SslState(Enum): +class SslState(str, Enum): disabled = "Disabled" sni_enabled = "SniEnabled" ip_based_enabled = "IpBasedEnabled" -class HostType(Enum): +class HostType(str, Enum): standard = "Standard" repository = "Repository" -class UsageState(Enum): +class UsageState(str, Enum): normal = "Normal" exceeded = "Exceeded" -class SiteAvailabilityState(Enum): +class SiteAvailabilityState(str, Enum): normal = "Normal" limited = "Limited" disaster_recovery_mode = "DisasterRecoveryMode" -class StatusOptions(Enum): +class StatusOptions(str, Enum): ready = "Ready" pending = "Pending" creating = "Creating" -class DomainStatus(Enum): +class DomainStatus(str, Enum): active = "Active" awaiting = "Awaiting" @@ -200,37 +205,37 @@ class DomainStatus(Enum): json_converter_failed = "JsonConverterFailed" -class AzureResourceType(Enum): +class AzureResourceType(str, Enum): website = "Website" traffic_manager = "TrafficManager" -class CustomHostNameDnsRecordType(Enum): +class CustomHostNameDnsRecordType(str, Enum): cname = "CName" a = "A" -class HostNameType(Enum): +class HostNameType(str, Enum): verified = "Verified" managed = "Managed" -class DnsType(Enum): +class DnsType(str, Enum): azure_dns = "AzureDns" default_domain_registrar_dns = "DefaultDomainRegistrarDns" -class DomainType(Enum): +class DomainType(str, Enum): regular = "Regular" soft_deleted = "SoftDeleted" -class HostingEnvironmentStatus(Enum): +class HostingEnvironmentStatus(str, Enum): preparing = "Preparing" ready = "Ready" @@ -238,21 +243,21 @@ class HostingEnvironmentStatus(Enum): deleting = "Deleting" -class InternalLoadBalancingMode(Enum): +class InternalLoadBalancingMode(str, Enum): none = "None" web = "Web" publishing = "Publishing" -class ComputeModeOptions(Enum): +class ComputeModeOptions(str, Enum): shared = "Shared" dedicated = "Dedicated" dynamic = "Dynamic" -class WorkerSizeOptions(Enum): +class WorkerSizeOptions(str, Enum): default = "Default" small = "Small" @@ -263,13 +268,13 @@ class WorkerSizeOptions(Enum): d3 = "D3" -class AccessControlEntryAction(Enum): +class AccessControlEntryAction(str, Enum): permit = "Permit" deny = "Deny" -class OperationStatus(Enum): +class OperationStatus(str, Enum): in_progress = "InProgress" failed = "Failed" @@ -278,7 +283,7 @@ class OperationStatus(Enum): created = "Created" -class IssueType(Enum): +class IssueType(str, Enum): service_incident = "ServiceIncident" app_deployment = "AppDeployment" @@ -290,21 +295,29 @@ class IssueType(Enum): other = "Other" -class SolutionType(Enum): +class SolutionType(str, Enum): quick_solution = "QuickSolution" deep_investigation = "DeepInvestigation" best_practices = "BestPractices" -class ResourceScopeType(Enum): +class RenderingType(str, Enum): + + no_graph = "NoGraph" + table = "Table" + time_series = "TimeSeries" + time_series_per_instance = "TimeSeriesPerInstance" + + +class ResourceScopeType(str, Enum): server_farm = "ServerFarm" subscription = "Subscription" web_site = "WebSite" -class NotificationLevel(Enum): +class NotificationLevel(str, Enum): critical = "Critical" warning = "Warning" @@ -312,7 +325,7 @@ class NotificationLevel(Enum): non_urgent_suggestion = "NonUrgentSuggestion" -class Channels(Enum): +class Channels(str, Enum): notification = "Notification" api = "Api" @@ -321,7 +334,7 @@ class Channels(Enum): all = "All" -class AppServicePlanRestrictions(Enum): +class AppServicePlanRestrictions(str, Enum): none = "None" free = "Free" @@ -331,13 +344,13 @@ class AppServicePlanRestrictions(Enum): premium = "Premium" -class InAvailabilityReasonType(Enum): +class InAvailabilityReasonType(str, Enum): invalid = "Invalid" already_exists = "AlreadyExists" -class CheckNameResourceTypes(Enum): +class CheckNameResourceTypes(str, Enum): site = "Site" slot = "Slot" @@ -349,13 +362,13 @@ class CheckNameResourceTypes(Enum): microsoft_webpublishing_users = "Microsoft.Web/publishingUsers" -class ValidateResourceTypes(Enum): +class ValidateResourceTypes(str, Enum): server_farm = "ServerFarm" site = "Site" -class LogLevel(Enum): +class LogLevel(str, Enum): off = "Off" verbose = "Verbose" @@ -364,7 +377,7 @@ class LogLevel(Enum): error = "Error" -class BackupItemStatus(Enum): +class BackupItemStatus(str, Enum): in_progress = "InProgress" failed = "Failed" @@ -378,7 +391,7 @@ class BackupItemStatus(Enum): deleted = "Deleted" -class DatabaseType(Enum): +class DatabaseType(str, Enum): sql_azure = "SqlAzure" my_sql = "MySql" @@ -386,13 +399,13 @@ class DatabaseType(Enum): postgre_sql = "PostgreSql" -class FrequencyUnit(Enum): +class FrequencyUnit(str, Enum): day = "Day" hour = "Hour" -class BackupRestoreOperationType(Enum): +class BackupRestoreOperationType(str, Enum): default = "Default" clone = "Clone" @@ -400,7 +413,7 @@ class BackupRestoreOperationType(Enum): snapshot = "Snapshot" -class ContinuousWebJobStatus(Enum): +class ContinuousWebJobStatus(str, Enum): initializing = "Initializing" starting = "Starting" @@ -409,34 +422,34 @@ class ContinuousWebJobStatus(Enum): stopped = "Stopped" -class WebJobType(Enum): +class WebJobType(str, Enum): continuous = "Continuous" triggered = "Triggered" -class PublishingProfileFormat(Enum): +class PublishingProfileFormat(str, Enum): file_zilla3 = "FileZilla3" web_deploy = "WebDeploy" ftp = "Ftp" -class DnsVerificationTestResult(Enum): +class DnsVerificationTestResult(str, Enum): passed = "Passed" failed = "Failed" skipped = "Skipped" -class MSDeployLogEntryType(Enum): +class MSDeployLogEntryType(str, Enum): message = "Message" warning = "Warning" error = "Error" -class MSDeployProvisioningState(Enum): +class MSDeployProvisioningState(str, Enum): accepted = "accepted" running = "running" @@ -445,26 +458,26 @@ class MSDeployProvisioningState(Enum): canceled = "canceled" -class MySqlMigrationType(Enum): +class MySqlMigrationType(str, Enum): local_to_remote = "LocalToRemote" remote_to_local = "RemoteToLocal" -class PublicCertificateLocation(Enum): +class PublicCertificateLocation(str, Enum): current_user_my = "CurrentUserMy" local_machine_my = "LocalMachineMy" unknown = "Unknown" -class UnauthenticatedClientAction(Enum): +class UnauthenticatedClientAction(str, Enum): redirect_to_login_page = "RedirectToLoginPage" allow_anonymous = "AllowAnonymous" -class BuiltInAuthenticationProvider(Enum): +class BuiltInAuthenticationProvider(str, Enum): azure_active_directory = "AzureActiveDirectory" facebook = "Facebook" @@ -473,27 +486,27 @@ class BuiltInAuthenticationProvider(Enum): twitter = "Twitter" -class CloneAbilityResult(Enum): +class CloneAbilityResult(str, Enum): cloneable = "Cloneable" partially_cloneable = "PartiallyCloneable" not_cloneable = "NotCloneable" -class SiteExtensionType(Enum): +class SiteExtensionType(str, Enum): gallery = "Gallery" web_root = "WebRoot" -class TriggeredWebJobStatus(Enum): +class TriggeredWebJobStatus(str, Enum): success = "Success" failed = "Failed" error = "Error" -class SkuName(Enum): +class SkuName(str, Enum): free = "Free" shared = "Shared" diff --git a/azure-mgmt-web/azure/mgmt/web/models/worker_pool.py b/azure-mgmt-web/azure/mgmt/web/models/worker_pool.py index c26d02899ed2..74b28651e46c 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/worker_pool.py +++ b/azure-mgmt-web/azure/mgmt/web/models/worker_pool.py @@ -44,10 +44,10 @@ class WorkerPool(Model): 'instance_names': {'key': 'instanceNames', 'type': '[str]'}, } - def __init__(self, worker_size_id=None, compute_mode=None, worker_size=None, worker_count=None): - super(WorkerPool, self).__init__() - self.worker_size_id = worker_size_id - self.compute_mode = compute_mode - self.worker_size = worker_size - self.worker_count = worker_count + def __init__(self, **kwargs): + super(WorkerPool, self).__init__(**kwargs) + self.worker_size_id = kwargs.get('worker_size_id', None) + self.compute_mode = kwargs.get('compute_mode', None) + self.worker_size = kwargs.get('worker_size', None) + self.worker_count = kwargs.get('worker_count', None) self.instance_names = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/worker_pool_py3.py b/azure-mgmt-web/azure/mgmt/web/models/worker_pool_py3.py new file mode 100644 index 000000000000..d320043e70b9 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/worker_pool_py3.py @@ -0,0 +1,53 @@ +# 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 msrest.serialization import Model + + +class WorkerPool(Model): + """Worker pool of an App Service Environment. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param worker_size_id: Worker size ID for referencing this worker pool. + :type worker_size_id: int + :param compute_mode: Shared or dedicated app hosting. Possible values + include: 'Shared', 'Dedicated', 'Dynamic' + :type compute_mode: str or ~azure.mgmt.web.models.ComputeModeOptions + :param worker_size: VM size of the worker pool instances. + :type worker_size: str + :param worker_count: Number of instances in the worker pool. + :type worker_count: int + :ivar instance_names: Names of all instances in the worker pool (read + only). + :vartype instance_names: list[str] + """ + + _validation = { + 'instance_names': {'readonly': True}, + } + + _attribute_map = { + 'worker_size_id': {'key': 'workerSizeId', 'type': 'int'}, + 'compute_mode': {'key': 'computeMode', 'type': 'ComputeModeOptions'}, + 'worker_size': {'key': 'workerSize', 'type': 'str'}, + 'worker_count': {'key': 'workerCount', 'type': 'int'}, + 'instance_names': {'key': 'instanceNames', 'type': '[str]'}, + } + + def __init__(self, *, worker_size_id: int=None, compute_mode=None, worker_size: str=None, worker_count: int=None, **kwargs) -> None: + super(WorkerPool, self).__init__(**kwargs) + self.worker_size_id = worker_size_id + self.compute_mode = compute_mode + self.worker_size = worker_size + self.worker_count = worker_count + self.instance_names = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/worker_pool_resource.py b/azure-mgmt-web/azure/mgmt/web/models/worker_pool_resource.py index 869353189d58..ca90bf8d794d 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/worker_pool_resource.py +++ b/azure-mgmt-web/azure/mgmt/web/models/worker_pool_resource.py @@ -62,11 +62,11 @@ class WorkerPoolResource(ProxyOnlyResource): 'sku': {'key': 'sku', 'type': 'SkuDescription'}, } - def __init__(self, kind=None, worker_size_id=None, compute_mode=None, worker_size=None, worker_count=None, sku=None): - super(WorkerPoolResource, self).__init__(kind=kind) - self.worker_size_id = worker_size_id - self.compute_mode = compute_mode - self.worker_size = worker_size - self.worker_count = worker_count + def __init__(self, **kwargs): + super(WorkerPoolResource, self).__init__(**kwargs) + self.worker_size_id = kwargs.get('worker_size_id', None) + self.compute_mode = kwargs.get('compute_mode', None) + self.worker_size = kwargs.get('worker_size', None) + self.worker_count = kwargs.get('worker_count', None) self.instance_names = None - self.sku = sku + self.sku = kwargs.get('sku', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/worker_pool_resource_py3.py b/azure-mgmt-web/azure/mgmt/web/models/worker_pool_resource_py3.py new file mode 100644 index 000000000000..885f2f39ce5f --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/worker_pool_resource_py3.py @@ -0,0 +1,72 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class WorkerPoolResource(ProxyOnlyResource): + """Worker pool of an App Service Environment ARM resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param worker_size_id: Worker size ID for referencing this worker pool. + :type worker_size_id: int + :param compute_mode: Shared or dedicated app hosting. Possible values + include: 'Shared', 'Dedicated', 'Dynamic' + :type compute_mode: str or ~azure.mgmt.web.models.ComputeModeOptions + :param worker_size: VM size of the worker pool instances. + :type worker_size: str + :param worker_count: Number of instances in the worker pool. + :type worker_count: int + :ivar instance_names: Names of all instances in the worker pool (read + only). + :vartype instance_names: list[str] + :param sku: + :type sku: ~azure.mgmt.web.models.SkuDescription + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'instance_names': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'worker_size_id': {'key': 'properties.workerSizeId', 'type': 'int'}, + 'compute_mode': {'key': 'properties.computeMode', 'type': 'ComputeModeOptions'}, + 'worker_size': {'key': 'properties.workerSize', 'type': 'str'}, + 'worker_count': {'key': 'properties.workerCount', 'type': 'int'}, + 'instance_names': {'key': 'properties.instanceNames', 'type': '[str]'}, + 'sku': {'key': 'sku', 'type': 'SkuDescription'}, + } + + def __init__(self, *, kind: str=None, worker_size_id: int=None, compute_mode=None, worker_size: str=None, worker_count: int=None, sku=None, **kwargs) -> None: + super(WorkerPoolResource, self).__init__(kind=kind, **kwargs) + self.worker_size_id = worker_size_id + self.compute_mode = compute_mode + self.worker_size = worker_size + self.worker_count = worker_count + self.instance_names = None + self.sku = sku diff --git a/azure-mgmt-web/azure/mgmt/web/operations/__init__.py b/azure-mgmt-web/azure/mgmt/web/operations/__init__.py index 93d9712f46bd..5ceaac0d94eb 100644 --- a/azure-mgmt-web/azure/mgmt/web/operations/__init__.py +++ b/azure-mgmt-web/azure/mgmt/web/operations/__init__.py @@ -19,6 +19,8 @@ from .diagnostics_operations import DiagnosticsOperations from .provider_operations import ProviderOperations from .recommendations_operations import RecommendationsOperations +from .resource_health_metadata_operations import ResourceHealthMetadataOperations +from .billing_meters_operations import BillingMetersOperations from .web_apps_operations import WebAppsOperations from .app_service_environments_operations import AppServiceEnvironmentsOperations from .app_service_plans_operations import AppServicePlansOperations @@ -34,6 +36,8 @@ 'DiagnosticsOperations', 'ProviderOperations', 'RecommendationsOperations', + 'ResourceHealthMetadataOperations', + 'BillingMetersOperations', 'WebAppsOperations', 'AppServiceEnvironmentsOperations', 'AppServicePlansOperations', diff --git a/azure-mgmt-web/azure/mgmt/web/operations/app_service_certificate_orders_operations.py b/azure-mgmt-web/azure/mgmt/web/operations/app_service_certificate_orders_operations.py index e1cc7214d1cb..756f74b6c1e5 100644 --- a/azure-mgmt-web/azure/mgmt/web/operations/app_service_certificate_orders_operations.py +++ b/azure-mgmt-web/azure/mgmt/web/operations/app_service_certificate_orders_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -353,7 +353,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, certificate_order_name, certificate_distinguished_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, certificate_order_name, certificate_distinguished_name, custom_headers=None, raw=False, polling=True, **operation_config): """Create or update a certificate purchase order. Create or update a certificate purchase order. @@ -368,13 +368,17 @@ def create_or_update( :type certificate_distinguished_name: ~azure.mgmt.web.models.AppServiceCertificateOrder :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - AppServiceCertificateOrder or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + AppServiceCertificateOrder or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.web.models.AppServiceCertificateOrder] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.models.AppServiceCertificateOrder]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -385,30 +389,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('AppServiceCertificateOrder', response) if raw: @@ -417,12 +399,13 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}'} def delete( @@ -754,7 +737,7 @@ def _create_or_update_certificate_initial( return deserialized def create_or_update_certificate( - self, resource_group_name, certificate_order_name, name, key_vault_certificate, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, certificate_order_name, name, key_vault_certificate, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a certificate and associates with key vault secret. Creates or updates a certificate and associates with key vault secret. @@ -770,13 +753,17 @@ def create_or_update_certificate( :type key_vault_certificate: ~azure.mgmt.web.models.AppServiceCertificateResource :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - AppServiceCertificateResource or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + AppServiceCertificateResource or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.web.models.AppServiceCertificateResource] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.models.AppServiceCertificateResource]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_certificate_initial( @@ -788,30 +775,8 @@ def create_or_update_certificate( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('AppServiceCertificateResource', response) if raw: @@ -820,12 +785,13 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) create_or_update_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}'} def delete_certificate( diff --git a/azure-mgmt-web/azure/mgmt/web/operations/app_service_environments_operations.py b/azure-mgmt-web/azure/mgmt/web/operations/app_service_environments_operations.py index f4c683d13e7b..033fade0ec3e 100644 --- a/azure-mgmt-web/azure/mgmt/web/operations/app_service_environments_operations.py +++ b/azure-mgmt-web/azure/mgmt/web/operations/app_service_environments_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -296,7 +296,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, name, hosting_environment_envelope, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, name, hosting_environment_envelope, custom_headers=None, raw=False, polling=True, **operation_config): """Create or update an App Service Environment. Create or update an App Service Environment. @@ -311,13 +311,17 @@ def create_or_update( :type hosting_environment_envelope: ~azure.mgmt.web.models.AppServiceEnvironmentResource :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - AppServiceEnvironmentResource or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + AppServiceEnvironmentResource or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.web.models.AppServiceEnvironmentResource] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.models.AppServiceEnvironmentResource]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -328,30 +332,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 400, 404, 409]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('AppServiceEnvironmentResource', response) if raw: @@ -360,12 +342,13 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}'} @@ -410,7 +393,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, name, force_delete=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, name, force_delete=None, custom_headers=None, raw=False, polling=True, **operation_config): """Delete an App Service Environment. Delete an App Service Environment. @@ -425,12 +408,14 @@ def delete( false. :type force_delete: bool :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -441,40 +426,19 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [202, 204, 400, 404, 409]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}'} def update( @@ -1172,7 +1136,7 @@ def _create_or_update_multi_role_pool_initial( return deserialized def create_or_update_multi_role_pool( - self, resource_group_name, name, multi_role_pool_envelope, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, name, multi_role_pool_envelope, custom_headers=None, raw=False, polling=True, **operation_config): """Create or update a multi-role pool. Create or update a multi-role pool. @@ -1186,13 +1150,16 @@ def create_or_update_multi_role_pool( :type multi_role_pool_envelope: ~azure.mgmt.web.models.WorkerPoolResource :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - WorkerPoolResource or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns WorkerPoolResource or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.web.models.WorkerPoolResource] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.models.WorkerPoolResource]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_multi_role_pool_initial( @@ -1203,30 +1170,8 @@ def create_or_update_multi_role_pool( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 400, 404, 409]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('WorkerPoolResource', response) if raw: @@ -1235,12 +1180,13 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) create_or_update_multi_role_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default'} def update_multi_role_pool( @@ -1478,7 +1424,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized - list_multi_role_pool_instance_metrics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/instances/{instance}metrics'} + list_multi_role_pool_instance_metrics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/instances/{instance}/metrics'} def list_multi_role_metric_definitions( self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): @@ -1974,7 +1920,7 @@ def _resume_initial( return deserialized def resume( - self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, name, custom_headers=None, raw=False, polling=True, **operation_config): """Resume an App Service Environment. Resume an App Service Environment. @@ -1985,13 +1931,16 @@ def resume( :param name: Name of the App Service Environment. :type name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - WebAppCollection or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns WebAppCollection or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.web.models.WebAppCollection] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.models.WebAppCollection]] :raises: :class:`CloudError` """ raw_result = self._resume_initial( @@ -2001,30 +1950,8 @@ def resume( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('WebAppCollection', response) if raw: @@ -2033,12 +1960,13 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) resume.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/resume'} def list_app_service_plans( @@ -2242,7 +2170,7 @@ def _suspend_initial( return deserialized def suspend( - self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, name, custom_headers=None, raw=False, polling=True, **operation_config): """Suspend an App Service Environment. Suspend an App Service Environment. @@ -2253,13 +2181,16 @@ def suspend( :param name: Name of the App Service Environment. :type name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - WebAppCollection or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns WebAppCollection or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.web.models.WebAppCollection] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.models.WebAppCollection]] :raises: :class:`CloudError` """ raw_result = self._suspend_initial( @@ -2269,30 +2200,8 @@ def suspend( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('WebAppCollection', response) if raw: @@ -2301,12 +2210,13 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) suspend.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/suspend'} def list_usages( @@ -2587,7 +2497,7 @@ def _create_or_update_worker_pool_initial( return deserialized def create_or_update_worker_pool( - self, resource_group_name, name, worker_pool_name, worker_pool_envelope, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, name, worker_pool_name, worker_pool_envelope, custom_headers=None, raw=False, polling=True, **operation_config): """Create or update a worker pool. Create or update a worker pool. @@ -2602,13 +2512,16 @@ def create_or_update_worker_pool( :param worker_pool_envelope: Properties of the worker pool. :type worker_pool_envelope: ~azure.mgmt.web.models.WorkerPoolResource :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - WorkerPoolResource or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns WorkerPoolResource or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.web.models.WorkerPoolResource] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.models.WorkerPoolResource]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_worker_pool_initial( @@ -2620,30 +2533,8 @@ def create_or_update_worker_pool( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 400, 404, 409]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('WorkerPoolResource', response) if raw: @@ -2652,12 +2543,13 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) create_or_update_worker_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}'} def update_worker_pool( @@ -2911,7 +2803,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized - list_worker_pool_instance_metrics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/instances/{instance}metrics'} + list_worker_pool_instance_metrics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/instances/{instance}/metrics'} def list_web_worker_metric_definitions( self, resource_group_name, name, worker_pool_name, custom_headers=None, raw=False, **operation_config): diff --git a/azure-mgmt-web/azure/mgmt/web/operations/app_service_plans_operations.py b/azure-mgmt-web/azure/mgmt/web/operations/app_service_plans_operations.py index 49c88aa0afd4..bf35c0a10ccd 100644 --- a/azure-mgmt-web/azure/mgmt/web/operations/app_service_plans_operations.py +++ b/azure-mgmt-web/azure/mgmt/web/operations/app_service_plans_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -302,7 +302,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, name, app_service_plan, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, name, app_service_plan, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates an App Service Plan. Creates or updates an App Service Plan. @@ -315,13 +315,16 @@ def create_or_update( :param app_service_plan: Details of the App Service plan. :type app_service_plan: ~azure.mgmt.web.models.AppServicePlan :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - AppServicePlan or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns AppServicePlan or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.web.models.AppServicePlan] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.models.AppServicePlan]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -332,30 +335,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('AppServicePlan', response) if raw: @@ -364,12 +345,13 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}'} def delete( diff --git a/azure-mgmt-web/azure/mgmt/web/operations/billing_meters_operations.py b/azure-mgmt-web/azure/mgmt/web/operations/billing_meters_operations.py new file mode 100644 index 000000000000..1fd793c46673 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/operations/billing_meters_operations.py @@ -0,0 +1,109 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class BillingMetersOperations(object): + """BillingMetersOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: API Version. Constant value: "2016-03-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2016-03-01" + + self.config = config + + def list( + self, billing_location=None, custom_headers=None, raw=False, **operation_config): + """Gets a list of meters for a given location. + + Gets a list of meters for a given location. + + :param billing_location: Azure Location of billable resource + :type billing_location: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of BillingMeter + :rtype: + ~azure.mgmt.web.models.BillingMeterPaged[~azure.mgmt.web.models.BillingMeter] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if billing_location is not None: + query_parameters['billingLocation'] = self._serialize.query("billing_location", billing_location, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.BillingMeterPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.BillingMeterPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/billingMeters'} diff --git a/azure-mgmt-web/azure/mgmt/web/operations/diagnostics_operations.py b/azure-mgmt-web/azure/mgmt/web/operations/diagnostics_operations.py index 1e912118452c..90609947d199 100644 --- a/azure-mgmt-web/azure/mgmt/web/operations/diagnostics_operations.py +++ b/azure-mgmt-web/azure/mgmt/web/operations/diagnostics_operations.py @@ -37,6 +37,314 @@ def __init__(self, client, config, serializer, deserializer): self.config = config + def list_hosting_environment_detector_responses( + self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): + """List Hosting Environment Detector Responses. + + List Hosting Environment Detector Responses. + + :param resource_group_name: Name of the resource group to which the + resource belongs. + :type resource_group_name: str + :param name: Site Name + :type name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of DetectorResponse + :rtype: + ~azure.mgmt.web.models.DetectorResponsePaged[~azure.mgmt.web.models.DetectorResponse] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_hosting_environment_detector_responses.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.DetectorResponsePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DetectorResponsePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_hosting_environment_detector_responses.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/detectors'} + + def get_hosting_environment_detector_response( + self, resource_group_name, name, detector_name, start_time=None, end_time=None, time_grain=None, custom_headers=None, raw=False, **operation_config): + """Get Hosting Environment Detector Response. + + Get Hosting Environment Detector Response. + + :param resource_group_name: Name of the resource group to which the + resource belongs. + :type resource_group_name: str + :param name: App Service Environment Name + :type name: str + :param detector_name: Detector Resource Name + :type detector_name: str + :param start_time: Start Time + :type start_time: datetime + :param end_time: End Time + :type end_time: datetime + :param time_grain: Time Grain + :type time_grain: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DetectorResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.DetectorResponse or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_hosting_environment_detector_response.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'detectorName': self._serialize.url("detector_name", detector_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if start_time is not None: + query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + if end_time is not None: + query_parameters['endTime'] = self._serialize.query("end_time", end_time, 'iso-8601') + if time_grain is not None: + query_parameters['timeGrain'] = self._serialize.query("time_grain", time_grain, 'str', pattern=r'PT[1-9][0-9]+[SMH]') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DetectorResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_hosting_environment_detector_response.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/detectors/{detectorName}'} + + def list_site_detector_responses( + self, resource_group_name, site_name, custom_headers=None, raw=False, **operation_config): + """List Site Detector Responses. + + List Site Detector Responses. + + :param resource_group_name: Name of the resource group to which the + resource belongs. + :type resource_group_name: str + :param site_name: Site Name + :type site_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of DetectorResponse + :rtype: + ~azure.mgmt.web.models.DetectorResponsePaged[~azure.mgmt.web.models.DetectorResponse] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_site_detector_responses.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.DetectorResponsePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DetectorResponsePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_site_detector_responses.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/detectors'} + + def get_site_detector_response( + self, resource_group_name, site_name, detector_name, start_time=None, end_time=None, time_grain=None, custom_headers=None, raw=False, **operation_config): + """Get site detector response. + + Get site detector response. + + :param resource_group_name: Name of the resource group to which the + resource belongs. + :type resource_group_name: str + :param site_name: Site Name + :type site_name: str + :param detector_name: Detector Resource Name + :type detector_name: str + :param start_time: Start Time + :type start_time: datetime + :param end_time: End Time + :type end_time: datetime + :param time_grain: Time Grain + :type time_grain: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DetectorResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.DetectorResponse or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_site_detector_response.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'detectorName': self._serialize.url("detector_name", detector_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if start_time is not None: + query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + if end_time is not None: + query_parameters['endTime'] = self._serialize.query("end_time", end_time, 'iso-8601') + if time_grain is not None: + query_parameters['timeGrain'] = self._serialize.query("time_grain", time_grain, 'str', pattern=r'PT[1-9][0-9]+[SMH]') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DetectorResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_site_detector_response.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/detectors/{detectorName}'} + def list_site_diagnostic_categories( self, resource_group_name, site_name, custom_headers=None, raw=False, **operation_config): """Get Diagnostics Categories. @@ -650,6 +958,166 @@ def execute_site_detector( return deserialized execute_site_detector.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/detectors/{detectorName}/execute'} + def list_site_detector_responses_slot( + self, resource_group_name, site_name, slot, custom_headers=None, raw=False, **operation_config): + """List Site Detector Responses. + + List Site Detector Responses. + + :param resource_group_name: Name of the resource group to which the + resource belongs. + :type resource_group_name: str + :param site_name: Site Name + :type site_name: str + :param slot: Slot Name + :type slot: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of DetectorResponse + :rtype: + ~azure.mgmt.web.models.DetectorResponsePaged[~azure.mgmt.web.models.DetectorResponse] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_site_detector_responses_slot.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.DetectorResponsePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DetectorResponsePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_site_detector_responses_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/detectors'} + + def get_site_detector_response_slot( + self, resource_group_name, site_name, detector_name, slot, start_time=None, end_time=None, time_grain=None, custom_headers=None, raw=False, **operation_config): + """Get site detector response. + + Get site detector response. + + :param resource_group_name: Name of the resource group to which the + resource belongs. + :type resource_group_name: str + :param site_name: Site Name + :type site_name: str + :param detector_name: Detector Resource Name + :type detector_name: str + :param slot: Slot Name + :type slot: str + :param start_time: Start Time + :type start_time: datetime + :param end_time: End Time + :type end_time: datetime + :param time_grain: Time Grain + :type time_grain: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DetectorResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.DetectorResponse or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_site_detector_response_slot.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'detectorName': self._serialize.url("detector_name", detector_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if start_time is not None: + query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + if end_time is not None: + query_parameters['endTime'] = self._serialize.query("end_time", end_time, 'iso-8601') + if time_grain is not None: + query_parameters['timeGrain'] = self._serialize.query("time_grain", time_grain, 'str', pattern=r'PT[1-9][0-9]+[SMH]') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DetectorResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_site_detector_response_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/detectors/{detectorName}'} + def list_site_diagnostic_categories_slot( self, resource_group_name, site_name, slot, custom_headers=None, raw=False, **operation_config): """Get Diagnostics Categories. diff --git a/azure-mgmt-web/azure/mgmt/web/operations/domains_operations.py b/azure-mgmt-web/azure/mgmt/web/operations/domains_operations.py index 2f3b2b1c3ae3..b7c35bb85110 100644 --- a/azure-mgmt-web/azure/mgmt/web/operations/domains_operations.py +++ b/azure-mgmt-web/azure/mgmt/web/operations/domains_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -498,7 +498,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, domain_name, domain, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, domain_name, domain, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a domain. Creates or updates a domain. @@ -511,13 +511,16 @@ def create_or_update( :param domain: Domain registration information. :type domain: ~azure.mgmt.web.models.Domain :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Domain or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Domain or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.web.models.Domain] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.models.Domain]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -528,30 +531,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('Domain', response) if raw: @@ -560,12 +541,13 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}'} def delete( diff --git a/azure-mgmt-web/azure/mgmt/web/operations/recommendations_operations.py b/azure-mgmt-web/azure/mgmt/web/operations/recommendations_operations.py index 737ad36f893a..79c8c4c870fd 100644 --- a/azure-mgmt-web/azure/mgmt/web/operations/recommendations_operations.py +++ b/azure-mgmt-web/azure/mgmt/web/operations/recommendations_operations.py @@ -57,13 +57,83 @@ def list( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: list or ClientRawResponse if raw=true - :rtype: list[~azure.mgmt.web.models.Recommendation] or - ~msrest.pipeline.ClientRawResponse + :return: An iterator like instance of Recommendation + :rtype: + ~azure.mgmt.web.models.RecommendationPaged[~azure.mgmt.web.models.Recommendation] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if featured is not None: + query_parameters['featured'] = self._serialize.query("featured", featured, 'bool') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.RecommendationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.RecommendationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/recommendations'} + + def reset_all_filters( + self, custom_headers=None, raw=False, **operation_config): + """Reset all recommendation opt-out settings for a subscription. + + Reset all recommendation opt-out settings for a subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = self.list.metadata['url'] + url = self.reset_all_filters.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -71,10 +141,6 @@ def list( # Construct parameters query_parameters = {} - if featured is not None: - query_parameters['featured'] = self._serialize.query("featured", featured, 'bool') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers @@ -88,32 +154,29 @@ def list( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) + request = self._client.post(url, query_parameters) response = self._client.send(request, header_parameters, stream=False, **operation_config) - if response.status_code not in [200]: + if response.status_code not in [204]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[Recommendation]', response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response = ClientRawResponse(None, response) return client_raw_response + reset_all_filters.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/recommendations/reset'} - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/recommendations'} - - def reset_all_filters( - self, custom_headers=None, raw=False, **operation_config): - """Reset all recommendation opt-out settings for a subscription. + def disable_recommendation_for_subscription( + self, name, custom_headers=None, raw=False, **operation_config): + """Disables the specified rule so it will not apply to a subscription in + the future. - Reset all recommendation opt-out settings for a subscription. + Disables the specified rule so it will not apply to a subscription in + the future. + :param name: Rule name + :type name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -124,8 +187,9 @@ def reset_all_filters( :raises: :class:`CloudError` """ # Construct URL - url = self.reset_all_filters.metadata['url'] + url = self.disable_recommendation_for_subscription.metadata['url'] path_format_arguments = { + 'name': self._serialize.url("name", name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -148,7 +212,7 @@ def reset_all_filters( request = self._client.post(url, query_parameters) response = self._client.send(request, header_parameters, stream=False, **operation_config) - if response.status_code not in [204]: + if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -156,7 +220,7 @@ def reset_all_filters( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - reset_all_filters.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/recommendations/reset'} + disable_recommendation_for_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/recommendations/{name}/disable'} def list_history_for_web_app( self, resource_group_name, site_name, filter=None, custom_headers=None, raw=False, **operation_config): @@ -181,52 +245,61 @@ def list_history_for_web_app( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: list or ClientRawResponse if raw=true - :rtype: list[~azure.mgmt.web.models.Recommendation] or - ~msrest.pipeline.ClientRawResponse + :return: An iterator like instance of Recommendation + :rtype: + ~azure.mgmt.web.models.RecommendationPaged[~azure.mgmt.web.models.Recommendation] :raises: :class:`CloudError` """ - # Construct URL - url = self.list_history_for_web_app.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), - 'siteName': self._serialize.url("site_name", site_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[Recommendation]', response) + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_history_for_web_app.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.RecommendationPaged(internal_paging, self._deserialize.dependencies) if raw: - client_raw_response = ClientRawResponse(deserialized, response) + header_dict = {} + client_raw_response = models.RecommendationPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized @@ -256,54 +329,63 @@ def list_recommended_rules_for_web_app( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: list or ClientRawResponse if raw=true - :rtype: list[~azure.mgmt.web.models.Recommendation] or - ~msrest.pipeline.ClientRawResponse + :return: An iterator like instance of Recommendation + :rtype: + ~azure.mgmt.web.models.RecommendationPaged[~azure.mgmt.web.models.Recommendation] :raises: :class:`CloudError` """ - # Construct URL - url = self.list_recommended_rules_for_web_app.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), - 'siteName': self._serialize.url("site_name", site_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - if featured is not None: - query_parameters['featured'] = self._serialize.query("featured", featured, 'bool') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[Recommendation]', response) + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_recommended_rules_for_web_app.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if featured is not None: + query_parameters['featured'] = self._serialize.query("featured", featured, 'bool') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.RecommendationPaged(internal_paging, self._deserialize.dependencies) if raw: - client_raw_response = ClientRawResponse(deserialized, response) + header_dict = {} + client_raw_response = models.RecommendationPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized @@ -424,7 +506,7 @@ def reset_all_filters_for_web_app( reset_all_filters_for_web_app.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/reset'} def get_rule_details_by_web_app( - self, resource_group_name, site_name, name, update_seen=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, site_name, name, update_seen=None, recommendation_id=None, custom_headers=None, raw=False, **operation_config): """Get a recommendation rule for an app. Get a recommendation rule for an app. @@ -439,6 +521,10 @@ def get_rule_details_by_web_app( :param update_seen: Specify true to update the last-seen timestamp of the recommendation object. :type update_seen: bool + :param recommendation_id: The GUID of the recommedation object if you + query an expired one. You don't need to specify it to query an active + entry. + :type recommendation_id: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -463,6 +549,8 @@ def get_rule_details_by_web_app( query_parameters = {} if update_seen is not None: query_parameters['updateSeen'] = self._serialize.query("update_seen", update_seen, 'bool') + if recommendation_id is not None: + query_parameters['recommendationId'] = self._serialize.query("recommendation_id", recommendation_id, 'str') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers @@ -495,3 +583,63 @@ def get_rule_details_by_web_app( return deserialized get_rule_details_by_web_app.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/{name}'} + + def disable_recommendation_for_site( + self, resource_group_name, site_name, name, custom_headers=None, raw=False, **operation_config): + """Disables the specific rule for a web site permanently. + + Disables the specific rule for a web site permanently. + + :param resource_group_name: Name of the resource group to which the + resource belongs. + :type resource_group_name: str + :param site_name: Site name + :type site_name: str + :param name: Rule name + :type name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.disable_recommendation_for_site.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + disable_recommendation_for_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/{name}/disable'} diff --git a/azure-mgmt-web/azure/mgmt/web/operations/resource_health_metadata_operations.py b/azure-mgmt-web/azure/mgmt/web/operations/resource_health_metadata_operations.py new file mode 100644 index 000000000000..2b8b44f45e60 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/operations/resource_health_metadata_operations.py @@ -0,0 +1,461 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ResourceHealthMetadataOperations(object): + """ResourceHealthMetadataOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: API Version. Constant value: "2016-03-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2016-03-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """List all ResourceHealthMetadata for all sites in the subscription. + + List all ResourceHealthMetadata for all sites in the subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ResourceHealthMetadata + :rtype: + ~azure.mgmt.web.models.ResourceHealthMetadataPaged[~azure.mgmt.web.models.ResourceHealthMetadata] + :raises: + :class:`DefaultErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.DefaultErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ResourceHealthMetadataPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ResourceHealthMetadataPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/resourceHealthMetadata'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """List all ResourceHealthMetadata for all sites in the resource group in + the subscription. + + List all ResourceHealthMetadata for all sites in the resource group in + the subscription. + + :param resource_group_name: Name of the resource group to which the + resource belongs. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ResourceHealthMetadata + :rtype: + ~azure.mgmt.web.models.ResourceHealthMetadataPaged[~azure.mgmt.web.models.ResourceHealthMetadata] + :raises: + :class:`DefaultErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.DefaultErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ResourceHealthMetadataPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ResourceHealthMetadataPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/resourceHealthMetadata'} + + def list_by_site( + self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): + """Gets the category of ResourceHealthMetadata to use for the given site + as a collection. + + Gets the category of ResourceHealthMetadata to use for the given site + as a collection. + + :param resource_group_name: Name of the resource group to which the + resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ResourceHealthMetadata + :rtype: + ~azure.mgmt.web.models.ResourceHealthMetadataPaged[~azure.mgmt.web.models.ResourceHealthMetadata] + :raises: + :class:`DefaultErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_site.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.DefaultErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ResourceHealthMetadataPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ResourceHealthMetadataPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/resourceHealthMetadata'} + + def get_by_site( + self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): + """Gets the category of ResourceHealthMetadata to use for the given site. + + Gets the category of ResourceHealthMetadata to use for the given site. + + :param resource_group_name: Name of the resource group to which the + resource belongs. + :type resource_group_name: str + :param name: Name of web app + :type name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ResourceHealthMetadata or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.ResourceHealthMetadata or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` + """ + # Construct URL + url = self.get_by_site.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.DefaultErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ResourceHealthMetadata', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_by_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/resourceHealthMetadata/default'} + + def list_by_site_slot( + self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): + """Gets the category of ResourceHealthMetadata to use for the given site + as a collection. + + Gets the category of ResourceHealthMetadata to use for the given site + as a collection. + + :param resource_group_name: Name of the resource group to which the + resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default + to production slot. + :type slot: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ResourceHealthMetadata + :rtype: + ~azure.mgmt.web.models.ResourceHealthMetadataPaged[~azure.mgmt.web.models.ResourceHealthMetadata] + :raises: + :class:`DefaultErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_site_slot.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.DefaultErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ResourceHealthMetadataPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ResourceHealthMetadataPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_site_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/resourceHealthMetadata'} + + def get_by_site_slot( + self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): + """Gets the category of ResourceHealthMetadata to use for the given site. + + Gets the category of ResourceHealthMetadata to use for the given site. + + :param resource_group_name: Name of the resource group to which the + resource belongs. + :type resource_group_name: str + :param name: Name of web app + :type name: str + :param slot: Name of web app slot. If not specified then will default + to production slot. + :type slot: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ResourceHealthMetadata or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.ResourceHealthMetadata or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` + """ + # Construct URL + url = self.get_by_site_slot.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.DefaultErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ResourceHealthMetadata', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_by_site_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/resourceHealthMetadata/default'} diff --git a/azure-mgmt-web/azure/mgmt/web/operations/web_apps_operations.py b/azure-mgmt-web/azure/mgmt/web/operations/web_apps_operations.py index 3bf64d3266ad..87a909f4c2c1 100644 --- a/azure-mgmt-web/azure/mgmt/web/operations/web_apps_operations.py +++ b/azure-mgmt-web/azure/mgmt/web/operations/web_apps_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -248,7 +248,7 @@ def get( def _create_or_update_initial( - self, resource_group_name, name, site_envelope, skip_dns_registration=None, skip_custom_domain_verification=None, force_dns_registration=None, ttl_in_seconds=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, name, site_envelope, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.create_or_update.metadata['url'] path_format_arguments = { @@ -260,14 +260,6 @@ def _create_or_update_initial( # Construct parameters query_parameters = {} - if skip_dns_registration is not None: - query_parameters['skipDnsRegistration'] = self._serialize.query("skip_dns_registration", skip_dns_registration, 'bool') - if skip_custom_domain_verification is not None: - query_parameters['skipCustomDomainVerification'] = self._serialize.query("skip_custom_domain_verification", skip_custom_domain_verification, 'bool') - if force_dns_registration is not None: - query_parameters['forceDnsRegistration'] = self._serialize.query("force_dns_registration", force_dns_registration, 'bool') - if ttl_in_seconds is not None: - query_parameters['ttlInSeconds'] = self._serialize.query("ttl_in_seconds", ttl_in_seconds, 'str') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers @@ -307,7 +299,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, name, site_envelope, skip_dns_registration=None, skip_custom_domain_verification=None, force_dns_registration=None, ttl_in_seconds=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, name, site_envelope, custom_headers=None, raw=False, polling=True, **operation_config): """Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. @@ -323,65 +315,29 @@ def create_or_update( :param site_envelope: A JSON representation of the app properties. See example. :type site_envelope: ~azure.mgmt.web.models.Site - :param skip_dns_registration: If true web app hostname is not - registered with DNS on creation. This parameter is - only used for app creation. - :type skip_dns_registration: bool - :param skip_custom_domain_verification: If true, custom (non - *.azurewebsites.net) domains associated with web app are not verified. - :type skip_custom_domain_verification: bool - :param force_dns_registration: If true, web app hostname is force - registered with DNS. - :type force_dns_registration: bool - :param ttl_in_seconds: Time to live in seconds for web app's default - domain name. - :type ttl_in_seconds: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Site or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Site or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.web.models.Site] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.models.Site]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, name=name, site_envelope=site_envelope, - skip_dns_registration=skip_dns_registration, - skip_custom_domain_verification=skip_custom_domain_verification, - force_dns_registration=force_dns_registration, - ttl_in_seconds=ttl_in_seconds, custom_headers=custom_headers, raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('Site', response) if raw: @@ -390,16 +346,17 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}'} def delete( - self, resource_group_name, name, delete_metrics=None, delete_empty_server_farm=None, skip_dns_registration=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, name, delete_metrics=None, delete_empty_server_farm=None, custom_headers=None, raw=False, **operation_config): """Deletes a web, mobile, or API app, or one of the deployment slots. Deletes a web, mobile, or API app, or one of the deployment slots. @@ -415,8 +372,6 @@ def delete( will be empty after app deletion and you want to delete the empty App Service plan. By default, the empty App Service plan is not deleted. :type delete_empty_server_farm: bool - :param skip_dns_registration: If true, DNS registration is skipped. - :type skip_dns_registration: bool :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -441,8 +396,6 @@ def delete( query_parameters['deleteMetrics'] = self._serialize.query("delete_metrics", delete_metrics, 'bool') if delete_empty_server_farm is not None: query_parameters['deleteEmptyServerFarm'] = self._serialize.query("delete_empty_server_farm", delete_empty_server_farm, 'bool') - if skip_dns_registration is not None: - query_parameters['skipDnsRegistration'] = self._serialize.query("skip_dns_registration", skip_dns_registration, 'bool') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers @@ -470,7 +423,7 @@ def delete( delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}'} def update( - self, resource_group_name, name, site_envelope, skip_dns_registration=None, skip_custom_domain_verification=None, force_dns_registration=None, ttl_in_seconds=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, name, site_envelope, custom_headers=None, raw=False, **operation_config): """Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. @@ -486,19 +439,6 @@ def update( :param site_envelope: A JSON representation of the app properties. See example. :type site_envelope: ~azure.mgmt.web.models.SitePatchResource - :param skip_dns_registration: If true web app hostname is not - registered with DNS on creation. This parameter is - only used for app creation. - :type skip_dns_registration: bool - :param skip_custom_domain_verification: If true, custom (non - *.azurewebsites.net) domains associated with web app are not verified. - :type skip_custom_domain_verification: bool - :param force_dns_registration: If true, web app hostname is force - registered with DNS. - :type force_dns_registration: bool - :param ttl_in_seconds: Time to live in seconds for web app's default - domain name. - :type ttl_in_seconds: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -520,14 +460,6 @@ def update( # Construct parameters query_parameters = {} - if skip_dns_registration is not None: - query_parameters['skipDnsRegistration'] = self._serialize.query("skip_dns_registration", skip_dns_registration, 'bool') - if skip_custom_domain_verification is not None: - query_parameters['skipCustomDomainVerification'] = self._serialize.query("skip_custom_domain_verification", skip_custom_domain_verification, 'bool') - if force_dns_registration is not None: - query_parameters['forceDnsRegistration'] = self._serialize.query("force_dns_registration", force_dns_registration, 'bool') - if ttl_in_seconds is not None: - query_parameters['ttlInSeconds'] = self._serialize.query("ttl_in_seconds", ttl_in_seconds, 'str') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers @@ -1186,7 +1118,7 @@ def _restore_initial( return deserialized def restore( - self, resource_group_name, name, backup_id, request, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, name, backup_id, request, custom_headers=None, raw=False, polling=True, **operation_config): """Restores a specific backup to another app (or deployment slot, if specified). @@ -1203,13 +1135,16 @@ def restore( :param request: Information on restore request . :type request: ~azure.mgmt.web.models.RestoreRequest :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - RestoreResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns RestoreResponse or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.web.models.RestoreResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.models.RestoreResponse]] :raises: :class:`CloudError` """ raw_result = self._restore_initial( @@ -1221,30 +1156,8 @@ def restore( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('RestoreResponse', response) if raw: @@ -1253,12 +1166,13 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) restore.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}/restore'} def list_configurations( @@ -2271,7 +2185,7 @@ def _list_publishing_credentials_initial( return deserialized def list_publishing_credentials( - self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, name, custom_headers=None, raw=False, polling=True, **operation_config): """Gets the Git/FTP publishing credentials of an app. Gets the Git/FTP publishing credentials of an app. @@ -2282,13 +2196,16 @@ def list_publishing_credentials( :param name: Name of the app. :type name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns User or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns User or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.web.models.User] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.models.User]] :raises: :class:`CloudError` """ raw_result = self._list_publishing_credentials_initial( @@ -2298,30 +2215,8 @@ def list_publishing_credentials( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('User', response) if raw: @@ -2330,12 +2225,13 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) list_publishing_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/publishingcredentials/list'} def update_site_push_settings( @@ -4323,7 +4219,7 @@ def _create_ms_deploy_operation_initial( return deserialized def create_ms_deploy_operation( - self, resource_group_name, name, ms_deploy, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, name, ms_deploy, custom_headers=None, raw=False, polling=True, **operation_config): """Invoke the MSDeploy web app extension. Invoke the MSDeploy web app extension. @@ -4336,13 +4232,16 @@ def create_ms_deploy_operation( :param ms_deploy: Details of MSDeploy operation :type ms_deploy: ~azure.mgmt.web.models.MSDeploy :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - MSDeployStatus or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns MSDeployStatus or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.web.models.MSDeployStatus] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.models.MSDeployStatus]] :raises: :class:`CloudError` """ raw_result = self._create_ms_deploy_operation_initial( @@ -4353,30 +4252,8 @@ def create_ms_deploy_operation( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [201, 409]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('MSDeployStatus', response) if raw: @@ -4385,12 +4262,13 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) create_ms_deploy_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy'} def get_ms_deploy_log( @@ -4716,7 +4594,7 @@ def _create_function_initial( return deserialized def create_function( - self, resource_group_name, name, function_name, function_envelope, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, name, function_name, function_envelope, custom_headers=None, raw=False, polling=True, **operation_config): """Create function for web site, or a deployment slot. Create function for web site, or a deployment slot. @@ -4731,13 +4609,16 @@ def create_function( :param function_envelope: Function details. :type function_envelope: ~azure.mgmt.web.models.FunctionEnvelope :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - FunctionEnvelope or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns FunctionEnvelope or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.web.models.FunctionEnvelope] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.models.FunctionEnvelope]] :raises: :class:`CloudError` """ raw_result = self._create_function_initial( @@ -4749,30 +4630,8 @@ def create_function( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('FunctionEnvelope', response) if raw: @@ -4781,12 +4640,13 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) create_function.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}'} def delete_function( @@ -6169,7 +6029,7 @@ def _create_instance_ms_deploy_operation_initial( return deserialized def create_instance_ms_deploy_operation( - self, resource_group_name, name, instance_id, ms_deploy, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, name, instance_id, ms_deploy, custom_headers=None, raw=False, polling=True, **operation_config): """Invoke the MSDeploy web app extension. Invoke the MSDeploy web app extension. @@ -6184,13 +6044,16 @@ def create_instance_ms_deploy_operation( :param ms_deploy: Details of MSDeploy operation :type ms_deploy: ~azure.mgmt.web.models.MSDeploy :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - MSDeployStatus or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns MSDeployStatus or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.web.models.MSDeployStatus] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.models.MSDeployStatus]] :raises: :class:`CloudError` """ raw_result = self._create_instance_ms_deploy_operation_initial( @@ -6202,30 +6065,8 @@ def create_instance_ms_deploy_operation( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [201, 409]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('MSDeployStatus', response) if raw: @@ -6234,12 +6075,13 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) create_instance_ms_deploy_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy'} def get_instance_ms_deploy_log( @@ -7283,7 +7125,7 @@ def _migrate_storage_initial( return deserialized def migrate_storage( - self, subscription_name, resource_group_name, name, migration_options, custom_headers=None, raw=False, **operation_config): + self, subscription_name, resource_group_name, name, migration_options, custom_headers=None, raw=False, polling=True, **operation_config): """Restores a web app. Restores a web app. @@ -7299,13 +7141,17 @@ def migrate_storage( :type migration_options: ~azure.mgmt.web.models.StorageMigrationOptions :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - StorageMigrationResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + StorageMigrationResponse or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.web.models.StorageMigrationResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.models.StorageMigrationResponse]] :raises: :class:`CloudError` """ raw_result = self._migrate_storage_initial( @@ -7317,30 +7163,8 @@ def migrate_storage( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('StorageMigrationResponse', response) if raw: @@ -7349,12 +7173,13 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) migrate_storage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migrate'} @@ -7408,7 +7233,7 @@ def _migrate_my_sql_initial( return deserialized def migrate_my_sql( - self, resource_group_name, name, migration_request_envelope, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, name, migration_request_envelope, custom_headers=None, raw=False, polling=True, **operation_config): """Migrates a local (in-app) MySql database to a remote MySql database. Migrates a local (in-app) MySql database to a remote MySql database. @@ -7422,13 +7247,16 @@ def migrate_my_sql( :type migration_request_envelope: ~azure.mgmt.web.models.MigrateMySqlRequest :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Operation or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Operation or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.web.models.Operation] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.models.Operation]] :raises: :class:`CloudError` """ raw_result = self._migrate_my_sql_initial( @@ -7439,30 +7267,8 @@ def migrate_my_sql( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('Operation', response) if raw: @@ -7471,12 +7277,13 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) migrate_my_sql.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql'} def get_migrate_my_sql_status( @@ -9221,7 +9028,7 @@ def _recover_initial( return client_raw_response def recover( - self, resource_group_name, name, recovery_entity, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, name, recovery_entity, custom_headers=None, raw=False, polling=True, **operation_config): """Recovers a web app to a previous snapshot. Recovers a web app to a previous snapshot. @@ -9236,12 +9043,14 @@ def recover( GetSiteSnapshots API. :type recovery_entity: ~azure.mgmt.web.models.SnapshotRecoveryRequest :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._recover_initial( @@ -9252,40 +9061,19 @@ def recover( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) recover.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/recover'} def reset_production_slot_config( @@ -9610,7 +9398,7 @@ def _install_site_extension_initial( return deserialized def install_site_extension( - self, resource_group_name, name, site_extension_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, name, site_extension_id, custom_headers=None, raw=False, polling=True, **operation_config): """Install site extension on a web site, or a deployment slot. Install site extension on a web site, or a deployment slot. @@ -9623,13 +9411,16 @@ def install_site_extension( :param site_extension_id: Site extension name. :type site_extension_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - SiteExtensionInfo or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns SiteExtensionInfo or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.web.models.SiteExtensionInfo] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.models.SiteExtensionInfo]] :raises: :class:`CloudError` """ raw_result = self._install_site_extension_initial( @@ -9640,30 +9431,8 @@ def install_site_extension( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 201, 429]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('SiteExtensionInfo', response) if raw: @@ -9672,12 +9441,13 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) install_site_extension.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}'} def delete_site_extension( @@ -9944,7 +9714,7 @@ def _create_or_update_slot_initial( return deserialized def create_or_update_slot( - self, resource_group_name, name, site_envelope, slot, skip_dns_registration=None, skip_custom_domain_verification=None, force_dns_registration=None, ttl_in_seconds=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, name, site_envelope, slot, skip_dns_registration=None, skip_custom_domain_verification=None, force_dns_registration=None, ttl_in_seconds=None, custom_headers=None, raw=False, polling=True, **operation_config): """Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. @@ -9977,13 +9747,16 @@ def create_or_update_slot( domain name. :type ttl_in_seconds: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Site or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Site or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.web.models.Site] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.models.Site]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_slot_initial( @@ -9999,30 +9772,8 @@ def create_or_update_slot( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('Site', response) if raw: @@ -10031,12 +9782,13 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) create_or_update_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}'} def delete_slot( @@ -10868,7 +10620,7 @@ def _restore_slot_initial( return deserialized def restore_slot( - self, resource_group_name, name, backup_id, request, slot, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, name, backup_id, request, slot, custom_headers=None, raw=False, polling=True, **operation_config): """Restores a specific backup to another app (or deployment slot, if specified). @@ -10888,13 +10640,16 @@ def restore_slot( the API will restore a backup of the production slot. :type slot: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - RestoreResponse or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns RestoreResponse or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.web.models.RestoreResponse] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.models.RestoreResponse]] :raises: :class:`CloudError` """ raw_result = self._restore_slot_initial( @@ -10907,30 +10662,8 @@ def restore_slot( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('RestoreResponse', response) if raw: @@ -10939,12 +10672,13 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) restore_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}/restore'} def list_configurations_slot( @@ -12014,7 +11748,7 @@ def _list_publishing_credentials_slot_initial( return deserialized def list_publishing_credentials_slot( - self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, name, slot, custom_headers=None, raw=False, polling=True, **operation_config): """Gets the Git/FTP publishing credentials of an app. Gets the Git/FTP publishing credentials of an app. @@ -12028,13 +11762,16 @@ def list_publishing_credentials_slot( the API will get the publishing credentials for the production slot. :type slot: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns User or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns User or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.web.models.User] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.models.User]] :raises: :class:`CloudError` """ raw_result = self._list_publishing_credentials_slot_initial( @@ -12045,30 +11782,8 @@ def list_publishing_credentials_slot( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('User', response) if raw: @@ -12077,12 +11792,13 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) list_publishing_credentials_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/publishingcredentials/list'} def update_site_push_settings_slot( @@ -14033,7 +13749,7 @@ def _create_ms_deploy_operation_slot_initial( return deserialized def create_ms_deploy_operation_slot( - self, resource_group_name, name, slot, ms_deploy, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, name, slot, ms_deploy, custom_headers=None, raw=False, polling=True, **operation_config): """Invoke the MSDeploy web app extension. Invoke the MSDeploy web app extension. @@ -14049,13 +13765,16 @@ def create_ms_deploy_operation_slot( :param ms_deploy: Details of MSDeploy operation :type ms_deploy: ~azure.mgmt.web.models.MSDeploy :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - MSDeployStatus or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns MSDeployStatus or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.web.models.MSDeployStatus] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.models.MSDeployStatus]] :raises: :class:`CloudError` """ raw_result = self._create_ms_deploy_operation_slot_initial( @@ -14067,30 +13786,8 @@ def create_ms_deploy_operation_slot( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [201, 409]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('MSDeployStatus', response) if raw: @@ -14099,12 +13796,13 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) create_ms_deploy_operation_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy'} def get_ms_deploy_log_slot( @@ -14447,7 +14145,7 @@ def _create_instance_function_slot_initial( return deserialized def create_instance_function_slot( - self, resource_group_name, name, function_name, slot, function_envelope, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, name, function_name, slot, function_envelope, custom_headers=None, raw=False, polling=True, **operation_config): """Create function for web site, or a deployment slot. Create function for web site, or a deployment slot. @@ -14465,13 +14163,16 @@ def create_instance_function_slot( :param function_envelope: Function details. :type function_envelope: ~azure.mgmt.web.models.FunctionEnvelope :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - FunctionEnvelope or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns FunctionEnvelope or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.web.models.FunctionEnvelope] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.models.FunctionEnvelope]] :raises: :class:`CloudError` """ raw_result = self._create_instance_function_slot_initial( @@ -14484,30 +14185,8 @@ def create_instance_function_slot( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('FunctionEnvelope', response) if raw: @@ -14516,12 +14195,13 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) create_instance_function_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}'} def delete_instance_function_slot( @@ -15977,7 +15657,7 @@ def _create_instance_ms_deploy_operation_slot_initial( return deserialized def create_instance_ms_deploy_operation_slot( - self, resource_group_name, name, slot, instance_id, ms_deploy, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, name, slot, instance_id, ms_deploy, custom_headers=None, raw=False, polling=True, **operation_config): """Invoke the MSDeploy web app extension. Invoke the MSDeploy web app extension. @@ -15995,13 +15675,16 @@ def create_instance_ms_deploy_operation_slot( :param ms_deploy: Details of MSDeploy operation :type ms_deploy: ~azure.mgmt.web.models.MSDeploy :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - MSDeployStatus or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns MSDeployStatus or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.web.models.MSDeployStatus] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.models.MSDeployStatus]] :raises: :class:`CloudError` """ raw_result = self._create_instance_ms_deploy_operation_slot_initial( @@ -16014,30 +15697,8 @@ def create_instance_ms_deploy_operation_slot( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [201, 409]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('MSDeployStatus', response) if raw: @@ -16046,12 +15707,13 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) create_instance_ms_deploy_operation_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy'} def get_instance_ms_deploy_log_slot( @@ -18931,7 +18593,7 @@ def _recover_slot_initial( return client_raw_response def recover_slot( - self, resource_group_name, name, recovery_entity, slot, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, name, recovery_entity, slot, custom_headers=None, raw=False, polling=True, **operation_config): """Recovers a web app to a previous snapshot. Recovers a web app to a previous snapshot. @@ -18949,12 +18611,14 @@ def recover_slot( to production slot. :type slot: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._recover_slot_initial( @@ -18966,40 +18630,19 @@ def recover_slot( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) recover_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/recover'} def reset_slot_configuration_slot( @@ -19341,7 +18984,7 @@ def _install_site_extension_slot_initial( return deserialized def install_site_extension_slot( - self, resource_group_name, name, site_extension_id, slot, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, name, site_extension_id, slot, custom_headers=None, raw=False, polling=True, **operation_config): """Install site extension on a web site, or a deployment slot. Install site extension on a web site, or a deployment slot. @@ -19357,13 +19000,16 @@ def install_site_extension_slot( the API deletes a deployment for the production slot. :type slot: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - SiteExtensionInfo or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns SiteExtensionInfo or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.web.models.SiteExtensionInfo] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.models.SiteExtensionInfo]] :raises: :class:`CloudError` """ raw_result = self._install_site_extension_slot_initial( @@ -19375,30 +19021,8 @@ def install_site_extension_slot( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 201, 429]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('SiteExtensionInfo', response) if raw: @@ -19407,12 +19031,13 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) install_site_extension_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}'} def delete_site_extension_slot( @@ -19614,7 +19239,7 @@ def _swap_slot_slot_initial( return client_raw_response def swap_slot_slot( - self, resource_group_name, name, slot, target_slot, preserve_vnet, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, name, slot, target_slot, preserve_vnet, custom_headers=None, raw=False, polling=True, **operation_config): """Swaps two deployment slots of an app. Swaps two deployment slots of an app. @@ -19633,12 +19258,14 @@ def swap_slot_slot( the slot during swap; otherwise, false. :type preserve_vnet: bool :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._swap_slot_slot_initial( @@ -19651,40 +19278,19 @@ def swap_slot_slot( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) swap_slot_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotsswap'} def list_snapshots_slot( @@ -19888,7 +19494,7 @@ def _create_or_update_source_control_slot_initial( return deserialized def create_or_update_source_control_slot( - self, resource_group_name, name, site_source_control, slot, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, name, site_source_control, slot, custom_headers=None, raw=False, polling=True, **operation_config): """Updates the source control configuration of an app. Updates the source control configuration of an app. @@ -19906,13 +19512,16 @@ def create_or_update_source_control_slot( production slot. :type slot: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - SiteSourceControl or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns SiteSourceControl or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.web.models.SiteSourceControl] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.models.SiteSourceControl]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_source_control_slot_initial( @@ -19924,30 +19533,8 @@ def create_or_update_source_control_slot( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('SiteSourceControl', response) if raw: @@ -19956,12 +19543,13 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) create_or_update_source_control_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web'} def delete_source_control_slot( @@ -21772,7 +21360,7 @@ def _swap_slot_with_production_initial( return client_raw_response def swap_slot_with_production( - self, resource_group_name, name, target_slot, preserve_vnet, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, name, target_slot, preserve_vnet, custom_headers=None, raw=False, polling=True, **operation_config): """Swaps two deployment slots of an app. Swaps two deployment slots of an app. @@ -21788,12 +21376,14 @@ def swap_slot_with_production( the slot during swap; otherwise, false. :type preserve_vnet: bool :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._swap_slot_with_production_initial( @@ -21805,40 +21395,19 @@ def swap_slot_with_production( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) swap_slot_with_production.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotsswap'} def list_snapshots( @@ -22033,7 +21602,7 @@ def _create_or_update_source_control_initial( return deserialized def create_or_update_source_control( - self, resource_group_name, name, site_source_control, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, name, site_source_control, custom_headers=None, raw=False, polling=True, **operation_config): """Updates the source control configuration of an app. Updates the source control configuration of an app. @@ -22047,13 +21616,16 @@ def create_or_update_source_control( object. See example. :type site_source_control: ~azure.mgmt.web.models.SiteSourceControl :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - SiteSourceControl or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns SiteSourceControl or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.web.models.SiteSourceControl] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.web.models.SiteSourceControl]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_source_control_initial( @@ -22064,30 +21636,8 @@ def create_or_update_source_control( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('SiteSourceControl', response) if raw: @@ -22096,12 +21646,13 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) create_or_update_source_control.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web'} def delete_source_control( diff --git a/azure-mgmt-web/azure/mgmt/web/version.py b/azure-mgmt-web/azure/mgmt/web/version.py index a39f64422a75..8ae395630e43 100644 --- a/azure-mgmt-web/azure/mgmt/web/version.py +++ b/azure-mgmt-web/azure/mgmt/web/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.35.0" +VERSION = "0.36.0" diff --git a/azure-mgmt-web/azure/mgmt/web/web_site_management_client.py b/azure-mgmt-web/azure/mgmt/web/web_site_management_client.py index a7da435b33ab..296ad78205d0 100644 --- a/azure-mgmt-web/azure/mgmt/web/web_site_management_client.py +++ b/azure-mgmt-web/azure/mgmt/web/web_site_management_client.py @@ -9,13 +9,14 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import ServiceClient +from msrest.service_client import SDKClient from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling import uuid from .operations.app_service_certificate_orders_operations import AppServiceCertificateOrdersOperations from .operations.certificate_registration_provider_operations import CertificateRegistrationProviderOperations @@ -27,6 +28,8 @@ from .operations.diagnostics_operations import DiagnosticsOperations from .operations.provider_operations import ProviderOperations from .operations.recommendations_operations import RecommendationsOperations +from .operations.resource_health_metadata_operations import ResourceHealthMetadataOperations +from .operations.billing_meters_operations import BillingMetersOperations from .operations.web_apps_operations import WebAppsOperations from .operations.app_service_environments_operations import AppServiceEnvironmentsOperations from .operations.app_service_plans_operations import AppServicePlansOperations @@ -66,7 +69,7 @@ def __init__( self.subscription_id = subscription_id -class WebSiteManagementClient(object): +class WebSiteManagementClient(SDKClient): """WebSite Management Client :ivar config: Configuration for client. @@ -92,6 +95,10 @@ class WebSiteManagementClient(object): :vartype provider: azure.mgmt.web.operations.ProviderOperations :ivar recommendations: Recommendations operations :vartype recommendations: azure.mgmt.web.operations.RecommendationsOperations + :ivar resource_health_metadata: ResourceHealthMetadata operations + :vartype resource_health_metadata: azure.mgmt.web.operations.ResourceHealthMetadataOperations + :ivar billing_meters: BillingMeters operations + :vartype billing_meters: azure.mgmt.web.operations.BillingMetersOperations :ivar web_apps: WebApps operations :vartype web_apps: azure.mgmt.web.operations.WebAppsOperations :ivar app_service_environments: AppServiceEnvironments operations @@ -112,7 +119,7 @@ def __init__( self, credentials, subscription_id, base_url=None): self.config = WebSiteManagementClientConfiguration(credentials, subscription_id, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + super(WebSiteManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -138,6 +145,10 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.recommendations = RecommendationsOperations( self._client, self.config, self._serialize, self._deserialize) + self.resource_health_metadata = ResourceHealthMetadataOperations( + self._client, self.config, self._serialize, self._deserialize) + self.billing_meters = BillingMetersOperations( + self._client, self.config, self._serialize, self._deserialize) self.web_apps = WebAppsOperations( self._client, self.config, self._serialize, self._deserialize) self.app_service_environments = AppServiceEnvironmentsOperations(