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

[AutoPR cost-management/resource-manager/consumption/resource-manager] [Hub Generated] Review request for Microsoft.CostManagement to add version stable/2019-01-01 #4871

Closed
wants to merge 17 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
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 azure-mgmt-consumption/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
recursive-include tests *.py *.yaml
include *.rst
include azure/__init__.py
include azure/mgmt/__init__.py

22 changes: 3 additions & 19 deletions azure-mgmt-consumption/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,6 @@ For the older Azure Service Management (ASM) libraries, see
For a more complete set of Azure libraries, see the `azure <https://pypi.python.org/pypi/azure>`__ bundle package.


Compatibility
=============

**IMPORTANT**: If you have an earlier version of the azure package
(version < 1.0), you should uninstall it before installing this package.

You can check the version using pip:

.. code:: shell

pip freeze

If you see azure==0.11.0 (or any version below 1.0), uninstall it first:

.. code:: shell

pip uninstall azure


Usage
=====

Expand All @@ -47,3 +28,6 @@ Provide Feedback
If you encounter any bugs or have suggestions, please file an issue in the
`Issues <https://github.com/Azure/azure-sdk-for-python/issues>`__
section of the project.


.. image:: https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-consumption%2FREADME.png
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,19 @@
# regenerated.
# --------------------------------------------------------------------------

from msrest.service_client import ServiceClient
from msrest.service_client import SDKClient
from msrest import Serializer, Deserializer
from msrestazure import AzureConfiguration
from .version import VERSION
from .operations.usage_details_operations import UsageDetailsOperations
from .operations.marketplaces_operations import MarketplacesOperations
from .operations.reservations_summaries_operations import ReservationsSummariesOperations
from .operations.reservations_details_operations import ReservationsDetailsOperations
from .operations.budgets_operations import BudgetsOperations
from .operations.operations import Operations
from .operations.price_sheet_operations import PriceSheetOperations
from .operations.credit_summary_by_billing_profile_operations import CreditSummaryByBillingProfileOperations
from .operations.events_by_billing_profile_operations import EventsByBillingProfileOperations
from .operations.lots_by_billing_profile_operations import LotsByBillingProfileOperations
from .operations.invoice_pricesheet_operations import InvoicePricesheetOperations
from .operations.billing_profile_pricesheet_operations import BillingProfilePricesheetOperations
from .operations.charges_by_billing_account_operations import ChargesByBillingAccountOperations
from .operations.charges_by_billing_profile_operations import ChargesByBillingProfileOperations
from .operations.charges_by_invoice_section_operations import ChargesByInvoiceSectionOperations
from . import models


Expand All @@ -31,18 +33,14 @@ class ConsumptionManagementClientConfiguration(AzureConfiguration):
:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param subscription_id: Azure Subscription ID.
:type subscription_id: str
:param str base_url: Service URL
"""

def __init__(
self, credentials, subscription_id, base_url=None):
self, credentials, base_url=None):

if credentials is None:
raise ValueError("Parameter 'credentials' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
if not base_url:
base_url = 'https://management.azure.com'

Expand All @@ -52,60 +50,65 @@ def __init__(
self.add_user_agent('Azure-SDK-For-Python')

self.credentials = credentials
self.subscription_id = subscription_id


class ConsumptionManagementClient(object):
class ConsumptionManagementClient(SDKClient):
"""Consumption management client provides access to consumption resources for Azure Enterprise Subscriptions.

:ivar config: Configuration for client.
:vartype config: ConsumptionManagementClientConfiguration

:ivar usage_details: UsageDetails operations
:vartype usage_details: azure.mgmt.consumption.operations.UsageDetailsOperations
:ivar marketplaces: Marketplaces operations
:vartype marketplaces: azure.mgmt.consumption.operations.MarketplacesOperations
:ivar reservations_summaries: ReservationsSummaries operations
:vartype reservations_summaries: azure.mgmt.consumption.operations.ReservationsSummariesOperations
:ivar reservations_details: ReservationsDetails operations
:vartype reservations_details: azure.mgmt.consumption.operations.ReservationsDetailsOperations
:ivar budgets: Budgets operations
:vartype budgets: azure.mgmt.consumption.operations.BudgetsOperations
:ivar operations: Operations operations
:vartype operations: azure.mgmt.consumption.operations.Operations
:ivar price_sheet: PriceSheet operations
:vartype price_sheet: azure.mgmt.consumption.operations.PriceSheetOperations
:ivar credit_summary_by_billing_profile: CreditSummaryByBillingProfile operations
:vartype credit_summary_by_billing_profile: azure.mgmt.consumption.operations.CreditSummaryByBillingProfileOperations
:ivar events_by_billing_profile: EventsByBillingProfile operations
:vartype events_by_billing_profile: azure.mgmt.consumption.operations.EventsByBillingProfileOperations
:ivar lots_by_billing_profile: LotsByBillingProfile operations
:vartype lots_by_billing_profile: azure.mgmt.consumption.operations.LotsByBillingProfileOperations
:ivar invoice_pricesheet: InvoicePricesheet operations
:vartype invoice_pricesheet: azure.mgmt.consumption.operations.InvoicePricesheetOperations
:ivar billing_profile_pricesheet: BillingProfilePricesheet operations
:vartype billing_profile_pricesheet: azure.mgmt.consumption.operations.BillingProfilePricesheetOperations
:ivar charges_by_billing_account: ChargesByBillingAccount operations
:vartype charges_by_billing_account: azure.mgmt.consumption.operations.ChargesByBillingAccountOperations
:ivar charges_by_billing_profile: ChargesByBillingProfile operations
:vartype charges_by_billing_profile: azure.mgmt.consumption.operations.ChargesByBillingProfileOperations
:ivar charges_by_invoice_section: ChargesByInvoiceSection operations
:vartype charges_by_invoice_section: azure.mgmt.consumption.operations.ChargesByInvoiceSectionOperations

:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param subscription_id: Azure Subscription ID.
:type subscription_id: str
:param str base_url: Service URL
"""

def __init__(
self, credentials, subscription_id, base_url=None):
self, credentials, base_url=None):

self.config = ConsumptionManagementClientConfiguration(credentials, subscription_id, base_url)
self._client = ServiceClient(self.config.credentials, self.config)
self.config = ConsumptionManagementClientConfiguration(credentials, base_url)
super(ConsumptionManagementClient, self).__init__(self.config.credentials, self.config)

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

self.usage_details = UsageDetailsOperations(
self.operations = Operations(
self._client, self.config, self._serialize, self._deserialize)
self.marketplaces = MarketplacesOperations(
self.credit_summary_by_billing_profile = CreditSummaryByBillingProfileOperations(
self._client, self.config, self._serialize, self._deserialize)
self.reservations_summaries = ReservationsSummariesOperations(
self.events_by_billing_profile = EventsByBillingProfileOperations(
self._client, self.config, self._serialize, self._deserialize)
self.reservations_details = ReservationsDetailsOperations(
self.lots_by_billing_profile = LotsByBillingProfileOperations(
self._client, self.config, self._serialize, self._deserialize)
self.budgets = BudgetsOperations(
self.invoice_pricesheet = InvoicePricesheetOperations(
self._client, self.config, self._serialize, self._deserialize)
self.operations = Operations(
self.billing_profile_pricesheet = BillingProfilePricesheetOperations(
self._client, self.config, self._serialize, self._deserialize)
self.charges_by_billing_account = ChargesByBillingAccountOperations(
self._client, self.config, self._serialize, self._deserialize)
self.charges_by_billing_profile = ChargesByBillingProfileOperations(
self._client, self.config, self._serialize, self._deserialize)
self.price_sheet = PriceSheetOperations(
self.charges_by_invoice_section = ChargesByInvoiceSectionOperations(
self._client, self.config, self._serialize, self._deserialize)
138 changes: 87 additions & 51 deletions azure-mgmt-consumption/azure/mgmt/consumption/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,64 +9,100 @@
# regenerated.
# --------------------------------------------------------------------------

from .meter_details import MeterDetails
from .usage_detail import UsageDetail
from .marketplace import Marketplace
from .reservation_summaries import ReservationSummaries
from .reservation_details import ReservationDetails
from .budget_time_period import BudgetTimePeriod
from .filters import Filters
from .current_spend import CurrentSpend
from .notification import Notification
from .budget import Budget
from .error_details import ErrorDetails
from .error_response import ErrorResponse, ErrorResponseException
from .operation_display import OperationDisplay
from .operation import Operation
from .resource import Resource
from .proxy_resource import ProxyResource
from .price_sheet_properties import PriceSheetProperties
from .price_sheet_result import PriceSheetResult
from .usage_detail_paged import UsageDetailPaged
from .marketplace_paged import MarketplacePaged
from .reservation_summaries_paged import ReservationSummariesPaged
from .reservation_details_paged import ReservationDetailsPaged
from .budget_paged import BudgetPaged
try:
from .enrollment_policies_py3 import EnrollmentPolicies
from .enrollment_py3 import Enrollment
from .department_py3 import Department
from .enrollment_account_py3 import EnrollmentAccount
from .address_py3 import Address
from .billing_profile_py3 import BillingProfile
from .invoice_section_py3 import InvoiceSection
from .billing_account_py3 import BillingAccount
from .amount_py3 import Amount
from .pricesheet_download_response_py3 import PricesheetDownloadResponse
from .credit_balance_summary_py3 import CreditBalanceSummary
from .credit_summary_py3 import CreditSummary
from .event_summary_py3 import EventSummary
from .events_py3 import Events
from .lot_summary_py3 import LotSummary
from .lots_py3 import Lots
from .charge_summary_by_billing_account_py3 import ChargeSummaryByBillingAccount
from .charges_list_by_billing_account_py3 import ChargesListByBillingAccount
from .charge_summary_by_billing_profile_py3 import ChargeSummaryByBillingProfile
from .charges_list_by_billing_profile_py3 import ChargesListByBillingProfile
from .charge_summary_by_invoice_section_py3 import ChargeSummaryByInvoiceSection
from .charges_list_by_invoice_section_py3 import ChargesListByInvoiceSection
from .operation_display_py3 import OperationDisplay
from .operation_py3 import Operation
from .error_details_py3 import ErrorDetails
from .error_response_py3 import ErrorResponse, ErrorResponseException
from .proxy_resource_py3 import ProxyResource
from .resource_py3 import Resource
except (SyntaxError, ImportError):
from .enrollment_policies import EnrollmentPolicies
from .enrollment import Enrollment
from .department import Department
from .enrollment_account import EnrollmentAccount
from .address import Address
from .billing_profile import BillingProfile
from .invoice_section import InvoiceSection
from .billing_account import BillingAccount
from .amount import Amount
from .pricesheet_download_response import PricesheetDownloadResponse
from .credit_balance_summary import CreditBalanceSummary
from .credit_summary import CreditSummary
from .event_summary import EventSummary
from .events import Events
from .lot_summary import LotSummary
from .lots import Lots
from .charge_summary_by_billing_account import ChargeSummaryByBillingAccount
from .charges_list_by_billing_account import ChargesListByBillingAccount
from .charge_summary_by_billing_profile import ChargeSummaryByBillingProfile
from .charges_list_by_billing_profile import ChargesListByBillingProfile
from .charge_summary_by_invoice_section import ChargeSummaryByInvoiceSection
from .charges_list_by_invoice_section import ChargesListByInvoiceSection
from .operation_display import OperationDisplay
from .operation import Operation
from .error_details import ErrorDetails
from .error_response import ErrorResponse, ErrorResponseException
from .proxy_resource import ProxyResource
from .resource import Resource
from .operation_paged import OperationPaged
from .consumption_management_client_enums import (
CategoryType,
TimeGrainType,
OperatorType,
Datagrain,
EventType,
LotSource,
)

__all__ = [
'MeterDetails',
'UsageDetail',
'Marketplace',
'ReservationSummaries',
'ReservationDetails',
'BudgetTimePeriod',
'Filters',
'CurrentSpend',
'Notification',
'Budget',
'ErrorDetails',
'ErrorResponse', 'ErrorResponseException',
'EnrollmentPolicies',
'Enrollment',
'Department',
'EnrollmentAccount',
'Address',
'BillingProfile',
'InvoiceSection',
'BillingAccount',
'Amount',
'PricesheetDownloadResponse',
'CreditBalanceSummary',
'CreditSummary',
'EventSummary',
'Events',
'LotSummary',
'Lots',
'ChargeSummaryByBillingAccount',
'ChargesListByBillingAccount',
'ChargeSummaryByBillingProfile',
'ChargesListByBillingProfile',
'ChargeSummaryByInvoiceSection',
'ChargesListByInvoiceSection',
'OperationDisplay',
'Operation',
'Resource',
'ErrorDetails',
'ErrorResponse', 'ErrorResponseException',
'ProxyResource',
'PriceSheetProperties',
'PriceSheetResult',
'UsageDetailPaged',
'MarketplacePaged',
'ReservationSummariesPaged',
'ReservationDetailsPaged',
'BudgetPaged',
'Resource',
'OperationPaged',
'CategoryType',
'TimeGrainType',
'OperatorType',
'Datagrain',
'EventType',
'LotSource',
]
56 changes: 56 additions & 0 deletions azure-mgmt-consumption/azure/mgmt/consumption/models/address.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# 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.serialization import Model


class Address(Model):
"""Address details.

:param address_line1: Address Line1.
:type address_line1: str
:param address_line2: Address Line2.
:type address_line2: str
:param address_line3: Address Line3.
:type address_line3: str
:param city: Address City.
:type city: str
:param region: Address Region.
:type region: str
:param country: Country code uses ISO2, 2-digit format..
:type country: str
:param postal_code: Postal Code.
:type postal_code: str
:param phone_number: Phone Number.
:type phone_number: str
"""

_attribute_map = {
'address_line1': {'key': 'addressLine1', 'type': 'str'},
'address_line2': {'key': 'addressLine2', 'type': 'str'},
'address_line3': {'key': 'addressLine3', 'type': 'str'},
'city': {'key': 'city', 'type': 'str'},
'region': {'key': 'region', 'type': 'str'},
'country': {'key': 'country', 'type': 'str'},
'postal_code': {'key': 'postalCode', 'type': 'str'},
'phone_number': {'key': 'phoneNumber', 'type': 'str'},
}

def __init__(self, **kwargs):
super(Address, self).__init__(**kwargs)
self.address_line1 = kwargs.get('address_line1', None)
self.address_line2 = kwargs.get('address_line2', None)
self.address_line3 = kwargs.get('address_line3', None)
self.city = kwargs.get('city', None)
self.region = kwargs.get('region', None)
self.country = kwargs.get('country', None)
self.postal_code = kwargs.get('postal_code', None)
self.phone_number = kwargs.get('phone_number', None)
Loading