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

[T2] GA commerce #15907

Merged
merged 1 commit into from
Jan 4, 2021
Merged
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
4 changes: 4 additions & 0 deletions sdk/commerce/azure-mgmt-commerce/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release History

## 6.0.0 (2020-12-22)

- GA release

## 6.0.0b1 (2020-10-22)

This is beta preview version.
Expand Down
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 = "6.0.0b1"
VERSION = "6.0.0"
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
from azure.mgmt.core.exceptions import ARMErrorFormat

from ... import models
from ... import models as _models

T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
Expand All @@ -32,7 +32,7 @@ class RateCardOperations:
:param deserializer: An object model deserializer.
"""

models = models
models = _models

def __init__(self, client, config, serializer, deserializer) -> None:
self._client = client
Expand All @@ -44,7 +44,7 @@ async def get(
self,
filter: str,
**kwargs
) -> "models.ResourceRateCardInfo":
) -> "_models.ResourceRateCardInfo":
"""Enables you to query for the resource/meter metadata and related prices used in a given
subscription by Offer ID, Currency, Locale and Region. The metadata associated with the billing
meters, including but not limited to service names, types, resources, units of measure, and
Expand All @@ -62,7 +62,7 @@ async def get(
:rtype: ~azure.mgmt.commerce.models.ResourceRateCardInfo
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceRateCardInfo"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceRateCardInfo"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
Expand Down Expand Up @@ -92,7 +92,7 @@ async def get(

if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(models.ErrorResponse, response)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

deserialized = self._deserialize('ResourceRateCardInfo', pipeline_response)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
from azure.mgmt.core.exceptions import ARMErrorFormat

from ... import models
from ... import models as _models

T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
Expand All @@ -34,7 +34,7 @@ class UsageAggregatesOperations:
:param deserializer: An object model deserializer.
"""

models = models
models = _models

def __init__(self, client, config, serializer, deserializer) -> None:
self._client = client
Expand All @@ -47,10 +47,10 @@ def list(
reported_start_time: datetime.datetime,
reported_end_time: datetime.datetime,
show_details: Optional[bool] = None,
aggregation_granularity: Optional[Union[str, "models.AggregationGranularity"]] = "Daily",
aggregation_granularity: Optional[Union[str, "_models.AggregationGranularity"]] = "Daily",
continuation_token_parameter: Optional[str] = None,
**kwargs
) -> AsyncIterable["models.UsageAggregationListResult"]:
) -> AsyncIterable["_models.UsageAggregationListResult"]:
"""Query aggregated Azure subscription consumption data for a date range.

:param reported_start_time: The start of the time range to retrieve data for.
Expand All @@ -75,7 +75,7 @@ def list(
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.commerce.models.UsageAggregationListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.UsageAggregationListResult"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.UsageAggregationListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
Expand Down Expand Up @@ -128,7 +128,7 @@ async def get_next(next_link=None):
response = pipeline_response.http_response

if response.status_code not in [200]:
error = self._deserialize(models.ErrorResponse, response)
error = self._deserialize(_models.ErrorResponse, response)
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

from ._usage_management_client_enums import (
AggregationGranularity,
OfferTermInfoName,
OfferTermInfoEnum,
)

__all__ = [
Expand All @@ -49,5 +49,5 @@
'UsageAggregation',
'UsageAggregationListResult',
'AggregationGranularity',
'OfferTermInfoName',
'OfferTermInfoEnum',
]
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class OfferTermInfo(msrest.serialization.Model):

:param name: Required. Name of the offer term.Constant filled by server. Possible values
include: "Recurring Charge", "Monetary Commitment", "Monetary Credit".
:type name: str or ~azure.mgmt.commerce.models.OfferTermInfoName
:type name: str or ~azure.mgmt.commerce.models.OfferTermInfoEnum
:param effective_date: Indicates the date from which the offer term is effective.
:type effective_date: ~datetime.datetime
"""
Expand Down Expand Up @@ -155,7 +155,7 @@ class MonetaryCommitment(OfferTermInfo):

:param name: Required. Name of the offer term.Constant filled by server. Possible values
include: "Recurring Charge", "Monetary Commitment", "Monetary Credit".
:type name: str or ~azure.mgmt.commerce.models.OfferTermInfoName
:type name: str or ~azure.mgmt.commerce.models.OfferTermInfoEnum
:param effective_date: Indicates the date from which the offer term is effective.
:type effective_date: ~datetime.datetime
:param tiered_discount: The list of key/value pairs for the tiered meter rates, in the format
Expand Down Expand Up @@ -194,7 +194,7 @@ class MonetaryCredit(OfferTermInfo):

:param name: Required. Name of the offer term.Constant filled by server. Possible values
include: "Recurring Charge", "Monetary Commitment", "Monetary Credit".
:type name: str or ~azure.mgmt.commerce.models.OfferTermInfoName
:type name: str or ~azure.mgmt.commerce.models.OfferTermInfoEnum
:param effective_date: Indicates the date from which the offer term is effective.
:type effective_date: ~datetime.datetime
:param credit: The amount of credit provided under the terms of the given offer level.
Expand Down Expand Up @@ -274,7 +274,7 @@ class RecurringCharge(OfferTermInfo):

:param name: Required. Name of the offer term.Constant filled by server. Possible values
include: "Recurring Charge", "Monetary Commitment", "Monetary Credit".
:type name: str or ~azure.mgmt.commerce.models.OfferTermInfoName
:type name: str or ~azure.mgmt.commerce.models.OfferTermInfoEnum
:param effective_date: Indicates the date from which the offer term is effective.
:type effective_date: ~datetime.datetime
:param recurring_charge: The amount of recurring charge as per the offer term.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class OfferTermInfo(msrest.serialization.Model):

:param name: Required. Name of the offer term.Constant filled by server. Possible values
include: "Recurring Charge", "Monetary Commitment", "Monetary Credit".
:type name: str or ~azure.mgmt.commerce.models.OfferTermInfoName
:type name: str or ~azure.mgmt.commerce.models.OfferTermInfoEnum
:param effective_date: Indicates the date from which the offer term is effective.
:type effective_date: ~datetime.datetime
"""
Expand Down Expand Up @@ -176,7 +176,7 @@ class MonetaryCommitment(OfferTermInfo):

:param name: Required. Name of the offer term.Constant filled by server. Possible values
include: "Recurring Charge", "Monetary Commitment", "Monetary Credit".
:type name: str or ~azure.mgmt.commerce.models.OfferTermInfoName
:type name: str or ~azure.mgmt.commerce.models.OfferTermInfoEnum
:param effective_date: Indicates the date from which the offer term is effective.
:type effective_date: ~datetime.datetime
:param tiered_discount: The list of key/value pairs for the tiered meter rates, in the format
Expand Down Expand Up @@ -219,7 +219,7 @@ class MonetaryCredit(OfferTermInfo):

:param name: Required. Name of the offer term.Constant filled by server. Possible values
include: "Recurring Charge", "Monetary Commitment", "Monetary Credit".
:type name: str or ~azure.mgmt.commerce.models.OfferTermInfoName
:type name: str or ~azure.mgmt.commerce.models.OfferTermInfoEnum
:param effective_date: Indicates the date from which the offer term is effective.
:type effective_date: ~datetime.datetime
:param credit: The amount of credit provided under the terms of the given offer level.
Expand Down Expand Up @@ -308,7 +308,7 @@ class RecurringCharge(OfferTermInfo):

:param name: Required. Name of the offer term.Constant filled by server. Possible values
include: "Recurring Charge", "Monetary Commitment", "Monetary Credit".
:type name: str or ~azure.mgmt.commerce.models.OfferTermInfoName
:type name: str or ~azure.mgmt.commerce.models.OfferTermInfoEnum
:param effective_date: Indicates the date from which the offer term is effective.
:type effective_date: ~datetime.datetime
:param recurring_charge: The amount of recurring charge as per the offer term.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class AggregationGranularity(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)
DAILY = "Daily"
HOURLY = "Hourly"

class OfferTermInfoName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
class OfferTermInfoEnum(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
"""Name of the offer term
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from azure.core.pipeline.transport import HttpRequest, HttpResponse
from azure.mgmt.core.exceptions import ARMErrorFormat

from .. import models
from .. import models as _models

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
Expand All @@ -36,7 +36,7 @@ class RateCardOperations(object):
:param deserializer: An object model deserializer.
"""

models = models
models = _models

def __init__(self, client, config, serializer, deserializer):
self._client = client
Expand All @@ -49,7 +49,7 @@ def get(
filter, # type: str
**kwargs # type: Any
):
# type: (...) -> "models.ResourceRateCardInfo"
# type: (...) -> "_models.ResourceRateCardInfo"
"""Enables you to query for the resource/meter metadata and related prices used in a given
subscription by Offer ID, Currency, Locale and Region. The metadata associated with the billing
meters, including but not limited to service names, types, resources, units of measure, and
Expand All @@ -67,7 +67,7 @@ def get(
:rtype: ~azure.mgmt.commerce.models.ResourceRateCardInfo
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceRateCardInfo"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceRateCardInfo"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
Expand Down Expand Up @@ -97,7 +97,7 @@ def get(

if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(models.ErrorResponse, response)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

deserialized = self._deserialize('ResourceRateCardInfo', pipeline_response)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from azure.core.pipeline.transport import HttpRequest, HttpResponse
from azure.mgmt.core.exceptions import ARMErrorFormat

from .. import models
from .. import models as _models

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
Expand All @@ -38,7 +38,7 @@ class UsageAggregatesOperations(object):
:param deserializer: An object model deserializer.
"""

models = models
models = _models

def __init__(self, client, config, serializer, deserializer):
self._client = client
Expand All @@ -51,11 +51,11 @@ def list(
reported_start_time, # type: datetime.datetime
reported_end_time, # type: datetime.datetime
show_details=None, # type: Optional[bool]
aggregation_granularity="Daily", # type: Optional[Union[str, "models.AggregationGranularity"]]
aggregation_granularity="Daily", # type: Optional[Union[str, "_models.AggregationGranularity"]]
continuation_token_parameter=None, # type: Optional[str]
**kwargs # type: Any
):
# type: (...) -> Iterable["models.UsageAggregationListResult"]
# type: (...) -> Iterable["_models.UsageAggregationListResult"]
"""Query aggregated Azure subscription consumption data for a date range.

:param reported_start_time: The start of the time range to retrieve data for.
Expand All @@ -80,7 +80,7 @@ def list(
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.commerce.models.UsageAggregationListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.UsageAggregationListResult"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.UsageAggregationListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
Expand Down Expand Up @@ -133,7 +133,7 @@ def get_next(next_link=None):
response = pipeline_response.http_response

if response.status_code not in [200]:
error = self._deserialize(models.ErrorResponse, response)
error = self._deserialize(_models.ErrorResponse, response)
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

Expand Down
Loading