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 May 20, 2021
1 parent 04b0108 commit 78b7301
Show file tree
Hide file tree
Showing 30 changed files with 547 additions and 1,484 deletions.
1 change: 1 addition & 0 deletions sdk/reservations/azure-mgmt-reservations/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/reservations/azure-mgmt-reservations/_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": "aac59eea2fb1c142fd371c9c1886f33713e494a2",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/reservations/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/reservations/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,23 @@
from typing import Any, Optional

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

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 +43,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 @@ -72,12 +70,6 @@ def __init__(
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 +80,25 @@ 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 _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
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
{
"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": 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\": [\"AzureReservationAPIConfiguration\"], \"._operations_mixin\": [\"AzureReservationAPIOperationsMixin\"]}}, \"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\": [\"AzureReservationAPIConfiguration\"], \"._operations_mixin\": [\"AzureReservationAPIOperationsMixin\"]}}, \"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
}
},
"async": {
"credential": {
"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",
"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": {
"reservation": "ReservationOperations",
"reservation_order": "ReservationOrderOperations",
"operation": "OperationOperations",
"calculate_exchange": "CalculateExchangeOperations",
"exchange": "ExchangeOperations",
"quota": "QuotaOperations",
"quota_request_status": "QuotaRequestStatusOperations"
},
"operation_mixins": {
"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\"]}}}",
"operations": {
"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: Any\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: Any\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"
}
}
}
}
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"
Loading

0 comments on commit 78b7301

Please sign in to comment.