How to use azure-mgmt-commerce - 10 common examples

To help you get started, we’ve selected a few azure-mgmt-commerce examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Azure / azure-sdk-for-python / azure-mgmt-commerce / azure / mgmt / commerce / models / monetary_credit.py View on Github external
# 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 .offer_term_info import OfferTermInfo


class MonetaryCredit(OfferTermInfo):
    """Indicates that this is a monetary credit offer.

    :param effective_date: Indicates the date from which the offer term is
     effective.
    :type effective_date: datetime
    :param name: Constant filled by server.
    :type name: str
    :param credit: The amount of credit provided under the terms of the given
     offer level.
    :type credit: decimal.Decimal
    :param excluded_meter_ids: An array of meter ids that are excluded from
     the given offer terms.
    :type excluded_meter_ids: list[str]
    """

    _validation = {
github Azure / azure-sdk-for-python / azure-mgmt-commerce / azure / mgmt / commerce / operations / rate_card_operations.py View on Github external
# Construct headers
        header_parameters = {}
        header_parameters['Content-Type'] = 'application/json; charset=utf-8'
        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)
        response = self._client.send(request, header_parameters, stream=False, **operation_config)

        if response.status_code not in [200]:
            raise models.ErrorResponseException(self._deserialize, response)

        deserialized = None

        if response.status_code == 200:
            deserialized = self._deserialize('ResourceRateCardInfo', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Commerce/RateCard'}
github Azure / azure-sdk-for-python / azure-mgmt-commerce / azure / mgmt / commerce / operations / usage_aggregates_operations.py View on Github external
header_parameters = {}
            header_parameters['Content-Type'] = 'application/json; charset=utf-8'
            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)
            response = self._client.send(
                request, header_parameters, stream=False, **operation_config)

            if response.status_code not in [200]:
                raise models.ErrorResponseException(self._deserialize, response)

            return response
github Azure / azure-sdk-for-python / azure-mgmt-commerce / azure / mgmt / commerce / operations / usage_aggregates_operations.py View on Github external
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)
            response = self._client.send(
                request, header_parameters, stream=False, **operation_config)

            if response.status_code not in [200]:
                raise models.ErrorResponseException(self._deserialize, response)

            return response

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

        if raw:
            header_dict = {}
            client_raw_response = models.UsageAggregationPaged(internal_paging, self._deserialize.dependencies, header_dict)
            return client_raw_response

        return deserialized
    list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Commerce/UsageAggregates'}
github Azure / azure-sdk-for-python / azure-mgmt-commerce / azure / mgmt / commerce / usage_management_client.py View on Github external
def __init__(
            self, credentials, subscription_id, base_url=None):

        self.config = UsageManagementClientConfiguration(credentials, subscription_id, base_url)
        self._client = ServiceClient(self.config.credentials, self.config)

        client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
        self.api_version = '2015-06-01-preview'
        self._serialize = Serializer(client_models)
        self._deserialize = Deserializer(client_models)

        self.usage_aggregates = UsageAggregatesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.rate_card = RateCardOperations(
            self._client, self.config, self._serialize, self._deserialize)
github Azure / azure-sdk-for-python / azure-mgmt-commerce / azure / mgmt / commerce / models / monetary_commitment.py View on Github external
# 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 .offer_term_info import OfferTermInfo


class MonetaryCommitment(OfferTermInfo):
    """Indicates that a monetary commitment is required for this offer.

    :param effective_date: Indicates the date from which the offer term is
     effective.
    :type effective_date: datetime
    :param name: Constant filled by server.
    :type name: str
    :param tiered_discount: The list of key/value pairs for the tiered meter
     rates, in the format 'key':'value' where key = price, and value = the
     corresponding discount percentage. This field is used only by offer terms
     of type 'Monetary Commitment'.
    :type tiered_discount: dict[str, decimal.Decimal]
    :param excluded_meter_ids: An array of meter ids that are excluded from
     the given offer terms.
    :type excluded_meter_ids: list[str]
    """
github Azure / azure-sdk-for-python / azure-mgmt-commerce / azure / mgmt / commerce / models / recurring_charge.py View on Github external
# 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 .offer_term_info import OfferTermInfo


class RecurringCharge(OfferTermInfo):
    """Indicates a recurring charge is present for this offer.

    :param effective_date: Indicates the date from which the offer term is
     effective.
    :type effective_date: datetime
    :param name: Constant filled by server.
    :type name: str
    :param recurring_charge: The amount of recurring charge as per the offer
     term.
    :type recurring_charge: int
    """

    _validation = {
        'name': {'required': True},
    }
github Azure / azure-sdk-for-python / azure-mgmt-commerce / azure / mgmt / commerce / models / offer_term_info.py View on Github external
def __init__(self, effective_date=None):
        super(OfferTermInfo, self).__init__()
        self.effective_date = effective_date
        self.name = None
github Azure / azure-sdk-for-python / azure-mgmt-commerce / azure / mgmt / commerce / operations / usage_aggregates_operations.py View on Github external
# Construct and send request
            request = self._client.get(url, query_parameters)
            response = self._client.send(
                request, header_parameters, stream=False, **operation_config)

            if response.status_code not in [200]:
                raise models.ErrorResponseException(self._deserialize, response)

            return response

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

        if raw:
            header_dict = {}
            client_raw_response = models.UsageAggregationPaged(internal_paging, self._deserialize.dependencies, header_dict)
            return client_raw_response

        return deserialized
    list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Commerce/UsageAggregates'}
github Azure / azure-sdk-for-python / azure-mgmt-commerce / azure / mgmt / commerce / usage_management_client.py View on Github external
def __init__(
            self, credentials, subscription_id, base_url=None):

        self.config = UsageManagementClientConfiguration(credentials, subscription_id, base_url)
        self._client = ServiceClient(self.config.credentials, self.config)

        client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
        self.api_version = '2015-06-01-preview'
        self._serialize = Serializer(client_models)
        self._deserialize = Deserializer(client_models)

        self.usage_aggregates = UsageAggregatesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.rate_card = RateCardOperations(
            self._client, self.config, self._serialize, self._deserialize)

azure-mgmt-commerce

Microsoft Azure Commerce Client Library for Python

MIT
Latest version published 3 years ago

Package Health Score

79 / 100
Full package analysis

Similar packages