[AutoRelease] t2-resource-2024-10-17-51538(can only be merged by SDK owner) (#37957)
* code and test * fix-live-test-fail * Update CHANGELOG.md * Update conftest.py --------- Co-authored-by: azure-sdk <PythonSdkPipelines> Co-authored-by: ChenxiJiang333 <v-chenjiang@microsoft.com> Co-authored-by: ChenxiJiang333 <119990644+ChenxiJiang333@users.noreply.github.com> Co-authored-by: Yuchao Yan <yuchaoyan@microsoft.com>
This commit is contained in:
Родитель
71681bdcd7
Коммит
7dcaf26923
|
@ -1,5 +1,20 @@
|
|||
# Release History
|
||||
|
||||
## 23.2.0 (2024-10-24)
|
||||
|
||||
### Features Added
|
||||
|
||||
- Added operation group DataBoundariesOperations
|
||||
- Added operation group PolicyDefinitionVersionsOperations
|
||||
- Added operation group PolicySetDefinitionVersionsOperations
|
||||
- Model ParameterDefinitionsValue has a new parameter schema
|
||||
- Model PolicyAssignment has a new parameter definition_version
|
||||
- Model PolicyDefinition has a new parameter version
|
||||
- Model PolicyDefinition has a new parameter versions
|
||||
- Model PolicyDefinitionReference has a new parameter definition_version
|
||||
- Model PolicySetDefinition has a new parameter version
|
||||
- Model PolicySetDefinition has a new parameter versions
|
||||
|
||||
## 23.1.1 (2024-05-08)
|
||||
|
||||
### Other Changes
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"commit": "63c41aa20e38fe6d2ddd1a367b4fe57e8b601c34",
|
||||
"commit": "34424077cae09522361ea641761dc37941603383",
|
||||
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
|
||||
"autorest": "3.10.2",
|
||||
"use": [
|
||||
|
@ -62,5 +62,6 @@
|
|||
"package-deploymentstacks-2024-03": "2024-05-02 13:16:57 -0400 88cc082d66e2b481ed99a17d44edffaeb6254eec Microsoft.Resources/stable/2024-03-01/deploymentStacks.json",
|
||||
"package-deploymentstacks-2022-08-preview": "2024-05-02 13:16:57 -0400 88cc082d66e2b481ed99a17d44edffaeb6254eec Microsoft.Resources/preview/2022-08-01-preview/deploymentStacks.json",
|
||||
"package-changes-2022-05": "2022-04-24 21:43:30 -0700 91b36e26db23dffc149d968333c29f9a2f131702 Microsoft.Resources/stable/2022-05-01/changes.json",
|
||||
"package-policy-2023-04-only": "2024-06-12 20:54:26 -0700 412364b282e52b50eadc3cd88d56d283b6c8712a Microsoft.Authorization/stable/2023-04-01/policySetDefinitions.json"
|
||||
"package-policy-2023-04-only": "2024-06-12 20:54:26 -0700 412364b282e52b50eadc3cd88d56d283b6c8712a Microsoft.Authorization/stable/2023-04-01/policySetDefinitions.json",
|
||||
"package-databoundaries-2024-08": "2024-08-22 09:22:07 -0700 a6074b7654c388dec49c9969d0136cfeb03575c9 Microsoft.Resources/stable/2024-08-01/dataBoundaries.json"
|
||||
}
|
|
@ -126,20 +126,6 @@ class DataBoundaryMgmtClient(MultiApiClientMixin, _SDKClient):
|
|||
self._config.api_version = api_version
|
||||
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version)
|
||||
|
||||
@property
|
||||
def operations(self):
|
||||
"""Instance depends on the API version:
|
||||
|
||||
* 2024-08-01: :class:`Operations<azure.mgmt.resource.databoundaries.v2024_08_01.operations.Operations>`
|
||||
"""
|
||||
api_version = self._get_api_version('operations')
|
||||
if api_version == '2024-08-01':
|
||||
from .v2024_08_01.operations import Operations as OperationClass
|
||||
else:
|
||||
raise ValueError("API version {} does not have operation group 'operations'".format(api_version))
|
||||
self._config.api_version = api_version
|
||||
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version)
|
||||
|
||||
def close(self):
|
||||
self._client.close()
|
||||
def __enter__(self):
|
||||
|
|
|
@ -126,20 +126,6 @@ class DataBoundaryMgmtClient(MultiApiClientMixin, _SDKClient):
|
|||
self._config.api_version = api_version
|
||||
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version)
|
||||
|
||||
@property
|
||||
def operations(self):
|
||||
"""Instance depends on the API version:
|
||||
|
||||
* 2024-08-01: :class:`Operations<azure.mgmt.resource.databoundaries.v2024_08_01.aio.operations.Operations>`
|
||||
"""
|
||||
api_version = self._get_api_version('operations')
|
||||
if api_version == '2024-08-01':
|
||||
from ..v2024_08_01.aio.operations import Operations as OperationClass
|
||||
else:
|
||||
raise ValueError("API version {} does not have operation group 'operations'".format(api_version))
|
||||
self._config.api_version = api_version
|
||||
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version)
|
||||
|
||||
async def close(self):
|
||||
await self._client.close()
|
||||
async def __aenter__(self):
|
||||
|
|
|
@ -18,7 +18,7 @@ from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
|
|||
from . import models as _models
|
||||
from .._serialization import Deserializer, Serializer
|
||||
from ._configuration import DataBoundaryMgmtClientConfiguration
|
||||
from .operations import DataBoundariesOperations, Operations
|
||||
from .operations import DataBoundariesOperations
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# pylint: disable=unused-import,ungrouped-imports
|
||||
|
@ -28,8 +28,6 @@ if TYPE_CHECKING:
|
|||
class DataBoundaryMgmtClient: # pylint: disable=client-accepts-api-version-keyword
|
||||
"""Provides APIs for data boundary operations.
|
||||
|
||||
:ivar operations: Operations operations
|
||||
:vartype operations: azure.mgmt.resource.databoundaries.v2024_08_01.operations.Operations
|
||||
:ivar data_boundaries: DataBoundariesOperations operations
|
||||
:vartype data_boundaries:
|
||||
azure.mgmt.resource.databoundaries.v2024_08_01.operations.DataBoundariesOperations
|
||||
|
@ -70,7 +68,6 @@ class DataBoundaryMgmtClient: # pylint: disable=client-accepts-api-version-keyw
|
|||
self._serialize = Serializer(client_models)
|
||||
self._deserialize = Deserializer(client_models)
|
||||
self._serialize.client_side_validation = False
|
||||
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize, "2024-08-01")
|
||||
self.data_boundaries = DataBoundariesOperations(
|
||||
self._client, self._config, self._serialize, self._deserialize, "2024-08-01"
|
||||
)
|
||||
|
|
|
@ -92,7 +92,6 @@
|
|||
"async_imports": "{\"regular\": {\"sdkcore\": {\"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
|
||||
},
|
||||
"operation_groups": {
|
||||
"operations": "Operations",
|
||||
"data_boundaries": "DataBoundariesOperations"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPol
|
|||
from .. import models as _models
|
||||
from ..._serialization import Deserializer, Serializer
|
||||
from ._configuration import DataBoundaryMgmtClientConfiguration
|
||||
from .operations import DataBoundariesOperations, Operations
|
||||
from .operations import DataBoundariesOperations
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# pylint: disable=unused-import,ungrouped-imports
|
||||
|
@ -28,8 +28,6 @@ if TYPE_CHECKING:
|
|||
class DataBoundaryMgmtClient: # pylint: disable=client-accepts-api-version-keyword
|
||||
"""Provides APIs for data boundary operations.
|
||||
|
||||
:ivar operations: Operations operations
|
||||
:vartype operations: azure.mgmt.resource.databoundaries.v2024_08_01.aio.operations.Operations
|
||||
:ivar data_boundaries: DataBoundariesOperations operations
|
||||
:vartype data_boundaries:
|
||||
azure.mgmt.resource.databoundaries.v2024_08_01.aio.operations.DataBoundariesOperations
|
||||
|
@ -70,7 +68,6 @@ class DataBoundaryMgmtClient: # pylint: disable=client-accepts-api-version-keyw
|
|||
self._serialize = Serializer(client_models)
|
||||
self._deserialize = Deserializer(client_models)
|
||||
self._serialize.client_side_validation = False
|
||||
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize, "2024-08-01")
|
||||
self.data_boundaries = DataBoundariesOperations(
|
||||
self._client, self._config, self._serialize, self._deserialize, "2024-08-01"
|
||||
)
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
from ._operations import Operations
|
||||
from ._operations import DataBoundariesOperations
|
||||
|
||||
from ._patch import __all__ as _patch_all
|
||||
|
@ -14,7 +13,6 @@ from ._patch import * # pylint: disable=unused-wildcard-import
|
|||
from ._patch import patch_sdk as _patch_sdk
|
||||
|
||||
__all__ = [
|
||||
"Operations",
|
||||
"DataBoundariesOperations",
|
||||
]
|
||||
__all__.extend([p for p in _patch_all if p not in __all__])
|
||||
|
|
|
@ -8,10 +8,8 @@
|
|||
# --------------------------------------------------------------------------
|
||||
from io import IOBase
|
||||
import sys
|
||||
from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
|
||||
import urllib.parse
|
||||
from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
|
||||
|
||||
from azure.core.async_paging import AsyncItemPaged, AsyncList
|
||||
from azure.core.exceptions import (
|
||||
ClientAuthenticationError,
|
||||
HttpResponseError,
|
||||
|
@ -22,7 +20,6 @@ from azure.core.exceptions import (
|
|||
)
|
||||
from azure.core.pipeline import PipelineResponse
|
||||
from azure.core.rest import AsyncHttpResponse, HttpRequest
|
||||
from azure.core.tracing.decorator import distributed_trace
|
||||
from azure.core.tracing.decorator_async import distributed_trace_async
|
||||
from azure.core.utils import case_insensitive_dict
|
||||
from azure.mgmt.core.exceptions import ARMErrorFormat
|
||||
|
@ -32,7 +29,6 @@ from ...operations._operations import (
|
|||
build_data_boundaries_get_scope_request,
|
||||
build_data_boundaries_get_tenant_request,
|
||||
build_data_boundaries_put_request,
|
||||
build_operations_list_request,
|
||||
)
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
|
@ -43,102 +39,6 @@ T = TypeVar("T")
|
|||
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
|
||||
|
||||
|
||||
class Operations:
|
||||
"""
|
||||
.. warning::
|
||||
**DO NOT** instantiate this class directly.
|
||||
|
||||
Instead, you should access the following operations through
|
||||
:class:`~azure.mgmt.resource.databoundaries.v2024_08_01.aio.DataBoundaryMgmtClient`'s
|
||||
:attr:`operations` attribute.
|
||||
"""
|
||||
|
||||
models = _models
|
||||
|
||||
def __init__(self, *args, **kwargs) -> None:
|
||||
input_args = list(args)
|
||||
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
|
||||
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
|
||||
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
|
||||
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
|
||||
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
|
||||
|
||||
@distributed_trace
|
||||
def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]:
|
||||
"""Lists all of the available Microsoft.Resources REST API operations.
|
||||
|
||||
:return: An iterator like instance of either Operation or the result of cls(response)
|
||||
:rtype:
|
||||
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.databoundaries.v2024_08_01.models.Operation]
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
_headers = kwargs.pop("headers", {}) or {}
|
||||
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
||||
|
||||
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-08-01"))
|
||||
cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None)
|
||||
|
||||
error_map: MutableMapping[int, Type[HttpResponseError]] = {
|
||||
401: ClientAuthenticationError,
|
||||
404: ResourceNotFoundError,
|
||||
409: ResourceExistsError,
|
||||
304: ResourceNotModifiedError,
|
||||
}
|
||||
error_map.update(kwargs.pop("error_map", {}) or {})
|
||||
|
||||
def prepare_request(next_link=None):
|
||||
if not next_link:
|
||||
|
||||
_request = build_operations_list_request(
|
||||
api_version=api_version,
|
||||
headers=_headers,
|
||||
params=_params,
|
||||
)
|
||||
_request.url = self._client.format_url(_request.url)
|
||||
|
||||
else:
|
||||
# make call to next link with the client's api-version
|
||||
_parsed_next_link = urllib.parse.urlparse(next_link)
|
||||
_next_request_params = case_insensitive_dict(
|
||||
{
|
||||
key: [urllib.parse.quote(v) for v in value]
|
||||
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
|
||||
}
|
||||
)
|
||||
_next_request_params["api-version"] = self._api_version
|
||||
_request = HttpRequest(
|
||||
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
|
||||
)
|
||||
_request.url = self._client.format_url(_request.url)
|
||||
_request.method = "GET"
|
||||
return _request
|
||||
|
||||
async def extract_data(pipeline_response):
|
||||
deserialized = self._deserialize("OperationListResult", pipeline_response)
|
||||
list_of_elem = deserialized.value
|
||||
if cls:
|
||||
list_of_elem = cls(list_of_elem) # type: ignore
|
||||
return deserialized.next_link or None, AsyncList(list_of_elem)
|
||||
|
||||
async def get_next(next_link=None):
|
||||
_request = prepare_request(next_link)
|
||||
|
||||
_stream = False
|
||||
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
|
||||
_request, stream=_stream, **kwargs
|
||||
)
|
||||
response = pipeline_response.http_response
|
||||
|
||||
if response.status_code not in [200]:
|
||||
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
||||
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
|
||||
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
|
||||
|
||||
return pipeline_response
|
||||
|
||||
return AsyncItemPaged(get_next, extract_data)
|
||||
|
||||
|
||||
class DataBoundariesOperations:
|
||||
"""
|
||||
.. warning::
|
||||
|
|
|
@ -11,18 +11,13 @@ from ._models_py3 import DataBoundaryProperties
|
|||
from ._models_py3 import ErrorAdditionalInfo
|
||||
from ._models_py3 import ErrorDetail
|
||||
from ._models_py3 import ErrorResponse
|
||||
from ._models_py3 import Operation
|
||||
from ._models_py3 import OperationDisplay
|
||||
from ._models_py3 import OperationListResult
|
||||
from ._models_py3 import ProxyResource
|
||||
from ._models_py3 import Resource
|
||||
from ._models_py3 import SystemData
|
||||
|
||||
from ._data_boundary_mgmt_client_enums import ActionType
|
||||
from ._data_boundary_mgmt_client_enums import CreatedByType
|
||||
from ._data_boundary_mgmt_client_enums import DataBoundary
|
||||
from ._data_boundary_mgmt_client_enums import DefaultName
|
||||
from ._data_boundary_mgmt_client_enums import Origin
|
||||
from ._data_boundary_mgmt_client_enums import ProvisioningState
|
||||
from ._patch import __all__ as _patch_all
|
||||
from ._patch import * # pylint: disable=unused-wildcard-import
|
||||
|
@ -34,17 +29,12 @@ __all__ = [
|
|||
"ErrorAdditionalInfo",
|
||||
"ErrorDetail",
|
||||
"ErrorResponse",
|
||||
"Operation",
|
||||
"OperationDisplay",
|
||||
"OperationListResult",
|
||||
"ProxyResource",
|
||||
"Resource",
|
||||
"SystemData",
|
||||
"ActionType",
|
||||
"CreatedByType",
|
||||
"DataBoundary",
|
||||
"DefaultName",
|
||||
"Origin",
|
||||
"ProvisioningState",
|
||||
]
|
||||
__all__.extend([p for p in _patch_all if p not in __all__])
|
||||
|
|
|
@ -10,12 +10,6 @@ from enum import Enum
|
|||
from azure.core import CaseInsensitiveEnumMeta
|
||||
|
||||
|
||||
class ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs."""
|
||||
|
||||
INTERNAL = "Internal"
|
||||
|
||||
|
||||
class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""The type of identity that created the resource."""
|
||||
|
||||
|
@ -40,16 +34,6 @@ class DefaultName(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
|||
DEFAULT = "default"
|
||||
|
||||
|
||||
class Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit
|
||||
logs UX. Default value is "user,system".
|
||||
"""
|
||||
|
||||
USER = "user"
|
||||
SYSTEM = "system"
|
||||
USER_SYSTEM = "user,system"
|
||||
|
||||
|
||||
class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""Denotes the state of provisioning."""
|
||||
|
||||
|
|
|
@ -253,127 +253,6 @@ class ErrorResponse(_serialization.Model):
|
|||
self.error = error
|
||||
|
||||
|
||||
class Operation(_serialization.Model):
|
||||
"""Details of a REST API operation, returned from the Resource Provider Operations API.
|
||||
|
||||
Variables are only populated by the server, and will be ignored when sending a request.
|
||||
|
||||
:ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples:
|
||||
"Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action".
|
||||
:vartype name: str
|
||||
:ivar is_data_action: Whether the operation applies to data-plane. This is "true" for
|
||||
data-plane operations and "false" for ARM/control-plane operations.
|
||||
:vartype is_data_action: bool
|
||||
:ivar display: Localized display information for this particular operation.
|
||||
:vartype display: ~azure.mgmt.resource.databoundaries.v2024_08_01.models.OperationDisplay
|
||||
:ivar origin: The intended executor of the operation; as in Resource Based Access Control
|
||||
(RBAC) and audit logs UX. Default value is "user,system". Known values are: "user", "system",
|
||||
and "user,system".
|
||||
:vartype origin: str or ~azure.mgmt.resource.databoundaries.v2024_08_01.models.Origin
|
||||
:ivar action_type: Enum. Indicates the action type. "Internal" refers to actions that are for
|
||||
internal only APIs. "Internal"
|
||||
:vartype action_type: str or ~azure.mgmt.resource.databoundaries.v2024_08_01.models.ActionType
|
||||
"""
|
||||
|
||||
_validation = {
|
||||
"name": {"readonly": True},
|
||||
"is_data_action": {"readonly": True},
|
||||
"origin": {"readonly": True},
|
||||
"action_type": {"readonly": True},
|
||||
}
|
||||
|
||||
_attribute_map = {
|
||||
"name": {"key": "name", "type": "str"},
|
||||
"is_data_action": {"key": "isDataAction", "type": "bool"},
|
||||
"display": {"key": "display", "type": "OperationDisplay"},
|
||||
"origin": {"key": "origin", "type": "str"},
|
||||
"action_type": {"key": "actionType", "type": "str"},
|
||||
}
|
||||
|
||||
def __init__(self, *, display: Optional["_models.OperationDisplay"] = None, **kwargs: Any) -> None:
|
||||
"""
|
||||
:keyword display: Localized display information for this particular operation.
|
||||
:paramtype display: ~azure.mgmt.resource.databoundaries.v2024_08_01.models.OperationDisplay
|
||||
"""
|
||||
super().__init__(**kwargs)
|
||||
self.name = None
|
||||
self.is_data_action = None
|
||||
self.display = display
|
||||
self.origin = None
|
||||
self.action_type = None
|
||||
|
||||
|
||||
class OperationDisplay(_serialization.Model):
|
||||
"""Localized display information for this particular operation.
|
||||
|
||||
Variables are only populated by the server, and will be ignored when sending a request.
|
||||
|
||||
:ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft
|
||||
Monitoring Insights" or "Microsoft Compute".
|
||||
:vartype provider: str
|
||||
:ivar resource: The localized friendly name of the resource type related to this operation.
|
||||
E.g. "Virtual Machines" or "Job Schedule Collections".
|
||||
:vartype resource: str
|
||||
:ivar operation: The concise, localized friendly name for the operation; suitable for
|
||||
dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine".
|
||||
:vartype operation: str
|
||||
:ivar description: The short, localized friendly description of the operation; suitable for
|
||||
tool tips and detailed views.
|
||||
:vartype description: str
|
||||
"""
|
||||
|
||||
_validation = {
|
||||
"provider": {"readonly": True},
|
||||
"resource": {"readonly": True},
|
||||
"operation": {"readonly": True},
|
||||
"description": {"readonly": True},
|
||||
}
|
||||
|
||||
_attribute_map = {
|
||||
"provider": {"key": "provider", "type": "str"},
|
||||
"resource": {"key": "resource", "type": "str"},
|
||||
"operation": {"key": "operation", "type": "str"},
|
||||
"description": {"key": "description", "type": "str"},
|
||||
}
|
||||
|
||||
def __init__(self, **kwargs: Any) -> None:
|
||||
""" """
|
||||
super().__init__(**kwargs)
|
||||
self.provider = None
|
||||
self.resource = None
|
||||
self.operation = None
|
||||
self.description = None
|
||||
|
||||
|
||||
class OperationListResult(_serialization.Model):
|
||||
"""A list of REST API operations supported by an Azure Resource Provider. It contains an URL link
|
||||
to get the next set of results.
|
||||
|
||||
Variables are only populated by the server, and will be ignored when sending a request.
|
||||
|
||||
:ivar value: List of operations supported by the resource provider.
|
||||
:vartype value: list[~azure.mgmt.resource.databoundaries.v2024_08_01.models.Operation]
|
||||
:ivar next_link: URL to get the next set of operation list results (if there are any).
|
||||
:vartype next_link: str
|
||||
"""
|
||||
|
||||
_validation = {
|
||||
"value": {"readonly": True},
|
||||
"next_link": {"readonly": True},
|
||||
}
|
||||
|
||||
_attribute_map = {
|
||||
"value": {"key": "value", "type": "[Operation]"},
|
||||
"next_link": {"key": "nextLink", "type": "str"},
|
||||
}
|
||||
|
||||
def __init__(self, **kwargs: Any) -> None:
|
||||
""" """
|
||||
super().__init__(**kwargs)
|
||||
self.value = None
|
||||
self.next_link = None
|
||||
|
||||
|
||||
class SystemData(_serialization.Model):
|
||||
"""Metadata pertaining to creation and last modification of the resource.
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
from ._operations import Operations
|
||||
from ._operations import DataBoundariesOperations
|
||||
|
||||
from ._patch import __all__ as _patch_all
|
||||
|
@ -14,7 +13,6 @@ from ._patch import * # pylint: disable=unused-wildcard-import
|
|||
from ._patch import patch_sdk as _patch_sdk
|
||||
|
||||
__all__ = [
|
||||
"Operations",
|
||||
"DataBoundariesOperations",
|
||||
]
|
||||
__all__.extend([p for p in _patch_all if p not in __all__])
|
||||
|
|
|
@ -8,8 +8,7 @@
|
|||
# --------------------------------------------------------------------------
|
||||
from io import IOBase
|
||||
import sys
|
||||
from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload
|
||||
import urllib.parse
|
||||
from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
|
||||
|
||||
from azure.core.exceptions import (
|
||||
ClientAuthenticationError,
|
||||
|
@ -19,7 +18,6 @@ from azure.core.exceptions import (
|
|||
ResourceNotModifiedError,
|
||||
map_error,
|
||||
)
|
||||
from azure.core.paging import ItemPaged
|
||||
from azure.core.pipeline import PipelineResponse
|
||||
from azure.core.rest import HttpRequest, HttpResponse
|
||||
from azure.core.tracing.decorator import distributed_trace
|
||||
|
@ -40,25 +38,6 @@ _SERIALIZER = Serializer()
|
|||
_SERIALIZER.client_side_validation = False
|
||||
|
||||
|
||||
def build_operations_list_request(**kwargs: Any) -> HttpRequest:
|
||||
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
||||
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
||||
|
||||
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-01"))
|
||||
accept = _headers.pop("Accept", "application/json")
|
||||
|
||||
# Construct URL
|
||||
_url = kwargs.pop("template_url", "/providers/Microsoft.Resources/operations")
|
||||
|
||||
# Construct parameters
|
||||
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
|
||||
|
||||
# Construct headers
|
||||
_headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
|
||||
|
||||
return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
|
||||
|
||||
|
||||
def build_data_boundaries_put_request(default: Union[str, _models.DefaultName], **kwargs: Any) -> HttpRequest:
|
||||
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
||||
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
||||
|
@ -137,102 +116,6 @@ def build_data_boundaries_get_scope_request(
|
|||
return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
|
||||
|
||||
|
||||
class Operations:
|
||||
"""
|
||||
.. warning::
|
||||
**DO NOT** instantiate this class directly.
|
||||
|
||||
Instead, you should access the following operations through
|
||||
:class:`~azure.mgmt.resource.databoundaries.v2024_08_01.DataBoundaryMgmtClient`'s
|
||||
:attr:`operations` attribute.
|
||||
"""
|
||||
|
||||
models = _models
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
input_args = list(args)
|
||||
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
|
||||
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
|
||||
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
|
||||
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
|
||||
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
|
||||
|
||||
@distributed_trace
|
||||
def list(self, **kwargs: Any) -> Iterable["_models.Operation"]:
|
||||
"""Lists all of the available Microsoft.Resources REST API operations.
|
||||
|
||||
:return: An iterator like instance of either Operation or the result of cls(response)
|
||||
:rtype:
|
||||
~azure.core.paging.ItemPaged[~azure.mgmt.resource.databoundaries.v2024_08_01.models.Operation]
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
_headers = kwargs.pop("headers", {}) or {}
|
||||
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
||||
|
||||
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-08-01"))
|
||||
cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None)
|
||||
|
||||
error_map: MutableMapping[int, Type[HttpResponseError]] = {
|
||||
401: ClientAuthenticationError,
|
||||
404: ResourceNotFoundError,
|
||||
409: ResourceExistsError,
|
||||
304: ResourceNotModifiedError,
|
||||
}
|
||||
error_map.update(kwargs.pop("error_map", {}) or {})
|
||||
|
||||
def prepare_request(next_link=None):
|
||||
if not next_link:
|
||||
|
||||
_request = build_operations_list_request(
|
||||
api_version=api_version,
|
||||
headers=_headers,
|
||||
params=_params,
|
||||
)
|
||||
_request.url = self._client.format_url(_request.url)
|
||||
|
||||
else:
|
||||
# make call to next link with the client's api-version
|
||||
_parsed_next_link = urllib.parse.urlparse(next_link)
|
||||
_next_request_params = case_insensitive_dict(
|
||||
{
|
||||
key: [urllib.parse.quote(v) for v in value]
|
||||
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
|
||||
}
|
||||
)
|
||||
_next_request_params["api-version"] = self._api_version
|
||||
_request = HttpRequest(
|
||||
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
|
||||
)
|
||||
_request.url = self._client.format_url(_request.url)
|
||||
_request.method = "GET"
|
||||
return _request
|
||||
|
||||
def extract_data(pipeline_response):
|
||||
deserialized = self._deserialize("OperationListResult", pipeline_response)
|
||||
list_of_elem = deserialized.value
|
||||
if cls:
|
||||
list_of_elem = cls(list_of_elem) # type: ignore
|
||||
return deserialized.next_link or None, iter(list_of_elem)
|
||||
|
||||
def get_next(next_link=None):
|
||||
_request = prepare_request(next_link)
|
||||
|
||||
_stream = False
|
||||
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
|
||||
_request, stream=_stream, **kwargs
|
||||
)
|
||||
response = pipeline_response.http_response
|
||||
|
||||
if response.status_code not in [200]:
|
||||
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
||||
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
|
||||
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
|
||||
|
||||
return pipeline_response
|
||||
|
||||
return ItemPaged(get_next, extract_data)
|
||||
|
||||
|
||||
class DataBoundariesOperations:
|
||||
"""
|
||||
.. warning::
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
collect_ignore_glob = ["generated_tests"]
|
|
@ -33,5 +33,3 @@ def add_sanitizers(test_proxy):
|
|||
add_header_regex_sanitizer(key="Set-Cookie", value="[set-cookie;]")
|
||||
add_header_regex_sanitizer(key="Cookie", value="cookie;")
|
||||
add_body_key_sanitizer(json_path="$..access_token", value="access_token")
|
||||
|
||||
collect_ignore_glob = ["*"]
|
||||
|
|
Загрузка…
Ссылка в новой задаче