Skip to content

Commit

Permalink
CodeGen from PR 14456 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge b0b11a82be3fb001f8d717cce6d7b1812a3d135d into e0624d2
  • Loading branch information
SDKAuto committed May 18, 2021
1 parent bdaea28 commit 310f72b
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 1 deletion.
2 changes: 1 addition & 1 deletion sdk/maps/azure-mgmt-maps/_meta.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"autorest": "V2",
"use": "@microsoft.azure/autorest.python@~4.0.71",
"commit": "5e6a5758c2bd7128984f131be88200cd4d2d1a17",
"commit": "4e34568f7426184edb7c719d71af44c5295ad5de",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/maps/resource-manager/readme.md --keep-version-file --multiapi --no-async --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --use=@microsoft.azure/autorest.python@~4.0.71 --version=V2",
"readme": "specification/maps/resource-manager/readme.md"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,68 @@ def internal_paging(next_link=None):

return deserialized
list_operations.metadata = {'url': '/providers/Microsoft.Maps/operations'}

def subscription_list_operations(
self, custom_headers=None, raw=False, **operation_config):
"""List operations available for the Maps Resource Provider.
: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 OperationDetail
:rtype:
~azure.mgmt.maps.models.OperationDetailPaged[~azure.mgmt.maps.models.OperationDetail]
:raises:
:class:`ErrorResponseException<azure.mgmt.maps.models.ErrorResponseException>`
"""
def prepare_request(next_link=None):
if not next_link:
# Construct URL
url = self.subscription_list_operations.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1)
}
url = self._client.format_url(url, **path_format_arguments)

# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1)

else:
url = next_link
query_parameters = {}

# Construct headers
header_parameters = {}
header_parameters['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.ErrorResponseException(self._deserialize, response)

return response

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

return deserialized
subscription_list_operations.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Maps/operations'}

0 comments on commit 310f72b

Please sign in to comment.