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 track2_azure-mgmt-billing] billing readme config(wave4) #5466

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/[email protected]",
"commit": "de488801257c3b39c11b1131dceb2842f35b291d",
"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/[email protected] --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 = "0.3.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
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,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 @@ -159,7 +159,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('BillingAccount', pipeline_response)
Expand Down Expand Up @@ -210,7 +210,7 @@ async def _update_initial(

if response.status_code not in [200, 202]:
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 = None
Expand Down Expand Up @@ -240,8 +240,8 @@ async def begin_update(
:type parameters: ~azure.mgmt.billing.models.BillingAccountUpdateRequest
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: True for ARMPolling, False for no polling, or a
polling object for personal polling strategy
:keyword polling: Pass in True if you'd like the AsyncARMPolling polling method,
False for no polling, or your own initialized polling object for a personal polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either BillingAccount or the result of cls(response)
Expand Down Expand Up @@ -352,7 +352,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
Loading