diff --git a/sdk/billing/azure-mgmt-billing/MANIFEST.in b/sdk/billing/azure-mgmt-billing/MANIFEST.in index a3cb07df8765..3a9b6517412b 100644 --- a/sdk/billing/azure-mgmt-billing/MANIFEST.in +++ b/sdk/billing/azure-mgmt-billing/MANIFEST.in @@ -1,3 +1,4 @@ +include _meta.json recursive-include tests *.py *.yaml include *.md include azure/__init__.py diff --git a/sdk/billing/azure-mgmt-billing/_meta.json b/sdk/billing/azure-mgmt-billing/_meta.json new file mode 100644 index 000000000000..da307a4f7e4d --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/_meta.json @@ -0,0 +1,8 @@ +{ + "autorest": "V2", + "use": "@microsoft.azure/autorest.python@~4.0.71", + "commit": "b81bd01311671cd7ee35dfb39bb31df5d64b4dbe", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "autorest_command": "autorest specification/billing/resource-manager/readme.md --keep-version-file --multiapi --no-async --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --use=@microsoft.azure/autorest.python@~4.0.71 --version=V2", + "readme": "specification/billing/resource-manager/readme.md" +} \ No newline at end of file diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/_billing_management_client.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/_billing_management_client.py index 6498b84ca446..23b2528f695b 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/_billing_management_client.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/_billing_management_client.py @@ -31,6 +31,7 @@ from .operations import BillingRoleDefinitionsOperations from .operations import BillingRoleAssignmentsOperations from .operations import AgreementsOperations +from .operations import ReservationsOperations from .operations import EnrollmentAccountsOperations from .operations import BillingPeriodsOperations from . import models @@ -78,6 +79,8 @@ class BillingManagementClient(SDKClient): :vartype billing_role_assignments: azure.mgmt.billing.operations.BillingRoleAssignmentsOperations :ivar agreements: Agreements operations :vartype agreements: azure.mgmt.billing.operations.AgreementsOperations + :ivar reservations: Reservations operations + :vartype reservations: azure.mgmt.billing.operations.ReservationsOperations :ivar enrollment_accounts: EnrollmentAccounts operations :vartype enrollment_accounts: azure.mgmt.billing.operations.EnrollmentAccountsOperations :ivar billing_periods: BillingPeriods operations @@ -138,6 +141,8 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.agreements = AgreementsOperations( self._client, self.config, self._serialize, self._deserialize) + self.reservations = ReservationsOperations( + self._client, self.config, self._serialize, self._deserialize) self.enrollment_accounts = EnrollmentAccountsOperations( self._client, self.config, self._serialize, self._deserialize) self.billing_periods = BillingPeriodsOperations( diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py index 1fe2d4a2985e..c7a540d5e23e 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py @@ -54,6 +54,11 @@ from ._models_py3 import Product from ._models_py3 import RebillDetails from ._models_py3 import Reseller + from ._models_py3 import Reservation + from ._models_py3 import ReservationPropertyUtilization + from ._models_py3 import ReservationSkuProperty + from ._models_py3 import ReservationSummary + from ._models_py3 import ReservationUtilizationAggregates from ._models_py3 import Resource from ._models_py3 import Transaction from ._models_py3 import TransferBillingSubscriptionRequestProperties @@ -108,6 +113,11 @@ from ._models import Product from ._models import RebillDetails from ._models import Reseller + from ._models import Reservation + from ._models import ReservationPropertyUtilization + from ._models import ReservationSkuProperty + from ._models import ReservationSummary + from ._models import ReservationUtilizationAggregates from ._models import Resource from ._models import Transaction from ._models import TransferBillingSubscriptionRequestProperties @@ -133,6 +143,7 @@ from ._paged_models import InvoiceSectionWithCreateSubPermissionPaged from ._paged_models import OperationPaged from ._paged_models import ProductPaged +from ._paged_models import ReservationPaged from ._paged_models import TransactionPaged from ._billing_management_client_enums import ( AddressValidationStatus, @@ -216,6 +227,11 @@ 'Product', 'RebillDetails', 'Reseller', + 'Reservation', + 'ReservationPropertyUtilization', + 'ReservationSkuProperty', + 'ReservationSummary', + 'ReservationUtilizationAggregates', 'Resource', 'Transaction', 'TransferBillingSubscriptionRequestProperties', @@ -240,6 +256,7 @@ 'BillingRoleDefinitionPaged', 'BillingRoleAssignmentPaged', 'AgreementPaged', + 'ReservationPaged', 'EnrollmentAccountSummaryPaged', 'BillingPeriodPaged', 'AddressValidationStatus', diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/_billing_management_client_enums.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/_billing_management_client_enums.py index 52b9d53545ed..b8c12d6566d0 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/_billing_management_client_enums.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/_billing_management_client_enums.py @@ -20,14 +20,26 @@ class AddressValidationStatus(str, Enum): class SubscriptionTransferValidationErrorCode(str, Enum): + billing_account_inactive = "BillingAccountInactive" + cross_billing_account_not_allowed = "CrossBillingAccountNotAllowed" + destination_billing_profile_inactive = "DestinationBillingProfileInactive" + destination_billing_profile_not_found = "DestinationBillingProfileNotFound" + destination_billing_profile_past_due = "DestinationBillingProfilePastDue" + destination_invoice_section_inactive = "DestinationInvoiceSectionInactive" + destination_invoice_section_not_found = "DestinationInvoiceSectionNotFound" + insufficient_permission_on_destination = "InsufficientPermissionOnDestination" + insufficient_permission_on_source = "InsufficientPermissionOnSource" + invalid_destination = "InvalidDestination" invalid_source = "InvalidSource" + marketplace_not_enabled_on_destination = "MarketplaceNotEnabledOnDestination" + not_available_for_destination_market = "NotAvailableForDestinationMarket" + product_inactive = "ProductInactive" + product_not_found = "ProductNotFound" + product_type_not_supported = "ProductTypeNotSupported" + source_billing_profile_past_due = "SourceBillingProfilePastDue" + source_invoice_section_inactive = "SourceInvoiceSectionInactive" subscription_not_active = "SubscriptionNotActive" - insufficient_permission_on_source = "InsufficientPermissionOnSource" - insufficient_permission_on_destination = "InsufficientPermissionOnDestination" - destination_billing_profile_past_due = "DestinationBillingProfilePastDue" subscription_type_not_supported = "SubscriptionTypeNotSupported" - cross_billing_account_not_allowed = "CrossBillingAccountNotAllowed" - not_available_for_destination_market = "NotAvailableForDestinationMarket" class AgreementType(str, Enum): diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/_models.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/_models.py index 9a2a589e732c..a12e4aff6e9d 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/_models.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/_models.py @@ -20,6 +20,8 @@ class AddressDetails(Model): :param first_name: First name. :type first_name: str + :param middle_name: Middle name. + :type middle_name: str :param last_name: Last name. :type last_name: str :param company_name: Company name. @@ -53,6 +55,7 @@ class AddressDetails(Model): _attribute_map = { 'first_name': {'key': 'firstName', 'type': 'str'}, + 'middle_name': {'key': 'middleName', 'type': 'str'}, 'last_name': {'key': 'lastName', 'type': 'str'}, 'company_name': {'key': 'companyName', 'type': 'str'}, 'address_line1': {'key': 'addressLine1', 'type': 'str'}, @@ -70,6 +73,7 @@ class AddressDetails(Model): def __init__(self, **kwargs): super(AddressDetails, self).__init__(**kwargs) self.first_name = kwargs.get('first_name', None) + self.middle_name = kwargs.get('middle_name', None) self.last_name = kwargs.get('last_name', None) self.company_name = kwargs.get('company_name', None) self.address_line1 = kwargs.get('address_line1', None) @@ -318,6 +322,9 @@ class BillingAccount(Resource): :ivar has_read_access: Indicates whether user has read access to the billing account. :vartype has_read_access: bool + :param notification_email_address: Notification email address, only for + legacy accounts + :type notification_email_address: str """ _validation = { @@ -345,6 +352,7 @@ class BillingAccount(Resource): 'departments': {'key': 'properties.departments', 'type': '[Department]'}, 'enrollment_accounts': {'key': 'properties.enrollmentAccounts', 'type': '[EnrollmentAccount]'}, 'has_read_access': {'key': 'properties.hasReadAccess', 'type': 'bool'}, + 'notification_email_address': {'key': 'properties.notificationEmailAddress', 'type': 'str'}, } def __init__(self, **kwargs): @@ -359,6 +367,7 @@ def __init__(self, **kwargs): self.departments = kwargs.get('departments', None) self.enrollment_accounts = kwargs.get('enrollment_accounts', None) self.has_read_access = None + self.notification_email_address = kwargs.get('notification_email_address', None) class BillingAccountUpdateRequest(Model): @@ -399,6 +408,9 @@ class BillingAccountUpdateRequest(Model): :ivar has_read_access: Indicates whether user has read access to the billing account. :vartype has_read_access: bool + :param notification_email_address: Notification email address, only for + legacy accounts + :type notification_email_address: str """ _validation = { @@ -420,6 +432,7 @@ class BillingAccountUpdateRequest(Model): 'departments': {'key': 'properties.departments', 'type': '[Department]'}, 'enrollment_accounts': {'key': 'properties.enrollmentAccounts', 'type': '[EnrollmentAccount]'}, 'has_read_access': {'key': 'properties.hasReadAccess', 'type': 'bool'}, + 'notification_email_address': {'key': 'properties.notificationEmailAddress', 'type': 'str'}, } def __init__(self, **kwargs): @@ -434,6 +447,7 @@ def __init__(self, **kwargs): self.departments = kwargs.get('departments', None) self.enrollment_accounts = kwargs.get('enrollment_accounts', None) self.has_read_access = None + self.notification_email_address = kwargs.get('notification_email_address', None) class BillingPeriod(Resource): @@ -579,6 +593,8 @@ class BillingProfile(Resource): clouds. :vartype target_clouds: list[str or ~azure.mgmt.billing.models.TargetCloud] + :param tags: Tags of billing profiles. + :type tags: dict[str, str] """ _validation = { @@ -617,6 +633,7 @@ class BillingProfile(Resource): 'status_reason_code': {'key': 'properties.statusReasonCode', 'type': 'str'}, 'spending_limit': {'key': 'properties.spendingLimit', 'type': 'str'}, 'target_clouds': {'key': 'properties.targetClouds', 'type': '[str]'}, + 'tags': {'key': 'properties.tags', 'type': '{str}'}, } def __init__(self, **kwargs): @@ -637,6 +654,7 @@ def __init__(self, **kwargs): self.status_reason_code = None self.spending_limit = None self.target_clouds = None + self.tags = kwargs.get('tags', None) class BillingProfileCreationRequest(Model): @@ -1365,6 +1383,8 @@ class EnrollmentAccount(Resource): :type cost_center: str :param account_owner: The owner of the enrollment account. :type account_owner: str + :param account_owner_email: The enrollment account owner email address. + :type account_owner_email: str :param status: The status of the enrollment account. :type status: str :param start_date: The start date of the enrollment account. @@ -1389,6 +1409,7 @@ class EnrollmentAccount(Resource): 'account_name': {'key': 'properties.accountName', 'type': 'str'}, 'cost_center': {'key': 'properties.costCenter', 'type': 'str'}, 'account_owner': {'key': 'properties.accountOwner', 'type': 'str'}, + 'account_owner_email': {'key': 'properties.accountOwnerEmail', 'type': 'str'}, 'status': {'key': 'properties.status', 'type': 'str'}, 'start_date': {'key': 'properties.startDate', 'type': 'iso-8601'}, 'end_date': {'key': 'properties.endDate', 'type': 'iso-8601'}, @@ -1400,6 +1421,7 @@ def __init__(self, **kwargs): self.account_name = kwargs.get('account_name', None) self.cost_center = kwargs.get('cost_center', None) self.account_owner = kwargs.get('account_owner', None) + self.account_owner_email = kwargs.get('account_owner_email', None) self.status = kwargs.get('status', None) self.start_date = kwargs.get('start_date', None) self.end_date = kwargs.get('end_date', None) @@ -1482,9 +1504,9 @@ class EnrollmentPolicies(Model): :ivar department_admin_view_charges: The policy that controls whether Department Administrators can view charges. :vartype department_admin_view_charges: bool - :ivar marketplaces_enabled: The policy that controls whether Azure + :ivar marketplace_enabled: The policy that controls whether Azure marketplace purchases are allowed in the enrollment. - :vartype marketplaces_enabled: bool + :vartype marketplace_enabled: bool :ivar reserved_instances_enabled: The policy that controls whether Azure reservation purchases are allowed in the enrollment. :vartype reserved_instances_enabled: bool @@ -1493,14 +1515,14 @@ class EnrollmentPolicies(Model): _validation = { 'account_owner_view_charges': {'readonly': True}, 'department_admin_view_charges': {'readonly': True}, - 'marketplaces_enabled': {'readonly': True}, + 'marketplace_enabled': {'readonly': True}, 'reserved_instances_enabled': {'readonly': True}, } _attribute_map = { 'account_owner_view_charges': {'key': 'accountOwnerViewCharges', 'type': 'bool'}, 'department_admin_view_charges': {'key': 'departmentAdminViewCharges', 'type': 'bool'}, - 'marketplaces_enabled': {'key': 'marketplacesEnabled', 'type': 'bool'}, + 'marketplace_enabled': {'key': 'marketplaceEnabled', 'type': 'bool'}, 'reserved_instances_enabled': {'key': 'reservedInstancesEnabled', 'type': 'bool'}, } @@ -1508,7 +1530,7 @@ def __init__(self, **kwargs): super(EnrollmentPolicies, self).__init__(**kwargs) self.account_owner_view_charges = None self.department_admin_view_charges = None - self.marketplaces_enabled = None + self.marketplace_enabled = None self.reserved_instances_enabled = None @@ -2069,22 +2091,27 @@ class Operation(Model): :ivar name: Operation name: {provider}/{resource}/{operation}. :vartype name: str + :ivar is_data_action: Identifies if the operation is a data operation. + :vartype is_data_action: bool :param display: The object that represents the operation. :type display: ~azure.mgmt.billing.models.OperationDisplay """ _validation = { 'name': {'readonly': True}, + 'is_data_action': {'readonly': True}, } _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, 'display': {'key': 'display', 'type': 'OperationDisplay'}, } def __init__(self, **kwargs): super(Operation, self).__init__(**kwargs) self.name = None + self.is_data_action = None self.display = kwargs.get('display', None) @@ -2101,18 +2128,22 @@ class OperationDisplay(Model): :vartype resource: str :ivar operation: Operation type such as read, write and delete. :vartype operation: str + :ivar description: Description of operation. + :vartype description: str """ _validation = { 'provider': {'readonly': True}, 'resource': {'readonly': True}, 'operation': {'readonly': True}, + 'description': {'readonly': True}, } _attribute_map = { 'provider': {'key': 'provider', 'type': 'str'}, 'resource': {'key': 'resource', 'type': 'str'}, 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, } def __init__(self, **kwargs): @@ -2120,6 +2151,7 @@ def __init__(self, **kwargs): self.provider = None self.resource = None self.operation = None + self.description = None class Participants(Model): @@ -2461,6 +2493,277 @@ def __init__(self, **kwargs): self.description = None +class Reservation(Model): + """The definition of the reservation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The id of the reservation. + :vartype id: str + :ivar name: The name of the reservation. + :vartype name: str + :ivar type: The type of the reservation. + :vartype type: str + :ivar location: The location of the reservation. + :vartype location: str + :param sku: The sku information associated to this reservation + :type sku: ~azure.mgmt.billing.models.ReservationSkuProperty + :param applied_scopes: The array of applied scopes of a reservation. Will + be null if the reservation is in Shared scope + :type applied_scopes: list[str] + :ivar applied_scope_type: The applied scope type of the reservation. + :vartype applied_scope_type: str + :ivar reserved_resource_type: The reserved source type of the reservation, + e.g. virtual machine. + :vartype reserved_resource_type: str + :ivar quantity: The number of the reservation. + :vartype quantity: float + :ivar provisioning_state: The provisioning state of the reservation, e.g. + Succeeded + :vartype provisioning_state: str + :ivar expiry_date: The expiry date of the reservation + :vartype expiry_date: str + :ivar provisioning_sub_state: The provisioning state of the reservation, + e.g. Succeeded + :vartype provisioning_sub_state: str + :ivar display_name: The display name of the reservation + :vartype display_name: str + :ivar display_provisioning_state: The provisioning state of the + reservation for display, e.g. Succeeded + :vartype display_provisioning_state: str + :ivar user_friendly_renew_state: The renew state of the reservation for + display, e.g. On + :vartype user_friendly_renew_state: str + :ivar user_friendly_applied_scope_type: The applied scope type of the + reservation for display, e.g. Shared + :vartype user_friendly_applied_scope_type: str + :ivar effective_date_time: The effective date time of the reservation + :vartype effective_date_time: str + :ivar sku_description: The sku description of the reservation + :vartype sku_description: str + :ivar term: The term of the reservation, e.g. P1Y + :vartype term: str + :ivar renew: The renew state of the reservation + :vartype renew: bool + :ivar renew_source: The renew source of the reservation + :vartype renew_source: str + :ivar utilization: Reservation utilization + :vartype utilization: + ~azure.mgmt.billing.models.ReservationPropertyUtilization + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'readonly': True}, + 'applied_scope_type': {'readonly': True}, + 'reserved_resource_type': {'readonly': True}, + 'quantity': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'expiry_date': {'readonly': True}, + 'provisioning_sub_state': {'readonly': True}, + 'display_name': {'readonly': True}, + 'display_provisioning_state': {'readonly': True}, + 'user_friendly_renew_state': {'readonly': True}, + 'user_friendly_applied_scope_type': {'readonly': True}, + 'effective_date_time': {'readonly': True}, + 'sku_description': {'readonly': True}, + 'term': {'readonly': True}, + 'renew': {'readonly': True}, + 'renew_source': {'readonly': True}, + 'utilization': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'ReservationSkuProperty'}, + 'applied_scopes': {'key': 'properties.appliedScopes', 'type': '[str]'}, + 'applied_scope_type': {'key': 'properties.appliedScopeType', 'type': 'str'}, + 'reserved_resource_type': {'key': 'properties.reservedResourceType', 'type': 'str'}, + 'quantity': {'key': 'properties.quantity', 'type': 'float'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'expiry_date': {'key': 'properties.expiryDate', 'type': 'str'}, + 'provisioning_sub_state': {'key': 'properties.provisioningSubState', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'display_provisioning_state': {'key': 'properties.displayProvisioningState', 'type': 'str'}, + 'user_friendly_renew_state': {'key': 'properties.userFriendlyRenewState', 'type': 'str'}, + 'user_friendly_applied_scope_type': {'key': 'properties.userFriendlyAppliedScopeType', 'type': 'str'}, + 'effective_date_time': {'key': 'properties.effectiveDateTime', 'type': 'str'}, + 'sku_description': {'key': 'properties.skuDescription', 'type': 'str'}, + 'term': {'key': 'properties.term', 'type': 'str'}, + 'renew': {'key': 'properties.renew', 'type': 'bool'}, + 'renew_source': {'key': 'properties.renewSource', 'type': 'str'}, + 'utilization': {'key': 'properties.utilization', 'type': 'ReservationPropertyUtilization'}, + } + + def __init__(self, **kwargs): + super(Reservation, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = None + self.sku = kwargs.get('sku', None) + self.applied_scopes = kwargs.get('applied_scopes', None) + self.applied_scope_type = None + self.reserved_resource_type = None + self.quantity = None + self.provisioning_state = None + self.expiry_date = None + self.provisioning_sub_state = None + self.display_name = None + self.display_provisioning_state = None + self.user_friendly_renew_state = None + self.user_friendly_applied_scope_type = None + self.effective_date_time = None + self.sku_description = None + self.term = None + self.renew = None + self.renew_source = None + self.utilization = None + + +class ReservationPropertyUtilization(Model): + """Reservation utilization. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar trend: The number of days trend for a reservation + :vartype trend: str + :param aggregates: The array of aggregates of a reservation's utilization + :type aggregates: + list[~azure.mgmt.billing.models.ReservationUtilizationAggregates] + """ + + _validation = { + 'trend': {'readonly': True}, + } + + _attribute_map = { + 'trend': {'key': 'trend', 'type': 'str'}, + 'aggregates': {'key': 'aggregates', 'type': '[ReservationUtilizationAggregates]'}, + } + + def __init__(self, **kwargs): + super(ReservationPropertyUtilization, self).__init__(**kwargs) + self.trend = None + self.aggregates = kwargs.get('aggregates', None) + + +class ReservationSkuProperty(Model): + """The property of reservation sku object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of the reservation sku. + :vartype name: str + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ReservationSkuProperty, self).__init__(**kwargs) + self.name = None + + +class ReservationSummary(Model): + """The roll up count summary of reservations in each state. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar succeeded_count: The number of reservation in Succeeded state + :vartype succeeded_count: float + :ivar failed_count: The number of reservation in Failed state + :vartype failed_count: float + :ivar expiring_count: The number of reservation in Expiring state + :vartype expiring_count: float + :ivar expired_count: The number of reservation in Expired state + :vartype expired_count: float + :ivar pending_count: The number of reservation in Pending state + :vartype pending_count: float + :ivar cancelled_count: The number of reservation in Cancelled state + :vartype cancelled_count: float + """ + + _validation = { + 'succeeded_count': {'readonly': True}, + 'failed_count': {'readonly': True}, + 'expiring_count': {'readonly': True}, + 'expired_count': {'readonly': True}, + 'pending_count': {'readonly': True}, + 'cancelled_count': {'readonly': True}, + } + + _attribute_map = { + 'succeeded_count': {'key': 'succeededCount', 'type': 'float'}, + 'failed_count': {'key': 'failedCount', 'type': 'float'}, + 'expiring_count': {'key': 'expiringCount', 'type': 'float'}, + 'expired_count': {'key': 'expiredCount', 'type': 'float'}, + 'pending_count': {'key': 'pendingCount', 'type': 'float'}, + 'cancelled_count': {'key': 'cancelledCount', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(ReservationSummary, self).__init__(**kwargs) + self.succeeded_count = None + self.failed_count = None + self.expiring_count = None + self.expired_count = None + self.pending_count = None + self.cancelled_count = None + + +class ReservationUtilizationAggregates(Model): + """The aggregate values of reservation utilization. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar grain: The grain of the aggregate + :vartype grain: float + :ivar grain_unit: The grain unit of the aggregate + :vartype grain_unit: str + :ivar value: The aggregate value + :vartype value: float + :ivar value_unit: The aggregate value unit + :vartype value_unit: str + """ + + _validation = { + 'grain': {'readonly': True}, + 'grain_unit': {'readonly': True}, + 'value': {'readonly': True}, + 'value_unit': {'readonly': True}, + } + + _attribute_map = { + 'grain': {'key': 'grain', 'type': 'float'}, + 'grain_unit': {'key': 'grainUnit', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'float'}, + 'value_unit': {'key': 'valueUnit', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ReservationUtilizationAggregates, self).__init__(**kwargs) + self.grain = None + self.grain_unit = None + self.value = None + self.value_unit = None + + class Transaction(Resource): """A transaction. @@ -2828,10 +3131,16 @@ class ValidateSubscriptionTransferEligibilityError(Model): """Error details of the transfer eligibility validation. :param code: Error code for the product transfer validation. Possible - values include: 'InvalidSource', 'SubscriptionNotActive', - 'InsufficientPermissionOnSource', 'InsufficientPermissionOnDestination', - 'DestinationBillingProfilePastDue', 'SubscriptionTypeNotSupported', - 'CrossBillingAccountNotAllowed', 'NotAvailableForDestinationMarket' + values include: 'BillingAccountInactive', 'CrossBillingAccountNotAllowed', + 'DestinationBillingProfileInactive', 'DestinationBillingProfileNotFound', + 'DestinationBillingProfilePastDue', 'DestinationInvoiceSectionInactive', + 'DestinationInvoiceSectionNotFound', + 'InsufficientPermissionOnDestination', 'InsufficientPermissionOnSource', + 'InvalidDestination', 'InvalidSource', + 'MarketplaceNotEnabledOnDestination', 'NotAvailableForDestinationMarket', + 'ProductInactive', 'ProductNotFound', 'ProductTypeNotSupported', + 'SourceBillingProfilePastDue', 'SourceInvoiceSectionInactive', + 'SubscriptionNotActive', 'SubscriptionTypeNotSupported' :type code: str or ~azure.mgmt.billing.models.SubscriptionTransferValidationErrorCode :param message: The error message. diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/_models_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/_models_py3.py index 995bf4c4e743..4b8b1aa1abbb 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/_models_py3.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/_models_py3.py @@ -20,6 +20,8 @@ class AddressDetails(Model): :param first_name: First name. :type first_name: str + :param middle_name: Middle name. + :type middle_name: str :param last_name: Last name. :type last_name: str :param company_name: Company name. @@ -53,6 +55,7 @@ class AddressDetails(Model): _attribute_map = { 'first_name': {'key': 'firstName', 'type': 'str'}, + 'middle_name': {'key': 'middleName', 'type': 'str'}, 'last_name': {'key': 'lastName', 'type': 'str'}, 'company_name': {'key': 'companyName', 'type': 'str'}, 'address_line1': {'key': 'addressLine1', 'type': 'str'}, @@ -67,9 +70,10 @@ class AddressDetails(Model): 'phone_number': {'key': 'phoneNumber', 'type': 'str'}, } - def __init__(self, *, address_line1: str, country: str, first_name: str=None, last_name: str=None, company_name: str=None, address_line2: str=None, address_line3: str=None, city: str=None, district: str=None, region: str=None, postal_code: str=None, email: str=None, phone_number: str=None, **kwargs) -> None: + def __init__(self, *, address_line1: str, country: str, first_name: str=None, middle_name: str=None, last_name: str=None, company_name: str=None, address_line2: str=None, address_line3: str=None, city: str=None, district: str=None, region: str=None, postal_code: str=None, email: str=None, phone_number: str=None, **kwargs) -> None: super(AddressDetails, self).__init__(**kwargs) self.first_name = first_name + self.middle_name = middle_name self.last_name = last_name self.company_name = company_name self.address_line1 = address_line1 @@ -318,6 +322,9 @@ class BillingAccount(Resource): :ivar has_read_access: Indicates whether user has read access to the billing account. :vartype has_read_access: bool + :param notification_email_address: Notification email address, only for + legacy accounts + :type notification_email_address: str """ _validation = { @@ -345,9 +352,10 @@ class BillingAccount(Resource): 'departments': {'key': 'properties.departments', 'type': '[Department]'}, 'enrollment_accounts': {'key': 'properties.enrollmentAccounts', 'type': '[EnrollmentAccount]'}, 'has_read_access': {'key': 'properties.hasReadAccess', 'type': 'bool'}, + 'notification_email_address': {'key': 'properties.notificationEmailAddress', 'type': 'str'}, } - def __init__(self, *, display_name: str=None, sold_to=None, billing_profiles=None, departments=None, enrollment_accounts=None, **kwargs) -> None: + def __init__(self, *, display_name: str=None, sold_to=None, billing_profiles=None, departments=None, enrollment_accounts=None, notification_email_address: str=None, **kwargs) -> None: super(BillingAccount, self).__init__(**kwargs) self.display_name = display_name self.sold_to = sold_to @@ -359,6 +367,7 @@ def __init__(self, *, display_name: str=None, sold_to=None, billing_profiles=Non self.departments = departments self.enrollment_accounts = enrollment_accounts self.has_read_access = None + self.notification_email_address = notification_email_address class BillingAccountUpdateRequest(Model): @@ -399,6 +408,9 @@ class BillingAccountUpdateRequest(Model): :ivar has_read_access: Indicates whether user has read access to the billing account. :vartype has_read_access: bool + :param notification_email_address: Notification email address, only for + legacy accounts + :type notification_email_address: str """ _validation = { @@ -420,9 +432,10 @@ class BillingAccountUpdateRequest(Model): 'departments': {'key': 'properties.departments', 'type': '[Department]'}, 'enrollment_accounts': {'key': 'properties.enrollmentAccounts', 'type': '[EnrollmentAccount]'}, 'has_read_access': {'key': 'properties.hasReadAccess', 'type': 'bool'}, + 'notification_email_address': {'key': 'properties.notificationEmailAddress', 'type': 'str'}, } - def __init__(self, *, display_name: str=None, sold_to=None, billing_profiles=None, departments=None, enrollment_accounts=None, **kwargs) -> None: + def __init__(self, *, display_name: str=None, sold_to=None, billing_profiles=None, departments=None, enrollment_accounts=None, notification_email_address: str=None, **kwargs) -> None: super(BillingAccountUpdateRequest, self).__init__(**kwargs) self.display_name = display_name self.sold_to = sold_to @@ -434,6 +447,7 @@ def __init__(self, *, display_name: str=None, sold_to=None, billing_profiles=Non self.departments = departments self.enrollment_accounts = enrollment_accounts self.has_read_access = None + self.notification_email_address = notification_email_address class BillingPeriod(Resource): @@ -579,6 +593,8 @@ class BillingProfile(Resource): clouds. :vartype target_clouds: list[str or ~azure.mgmt.billing.models.TargetCloud] + :param tags: Tags of billing profiles. + :type tags: dict[str, str] """ _validation = { @@ -617,9 +633,10 @@ class BillingProfile(Resource): 'status_reason_code': {'key': 'properties.statusReasonCode', 'type': 'str'}, 'spending_limit': {'key': 'properties.spendingLimit', 'type': 'str'}, 'target_clouds': {'key': 'properties.targetClouds', 'type': '[str]'}, + 'tags': {'key': 'properties.tags', 'type': '{str}'}, } - def __init__(self, *, display_name: str=None, po_number: str=None, bill_to=None, invoice_email_opt_in: bool=None, enabled_azure_plans=None, invoice_sections=None, **kwargs) -> None: + def __init__(self, *, display_name: str=None, po_number: str=None, bill_to=None, invoice_email_opt_in: bool=None, enabled_azure_plans=None, invoice_sections=None, tags=None, **kwargs) -> None: super(BillingProfile, self).__init__(**kwargs) self.display_name = display_name self.po_number = po_number @@ -637,6 +654,7 @@ def __init__(self, *, display_name: str=None, po_number: str=None, bill_to=None, self.status_reason_code = None self.spending_limit = None self.target_clouds = None + self.tags = tags class BillingProfileCreationRequest(Model): @@ -1365,6 +1383,8 @@ class EnrollmentAccount(Resource): :type cost_center: str :param account_owner: The owner of the enrollment account. :type account_owner: str + :param account_owner_email: The enrollment account owner email address. + :type account_owner_email: str :param status: The status of the enrollment account. :type status: str :param start_date: The start date of the enrollment account. @@ -1389,17 +1409,19 @@ class EnrollmentAccount(Resource): 'account_name': {'key': 'properties.accountName', 'type': 'str'}, 'cost_center': {'key': 'properties.costCenter', 'type': 'str'}, 'account_owner': {'key': 'properties.accountOwner', 'type': 'str'}, + 'account_owner_email': {'key': 'properties.accountOwnerEmail', 'type': 'str'}, 'status': {'key': 'properties.status', 'type': 'str'}, 'start_date': {'key': 'properties.startDate', 'type': 'iso-8601'}, 'end_date': {'key': 'properties.endDate', 'type': 'iso-8601'}, 'department': {'key': 'properties.department', 'type': 'Department'}, } - def __init__(self, *, account_name: str=None, cost_center: str=None, account_owner: str=None, status: str=None, start_date=None, end_date=None, department=None, **kwargs) -> None: + def __init__(self, *, account_name: str=None, cost_center: str=None, account_owner: str=None, account_owner_email: str=None, status: str=None, start_date=None, end_date=None, department=None, **kwargs) -> None: super(EnrollmentAccount, self).__init__(**kwargs) self.account_name = account_name self.cost_center = cost_center self.account_owner = account_owner + self.account_owner_email = account_owner_email self.status = status self.start_date = start_date self.end_date = end_date @@ -1482,9 +1504,9 @@ class EnrollmentPolicies(Model): :ivar department_admin_view_charges: The policy that controls whether Department Administrators can view charges. :vartype department_admin_view_charges: bool - :ivar marketplaces_enabled: The policy that controls whether Azure + :ivar marketplace_enabled: The policy that controls whether Azure marketplace purchases are allowed in the enrollment. - :vartype marketplaces_enabled: bool + :vartype marketplace_enabled: bool :ivar reserved_instances_enabled: The policy that controls whether Azure reservation purchases are allowed in the enrollment. :vartype reserved_instances_enabled: bool @@ -1493,14 +1515,14 @@ class EnrollmentPolicies(Model): _validation = { 'account_owner_view_charges': {'readonly': True}, 'department_admin_view_charges': {'readonly': True}, - 'marketplaces_enabled': {'readonly': True}, + 'marketplace_enabled': {'readonly': True}, 'reserved_instances_enabled': {'readonly': True}, } _attribute_map = { 'account_owner_view_charges': {'key': 'accountOwnerViewCharges', 'type': 'bool'}, 'department_admin_view_charges': {'key': 'departmentAdminViewCharges', 'type': 'bool'}, - 'marketplaces_enabled': {'key': 'marketplacesEnabled', 'type': 'bool'}, + 'marketplace_enabled': {'key': 'marketplaceEnabled', 'type': 'bool'}, 'reserved_instances_enabled': {'key': 'reservedInstancesEnabled', 'type': 'bool'}, } @@ -1508,7 +1530,7 @@ def __init__(self, **kwargs) -> None: super(EnrollmentPolicies, self).__init__(**kwargs) self.account_owner_view_charges = None self.department_admin_view_charges = None - self.marketplaces_enabled = None + self.marketplace_enabled = None self.reserved_instances_enabled = None @@ -2069,22 +2091,27 @@ class Operation(Model): :ivar name: Operation name: {provider}/{resource}/{operation}. :vartype name: str + :ivar is_data_action: Identifies if the operation is a data operation. + :vartype is_data_action: bool :param display: The object that represents the operation. :type display: ~azure.mgmt.billing.models.OperationDisplay """ _validation = { 'name': {'readonly': True}, + 'is_data_action': {'readonly': True}, } _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, 'display': {'key': 'display', 'type': 'OperationDisplay'}, } def __init__(self, *, display=None, **kwargs) -> None: super(Operation, self).__init__(**kwargs) self.name = None + self.is_data_action = None self.display = display @@ -2101,18 +2128,22 @@ class OperationDisplay(Model): :vartype resource: str :ivar operation: Operation type such as read, write and delete. :vartype operation: str + :ivar description: Description of operation. + :vartype description: str """ _validation = { 'provider': {'readonly': True}, 'resource': {'readonly': True}, 'operation': {'readonly': True}, + 'description': {'readonly': True}, } _attribute_map = { 'provider': {'key': 'provider', 'type': 'str'}, 'resource': {'key': 'resource', 'type': 'str'}, 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, } def __init__(self, **kwargs) -> None: @@ -2120,6 +2151,7 @@ def __init__(self, **kwargs) -> None: self.provider = None self.resource = None self.operation = None + self.description = None class Participants(Model): @@ -2461,6 +2493,277 @@ def __init__(self, **kwargs) -> None: self.description = None +class Reservation(Model): + """The definition of the reservation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The id of the reservation. + :vartype id: str + :ivar name: The name of the reservation. + :vartype name: str + :ivar type: The type of the reservation. + :vartype type: str + :ivar location: The location of the reservation. + :vartype location: str + :param sku: The sku information associated to this reservation + :type sku: ~azure.mgmt.billing.models.ReservationSkuProperty + :param applied_scopes: The array of applied scopes of a reservation. Will + be null if the reservation is in Shared scope + :type applied_scopes: list[str] + :ivar applied_scope_type: The applied scope type of the reservation. + :vartype applied_scope_type: str + :ivar reserved_resource_type: The reserved source type of the reservation, + e.g. virtual machine. + :vartype reserved_resource_type: str + :ivar quantity: The number of the reservation. + :vartype quantity: float + :ivar provisioning_state: The provisioning state of the reservation, e.g. + Succeeded + :vartype provisioning_state: str + :ivar expiry_date: The expiry date of the reservation + :vartype expiry_date: str + :ivar provisioning_sub_state: The provisioning state of the reservation, + e.g. Succeeded + :vartype provisioning_sub_state: str + :ivar display_name: The display name of the reservation + :vartype display_name: str + :ivar display_provisioning_state: The provisioning state of the + reservation for display, e.g. Succeeded + :vartype display_provisioning_state: str + :ivar user_friendly_renew_state: The renew state of the reservation for + display, e.g. On + :vartype user_friendly_renew_state: str + :ivar user_friendly_applied_scope_type: The applied scope type of the + reservation for display, e.g. Shared + :vartype user_friendly_applied_scope_type: str + :ivar effective_date_time: The effective date time of the reservation + :vartype effective_date_time: str + :ivar sku_description: The sku description of the reservation + :vartype sku_description: str + :ivar term: The term of the reservation, e.g. P1Y + :vartype term: str + :ivar renew: The renew state of the reservation + :vartype renew: bool + :ivar renew_source: The renew source of the reservation + :vartype renew_source: str + :ivar utilization: Reservation utilization + :vartype utilization: + ~azure.mgmt.billing.models.ReservationPropertyUtilization + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'readonly': True}, + 'applied_scope_type': {'readonly': True}, + 'reserved_resource_type': {'readonly': True}, + 'quantity': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'expiry_date': {'readonly': True}, + 'provisioning_sub_state': {'readonly': True}, + 'display_name': {'readonly': True}, + 'display_provisioning_state': {'readonly': True}, + 'user_friendly_renew_state': {'readonly': True}, + 'user_friendly_applied_scope_type': {'readonly': True}, + 'effective_date_time': {'readonly': True}, + 'sku_description': {'readonly': True}, + 'term': {'readonly': True}, + 'renew': {'readonly': True}, + 'renew_source': {'readonly': True}, + 'utilization': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'ReservationSkuProperty'}, + 'applied_scopes': {'key': 'properties.appliedScopes', 'type': '[str]'}, + 'applied_scope_type': {'key': 'properties.appliedScopeType', 'type': 'str'}, + 'reserved_resource_type': {'key': 'properties.reservedResourceType', 'type': 'str'}, + 'quantity': {'key': 'properties.quantity', 'type': 'float'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'expiry_date': {'key': 'properties.expiryDate', 'type': 'str'}, + 'provisioning_sub_state': {'key': 'properties.provisioningSubState', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'display_provisioning_state': {'key': 'properties.displayProvisioningState', 'type': 'str'}, + 'user_friendly_renew_state': {'key': 'properties.userFriendlyRenewState', 'type': 'str'}, + 'user_friendly_applied_scope_type': {'key': 'properties.userFriendlyAppliedScopeType', 'type': 'str'}, + 'effective_date_time': {'key': 'properties.effectiveDateTime', 'type': 'str'}, + 'sku_description': {'key': 'properties.skuDescription', 'type': 'str'}, + 'term': {'key': 'properties.term', 'type': 'str'}, + 'renew': {'key': 'properties.renew', 'type': 'bool'}, + 'renew_source': {'key': 'properties.renewSource', 'type': 'str'}, + 'utilization': {'key': 'properties.utilization', 'type': 'ReservationPropertyUtilization'}, + } + + def __init__(self, *, sku=None, applied_scopes=None, **kwargs) -> None: + super(Reservation, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = None + self.sku = sku + self.applied_scopes = applied_scopes + self.applied_scope_type = None + self.reserved_resource_type = None + self.quantity = None + self.provisioning_state = None + self.expiry_date = None + self.provisioning_sub_state = None + self.display_name = None + self.display_provisioning_state = None + self.user_friendly_renew_state = None + self.user_friendly_applied_scope_type = None + self.effective_date_time = None + self.sku_description = None + self.term = None + self.renew = None + self.renew_source = None + self.utilization = None + + +class ReservationPropertyUtilization(Model): + """Reservation utilization. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar trend: The number of days trend for a reservation + :vartype trend: str + :param aggregates: The array of aggregates of a reservation's utilization + :type aggregates: + list[~azure.mgmt.billing.models.ReservationUtilizationAggregates] + """ + + _validation = { + 'trend': {'readonly': True}, + } + + _attribute_map = { + 'trend': {'key': 'trend', 'type': 'str'}, + 'aggregates': {'key': 'aggregates', 'type': '[ReservationUtilizationAggregates]'}, + } + + def __init__(self, *, aggregates=None, **kwargs) -> None: + super(ReservationPropertyUtilization, self).__init__(**kwargs) + self.trend = None + self.aggregates = aggregates + + +class ReservationSkuProperty(Model): + """The property of reservation sku object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of the reservation sku. + :vartype name: str + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ReservationSkuProperty, self).__init__(**kwargs) + self.name = None + + +class ReservationSummary(Model): + """The roll up count summary of reservations in each state. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar succeeded_count: The number of reservation in Succeeded state + :vartype succeeded_count: float + :ivar failed_count: The number of reservation in Failed state + :vartype failed_count: float + :ivar expiring_count: The number of reservation in Expiring state + :vartype expiring_count: float + :ivar expired_count: The number of reservation in Expired state + :vartype expired_count: float + :ivar pending_count: The number of reservation in Pending state + :vartype pending_count: float + :ivar cancelled_count: The number of reservation in Cancelled state + :vartype cancelled_count: float + """ + + _validation = { + 'succeeded_count': {'readonly': True}, + 'failed_count': {'readonly': True}, + 'expiring_count': {'readonly': True}, + 'expired_count': {'readonly': True}, + 'pending_count': {'readonly': True}, + 'cancelled_count': {'readonly': True}, + } + + _attribute_map = { + 'succeeded_count': {'key': 'succeededCount', 'type': 'float'}, + 'failed_count': {'key': 'failedCount', 'type': 'float'}, + 'expiring_count': {'key': 'expiringCount', 'type': 'float'}, + 'expired_count': {'key': 'expiredCount', 'type': 'float'}, + 'pending_count': {'key': 'pendingCount', 'type': 'float'}, + 'cancelled_count': {'key': 'cancelledCount', 'type': 'float'}, + } + + def __init__(self, **kwargs) -> None: + super(ReservationSummary, self).__init__(**kwargs) + self.succeeded_count = None + self.failed_count = None + self.expiring_count = None + self.expired_count = None + self.pending_count = None + self.cancelled_count = None + + +class ReservationUtilizationAggregates(Model): + """The aggregate values of reservation utilization. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar grain: The grain of the aggregate + :vartype grain: float + :ivar grain_unit: The grain unit of the aggregate + :vartype grain_unit: str + :ivar value: The aggregate value + :vartype value: float + :ivar value_unit: The aggregate value unit + :vartype value_unit: str + """ + + _validation = { + 'grain': {'readonly': True}, + 'grain_unit': {'readonly': True}, + 'value': {'readonly': True}, + 'value_unit': {'readonly': True}, + } + + _attribute_map = { + 'grain': {'key': 'grain', 'type': 'float'}, + 'grain_unit': {'key': 'grainUnit', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'float'}, + 'value_unit': {'key': 'valueUnit', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ReservationUtilizationAggregates, self).__init__(**kwargs) + self.grain = None + self.grain_unit = None + self.value = None + self.value_unit = None + + class Transaction(Resource): """A transaction. @@ -2828,10 +3131,16 @@ class ValidateSubscriptionTransferEligibilityError(Model): """Error details of the transfer eligibility validation. :param code: Error code for the product transfer validation. Possible - values include: 'InvalidSource', 'SubscriptionNotActive', - 'InsufficientPermissionOnSource', 'InsufficientPermissionOnDestination', - 'DestinationBillingProfilePastDue', 'SubscriptionTypeNotSupported', - 'CrossBillingAccountNotAllowed', 'NotAvailableForDestinationMarket' + values include: 'BillingAccountInactive', 'CrossBillingAccountNotAllowed', + 'DestinationBillingProfileInactive', 'DestinationBillingProfileNotFound', + 'DestinationBillingProfilePastDue', 'DestinationInvoiceSectionInactive', + 'DestinationInvoiceSectionNotFound', + 'InsufficientPermissionOnDestination', 'InsufficientPermissionOnSource', + 'InvalidDestination', 'InvalidSource', + 'MarketplaceNotEnabledOnDestination', 'NotAvailableForDestinationMarket', + 'ProductInactive', 'ProductNotFound', 'ProductTypeNotSupported', + 'SourceBillingProfilePastDue', 'SourceInvoiceSectionInactive', + 'SubscriptionNotActive', 'SubscriptionTypeNotSupported' :type code: str or ~azure.mgmt.billing.models.SubscriptionTransferValidationErrorCode :param message: The error message. diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/_paged_models.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/_paged_models.py index 4dde2e787acb..bfbd7898a86b 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/_paged_models.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/_paged_models.py @@ -207,6 +207,19 @@ class AgreementPaged(Paged): def __init__(self, *args, **kwargs): super(AgreementPaged, self).__init__(*args, **kwargs) +class ReservationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Reservation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Reservation]'} + } + + def __init__(self, *args, **kwargs): + + super(ReservationPaged, self).__init__(*args, **kwargs) class EnrollmentAccountSummaryPaged(Paged): """ A paging container for iterating over a list of :class:`EnrollmentAccountSummary ` object diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py index d294ba99622a..fb9e465d6650 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py @@ -27,6 +27,7 @@ from ._billing_role_definitions_operations import BillingRoleDefinitionsOperations from ._billing_role_assignments_operations import BillingRoleAssignmentsOperations from ._agreements_operations import AgreementsOperations +from ._reservations_operations import ReservationsOperations from ._enrollment_accounts_operations import EnrollmentAccountsOperations from ._billing_periods_operations import BillingPeriodsOperations @@ -49,6 +50,7 @@ 'BillingRoleDefinitionsOperations', 'BillingRoleAssignmentsOperations', 'AgreementsOperations', + 'ReservationsOperations', 'EnrollmentAccountsOperations', 'BillingPeriodsOperations', ] diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_invoices_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_invoices_operations.py index d8bcbe29d84f..04c84f19fb9b 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_invoices_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_invoices_operations.py @@ -431,10 +431,10 @@ def get_long_running_output(response): download_invoice.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/download'} - def _download_multiple_modern_invoice_initial( + def _download_multiple_billing_profile_invoices_initial( self, billing_account_name, download_urls, custom_headers=None, raw=False, **operation_config): # Construct URL - url = self.download_multiple_modern_invoice.metadata['url'] + url = self.download_multiple_billing_profile_invoices.metadata['url'] path_format_arguments = { 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') } @@ -482,9 +482,9 @@ def _download_multiple_modern_invoice_initial( return deserialized - def download_multiple_modern_invoice( + def download_multiple_billing_profile_invoices( self, billing_account_name, download_urls, custom_headers=None, raw=False, polling=True, **operation_config): - """Gets a URL to download an multiple invoices documents (invoice pdf, tax + """Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. @@ -509,7 +509,7 @@ def download_multiple_modern_invoice( :raises: :class:`ErrorResponseException` """ - raw_result = self._download_multiple_modern_invoice_initial( + raw_result = self._download_multiple_billing_profile_invoices_initial( billing_account_name=billing_account_name, download_urls=download_urls, custom_headers=custom_headers, @@ -538,7 +538,7 @@ def get_long_running_output(response): elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - download_multiple_modern_invoice.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/downloadDocuments'} + download_multiple_billing_profile_invoices.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/downloadDocuments'} def list_by_billing_subscription( self, period_start_date, period_end_date, custom_headers=None, raw=False, **operation_config): @@ -773,10 +773,10 @@ def get_long_running_output(response): download_billing_subscription_invoice.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices/{invoiceName}/download'} - def _download_multiple_billing_subscription_invoice_initial( + def _download_multiple_billing_subscription_invoices_initial( self, download_urls, custom_headers=None, raw=False, **operation_config): # Construct URL - url = self.download_multiple_billing_subscription_invoice.metadata['url'] + url = self.download_multiple_billing_subscription_invoices.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -824,9 +824,9 @@ def _download_multiple_billing_subscription_invoice_initial( return deserialized - def download_multiple_billing_subscription_invoice( + def download_multiple_billing_subscription_invoices( self, download_urls, custom_headers=None, raw=False, polling=True, **operation_config): - """Gets a URL to download multiple invoices documents (invoice pdf, tax + """Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. :param download_urls: An array of download urls for individual @@ -846,7 +846,7 @@ def download_multiple_billing_subscription_invoice( :raises: :class:`ErrorResponseException` """ - raw_result = self._download_multiple_billing_subscription_invoice_initial( + raw_result = self._download_multiple_billing_subscription_invoices_initial( download_urls=download_urls, custom_headers=custom_headers, raw=True, @@ -874,4 +874,4 @@ def get_long_running_output(response): elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - download_multiple_billing_subscription_invoice.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/downloadDocuments'} + download_multiple_billing_subscription_invoices.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/downloadDocuments'} diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_reservations_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_reservations_operations.py new file mode 100644 index 000000000000..e397e0568020 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/_reservations_operations.py @@ -0,0 +1,219 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ReservationsOperations(object): + """ReservationsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The version of the API to be used with the client request. The current version is 2020-05-01. Constant value: "2020-05-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-05-01" + + self.config = config + + def list_by_billing_account( + self, billing_account_name, filter=None, orderby=None, refresh_summary=None, selected_state=None, custom_headers=None, raw=False, **operation_config): + """Lists the reservations for a billing account and the roll up counts of + reservations group by provisioning states. + + :param billing_account_name: The ID that uniquely identifies a billing + account. + :type billing_account_name: str + :param filter: May be used to filter by reservation properties. The + filter supports 'eq', 'or', and 'and'. It does not currently support + 'ne', 'gt', 'le', 'ge', or 'not'. + :type filter: str + :param orderby: May be used to sort order by reservation properties. + :type orderby: str + :param refresh_summary: To indicate whether to refresh the roll up + counts of the reservations group by provisioning states + :type refresh_summary: str + :param selected_state: The selected provisioning state + :type selected_state: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Reservation + :rtype: + ~azure.mgmt.billing.models.ReservationPaged[~azure.mgmt.billing.models.Reservation] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_billing_account.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if orderby is not None: + query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') + if refresh_summary is not None: + query_parameters['refreshSummary'] = self._serialize.query("refresh_summary", refresh_summary, 'str') + if selected_state is not None: + query_parameters['selectedState'] = self._serialize.query("selected_state", selected_state, 'str') + + else: + url = next_link + query_parameters = {} + + # 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ReservationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_billing_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/reservations'} + + def list_by_billing_profile( + self, billing_account_name, billing_profile_name, filter=None, orderby=None, refresh_summary=None, selected_state=None, custom_headers=None, raw=False, **operation_config): + """Lists the reservations for a billing profile and the roll up counts of + reservations group by provisioning state. + + :param billing_account_name: The ID that uniquely identifies a billing + account. + :type billing_account_name: str + :param billing_profile_name: The ID that uniquely identifies a billing + profile. + :type billing_profile_name: str + :param filter: May be used to filter by reservation properties. The + filter supports 'eq', 'or', and 'and'. It does not currently support + 'ne', 'gt', 'le', 'ge', or 'not'. + :type filter: str + :param orderby: May be used to sort order by reservation properties. + :type orderby: str + :param refresh_summary: To indicate whether to refresh the roll up + counts of the reservations group by provisioning state + :type refresh_summary: str + :param selected_state: The selected provisioning state + :type selected_state: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Reservation + :rtype: + ~azure.mgmt.billing.models.ReservationPaged[~azure.mgmt.billing.models.Reservation] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_billing_profile.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if orderby is not None: + query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') + if refresh_summary is not None: + query_parameters['refreshSummary'] = self._serialize.query("refresh_summary", refresh_summary, 'str') + if selected_state is not None: + query_parameters['selectedState'] = self._serialize.query("selected_state", selected_state, 'str') + + else: + url = next_link + query_parameters = {} + + # 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ReservationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_billing_profile.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/reservations'}