Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[AutoPR relay/resource-manager] Add relay/resource-manager/readme.typescript.md #3606

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 34 additions & 16 deletions azure-mgmt-relay/azure/mgmt/relay/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,40 @@
# regenerated.
# --------------------------------------------------------------------------

from .tracked_resource import TrackedResource
from .resource_namespace_patch import ResourceNamespacePatch
from .resource import Resource
from .hybrid_connection import HybridConnection
from .wcf_relay import WcfRelay
from .sku import Sku
from .relay_namespace import RelayNamespace
from .relay_update_parameters import RelayUpdateParameters
from .authorization_rule import AuthorizationRule
from .access_keys import AccessKeys
from .regenerate_access_key_parameters import RegenerateAccessKeyParameters
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
try:
from .tracked_resource_py3 import TrackedResource
from .resource_namespace_patch_py3 import ResourceNamespacePatch
from .resource_py3 import Resource
from .hybrid_connection_py3 import HybridConnection
from .wcf_relay_py3 import WcfRelay
from .sku_py3 import Sku
from .relay_namespace_py3 import RelayNamespace
from .relay_update_parameters_py3 import RelayUpdateParameters
from .authorization_rule_py3 import AuthorizationRule
from .access_keys_py3 import AccessKeys
from .regenerate_access_key_parameters_py3 import RegenerateAccessKeyParameters
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
except (SyntaxError, ImportError):
from .tracked_resource import TrackedResource
from .resource_namespace_patch import ResourceNamespacePatch
from .resource import Resource
from .hybrid_connection import HybridConnection
from .wcf_relay import WcfRelay
from .sku import Sku
from .relay_namespace import RelayNamespace
from .relay_update_parameters import RelayUpdateParameters
from .authorization_rule import AuthorizationRule
from .access_keys import AccessKeys
from .regenerate_access_key_parameters import RegenerateAccessKeyParameters
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 .operation_paged import OperationPaged
from .relay_namespace_paged import RelayNamespacePaged
from .authorization_rule_paged import AuthorizationRulePaged
Expand Down
13 changes: 7 additions & 6 deletions azure-mgmt-relay/azure/mgmt/relay/models/access_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@ class AccessKeys(Model):
'key_name': {'key': 'keyName', 'type': 'str'},
}

def __init__(self, primary_connection_string=None, secondary_connection_string=None, primary_key=None, secondary_key=None, key_name=None):
self.primary_connection_string = primary_connection_string
self.secondary_connection_string = secondary_connection_string
self.primary_key = primary_key
self.secondary_key = secondary_key
self.key_name = key_name
def __init__(self, **kwargs):
super(AccessKeys, self).__init__(**kwargs)
self.primary_connection_string = kwargs.get('primary_connection_string', None)
self.secondary_connection_string = kwargs.get('secondary_connection_string', None)
self.primary_key = kwargs.get('primary_key', None)
self.secondary_key = kwargs.get('secondary_key', None)
self.key_name = kwargs.get('key_name', None)
48 changes: 48 additions & 0 deletions azure-mgmt-relay/azure/mgmt/relay/models/access_keys_py3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class AccessKeys(Model):
"""Namespace/Relay Connection String.

:param primary_connection_string: Primary connection string of the created
namespace authorization rule.
:type primary_connection_string: str
:param secondary_connection_string: Secondary connection string of the
created namespace authorization rule.
:type secondary_connection_string: str
:param primary_key: A base64-encoded 256-bit primary key for signing and
validating the SAS token.
:type primary_key: str
:param secondary_key: A base64-encoded 256-bit secondary key for signing
and validating the SAS token.
:type secondary_key: str
:param key_name: A string that describes the authorization rule.
:type key_name: str
"""

_attribute_map = {
'primary_connection_string': {'key': 'primaryConnectionString', 'type': 'str'},
'secondary_connection_string': {'key': 'secondaryConnectionString', 'type': 'str'},
'primary_key': {'key': 'primaryKey', 'type': 'str'},
'secondary_key': {'key': 'secondaryKey', 'type': 'str'},
'key_name': {'key': 'keyName', 'type': 'str'},
}

def __init__(self, *, primary_connection_string: str=None, secondary_connection_string: str=None, primary_key: str=None, secondary_key: str=None, key_name: str=None, **kwargs) -> None:
super(AccessKeys, self).__init__(**kwargs)
self.primary_connection_string = primary_connection_string
self.secondary_connection_string = secondary_connection_string
self.primary_key = primary_key
self.secondary_key = secondary_key
self.key_name = key_name
12 changes: 7 additions & 5 deletions azure-mgmt-relay/azure/mgmt/relay/models/authorization_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,23 @@ class AuthorizationRule(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.relay.models.AccessRights]
"""

_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'rights': {'unique': True},
'rights': {'required': True, 'unique': True},
}

_attribute_map = {
Expand All @@ -42,6 +44,6 @@ class AuthorizationRule(Resource):
'rights': {'key': 'properties.rights', 'type': '[AccessRights]'},
}

def __init__(self, rights=None):
super(AuthorizationRule, self).__init__()
self.rights = rights
def __init__(self, **kwargs):
super(AuthorizationRule, self).__init__(**kwargs)
self.rights = kwargs.get('rights', None)
49 changes: 49 additions & 0 deletions azure-mgmt-relay/azure/mgmt/relay/models/authorization_rule_py3.py
Original file line number Diff line number Diff line change
@@ -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_py3 import Resource


class AuthorizationRule(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.relay.models.AccessRights]
"""

_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'rights': {'required': True, 'unique': 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(AuthorizationRule, self).__init__(**kwargs)
self.rights = rights
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@
class CheckNameAvailability(Model):
"""Description of the check name availability request properties.

:param name: The namespace name to check for availability. 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.
All required parameters must be populated in order to send to Azure.

:param name: Required. The namespace name to check for availability. 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
"""

Expand All @@ -29,5 +32,6 @@ class CheckNameAvailability(Model):
'name': {'key': 'name', 'type': 'str'},
}

def __init__(self, name):
self.name = name
def __init__(self, **kwargs):
super(CheckNameAvailability, self).__init__(**kwargs)
self.name = kwargs.get('name', None)
Original file line number Diff line number Diff line change
@@ -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 the check name availability request properties.

All required parameters must be populated in order to send to Azure.

:param name: Required. The namespace name to check for availability. 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
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ class CheckNameAvailabilityResult(Model):
'reason': {'key': 'reason', 'type': 'UnavailableReason'},
}

def __init__(self, name_available=None, reason=None):
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)
Original file line number Diff line number Diff line change
@@ -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 the 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 available. Returns
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.relay.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
7 changes: 4 additions & 3 deletions azure-mgmt-relay/azure/mgmt/relay/models/error_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ class ErrorResponse(Model):
'message': {'key': 'message', 'type': 'str'},
}

def __init__(self, code=None, message=None):
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):
Expand Down
46 changes: 46 additions & 0 deletions azure-mgmt-relay/azure/mgmt/relay/models/error_response_py3.py
Original file line number Diff line number Diff line change
@@ -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 Relay 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)
Loading