Skip to content

Commit

Permalink
CodeGen from PR 14584 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Create readme.md (Azure#14584)
  • Loading branch information
SDKAuto committed May 28, 2021
1 parent ee209c8 commit 6925dd6
Show file tree
Hide file tree
Showing 32 changed files with 2,399 additions and 1,010 deletions.
1 change: 1 addition & 0 deletions sdk/costmanagement/azure-mgmt-costmanagement/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
11 changes: 11 additions & 0 deletions sdk/costmanagement/azure-mgmt-costmanagement/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"autorest": "3.4.2",
"use": [
"@autorest/[email protected]",
"@autorest/[email protected]"
],
"commit": "67528b3e539b96ccaaf82c360f5715184e467e21",
"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/[email protected] --use=@autorest/[email protected] --version=3.4.2",
"readme": "specification/cost-management/resource-manager/readme.md"
}
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 = "2020-06-01"
self.api_version = "2019-11-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 @@ -16,13 +16,16 @@
from typing import Any, Optional

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

from ._configuration import CostManagementClientConfiguration
from .operations import SettingsOperations
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
Expand All @@ -31,6 +34,8 @@
class CostManagementClient(object):
"""CostManagementClient.
:ivar settings: SettingsOperations operations
:vartype settings: azure.mgmt.costmanagement.operations.SettingsOperations
:ivar views: ViewsOperations operations
:vartype views: azure.mgmt.costmanagement.operations.ViewsOperations
:ivar alerts: AlertsOperations operations
Expand All @@ -41,13 +46,16 @@ 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
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
"""

def __init__(
Expand All @@ -64,8 +72,11 @@ def __init__(

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._serialize.client_side_validation = False
self._deserialize = Deserializer(client_models)

self.settings = SettingsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.views = ViewsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.alerts = AlertsOperations(
Expand All @@ -76,11 +87,28 @@ 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
"""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
"""
http_request.url = self._client.format_url(http_request.url)
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
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
{
"chosen_version": "2020-06-01",
"total_api_version_list": ["2020-06-01"],
"chosen_version": "2019-11-01",
"total_api_version_list": ["2019-11-01"],
"client": {
"name": "CostManagementClient",
"filename": "_cost_management_client",
"description": "CostManagementClient.",
"base_url": "\u0027https://management.azure.com\u0027",
"custom_base_url": null,
"azure_arm": true,
"has_lro_operations": false,
"client_side_validation": 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\": [\"CostManagementClientConfiguration\"]}}, \"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\": [\"CostManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}"
},
"global_parameters": {
"sync": {
Expand All @@ -22,34 +24,76 @@
},
"async": {
"credential": {
"signature": "credential, # type: \"AsyncTokenCredential\"",
"signature": "credential: \"AsyncTokenCredential\",",
"description": "Credential needed for the client to connect to Azure.",
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
"required": true
}
},
"constant": {
},
"call": "credential"
"call": "credential",
"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
"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": {
"settings": "SettingsOperations",
"views": "ViewsOperations",
"alerts": "AlertsOperations",
"forecast": "ForecastOperations",
"dimensions": "DimensionsOperations",
"query": "QueryOperations",
"generate_reservation_details_report": "GenerateReservationDetailsReportOperations",
"operations": "Operations",
"exports": "ExportsOperations"
},
"operation_mixins": {
},
"sync_imports": "None",
"async_imports": "None"
}
}
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 = "1.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 = "2020-06-01"
self.api_version = "2019-11-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 @@ -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 @@ -16,11 +17,13 @@
from azure.core.credentials_async import AsyncTokenCredential

from ._configuration import CostManagementClientConfiguration
from .operations import SettingsOperations
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
Expand All @@ -29,6 +32,8 @@
class CostManagementClient(object):
"""CostManagementClient.
:ivar settings: SettingsOperations operations
:vartype settings: azure.mgmt.costmanagement.aio.operations.SettingsOperations
:ivar views: ViewsOperations operations
:vartype views: azure.mgmt.costmanagement.aio.operations.ViewsOperations
:ivar alerts: AlertsOperations operations
Expand All @@ -39,13 +44,16 @@ 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
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
"""

def __init__(
Expand All @@ -61,8 +69,11 @@ def __init__(

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._serialize.client_side_validation = False
self._deserialize = Deserializer(client_models)

self.settings = SettingsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.views = ViewsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.alerts = AlertsOperations(
Expand All @@ -73,11 +84,27 @@ 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.
: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
"""
http_request.url = self._client.format_url(http_request.url)
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 @@ -6,20 +6,24 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from ._settings_operations import SettingsOperations
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',
'ViewsOperations',
'AlertsOperations',
'ForecastOperations',
'DimensionsOperations',
'QueryOperations',
'GenerateReservationDetailsReportOperations',
'Operations',
'ExportsOperations',
]
Loading

0 comments on commit 6925dd6

Please sign in to comment.