Skip to content

Commit

Permalink
[AutoPR consumption/resource-manager] Updating $filter parameter samp…
Browse files Browse the repository at this point in the history
…le values in examples. Earlier version had incorrect format for the date values. (Azure#1999)

* Introduce 'top' filter to Pricesheet API (Azure#1977)

* Introducing (rough) tests around Price Sheet API.

* Introduce 'top' filter to Pricesheet Api. And update the associated test.
All files besides the following are related to line-endings. Since AutoRest generated the files, its left as is.
price_sheet_operations.py
test_mgmt_consumption.test_consumption_subscription_price_sheet.yaml
consumption/version.py was reset to 2.0.0 (different than what AutoRest generated)

* Generated from cbefdc6e1ebb76efd65b14d3737cc6fe6f20d0d0

Updating $filter parameter sample values in examples. Earlier version had incorrect format for the date values.

* Update version.py
  • Loading branch information
AutorestCI authored and lmazuel committed Feb 21, 2018
1 parent 13ad6a9 commit af67c66
Show file tree
Hide file tree
Showing 9 changed files with 65 additions and 1,295 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class BudgetsOperations(object):
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An objec model deserializer.
:param deserializer: An object model deserializer.
:ivar api_version: Version of the API to be used with the client request. The current version is 2018-01-31. Constant value: "2018-01-31".
"""

Expand Down Expand Up @@ -55,7 +55,7 @@ def internal_paging(next_link=None, raw=False):

if not next_link:
# Construct URL
url = '/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/budgets'
url = self.list.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
}
Expand Down Expand Up @@ -98,6 +98,7 @@ def internal_paging(next_link=None, raw=False):
return client_raw_response

return deserialized
list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/budgets'}

def list_by_resource_group_name(
self, resource_group_name, custom_headers=None, raw=False, **operation_config):
Expand All @@ -120,7 +121,7 @@ def internal_paging(next_link=None, raw=False):

if not next_link:
# Construct URL
url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Consumption/budgets'
url = self.list_by_resource_group_name.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str')
Expand Down Expand Up @@ -164,6 +165,7 @@ def internal_paging(next_link=None, raw=False):
return client_raw_response

return deserialized
list_by_resource_group_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Consumption/budgets'}

def get(
self, budget_name, custom_headers=None, raw=False, **operation_config):
Expand All @@ -183,7 +185,7 @@ def get(
:class:`ErrorResponseException<azure.mgmt.consumption.models.ErrorResponseException>`
"""
# Construct URL
url = '/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/budgets/{budgetName}'
url = self.get.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'),
'budgetName': self._serialize.url("budget_name", budget_name, 'str')
Expand Down Expand Up @@ -221,6 +223,7 @@ def get(
return client_raw_response

return deserialized
get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/budgets/{budgetName}'}

def create_or_update(
self, budget_name, parameters, custom_headers=None, raw=False, **operation_config):
Expand All @@ -245,7 +248,7 @@ def create_or_update(
:class:`ErrorResponseException<azure.mgmt.consumption.models.ErrorResponseException>`
"""
# Construct URL
url = '/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/budgets/{budgetName}'
url = self.create_or_update.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'),
'budgetName': self._serialize.url("budget_name", budget_name, 'str')
Expand Down Expand Up @@ -289,6 +292,7 @@ def create_or_update(
return client_raw_response

return deserialized
create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/budgets/{budgetName}'}

def delete(
self, budget_name, custom_headers=None, raw=False, **operation_config):
Expand All @@ -307,7 +311,7 @@ def delete(
:class:`ErrorResponseException<azure.mgmt.consumption.models.ErrorResponseException>`
"""
# Construct URL
url = '/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/budgets/{budgetName}'
url = self.delete.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'),
'budgetName': self._serialize.url("budget_name", budget_name, 'str')
Expand Down Expand Up @@ -338,6 +342,7 @@ def delete(
if raw:
client_raw_response = ClientRawResponse(None, response)
return client_raw_response
delete.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/budgets/{budgetName}'}

def get_by_resource_group_name(
self, resource_group_name, budget_name, custom_headers=None, raw=False, **operation_config):
Expand All @@ -360,7 +365,7 @@ def get_by_resource_group_name(
:class:`ErrorResponseException<azure.mgmt.consumption.models.ErrorResponseException>`
"""
# Construct URL
url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Consumption/budgets/{budgetName}'
url = self.get_by_resource_group_name.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
Expand Down Expand Up @@ -399,6 +404,7 @@ def get_by_resource_group_name(
return client_raw_response

return deserialized
get_by_resource_group_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Consumption/budgets/{budgetName}'}

def create_or_update_by_resource_group_name(
self, resource_group_name, budget_name, parameters, custom_headers=None, raw=False, **operation_config):
Expand All @@ -425,7 +431,7 @@ def create_or_update_by_resource_group_name(
:class:`ErrorResponseException<azure.mgmt.consumption.models.ErrorResponseException>`
"""
# Construct URL
url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Consumption/budgets/{budgetName}'
url = self.create_or_update_by_resource_group_name.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
Expand Down Expand Up @@ -470,6 +476,7 @@ def create_or_update_by_resource_group_name(
return client_raw_response

return deserialized
create_or_update_by_resource_group_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Consumption/budgets/{budgetName}'}

def delete_by_resource_group_name(
self, resource_group_name, budget_name, custom_headers=None, raw=False, **operation_config):
Expand All @@ -490,7 +497,7 @@ def delete_by_resource_group_name(
:class:`ErrorResponseException<azure.mgmt.consumption.models.ErrorResponseException>`
"""
# Construct URL
url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Consumption/budgets/{budgetName}'
url = self.delete_by_resource_group_name.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
Expand Down Expand Up @@ -522,3 +529,4 @@ def delete_by_resource_group_name(
if raw:
client_raw_response = ClientRawResponse(None, response)
return client_raw_response
delete_by_resource_group_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Consumption/budgets/{budgetName}'}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class MarketplacesOperations(object):
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An objec model deserializer.
:param deserializer: An object model deserializer.
:ivar api_version: Version of the API to be used with the client request. The current version is 2018-01-31. Constant value: "2018-01-31".
"""

Expand Down Expand Up @@ -70,7 +70,7 @@ def internal_paging(next_link=None, raw=False):

if not next_link:
# Construct URL
url = '/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/marketplaces'
url = self.list.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
}
Expand Down Expand Up @@ -119,6 +119,7 @@ def internal_paging(next_link=None, raw=False):
return client_raw_response

return deserialized
list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/marketplaces'}

def list_by_billing_period(
self, billing_period_name, filter=None, top=None, skiptoken=None, custom_headers=None, raw=False, **operation_config):
Expand Down Expand Up @@ -157,7 +158,7 @@ def internal_paging(next_link=None, raw=False):

if not next_link:
# Construct URL
url = '/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/marketplaces'
url = self.list_by_billing_period.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'),
'billingPeriodName': self._serialize.url("billing_period_name", billing_period_name, 'str')
Expand Down Expand Up @@ -207,3 +208,4 @@ def internal_paging(next_link=None, raw=False):
return client_raw_response

return deserialized
list_by_billing_period.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/marketplaces'}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Operations(object):
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An objec model deserializer.
:param deserializer: An object model deserializer.
:ivar api_version: Version of the API to be used with the client request. The current version is 2018-01-31. Constant value: "2018-01-31".
"""

Expand Down Expand Up @@ -55,7 +55,7 @@ def internal_paging(next_link=None, raw=False):

if not next_link:
# Construct URL
url = '/providers/Microsoft.Consumption/operations'
url = self.list.metadata['url']

# Construct parameters
query_parameters = {}
Expand Down Expand Up @@ -94,3 +94,4 @@ def internal_paging(next_link=None, raw=False):
return client_raw_response

return deserialized
list.metadata = {'url': '/providers/Microsoft.Consumption/operations'}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class PriceSheetOperations(object):
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An objec model deserializer.
:param deserializer: An object model deserializer.
:ivar api_version: Version of the API to be used with the client request. The current version is 2018-01-31. Constant value: "2018-01-31".
"""

Expand All @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer):
self.config = config

def get(
self, expand=None, skiptoken=None, custom_headers=None, raw=False, **operation_config):
self, expand=None, skiptoken=None, top=None, custom_headers=None, raw=False, **operation_config):
"""Gets the price sheet for a scope by subscriptionId. Price sheet is
available via this API only for May 1, 2014 or later.
Expand All @@ -50,6 +50,9 @@ def get(
element, the value of the nextLink element will include a skiptoken
parameter that specifies a starting point to use for subsequent calls.
:type skiptoken: str
:param top: May be used to limit the number of results to the top N
results.
:type top: int
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
Expand All @@ -62,7 +65,7 @@ def get(
:class:`ErrorResponseException<azure.mgmt.consumption.models.ErrorResponseException>`
"""
# Construct URL
url = '/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/pricesheets/default'
url = self.get.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
}
Expand All @@ -74,6 +77,8 @@ def get(
query_parameters['$expand'] = self._serialize.query("expand", expand, 'str')
if skiptoken is not None:
query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str')
if top is not None:
query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1)
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')

# Construct headers
Expand Down Expand Up @@ -103,9 +108,10 @@ def get(
return client_raw_response

return deserialized
get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/pricesheets/default'}

def get_by_billing_period(
self, billing_period_name, expand=None, skiptoken=None, custom_headers=None, raw=False, **operation_config):
self, billing_period_name, expand=None, skiptoken=None, top=None, custom_headers=None, raw=False, **operation_config):
"""Get the price sheet for a scope by subscriptionId and billing period.
Price sheet is available via this API only for May 1, 2014 or later.
Expand All @@ -120,6 +126,9 @@ def get_by_billing_period(
element, the value of the nextLink element will include a skiptoken
parameter that specifies a starting point to use for subsequent calls.
:type skiptoken: str
:param top: May be used to limit the number of results to the top N
results.
:type top: int
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
Expand All @@ -132,7 +141,7 @@ def get_by_billing_period(
:class:`ErrorResponseException<azure.mgmt.consumption.models.ErrorResponseException>`
"""
# Construct URL
url = '/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/pricesheets/default'
url = self.get_by_billing_period.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'),
'billingPeriodName': self._serialize.url("billing_period_name", billing_period_name, 'str')
Expand All @@ -145,6 +154,8 @@ def get_by_billing_period(
query_parameters['$expand'] = self._serialize.query("expand", expand, 'str')
if skiptoken is not None:
query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str')
if top is not None:
query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1)
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')

# Construct headers
Expand Down Expand Up @@ -174,3 +185,4 @@ def get_by_billing_period(
return client_raw_response

return deserialized
get_by_billing_period.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/pricesheets/default'}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ReservationsDetailsOperations(object):
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An objec model deserializer.
:param deserializer: An object model deserializer.
:ivar api_version: Version of the API to be used with the client request. The current version is 2018-01-31. Constant value: "2018-01-31".
"""

Expand Down Expand Up @@ -61,7 +61,7 @@ def internal_paging(next_link=None, raw=False):

if not next_link:
# Construct URL
url = '/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/providers/Microsoft.Consumption/reservationDetails'
url = self.list_by_reservation_order.metadata['url']
path_format_arguments = {
'reservationOrderId': self._serialize.url("reservation_order_id", reservation_order_id, 'str')
}
Expand Down Expand Up @@ -105,6 +105,7 @@ def internal_paging(next_link=None, raw=False):
return client_raw_response

return deserialized
list_by_reservation_order.metadata = {'url': '/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/providers/Microsoft.Consumption/reservationDetails'}

def list_by_reservation_order_and_reservation(
self, reservation_order_id, reservation_id, filter, custom_headers=None, raw=False, **operation_config):
Expand Down Expand Up @@ -133,7 +134,7 @@ def internal_paging(next_link=None, raw=False):

if not next_link:
# Construct URL
url = '/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/reservations/{reservationId}/providers/Microsoft.Consumption/reservationDetails'
url = self.list_by_reservation_order_and_reservation.metadata['url']
path_format_arguments = {
'reservationOrderId': self._serialize.url("reservation_order_id", reservation_order_id, 'str'),
'reservationId': self._serialize.url("reservation_id", reservation_id, 'str')
Expand Down Expand Up @@ -178,3 +179,4 @@ def internal_paging(next_link=None, raw=False):
return client_raw_response

return deserialized
list_by_reservation_order_and_reservation.metadata = {'url': '/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/reservations/{reservationId}/providers/Microsoft.Consumption/reservationDetails'}
Loading

0 comments on commit af67c66

Please sign in to comment.