diff --git a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/__init__.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/__init__.py index b769252f8a14..09ea5c935ca7 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/__init__.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/__init__.py @@ -9,36 +9,68 @@ # 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 +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 .operation_paged import OperationPaged from .sb_namespace_paged import SBNamespacePaged from .sb_authorization_rule_paged import SBAuthorizationRulePaged 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..2b3c46023fd0 --- /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..8e22e43c612b --- /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/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..852de43eff40 --- /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..f17ee0a77ebb --- /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..ed1eb02748f9 --- /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 79da01fd3d74..41d2a45f277b 100644 --- a/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_queue.py +++ b/azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_queue.py @@ -131,26 +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, enable_batched_operations=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.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 + 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..996055c4c27b --- /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..c845b0ef2fa5 --- /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..c4d66241b1c0 --- /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..406a774c9951 --- /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/namespaces_operations.py b/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/namespaces_operations.py index 5d83acaffd93..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 @@ -288,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. @@ -300,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` """ @@ -318,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: @@ -348,12 +331,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.ServiceBus/namespaces/{namespaceName}'} @@ -394,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. @@ -404,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` """ @@ -420,38 +406,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 [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(