Skip to content

Commit

Permalink
CodeGen from PR 16886 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge c00e5ce96ae9732e967d50cb3c6e1e73e5abf34e into 37d6907
  • Loading branch information
SDKAuto committed Nov 26, 2021
1 parent a479ea8 commit 18cfe45
Show file tree
Hide file tree
Showing 32 changed files with 602 additions and 120 deletions.
11 changes: 7 additions & 4 deletions sdk/datashare/azure-mgmt-datashare/_meta.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
{
"autorest": "3.0.6369",
"use": "@autorest/[email protected]",
"commit": "36084f10aacb98d77af2f67c9d57fca2bbe68e97",
"autorest": "3.4.5",
"use": [
"@autorest/[email protected]",
"@autorest/[email protected]"
],
"commit": "2c59c559d6804068f72b8ead08d287c4f6e48fc0",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/datashare/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.6.2 --version=3.0.6369",
"autorest_command": "autorest specification/datashare/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.4 --use=@autorest/[email protected].2 --version=3.4.5",
"readme": "specification/datashare/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@
from typing import Any, Optional

from azure.core.credentials import TokenCredential
from azure.core.pipeline.transport import HttpRequest, HttpResponse

from ._configuration import DataShareManagementClientConfiguration
from .operations import AccountsOperations
from .operations import ConsumerInvitationsOperations
from .operations import DataSetsOperations
from .operations import DataSetMappingsOperations
from .operations import EmailRegistrationsOperations
from .operations import InvitationsOperations
from .operations import Operations
from .operations import SharesOperations
Expand All @@ -44,6 +46,8 @@ class DataShareManagementClient(object):
:vartype data_sets: azure.mgmt.datashare.operations.DataSetsOperations
:ivar data_set_mappings: DataSetMappingsOperations operations
:vartype data_set_mappings: azure.mgmt.datashare.operations.DataSetMappingsOperations
:ivar email_registrations: EmailRegistrationsOperations operations
:vartype email_registrations: azure.mgmt.datashare.operations.EmailRegistrationsOperations
:ivar invitations: InvitationsOperations operations
:vartype invitations: azure.mgmt.datashare.operations.InvitationsOperations
:ivar operations: Operations operations
Expand Down Expand Up @@ -94,6 +98,8 @@ def __init__(
self._client, self._config, self._serialize, self._deserialize)
self.data_set_mappings = DataSetMappingsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.email_registrations = EmailRegistrationsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.invitations = InvitationsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.operations = Operations(
Expand All @@ -111,6 +117,24 @@ def __init__(
self.triggers = TriggersOperations(
self._client, self._config, self._serialize, self._deserialize)

def _send_request(self, http_request, **kwargs):
# type: (HttpRequest, Any) -> HttpResponse
"""Runs the network request through the client's chained policies.
:param http_request: The network request you want to make. Required.
:type http_request: ~azure.core.pipeline.transport.HttpRequest
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
:return: The response of your network call. Does not do error handling on your response.
:rtype: ~azure.core.pipeline.transport.HttpResponse
"""
path_format_arguments = {
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
}
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
stream = kwargs.pop("stream", True)
pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs)
return pipeline_response.http_response

def close(self):
# type: () -> None
self._client.close()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"azure_arm": true,
"has_lro_operations": true,
"client_side_validation": false,
"sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"DataShareManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}",
"async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"DataShareManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}"
"sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"DataShareManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}",
"async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"DataShareManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}"
},
"global_parameters": {
"sync": {
Expand Down Expand Up @@ -102,6 +102,7 @@
"consumer_invitations": "ConsumerInvitationsOperations",
"data_sets": "DataSetsOperations",
"data_set_mappings": "DataSetMappingsOperations",
"email_registrations": "EmailRegistrationsOperations",
"invitations": "InvitationsOperations",
"operations": "Operations",
"shares": "SharesOperations",
Expand All @@ -110,11 +111,5 @@
"consumer_source_data_sets": "ConsumerSourceDataSetsOperations",
"synchronization_settings": "SynchronizationSettingsOperations",
"triggers": "TriggersOperations"
},
"operation_mixins": {
"sync_imports": "None",
"async_imports": "None",
"operations": {
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "1.0.0"
VERSION = "1.0.0b1"
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from typing import Any, Optional, TYPE_CHECKING

from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
from azure.mgmt.core import AsyncARMPipelineClient
from msrest import Deserializer, Serializer

Expand All @@ -20,6 +21,7 @@
from .operations import ConsumerInvitationsOperations
from .operations import DataSetsOperations
from .operations import DataSetMappingsOperations
from .operations import EmailRegistrationsOperations
from .operations import InvitationsOperations
from .operations import Operations
from .operations import SharesOperations
Expand All @@ -42,6 +44,8 @@ class DataShareManagementClient(object):
:vartype data_sets: azure.mgmt.datashare.aio.operations.DataSetsOperations
:ivar data_set_mappings: DataSetMappingsOperations operations
:vartype data_set_mappings: azure.mgmt.datashare.aio.operations.DataSetMappingsOperations
:ivar email_registrations: EmailRegistrationsOperations operations
:vartype email_registrations: azure.mgmt.datashare.aio.operations.EmailRegistrationsOperations
:ivar invitations: InvitationsOperations operations
:vartype invitations: azure.mgmt.datashare.aio.operations.InvitationsOperations
:ivar operations: Operations operations
Expand Down Expand Up @@ -91,6 +95,8 @@ def __init__(
self._client, self._config, self._serialize, self._deserialize)
self.data_set_mappings = DataSetMappingsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.email_registrations = EmailRegistrationsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.invitations = InvitationsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.operations = Operations(
Expand All @@ -108,6 +114,23 @@ def __init__(
self.triggers = TriggersOperations(
self._client, self._config, self._serialize, self._deserialize)

async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse:
"""Runs the network request through the client's chained policies.
:param http_request: The network request you want to make. Required.
:type http_request: ~azure.core.pipeline.transport.HttpRequest
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
:return: The response of your network call. Does not do error handling on your response.
:rtype: ~azure.core.pipeline.transport.AsyncHttpResponse
"""
path_format_arguments = {
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
}
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
stream = kwargs.pop("stream", True)
pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs)
return pipeline_response.http_response

async def close(self) -> None:
await self._client.close()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from ._consumer_invitations_operations import ConsumerInvitationsOperations
from ._data_sets_operations import DataSetsOperations
from ._data_set_mappings_operations import DataSetMappingsOperations
from ._email_registrations_operations import EmailRegistrationsOperations
from ._invitations_operations import InvitationsOperations
from ._operations import Operations
from ._shares_operations import SharesOperations
Expand All @@ -24,6 +25,7 @@
'ConsumerInvitationsOperations',
'DataSetsOperations',
'DataSetMappingsOperations',
'EmailRegistrationsOperations',
'InvitationsOperations',
'Operations',
'SharesOperations',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None:
def list_by_subscription(
self,
skip_token: Optional[str] = None,
**kwargs
**kwargs: Any
) -> AsyncIterable["_models.AccountList"]:
"""List Accounts in a subscription.
Expand Down Expand Up @@ -121,7 +121,7 @@ async def get(
self,
resource_group_name: str,
account_name: str,
**kwargs
**kwargs: Any
) -> "_models.Account":
"""Get an account under a resource group.
Expand Down Expand Up @@ -183,7 +183,7 @@ async def _create_initial(
resource_group_name: str,
account_name: str,
account: "_models.Account",
**kwargs
**kwargs: Any
) -> "_models.Account":
cls = kwargs.pop('cls', None) # type: ClsType["_models.Account"]
error_map = {
Expand Down Expand Up @@ -241,7 +241,7 @@ async def begin_create(
resource_group_name: str,
account_name: str,
account: "_models.Account",
**kwargs
**kwargs: Any
) -> AsyncLROPoller["_models.Account"]:
"""Create an account in the given resource group.
Expand All @@ -255,8 +255,8 @@ async def begin_create(
:type account: ~azure.mgmt.datashare.models.Account
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: Pass in True if you'd like the AsyncARMPolling polling method,
False for no polling, or your own initialized polling object for a personal polling strategy.
:keyword polling: By default, your polling method will be AsyncARMPolling.
Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either Account or the result of cls(response)
Expand Down Expand Up @@ -313,7 +313,7 @@ async def _delete_initial(
self,
resource_group_name: str,
account_name: str,
**kwargs
**kwargs: Any
) -> Optional["_models.OperationResponse"]:
cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationResponse"]]
error_map = {
Expand Down Expand Up @@ -363,7 +363,7 @@ async def begin_delete(
self,
resource_group_name: str,
account_name: str,
**kwargs
**kwargs: Any
) -> AsyncLROPoller["_models.OperationResponse"]:
"""Delete an account.
Expand All @@ -375,8 +375,8 @@ async def begin_delete(
:type account_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: Pass in True if you'd like the AsyncARMPolling polling method,
False for no polling, or your own initialized polling object for a personal polling strategy.
:keyword polling: By default, your polling method will be AsyncARMPolling.
Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either OperationResponse or the result of cls(response)
Expand Down Expand Up @@ -433,7 +433,7 @@ async def update(
resource_group_name: str,
account_name: str,
account_update_parameters: "_models.AccountUpdateParameters",
**kwargs
**kwargs: Any
) -> "_models.Account":
"""Patch a given account.
Expand Down Expand Up @@ -501,7 +501,7 @@ def list_by_resource_group(
self,
resource_group_name: str,
skip_token: Optional[str] = None,
**kwargs
**kwargs: Any
) -> AsyncIterable["_models.AccountList"]:
"""List Accounts in a resource group.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None:
def list_invitations(
self,
skip_token: Optional[str] = None,
**kwargs
**kwargs: Any
) -> AsyncIterable["_models.ConsumerInvitationList"]:
"""List the invitations.
Expand Down Expand Up @@ -115,7 +115,7 @@ async def get(
self,
location: str,
invitation_id: str,
**kwargs
**kwargs: Any
) -> "_models.ConsumerInvitation":
"""Gets the invitation identified by invitationId.
Expand Down Expand Up @@ -175,7 +175,7 @@ async def reject_invitation(
self,
location: str,
invitation: "_models.ConsumerInvitation",
**kwargs
**kwargs: Any
) -> "_models.ConsumerInvitation":
"""Rejects the invitation identified by invitationId.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def list_by_share_subscription(
account_name: str,
share_subscription_name: str,
skip_token: Optional[str] = None,
**kwargs
**kwargs: Any
) -> AsyncIterable["_models.ConsumerSourceDataSetList"]:
"""Get source dataSets of a shareSubscription.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ async def get(
account_name: str,
share_subscription_name: str,
data_set_mapping_name: str,
**kwargs
**kwargs: Any
) -> "_models.DataSetMapping":
"""Get DataSetMapping in a shareSubscription.
Expand Down Expand Up @@ -117,7 +117,7 @@ async def create(
share_subscription_name: str,
data_set_mapping_name: str,
data_set_mapping: "_models.DataSetMapping",
**kwargs
**kwargs: Any
) -> "_models.DataSetMapping":
"""Maps a source data set in the source share to a sink data set in the share subscription.
Enables copying the data set from source to destination.
Expand Down Expand Up @@ -199,7 +199,7 @@ async def delete(
account_name: str,
share_subscription_name: str,
data_set_mapping_name: str,
**kwargs
**kwargs: Any
) -> None:
"""Delete DataSetMapping in a shareSubscription.
Expand Down Expand Up @@ -267,7 +267,7 @@ def list_by_share_subscription(
skip_token: Optional[str] = None,
filter: Optional[str] = None,
orderby: Optional[str] = None,
**kwargs
**kwargs: Any
) -> AsyncIterable["_models.DataSetMappingList"]:
"""List DataSetMappings in a share subscription.
Expand Down
Loading

0 comments on commit 18cfe45

Please sign in to comment.