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

[ReleasePR azure-mgmt-datashare] [datashare] sort api's and definitions #12800

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
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,10 @@
ProvisioningState,
Status,
InvitationStatus,
ShareKind,
SynchronizationMode,
DataSetType,
ShareSubscriptionStatus,
ShareKind,
RecurrenceInterval,
TriggerStatus,
DataSetMappingStatus,
Expand Down Expand Up @@ -211,24 +211,24 @@
'DataSetMappingPaged',
'InvitationPaged',
'OperationModelPaged',
'SharePaged',
'ShareSynchronizationPaged',
'SynchronizationDetailsPaged',
'ShareSynchronizationPaged',
'SharePaged',
'ProviderShareSubscriptionPaged',
'ShareSubscriptionPaged',
'SourceShareSynchronizationSettingPaged',
'ShareSubscriptionSynchronizationPaged',
'ShareSubscriptionPaged',
'ConsumerSourceDataSetPaged',
'SynchronizationSettingPaged',
'TriggerPaged',
'Type',
'ProvisioningState',
'Status',
'InvitationStatus',
'ShareKind',
'SynchronizationMode',
'DataSetType',
'ShareSubscriptionStatus',
'ShareKind',
'RecurrenceInterval',
'TriggerStatus',
'DataSetMappingStatus',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,6 @@ class InvitationStatus(str, Enum):
withdrawn = "Withdrawn"


class ShareKind(str, Enum):

copy_based = "CopyBased"
in_place = "InPlace"


class SynchronizationMode(str, Enum):

incremental = "Incremental"
Expand Down Expand Up @@ -80,6 +74,12 @@ class ShareSubscriptionStatus(str, Enum):
revoking = "Revoking"


class ShareKind(str, Enum):

copy_based = "CopyBased"
in_place = "InPlace"


class RecurrenceInterval(str, Enum):

hour = "Hour"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,19 +90,19 @@ class OperationModelPaged(Paged):
def __init__(self, *args, **kwargs):

super(OperationModelPaged, self).__init__(*args, **kwargs)
class SharePaged(Paged):
class SynchronizationDetailsPaged(Paged):
"""
A paging container for iterating over a list of :class:`Share <azure.mgmt.datashare.models.Share>` object
A paging container for iterating over a list of :class:`SynchronizationDetails <azure.mgmt.datashare.models.SynchronizationDetails>` object
"""

_attribute_map = {
'next_link': {'key': 'nextLink', 'type': 'str'},
'current_page': {'key': 'value', 'type': '[Share]'}
'current_page': {'key': 'value', 'type': '[SynchronizationDetails]'}
}

def __init__(self, *args, **kwargs):

super(SharePaged, self).__init__(*args, **kwargs)
super(SynchronizationDetailsPaged, self).__init__(*args, **kwargs)
class ShareSynchronizationPaged(Paged):
"""
A paging container for iterating over a list of :class:`ShareSynchronization <azure.mgmt.datashare.models.ShareSynchronization>` object
Expand All @@ -116,19 +116,19 @@ class ShareSynchronizationPaged(Paged):
def __init__(self, *args, **kwargs):

super(ShareSynchronizationPaged, self).__init__(*args, **kwargs)
class SynchronizationDetailsPaged(Paged):
class SharePaged(Paged):
"""
A paging container for iterating over a list of :class:`SynchronizationDetails <azure.mgmt.datashare.models.SynchronizationDetails>` object
A paging container for iterating over a list of :class:`Share <azure.mgmt.datashare.models.Share>` object
"""

_attribute_map = {
'next_link': {'key': 'nextLink', 'type': 'str'},
'current_page': {'key': 'value', 'type': '[SynchronizationDetails]'}
'current_page': {'key': 'value', 'type': '[Share]'}
}

def __init__(self, *args, **kwargs):

super(SynchronizationDetailsPaged, self).__init__(*args, **kwargs)
super(SharePaged, self).__init__(*args, **kwargs)
class ProviderShareSubscriptionPaged(Paged):
"""
A paging container for iterating over a list of :class:`ProviderShareSubscription <azure.mgmt.datashare.models.ProviderShareSubscription>` object
Expand All @@ -142,45 +142,45 @@ class ProviderShareSubscriptionPaged(Paged):
def __init__(self, *args, **kwargs):

super(ProviderShareSubscriptionPaged, self).__init__(*args, **kwargs)
class ShareSubscriptionPaged(Paged):
class SourceShareSynchronizationSettingPaged(Paged):
"""
A paging container for iterating over a list of :class:`ShareSubscription <azure.mgmt.datashare.models.ShareSubscription>` object
A paging container for iterating over a list of :class:`SourceShareSynchronizationSetting <azure.mgmt.datashare.models.SourceShareSynchronizationSetting>` object
"""

_attribute_map = {
'next_link': {'key': 'nextLink', 'type': 'str'},
'current_page': {'key': 'value', 'type': '[ShareSubscription]'}
'current_page': {'key': 'value', 'type': '[SourceShareSynchronizationSetting]'}
}

def __init__(self, *args, **kwargs):

super(ShareSubscriptionPaged, self).__init__(*args, **kwargs)
class SourceShareSynchronizationSettingPaged(Paged):
super(SourceShareSynchronizationSettingPaged, self).__init__(*args, **kwargs)
class ShareSubscriptionSynchronizationPaged(Paged):
"""
A paging container for iterating over a list of :class:`SourceShareSynchronizationSetting <azure.mgmt.datashare.models.SourceShareSynchronizationSetting>` object
A paging container for iterating over a list of :class:`ShareSubscriptionSynchronization <azure.mgmt.datashare.models.ShareSubscriptionSynchronization>` object
"""

_attribute_map = {
'next_link': {'key': 'nextLink', 'type': 'str'},
'current_page': {'key': 'value', 'type': '[SourceShareSynchronizationSetting]'}
'current_page': {'key': 'value', 'type': '[ShareSubscriptionSynchronization]'}
}

def __init__(self, *args, **kwargs):

super(SourceShareSynchronizationSettingPaged, self).__init__(*args, **kwargs)
class ShareSubscriptionSynchronizationPaged(Paged):
super(ShareSubscriptionSynchronizationPaged, self).__init__(*args, **kwargs)
class ShareSubscriptionPaged(Paged):
"""
A paging container for iterating over a list of :class:`ShareSubscriptionSynchronization <azure.mgmt.datashare.models.ShareSubscriptionSynchronization>` object
A paging container for iterating over a list of :class:`ShareSubscription <azure.mgmt.datashare.models.ShareSubscription>` object
"""

_attribute_map = {
'next_link': {'key': 'nextLink', 'type': 'str'},
'current_page': {'key': 'value', 'type': '[ShareSubscriptionSynchronization]'}
'current_page': {'key': 'value', 'type': '[ShareSubscription]'}
}

def __init__(self, *args, **kwargs):

super(ShareSubscriptionSynchronizationPaged, self).__init__(*args, **kwargs)
super(ShareSubscriptionPaged, self).__init__(*args, **kwargs)
class ConsumerSourceDataSetPaged(Paged):
"""
A paging container for iterating over a list of :class:`ConsumerSourceDataSet <azure.mgmt.datashare.models.ConsumerSourceDataSet>` object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,77 @@ def __init__(self, client, config, serializer, deserializer):

self.config = config

def list_by_subscription(
self, skip_token=None, custom_headers=None, raw=False, **operation_config):
"""List Accounts in a subscription.

List Accounts in Subscription.

:param skip_token: Continuation token
:type skip_token: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: An iterator like instance of Account
:rtype:
~azure.mgmt.datashare.models.AccountPaged[~azure.mgmt.datashare.models.Account]
:raises:
:class:`DataShareErrorException<azure.mgmt.datashare.models.DataShareErrorException>`
"""
def prepare_request(next_link=None):
if not next_link:
# Construct URL
url = self.list_by_subscription.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)

# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
if skip_token is not None:
query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str')

else:
url = next_link
query_parameters = {}

# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
header_parameters.update(custom_headers)
if self.config.accept_language is not None:
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
return request

def internal_paging(next_link=None):
request = prepare_request(next_link)

response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200]:
raise models.DataShareErrorException(self._deserialize, response)

return response

# Deserialize response
header_dict = None
if raw:
header_dict = {}
deserialized = models.AccountPaged(internal_paging, self._deserialize.dependencies, header_dict)

return deserialized
list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataShare/accounts'}

def get(
self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config):
"""Get an account under a resource group.
Expand Down Expand Up @@ -369,77 +440,6 @@ def update(
return deserialized
update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}'}

def list_by_subscription(
self, skip_token=None, custom_headers=None, raw=False, **operation_config):
"""List Accounts in a subscription.

List Accounts in Subscription.

:param skip_token: Continuation token
:type skip_token: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: An iterator like instance of Account
:rtype:
~azure.mgmt.datashare.models.AccountPaged[~azure.mgmt.datashare.models.Account]
:raises:
:class:`DataShareErrorException<azure.mgmt.datashare.models.DataShareErrorException>`
"""
def prepare_request(next_link=None):
if not next_link:
# Construct URL
url = self.list_by_subscription.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)

# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
if skip_token is not None:
query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str')

else:
url = next_link
query_parameters = {}

# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
header_parameters.update(custom_headers)
if self.config.accept_language is not None:
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
return request

def internal_paging(next_link=None):
request = prepare_request(next_link)

response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200]:
raise models.DataShareErrorException(self._deserialize, response)

return response

# Deserialize response
header_dict = None
if raw:
header_dict = {}
deserialized = models.AccountPaged(internal_paging, self._deserialize.dependencies, header_dict)

return deserialized
list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataShare/accounts'}

def list_by_resource_group(
self, resource_group_name, skip_token=None, custom_headers=None, raw=False, **operation_config):
"""List Accounts in a resource group.
Expand Down
Loading