Skip to content

Commit

Permalink
[AutoRelease] t2-billing-2021-05-12-16217(wave4) (#18660)
Browse files Browse the repository at this point in the history
* CodeGen from PR 14268 in Azure/azure-rest-api-specs
readme config (#14268)

* version,CHANGELOG

* test

* changelog config

Co-authored-by: SDKAuto <sdkautomation@microsoft.com>
Co-authored-by: PythonSdkPipelines <PythonSdkPipelines>
Co-authored-by: Zed <601306339@qq.com>
  • Loading branch information
3 people authored May 12, 2021
1 parent edc8980 commit 9eb1655
Show file tree
Hide file tree
Showing 65 changed files with 1,653 additions and 629 deletions.
21 changes: 21 additions & 0 deletions sdk/billing/azure-mgmt-billing/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# Release History

## 6.0.0 (2021-05-12)

**Features**

- Model InvoiceSectionListResult has a new parameter total_count
- Model OperationDisplay has a new parameter description
- Model BillingSubscriptionsListResult has a new parameter total_count
- Model BillingAccountUpdateRequest has a new parameter notification_email_address
- Model EnrollmentAccount has a new parameter account_owner_email
- Model CustomerListResult has a new parameter total_count
- Model Operation has a new parameter is_data_action
- Model BillingAccount has a new parameter notification_email_address
- Model AddressDetails has a new parameter middle_name
- Model BillingProfile has a new parameter tags
- Model EnrollmentPolicies has a new parameter marketplace_enabled
- Added operation group ReservationsOperations

**Breaking changes**

- Model EnrollmentPolicies no longer has parameter marketplaces_enabled

## 6.0.0b1 (2020-11-20)

This is beta preview version.
Expand Down
1 change: 1 addition & 0 deletions sdk/billing/azure-mgmt-billing/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include _meta.json
recursive-include tests *.py *.yaml
include *.md
include azure/__init__.py
Expand Down
8 changes: 8 additions & 0 deletions sdk/billing/azure-mgmt-billing/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"autorest": "3.3.0",
"use": "@autorest/python@5.6.6",
"commit": "1e43e60cfb0bb2829ff8d57a9ba06a2410f0b3c0",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/billing/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.6.6 --version=3.3.0",
"readme": "specification/billing/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from typing import Any, Optional

from azure.core.credentials import TokenCredential
from azure.core.pipeline.transport import HttpRequest, HttpResponse

from ._configuration import BillingManagementClientConfiguration
from .operations import BillingAccountsOperations
Expand All @@ -36,6 +37,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
Expand Down Expand Up @@ -80,6 +82,8 @@ class BillingManagementClient(object):
:vartype billing_role_assignments: azure.mgmt.billing.operations.BillingRoleAssignmentsOperations
:ivar agreements: AgreementsOperations operations
:vartype agreements: azure.mgmt.billing.operations.AgreementsOperations
:ivar reservations: ReservationsOperations operations
:vartype reservations: azure.mgmt.billing.operations.ReservationsOperations
:ivar enrollment_accounts: EnrollmentAccountsOperations operations
:vartype enrollment_accounts: azure.mgmt.billing.operations.EnrollmentAccountsOperations
:ivar billing_periods: BillingPeriodsOperations operations
Expand Down Expand Up @@ -146,11 +150,31 @@ 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(
self._client, self._config, self._serialize, self._deserialize)

def _send_request(self, http_request, **kwargs):
# type: (HttpRequest, Any) -> HttpResponse
"""Runs the network request through the client's chained policies.
:param http_request: The network request you want to make. Required.
:type http_request: ~azure.core.pipeline.transport.HttpRequest
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
:return: The response of your network call. Does not do error handling on your response.
:rtype: ~azure.core.pipeline.transport.HttpResponse
"""
path_format_arguments = {
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
}
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
stream = kwargs.pop("stream", True)
pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs)
return pipeline_response.http_response

def close(self):
# type: () -> None
self._client.close()
Expand Down
123 changes: 123 additions & 0 deletions sdk/billing/azure-mgmt-billing/azure/mgmt/billing/_metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
{
"chosen_version": "",
"total_api_version_list": ["2018-03-01-preview", "2020-05-01"],
"client": {
"name": "BillingManagementClient",
"filename": "_billing_management_client",
"description": "Billing client provides access to billing resources for Azure subscriptions.",
"base_url": "\u0027https://management.azure.com\u0027",
"custom_base_url": null,
"azure_arm": true,
"has_lro_operations": true,
"client_side_validation": false,
"sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"BillingManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}",
"async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"BillingManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}"
},
"global_parameters": {
"sync": {
"credential": {
"signature": "credential, # type: \"TokenCredential\"",
"description": "Credential needed for the client to connect to Azure.",
"docstring_type": "~azure.core.credentials.TokenCredential",
"required": true
},
"subscription_id": {
"signature": "subscription_id, # type: str",
"description": "The ID that uniquely identifies an Azure subscription.",
"docstring_type": "str",
"required": true
}
},
"async": {
"credential": {
"signature": "credential: \"AsyncTokenCredential\",",
"description": "Credential needed for the client to connect to Azure.",
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
"required": true
},
"subscription_id": {
"signature": "subscription_id: str,",
"description": "The ID that uniquely identifies an Azure subscription.",
"docstring_type": "str",
"required": true
}
},
"constant": {
},
"call": "credential, subscription_id",
"service_client_specific": {
"sync": {
"api_version": {
"signature": "api_version=None, # type: Optional[str]",
"description": "API version to use if no profile is provided, or if missing in profile.",
"docstring_type": "str",
"required": false
},
"base_url": {
"signature": "base_url=None, # type: Optional[str]",
"description": "Service URL",
"docstring_type": "str",
"required": false
},
"profile": {
"signature": "profile=KnownProfiles.default, # type: KnownProfiles",
"description": "A profile definition, from KnownProfiles to dict.",
"docstring_type": "azure.profiles.KnownProfiles",
"required": false
}
},
"async": {
"api_version": {
"signature": "api_version: Optional[str] = None,",
"description": "API version to use if no profile is provided, or if missing in profile.",
"docstring_type": "str",
"required": false
},
"base_url": {
"signature": "base_url: Optional[str] = None,",
"description": "Service URL",
"docstring_type": "str",
"required": false
},
"profile": {
"signature": "profile: KnownProfiles = KnownProfiles.default,",
"description": "A profile definition, from KnownProfiles to dict.",
"docstring_type": "azure.profiles.KnownProfiles",
"required": false
}
}
}
},
"config": {
"credential": true,
"credential_scopes": ["https://management.azure.com/.default"],
"credential_default_policy_type": "BearerTokenCredentialPolicy",
"credential_default_policy_type_has_async_version": true,
"credential_key_header_name": null,
"sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}",
"async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
},
"operation_groups": {
"billing_accounts": "BillingAccountsOperations",
"address": "AddressOperations",
"available_balances": "AvailableBalancesOperations",
"instructions": "InstructionsOperations",
"billing_profiles": "BillingProfilesOperations",
"customers": "CustomersOperations",
"invoice_sections": "InvoiceSectionsOperations",
"billing_permissions": "BillingPermissionsOperations",
"billing_subscriptions": "BillingSubscriptionsOperations",
"products": "ProductsOperations",
"invoices": "InvoicesOperations",
"transactions": "TransactionsOperations",
"policies": "PoliciesOperations",
"billing_property": "BillingPropertyOperations",
"operations": "Operations",
"billing_role_definitions": "BillingRoleDefinitionsOperations",
"billing_role_assignments": "BillingRoleAssignmentsOperations",
"agreements": "AgreementsOperations",
"reservations": "ReservationsOperations",
"enrollment_accounts": "EnrollmentAccountsOperations",
"billing_periods": "BillingPeriodsOperations"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "6.0.0b1"
VERSION = "6.0.0"
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from typing import Any, Optional, TYPE_CHECKING

from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
from azure.mgmt.core import AsyncARMPipelineClient
from msrest import Deserializer, Serializer

Expand All @@ -34,6 +35,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
Expand Down Expand Up @@ -78,6 +80,8 @@ class BillingManagementClient(object):
:vartype billing_role_assignments: azure.mgmt.billing.aio.operations.BillingRoleAssignmentsOperations
:ivar agreements: AgreementsOperations operations
:vartype agreements: azure.mgmt.billing.aio.operations.AgreementsOperations
:ivar reservations: ReservationsOperations operations
:vartype reservations: azure.mgmt.billing.aio.operations.ReservationsOperations
:ivar enrollment_accounts: EnrollmentAccountsOperations operations
:vartype enrollment_accounts: azure.mgmt.billing.aio.operations.EnrollmentAccountsOperations
:ivar billing_periods: BillingPeriodsOperations operations
Expand Down Expand Up @@ -143,11 +147,30 @@ 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(
self._client, self._config, self._serialize, self._deserialize)

async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse:
"""Runs the network request through the client's chained policies.
:param http_request: The network request you want to make. Required.
:type http_request: ~azure.core.pipeline.transport.HttpRequest
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
:return: The response of your network call. Does not do error handling on your response.
:rtype: ~azure.core.pipeline.transport.AsyncHttpResponse
"""
path_format_arguments = {
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
}
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
stream = kwargs.pop("stream", True)
pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs)
return pipeline_response.http_response

async def close(self) -> None:
await self._client.close()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,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

Expand All @@ -46,6 +47,7 @@
'BillingRoleDefinitionsOperations',
'BillingRoleAssignmentsOperations',
'AgreementsOperations',
'ReservationsOperations',
'EnrollmentAccountsOperations',
'BillingPeriodsOperations',
]
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ async def validate(

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

deserialized = self._deserialize('ValidateAddressResponse', pipeline_response)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ async def get_next(next_link=None):
response = pipeline_response.http_response

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

Expand Down Expand Up @@ -168,7 +168,7 @@ async def get(

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

deserialized = self._deserialize('Agreement', pipeline_response)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ async def get(

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

deserialized = self._deserialize('AvailableBalance', pipeline_response)
Expand Down
Loading

0 comments on commit 9eb1655

Please sign in to comment.