Skip to content

Commit

Permalink
CodeGen from PR 13516 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
reservation readme t2 config (Azure#13516)
  • Loading branch information
SDKAuto committed Mar 22, 2021
1 parent 58c46ee commit 42a51d8
Show file tree
Hide file tree
Showing 22 changed files with 341 additions and 1,371 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,20 @@
from azure.core.credentials import TokenCredential

from ._configuration import AzureReservationAPIConfiguration
from .operations import QuotaOperations
from .operations import QuotaRequestStatusOperations
from .operations import AutoQuotaIncreaseOperations
from .operations import ReservationOperations
from .operations import AzureReservationAPIOperationsMixin
from .operations import ReservationOrderOperations
from .operations import OperationOperations
from .operations import CalculateExchangeOperations
from .operations import ExchangeOperations
from .operations import QuotaOperations
from .operations import QuotaRequestStatusOperations
from . import models


class AzureReservationAPI(AzureReservationAPIOperationsMixin):
"""Microsoft Azure Quota Resource Provider.
"""This API describe Azure Reservation.
:ivar quota: QuotaOperations operations
:vartype quota: azure.mgmt.reservations.operations.QuotaOperations
:ivar quota_request_status: QuotaRequestStatusOperations operations
:vartype quota_request_status: azure.mgmt.reservations.operations.QuotaRequestStatusOperations
:ivar auto_quota_increase: AutoQuotaIncreaseOperations operations
:vartype auto_quota_increase: azure.mgmt.reservations.operations.AutoQuotaIncreaseOperations
:ivar reservation: ReservationOperations operations
:vartype reservation: azure.mgmt.reservations.operations.ReservationOperations
:ivar reservation_order: ReservationOrderOperations operations
Expand All @@ -49,6 +42,10 @@ class AzureReservationAPI(AzureReservationAPIOperationsMixin):
:vartype calculate_exchange: azure.mgmt.reservations.operations.CalculateExchangeOperations
:ivar exchange: ExchangeOperations operations
:vartype exchange: azure.mgmt.reservations.operations.ExchangeOperations
:ivar quota: QuotaOperations operations
:vartype quota: azure.mgmt.reservations.operations.QuotaOperations
:ivar quota_request_status: QuotaRequestStatusOperations operations
:vartype quota_request_status: azure.mgmt.reservations.operations.QuotaRequestStatusOperations
: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 @@ -69,15 +66,8 @@ 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.quota = QuotaOperations(
self._client, self._config, self._serialize, self._deserialize)
self.quota_request_status = QuotaRequestStatusOperations(
self._client, self._config, self._serialize, self._deserialize)
self.auto_quota_increase = AutoQuotaIncreaseOperations(
self._client, self._config, self._serialize, self._deserialize)
self.reservation = ReservationOperations(
self._client, self._config, self._serialize, self._deserialize)
self.reservation_order = ReservationOrderOperations(
Expand All @@ -88,6 +78,10 @@ def __init__(
self._client, self._config, self._serialize, self._deserialize)
self.exchange = ExchangeOperations(
self._client, self._config, self._serialize, self._deserialize)
self.quota = QuotaOperations(
self._client, self._config, self._serialize, self._deserialize)
self.quota_request_status = QuotaRequestStatusOperations(
self._client, self._config, self._serialize, self._deserialize)

def close(self):
# type: () -> None
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{
"chosen_version": "",
"total_api_version_list": ["2020-10-01-preview", "2020-10-25"],
"client": {
"name": "AzureReservationAPI",
"filename": "_azure_reservation_api",
"description": "This API describe Azure Reservation.",
"base_url": "\u0027https://management.azure.com\u0027",
"custom_base_url": null,
"azure_arm": true,
"has_lro_operations": true,
"client_side_validation": true
},
"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
}
},
"async": {
"credential": {
"signature": "credential, # type: \"AsyncTokenCredential\"",
"description": "Credential needed for the client to connect to Azure.",
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
"required": true
}
},
"constant": {
},
"call": "credential"
},
"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
},
"operation_groups": {
"reservation": "ReservationOperations",
"reservation_order": "ReservationOrderOperations",
"operation": "OperationOperations",
"calculate_exchange": "CalculateExchangeOperations",
"exchange": "ExchangeOperations",
"quota": "QuotaOperations",
"quota_request_status": "QuotaRequestStatusOperations"
},
"operation_mixins": {
"get_catalog" : {
"sync": {
"signature": "def get_catalog(\n self,\n subscription_id, # type: str\n reserved_resource_type, # type: str\n location=None, # type: Optional[str]\n **kwargs # type: Any\n):\n",
"doc": "\"\"\"Get the regions and skus that are available for RI purchase for the specified Azure subscription.\n\nGet the regions and skus that are available for RI purchase for the specified Azure\nsubscription.\n\n:param subscription_id: Id of the subscription.\n:type subscription_id: str\n:param reserved_resource_type: The type of the resource for which the skus should be provided.\n:type reserved_resource_type: str\n:param location: Filters the skus based on the location specified in this parameter. This can\n be an azure region or global.\n:type location: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: list of Catalog, or the result of cls(response)\n:rtype: list[~azure.mgmt.reservations.models.Catalog]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
},
"async": {
"coroutine": true,
"signature": "async def get_catalog(\n self,\n subscription_id: str,\n reserved_resource_type: str,\n location: Optional[str] = None,\n **kwargs\n) -\u003e List[\"_models.Catalog\"]:\n",
"doc": "\"\"\"Get the regions and skus that are available for RI purchase for the specified Azure subscription.\n\nGet the regions and skus that are available for RI purchase for the specified Azure\nsubscription.\n\n:param subscription_id: Id of the subscription.\n:type subscription_id: str\n:param reserved_resource_type: The type of the resource for which the skus should be provided.\n:type reserved_resource_type: str\n:param location: Filters the skus based on the location specified in this parameter. This can\n be an azure region or global.\n:type location: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: list of Catalog, or the result of cls(response)\n:rtype: list[~azure.mgmt.reservations.models.Catalog]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
},
"call": "subscription_id, reserved_resource_type, location"
},
"get_applied_reservation_list" : {
"sync": {
"signature": "def get_applied_reservation_list(\n self,\n subscription_id, # type: str\n **kwargs # type: Any\n):\n",
"doc": "\"\"\"Get list of applicable ``Reservation``\\ s.\n\nGet applicable ``Reservation``\\ s that are applied to this subscription or a resource group\nunder this subscription.\n\n:param subscription_id: Id of the subscription.\n:type subscription_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AppliedReservations, or the result of cls(response)\n:rtype: ~azure.mgmt.reservations.models.AppliedReservations\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
},
"async": {
"coroutine": true,
"signature": "async def get_applied_reservation_list(\n self,\n subscription_id: str,\n **kwargs\n) -\u003e \"_models.AppliedReservations\":\n",
"doc": "\"\"\"Get list of applicable ``Reservation``\\ s.\n\nGet applicable ``Reservation``\\ s that are applied to this subscription or a resource group\nunder this subscription.\n\n:param subscription_id: Id of the subscription.\n:type subscription_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AppliedReservations, or the result of cls(response)\n:rtype: ~azure.mgmt.reservations.models.AppliedReservations\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
},
"call": "subscription_id"
}
},
"sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"ClientAuthenticationError\", \"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"List\", \"Optional\", \"TypeVar\"]}}}",
"async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"ClientAuthenticationError\", \"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"List\", \"Optional\", \"TypeVar\"]}}}"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "1.0.0b1"

VERSION = "0.3.2"
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,20 @@
from azure.core.credentials_async import AsyncTokenCredential

from ._configuration import AzureReservationAPIConfiguration
from .operations import QuotaOperations
from .operations import QuotaRequestStatusOperations
from .operations import AutoQuotaIncreaseOperations
from .operations import ReservationOperations
from .operations import AzureReservationAPIOperationsMixin
from .operations import ReservationOrderOperations
from .operations import OperationOperations
from .operations import CalculateExchangeOperations
from .operations import ExchangeOperations
from .operations import QuotaOperations
from .operations import QuotaRequestStatusOperations
from .. import models


class AzureReservationAPI(AzureReservationAPIOperationsMixin):
"""Microsoft Azure Quota Resource Provider.
"""This API describe Azure Reservation.
:ivar quota: QuotaOperations operations
:vartype quota: azure.mgmt.reservations.aio.operations.QuotaOperations
:ivar quota_request_status: QuotaRequestStatusOperations operations
:vartype quota_request_status: azure.mgmt.reservations.aio.operations.QuotaRequestStatusOperations
:ivar auto_quota_increase: AutoQuotaIncreaseOperations operations
:vartype auto_quota_increase: azure.mgmt.reservations.aio.operations.AutoQuotaIncreaseOperations
:ivar reservation: ReservationOperations operations
:vartype reservation: azure.mgmt.reservations.aio.operations.ReservationOperations
:ivar reservation_order: ReservationOrderOperations operations
Expand All @@ -47,6 +40,10 @@ class AzureReservationAPI(AzureReservationAPIOperationsMixin):
:vartype calculate_exchange: azure.mgmt.reservations.aio.operations.CalculateExchangeOperations
:ivar exchange: ExchangeOperations operations
:vartype exchange: azure.mgmt.reservations.aio.operations.ExchangeOperations
:ivar quota: QuotaOperations operations
:vartype quota: azure.mgmt.reservations.aio.operations.QuotaOperations
:ivar quota_request_status: QuotaRequestStatusOperations operations
:vartype quota_request_status: azure.mgmt.reservations.aio.operations.QuotaRequestStatusOperations
: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 @@ -66,15 +63,8 @@ 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.quota = QuotaOperations(
self._client, self._config, self._serialize, self._deserialize)
self.quota_request_status = QuotaRequestStatusOperations(
self._client, self._config, self._serialize, self._deserialize)
self.auto_quota_increase = AutoQuotaIncreaseOperations(
self._client, self._config, self._serialize, self._deserialize)
self.reservation = ReservationOperations(
self._client, self._config, self._serialize, self._deserialize)
self.reservation_order = ReservationOrderOperations(
Expand All @@ -85,6 +75,10 @@ def __init__(
self._client, self._config, self._serialize, self._deserialize)
self.exchange = ExchangeOperations(
self._client, self._config, self._serialize, self._deserialize)
self.quota = QuotaOperations(
self._client, self._config, self._serialize, self._deserialize)
self.quota_request_status = QuotaRequestStatusOperations(
self._client, self._config, self._serialize, self._deserialize)

async def close(self) -> None:
await self._client.close()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,22 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from ._quota_operations import QuotaOperations
from ._quota_request_status_operations import QuotaRequestStatusOperations
from ._auto_quota_increase_operations import AutoQuotaIncreaseOperations
from ._reservation_operations import ReservationOperations
from ._azure_reservation_api_operations import AzureReservationAPIOperationsMixin
from ._reservation_order_operations import ReservationOrderOperations
from ._operation_operations import OperationOperations
from ._calculate_exchange_operations import CalculateExchangeOperations
from ._exchange_operations import ExchangeOperations
from ._quota_operations import QuotaOperations
from ._quota_request_status_operations import QuotaRequestStatusOperations

__all__ = [
'QuotaOperations',
'QuotaRequestStatusOperations',
'AutoQuotaIncreaseOperations',
'ReservationOperations',
'AzureReservationAPIOperationsMixin',
'ReservationOrderOperations',
'OperationOperations',
'CalculateExchangeOperations',
'ExchangeOperations',
'QuotaOperations',
'QuotaRequestStatusOperations',
]
Loading

0 comments on commit 42a51d8

Please sign in to comment.