Skip to content

Commit

Permalink
Generated from 13b235cccbe934e60dba491a2a49edcae9c7f275 (#4481)
Browse files Browse the repository at this point in the history
Fix Hosting Environment Network Dependencies pagination
  • Loading branch information
AutorestCI authored Mar 5, 2019
1 parent 11726bc commit 040ae80
Show file tree
Hide file tree
Showing 4 changed files with 138 additions and 64 deletions.
4 changes: 4 additions & 0 deletions azure-mgmt-web/azure/mgmt/web/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,9 +513,11 @@
from .web_job_paged import WebJobPaged
from .app_service_environment_resource_paged import AppServiceEnvironmentResourcePaged
from .stamp_capacity_paged import StampCapacityPaged
from .inbound_environment_endpoint_paged import InboundEnvironmentEndpointPaged
from .worker_pool_resource_paged import WorkerPoolResourcePaged
from .sku_info_paged import SkuInfoPaged
from .usage_paged import UsagePaged
from .outbound_environment_endpoint_paged import OutboundEnvironmentEndpointPaged
from .app_service_plan_paged import AppServicePlanPaged
from .str_paged import StrPaged
from .hybrid_connection_paged import HybridConnectionPaged
Expand Down Expand Up @@ -862,9 +864,11 @@
'WebJobPaged',
'AppServiceEnvironmentResourcePaged',
'StampCapacityPaged',
'InboundEnvironmentEndpointPaged',
'WorkerPoolResourcePaged',
'SkuInfoPaged',
'UsagePaged',
'OutboundEnvironmentEndpointPaged',
'AppServicePlanPaged',
'StrPaged',
'HybridConnectionPaged',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# 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.paging import Paged


class InboundEnvironmentEndpointPaged(Paged):
"""
A paging container for iterating over a list of :class:`InboundEnvironmentEndpoint <azure.mgmt.web.models.InboundEnvironmentEndpoint>` object
"""

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

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

super(InboundEnvironmentEndpointPaged, self).__init__(*args, **kwargs)
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# 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.paging import Paged


class OutboundEnvironmentEndpointPaged(Paged):
"""
A paging container for iterating over a list of :class:`OutboundEnvironmentEndpoint <azure.mgmt.web.models.OutboundEnvironmentEndpoint>` object
"""

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

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

super(OutboundEnvironmentEndpointPaged, self).__init__(*args, **kwargs)
Original file line number Diff line number Diff line change
Expand Up @@ -908,49 +908,57 @@ def get_inbound_network_dependencies_endpoints(
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: list or ClientRawResponse if raw=true
:rtype: list[~azure.mgmt.web.models.InboundEnvironmentEndpoint] or
~msrest.pipeline.ClientRawResponse
:return: An iterator like instance of InboundEnvironmentEndpoint
:rtype:
~azure.mgmt.web.models.InboundEnvironmentEndpointPaged[~azure.mgmt.web.models.InboundEnvironmentEndpoint]
:raises:
:class:`DefaultErrorResponseException<azure.mgmt.web.models.DefaultErrorResponseException>`
"""
# Construct URL
url = self.get_inbound_network_dependencies_endpoints.metadata['url']
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'),
'name': self._serialize.url("name", name, 'str'),
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
def internal_paging(next_link=None, raw=False):

# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
if not next_link:
# Construct URL
url = self.get_inbound_network_dependencies_endpoints.metadata['url']
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'),
'name': self._serialize.url("name", name, 'str'),
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)

# 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 parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')

# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
else:
url = next_link
query_parameters = {}

if response.status_code not in [200]:
raise models.DefaultErrorResponseException(self._deserialize, response)
# 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')

deserialized = None
# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code == 200:
deserialized = self._deserialize('[InboundEnvironmentEndpoint]', response)
if response.status_code not in [200]:
raise models.DefaultErrorResponseException(self._deserialize, response)

return response

# Deserialize response
deserialized = models.InboundEnvironmentEndpointPaged(internal_paging, self._deserialize.dependencies)

if raw:
client_raw_response = ClientRawResponse(deserialized, response)
header_dict = {}
client_raw_response = models.InboundEnvironmentEndpointPaged(internal_paging, self._deserialize.dependencies, header_dict)
return client_raw_response

return deserialized
Expand Down Expand Up @@ -1977,49 +1985,57 @@ def get_outbound_network_dependencies_endpoints(
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: list or ClientRawResponse if raw=true
:rtype: list[~azure.mgmt.web.models.OutboundEnvironmentEndpoint] or
~msrest.pipeline.ClientRawResponse
:return: An iterator like instance of OutboundEnvironmentEndpoint
:rtype:
~azure.mgmt.web.models.OutboundEnvironmentEndpointPaged[~azure.mgmt.web.models.OutboundEnvironmentEndpoint]
:raises:
:class:`DefaultErrorResponseException<azure.mgmt.web.models.DefaultErrorResponseException>`
"""
# Construct URL
url = self.get_outbound_network_dependencies_endpoints.metadata['url']
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'),
'name': self._serialize.url("name", name, 'str'),
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
def internal_paging(next_link=None, raw=False):

# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
if not next_link:
# Construct URL
url = self.get_outbound_network_dependencies_endpoints.metadata['url']
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'),
'name': self._serialize.url("name", name, 'str'),
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)

# 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 parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')

# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
else:
url = next_link
query_parameters = {}

if response.status_code not in [200]:
raise models.DefaultErrorResponseException(self._deserialize, response)
# 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')

deserialized = None
# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code == 200:
deserialized = self._deserialize('[OutboundEnvironmentEndpoint]', response)
if response.status_code not in [200]:
raise models.DefaultErrorResponseException(self._deserialize, response)

return response

# Deserialize response
deserialized = models.OutboundEnvironmentEndpointPaged(internal_paging, self._deserialize.dependencies)

if raw:
client_raw_response = ClientRawResponse(deserialized, response)
header_dict = {}
client_raw_response = models.OutboundEnvironmentEndpointPaged(internal_paging, self._deserialize.dependencies, header_dict)
return client_raw_response

return deserialized
Expand Down

0 comments on commit 040ae80

Please sign in to comment.