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-costmanagement] [Hub Generated] Review request for Microsoft.CostManagement to add version stable/2019-11-01 #7943

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
2 changes: 1 addition & 1 deletion sdk/costmanagement/azure-mgmt-costmanagement/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"@autorest/python@5.8.4",
"@autorest/modelerfour@4.19.2"
],
"commit": "74efe54fbc55c91a1d9213afbb2723747acfddf9",
"commit": "def63c6494991a6425fcd326c918bf5c96bd31cd",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/cost-management/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.8.4 --use=@autorest/modelerfour@4.19.2 --version=3.4.5",
"readme": "specification/cost-management/resource-manager/readme.md"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def __init__(
super(CostManagementClientConfiguration, self).__init__(**kwargs)

self.credential = credential
self.api_version = "2019-11-01"
self.api_version = "2021-10-01"
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-costmanagement/{}'.format(VERSION))
self._configure(**kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,30 @@
from azure.core.pipeline.transport import HttpRequest, HttpResponse

from ._configuration import CostManagementClientConfiguration
from .operations import SettingsOperations
from .operations import ExportsOperations
from .operations import GenerateDetailedCostReportOperations
from .operations import GenerateDetailedCostReportOperationResultsOperations
from .operations import GenerateDetailedCostReportOperationStatusOperations
from .operations import ViewsOperations
from .operations import AlertsOperations
from .operations import ForecastOperations
from .operations import DimensionsOperations
from .operations import QueryOperations
from .operations import GenerateReservationDetailsReportOperations
from .operations import Operations
from .operations import ExportsOperations
from . import models


class CostManagementClient(object):
"""CostManagementClient.

:ivar settings: SettingsOperations operations
:vartype settings: azure.mgmt.costmanagement.operations.SettingsOperations
:ivar exports: ExportsOperations operations
:vartype exports: azure.mgmt.costmanagement.operations.ExportsOperations
:ivar generate_detailed_cost_report: GenerateDetailedCostReportOperations operations
:vartype generate_detailed_cost_report: azure.mgmt.costmanagement.operations.GenerateDetailedCostReportOperations
:ivar generate_detailed_cost_report_operation_results: GenerateDetailedCostReportOperationResultsOperations operations
:vartype generate_detailed_cost_report_operation_results: azure.mgmt.costmanagement.operations.GenerateDetailedCostReportOperationResultsOperations
:ivar generate_detailed_cost_report_operation_status: GenerateDetailedCostReportOperationStatusOperations operations
:vartype generate_detailed_cost_report_operation_status: azure.mgmt.costmanagement.operations.GenerateDetailedCostReportOperationStatusOperations
:ivar views: ViewsOperations operations
:vartype views: azure.mgmt.costmanagement.operations.ViewsOperations
:ivar alerts: AlertsOperations operations
Expand All @@ -46,12 +53,8 @@ class CostManagementClient(object):
:vartype dimensions: azure.mgmt.costmanagement.operations.DimensionsOperations
:ivar query: QueryOperations operations
:vartype query: azure.mgmt.costmanagement.operations.QueryOperations
:ivar generate_reservation_details_report: GenerateReservationDetailsReportOperations operations
:vartype generate_reservation_details_report: azure.mgmt.costmanagement.operations.GenerateReservationDetailsReportOperations
:ivar operations: Operations operations
:vartype operations: azure.mgmt.costmanagement.operations.Operations
:ivar exports: ExportsOperations operations
:vartype exports: azure.mgmt.costmanagement.operations.ExportsOperations
:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials.TokenCredential
:param str base_url: Service URL
Expand All @@ -75,7 +78,13 @@ def __init__(
self._serialize.client_side_validation = False
self._deserialize = Deserializer(client_models)

self.settings = SettingsOperations(
self.exports = ExportsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.generate_detailed_cost_report = GenerateDetailedCostReportOperations(
self._client, self._config, self._serialize, self._deserialize)
self.generate_detailed_cost_report_operation_results = GenerateDetailedCostReportOperationResultsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.generate_detailed_cost_report_operation_status = GenerateDetailedCostReportOperationStatusOperations(
self._client, self._config, self._serialize, self._deserialize)
self.views = ViewsOperations(
self._client, self._config, self._serialize, self._deserialize)
Expand All @@ -87,12 +96,8 @@ def __init__(
self._client, self._config, self._serialize, self._deserialize)
self.query = QueryOperations(
self._client, self._config, self._serialize, self._deserialize)
self.generate_reservation_details_report = GenerateReservationDetailsReportOperations(
self._client, self._config, self._serialize, self._deserialize)
self.operations = Operations(
self._client, self._config, self._serialize, self._deserialize)
self.exports = ExportsOperations(
self._client, self._config, self._serialize, self._deserialize)

def _send_request(self, http_request, **kwargs):
# type: (HttpRequest, Any) -> HttpResponse
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"chosen_version": "2019-11-01",
"total_api_version_list": ["2019-11-01"],
"chosen_version": "2021-10-01",
"total_api_version_list": ["2021-10-01"],
"client": {
"name": "CostManagementClient",
"filename": "_cost_management_client",
Expand Down Expand Up @@ -86,14 +86,15 @@
"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": {
"settings": "SettingsOperations",
"exports": "ExportsOperations",
"generate_detailed_cost_report": "GenerateDetailedCostReportOperations",
"generate_detailed_cost_report_operation_results": "GenerateDetailedCostReportOperationResultsOperations",
"generate_detailed_cost_report_operation_status": "GenerateDetailedCostReportOperationStatusOperations",
"views": "ViewsOperations",
"alerts": "AlertsOperations",
"forecast": "ForecastOperations",
"dimensions": "DimensionsOperations",
"query": "QueryOperations",
"generate_reservation_details_report": "GenerateReservationDetailsReportOperations",
"operations": "Operations",
"exports": "ExportsOperations"
"operations": "Operations"
}
}
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 = "3.0.0"
VERSION = "1.0.0b1"
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def __init__(
super(CostManagementClientConfiguration, self).__init__(**kwargs)

self.credential = credential
self.api_version = "2019-11-01"
self.api_version = "2021-10-01"
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-costmanagement/{}'.format(VERSION))
self._configure(**kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,30 @@
from azure.core.credentials_async import AsyncTokenCredential

from ._configuration import CostManagementClientConfiguration
from .operations import SettingsOperations
from .operations import ExportsOperations
from .operations import GenerateDetailedCostReportOperations
from .operations import GenerateDetailedCostReportOperationResultsOperations
from .operations import GenerateDetailedCostReportOperationStatusOperations
from .operations import ViewsOperations
from .operations import AlertsOperations
from .operations import ForecastOperations
from .operations import DimensionsOperations
from .operations import QueryOperations
from .operations import GenerateReservationDetailsReportOperations
from .operations import Operations
from .operations import ExportsOperations
from .. import models


class CostManagementClient(object):
"""CostManagementClient.

:ivar settings: SettingsOperations operations
:vartype settings: azure.mgmt.costmanagement.aio.operations.SettingsOperations
:ivar exports: ExportsOperations operations
:vartype exports: azure.mgmt.costmanagement.aio.operations.ExportsOperations
:ivar generate_detailed_cost_report: GenerateDetailedCostReportOperations operations
:vartype generate_detailed_cost_report: azure.mgmt.costmanagement.aio.operations.GenerateDetailedCostReportOperations
:ivar generate_detailed_cost_report_operation_results: GenerateDetailedCostReportOperationResultsOperations operations
:vartype generate_detailed_cost_report_operation_results: azure.mgmt.costmanagement.aio.operations.GenerateDetailedCostReportOperationResultsOperations
:ivar generate_detailed_cost_report_operation_status: GenerateDetailedCostReportOperationStatusOperations operations
:vartype generate_detailed_cost_report_operation_status: azure.mgmt.costmanagement.aio.operations.GenerateDetailedCostReportOperationStatusOperations
:ivar views: ViewsOperations operations
:vartype views: azure.mgmt.costmanagement.aio.operations.ViewsOperations
:ivar alerts: AlertsOperations operations
Expand All @@ -44,12 +51,8 @@ class CostManagementClient(object):
:vartype dimensions: azure.mgmt.costmanagement.aio.operations.DimensionsOperations
:ivar query: QueryOperations operations
:vartype query: azure.mgmt.costmanagement.aio.operations.QueryOperations
:ivar generate_reservation_details_report: GenerateReservationDetailsReportOperations operations
:vartype generate_reservation_details_report: azure.mgmt.costmanagement.aio.operations.GenerateReservationDetailsReportOperations
:ivar operations: Operations operations
:vartype operations: azure.mgmt.costmanagement.aio.operations.Operations
:ivar exports: ExportsOperations operations
:vartype exports: azure.mgmt.costmanagement.aio.operations.ExportsOperations
:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param str base_url: Service URL
Expand All @@ -72,7 +75,13 @@ def __init__(
self._serialize.client_side_validation = False
self._deserialize = Deserializer(client_models)

self.settings = SettingsOperations(
self.exports = ExportsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.generate_detailed_cost_report = GenerateDetailedCostReportOperations(
self._client, self._config, self._serialize, self._deserialize)
self.generate_detailed_cost_report_operation_results = GenerateDetailedCostReportOperationResultsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.generate_detailed_cost_report_operation_status = GenerateDetailedCostReportOperationStatusOperations(
self._client, self._config, self._serialize, self._deserialize)
self.views = ViewsOperations(
self._client, self._config, self._serialize, self._deserialize)
Expand All @@ -84,12 +93,8 @@ def __init__(
self._client, self._config, self._serialize, self._deserialize)
self.query = QueryOperations(
self._client, self._config, self._serialize, self._deserialize)
self.generate_reservation_details_report = GenerateReservationDetailsReportOperations(
self._client, self._config, self._serialize, self._deserialize)
self.operations = Operations(
self._client, self._config, self._serialize, self._deserialize)
self.exports = ExportsOperations(
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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,26 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from ._settings_operations import SettingsOperations
from ._exports_operations import ExportsOperations
from ._generate_detailed_cost_report_operations import GenerateDetailedCostReportOperations
from ._generate_detailed_cost_report_operation_results_operations import GenerateDetailedCostReportOperationResultsOperations
from ._generate_detailed_cost_report_operation_status_operations import GenerateDetailedCostReportOperationStatusOperations
from ._views_operations import ViewsOperations
from ._alerts_operations import AlertsOperations
from ._forecast_operations import ForecastOperations
from ._dimensions_operations import DimensionsOperations
from ._query_operations import QueryOperations
from ._generate_reservation_details_report_operations import GenerateReservationDetailsReportOperations
from ._operations import Operations
from ._exports_operations import ExportsOperations

__all__ = [
'SettingsOperations',
'ExportsOperations',
'GenerateDetailedCostReportOperations',
'GenerateDetailedCostReportOperationResultsOperations',
'GenerateDetailedCostReportOperationStatusOperations',
'ViewsOperations',
'AlertsOperations',
'ForecastOperations',
'DimensionsOperations',
'QueryOperations',
'GenerateReservationDetailsReportOperations',
'Operations',
'ExportsOperations',
]
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ async def list(
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2019-11-01"
api_version = "2021-10-01"
accept = "application/json"

# Construct URL
Expand Down Expand Up @@ -146,7 +146,7 @@ async def get(
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2019-11-01"
api_version = "2021-10-01"
accept = "application/json"

# Construct URL
Expand Down Expand Up @@ -222,7 +222,7 @@ async def dismiss(
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2019-11-01"
api_version = "2021-10-01"
content_type = kwargs.pop("content_type", "application/json")
accept = "application/json"

Expand Down Expand Up @@ -288,7 +288,7 @@ async def list_external(
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2019-11-01"
api_version = "2021-10-01"
accept = "application/json"

# Construct URL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@ def list(
:type top: int
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either DimensionsListResult or the result of cls(response)
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.costmanagement.models.DimensionsListResultor None]
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.costmanagement.models.DimensionsListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.DimensionsListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2019-11-01"
api_version = "2021-10-01"
accept = "application/json"

def prepare_request(next_link=None):
Expand Down Expand Up @@ -138,7 +138,7 @@ async def get_next(next_link=None):
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response

if response.status_code not in [200, 204]:
if response.status_code not in [200]:
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 @@ -191,7 +191,7 @@ def by_external_cloud_provider_type(
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2019-11-01"
api_version = "2021-10-01"
accept = "application/json"

def prepare_request(next_link=None):
Expand Down
Loading