Skip to content

Commit 2a91173

Browse files
author
SDKAuto
committed
CodeGen from PR 33988 in Azure/azure-rest-api-specs
Merge 1522e0f61d37aaaa9cdb5c143b6ffdf1643eac13 into 4f6ba43a83ed4f80863e1fe698ac10b89e8c48a0
1 parent 6d22700 commit 2a91173

File tree

50 files changed

+2486
-1329
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+2486
-1329
lines changed

sdk/attestation/azure-mgmt-attestation/CHANGELOG.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,53 @@
11
# Release History
22

3+
## 2.0.0 (2025-04-16)
4+
5+
### Features Added
6+
7+
- Client `AttestationManagementClient` added operation group `private_endpoint_connections`
8+
- Client `AttestationManagementClient` added operation group `private_link_resources`
9+
- Model `AttestationProvider` added property `system_data`
10+
- Model `AttestationProvider` added property `public_network_access`
11+
- Model `AttestationProvider` added property `private_endpoint_connections`
12+
- Model `AttestationProvider` added property `tpm_attestation_authentication`
13+
- Model `AttestationProviderListResult` added property `system_data`
14+
- Model `AttestationServiceCreationSpecificParams` added property `public_network_access`
15+
- Model `AttestationServiceCreationSpecificParams` added property `tpm_attestation_authentication`
16+
- Model `AttestationServicePatchParams` added property `properties`
17+
- Model `OperationList` added property `system_data`
18+
- Model `OperationsDefinition` added property `properties`
19+
- Added model `AttestationServicePatchSpecificParams`
20+
- Added enum `CreatedByType`
21+
- Added model `LogSpecification`
22+
- Added model `OperationProperties`
23+
- Added model `PrivateEndpoint`
24+
- Added model `PrivateEndpointConnection`
25+
- Added model `PrivateEndpointConnectionListResult`
26+
- Added enum `PrivateEndpointConnectionProvisioningState`
27+
- Added enum `PrivateEndpointServiceConnectionStatus`
28+
- Added model `PrivateLinkResource`
29+
- Added model `PrivateLinkResourceListResult`
30+
- Added model `PrivateLinkServiceConnectionState`
31+
- Added enum `PublicNetworkAccessType`
32+
- Added model `ServiceSpecification`
33+
- Added model `SystemData`
34+
- Added enum `TpmAttestationAuthenticationType`
35+
- Model `AttestationProvidersOperations` added parameter `kwargs` in method `__init__`
36+
- Model `Operations` added parameter `kwargs` in method `__init__`
37+
- Added model `PrivateEndpointConnectionsOperations`
38+
- Added model `PrivateLinkResourcesOperations`
39+
- Method `AttestationProvidersOperations.create` has a new overload `def create(self: None, resource_group_name: str, provider_name: str, creation_params: AttestationServiceCreationParams, content_type: str)`
40+
- Method `AttestationProvidersOperations.create` has a new overload `def create(self: None, resource_group_name: str, provider_name: str, creation_params: IO[bytes], content_type: str)`
41+
- Method `AttestationProvidersOperations.update` has a new overload `def update(self: None, resource_group_name: str, provider_name: str, update_params: AttestationServicePatchParams, content_type: str)`
42+
- Method `AttestationProvidersOperations.update` has a new overload `def update(self: None, resource_group_name: str, provider_name: str, update_params: IO[bytes], content_type: str)`
43+
- Method `PrivateEndpointConnectionsOperations.create` has a new overload `def create(self: None, resource_group_name: str, provider_name: str, private_endpoint_connection_name: str, properties: PrivateEndpointConnection, content_type: str)`
44+
- Method `PrivateEndpointConnectionsOperations.create` has a new overload `def create(self: None, resource_group_name: str, provider_name: str, private_endpoint_connection_name: str, properties: IO[bytes], content_type: str)`
45+
46+
### Breaking Changes
47+
48+
- Method `AttestationManagementClient.__init__` parameter `base_url` changed default value from `None` to `str`
49+
- Model `AttestationServiceCreationSpecificParams` deleted or renamed its instance variable `attestation_policy`
50+
351
## 2.0.0b1 (2022-10-28)
452

553
### Features Added
Lines changed: 32 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,61 @@
11
# Microsoft Azure SDK for Python
22

33
This is the Microsoft Azure Attestation Management Client Library.
4-
This package has been tested with Python 3.7+.
4+
This package has been tested with Python 3.9+.
55
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).
66

77
## _Disclaimer_
88

99
_Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For more information and questions, please refer to https://github.com/Azure/azure-sdk-for-python/issues/20691_
1010

11-
## Getting Started
11+
## Getting started
1212

13-
### Prerequsites
14-
```shell
15-
pip install azure-identity
13+
### Prerequisites
14+
15+
- Python 3.9+ is required to use this package.
16+
- [Azure subscription](https://azure.microsoft.com/free/)
17+
18+
### Install the package
19+
20+
```bash
1621
pip install azure-mgmt-attestation
22+
pip install azure-identity
1723
```
18-
19-
Before running the examples, please set the values of the client ID, tenant ID and client secret
20-
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
21-
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
22-
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
2324

25+
### Authentication
2426

25-
### Resources
26-
To learn how to use this package, see the [quickstart guide](https://aka.ms/azsdk/python/mgmt)
27-
28-
For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure/)
29-
Code samples for this package can be found at [Attestation Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com.
30-
Additional code samples for different Azure services are available at [Samples Repo](https://aka.ms/azsdk/python/mgmt/samples)
27+
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configuration of the following environment variables.
3128

29+
- `AZURE_CLIENT_ID` for Azure client ID.
30+
- `AZURE_TENANT_ID` for Azure tenant ID.
31+
- `AZURE_CLIENT_SECRET` for Azure client secret.
3232

33-
## Examples
33+
In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`.
34+
35+
With above configuration, client can be authenticated by following code:
3436

35-
### List Attestation Providers
3637
```python
37-
from azure.core.exceptions import ClientAuthenticationError
3838
from azure.identity import DefaultAzureCredential
3939
from azure.mgmt.attestation import AttestationManagementClient
40+
import os
4041

41-
client = AttestationManagementClient(
42-
credential=DefaultAzureCredential(),
43-
subscription_id="00000000-0000-0000-0000-000000000000",
44-
)
45-
46-
response = client.attestation_providers.list()
47-
print(response)
42+
sub_id = os.getenv("AZURE_SUBSCRIPTION_ID")
43+
client = AttestationManagementClient(credential=DefaultAzureCredential(), subscription_id=sub_id)
4844
```
4945

50-
## Troubleshooting
51-
52-
### CredentialUnavailableError
53-
The CredentialUnavailableError is a specific error type derived from ClientAuthenticationError. This error type is used to indicate that the credential can't authenticate in the current environment, due to missing required configuration or setup. This error is also used as an indication for chained credential types, such as DefaultAzureCredential and ChainedTokenCredential, that the chained credential should continue to attempt other credential types later in the chain.
54-
55-
### Permission issues
56-
Service client calls that result in HttpResponseError with a StatusCode of 401 or 403 often indicate the caller doesn't have sufficient permissions for the specified API. Check the [service documentation](https://learn.microsoft.com/azure/attestation/) to determine which RBAC roles are needed for the specific request, and ensure the authenticated user or service principal have been granted the appropriate roles on the resource.
57-
58-
## Next Steps
59-
60-
If you encounter any bugs or have suggestions, please file an issue in the
61-
[Issues](https://github.com/Azure/azure-sdk-for-python/issues)
62-
section of the project.
63-
46+
## Examples
6447

48+
Code samples for this package can be found at:
49+
- [Search Attestation Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com
50+
- [Azure Python Mgmt SDK Samples Repo](https://aka.ms/azsdk/python/mgmt/samples)
6551

6652

67-
## Contributing
53+
## Troubleshooting
6854

69-
This project welcomes contributions and suggestions. Most contributions require
70-
you to agree to a Contributor License Agreement (CLA) declaring that you have
71-
the right to, and actually do, grant us the rights to use your contribution.
72-
For details, visit [https://cla.microsoft.com](https://cla.microsoft.com).
55+
## Next steps
7356

74-
When you submit a pull request, a CLA-bot will automatically determine whether
75-
you need to provide a CLA and decorate the PR appropriately (e.g., label,
76-
comment). Simply follow the instructions provided by the bot. You will only
77-
need to do this once across all repos using our CLA.
57+
## Provide Feedback
7858

79-
This project has adopted the
80-
[Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
81-
For more information, see the
82-
[Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
83-
or contact [[email protected]](mailto:[email protected]) with any
84-
additional questions or comments.
59+
If you encounter any bugs or have suggestions, please file an issue in the
60+
[Issues](https://github.com/Azure/azure-sdk-for-python/issues)
61+
section of the project.
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "e82a24def11ffc98cc263884f9f1742c99f2df5e",
2+
"commit": "e7f52891d98eba629a54a20c75f81b0537bdf5fa",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4-
"autorest": "3.9.2",
4+
"autorest": "3.10.2",
55
"use": [
6-
"@autorest/python@6.2.1",
7-
"@autorest/modelerfour@4.24.3"
6+
"@autorest/python@6.32.3",
7+
"@autorest/modelerfour@4.27.0"
88
],
9-
"autorest_command": "autorest specification/attestation/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.2.1 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
9+
"autorest_command": "autorest specification/attestation/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.32.3 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False",
1010
"readme": "specification/attestation/resource-manager/readme.md"
1111
}

sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/__init__.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,28 @@
55
# Code generated by Microsoft (R) AutoRest Code Generator.
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
8+
# pylint: disable=wrong-import-position
89

9-
from ._attestation_management_client import AttestationManagementClient
10+
from typing import TYPE_CHECKING
11+
12+
if TYPE_CHECKING:
13+
from ._patch import * # pylint: disable=unused-wildcard-import
14+
15+
from ._attestation_management_client import AttestationManagementClient # type: ignore
1016
from ._version import VERSION
1117

1218
__version__ = VERSION
1319

1420
try:
1521
from ._patch import __all__ as _patch_all
16-
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
22+
from ._patch import *
1723
except ImportError:
1824
_patch_all = []
1925
from ._patch import patch_sdk as _patch_sdk
2026

2127
__all__ = [
2228
"AttestationManagementClient",
2329
]
24-
__all__.extend([p for p in _patch_all if p not in __all__])
30+
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
2531

2632
_patch_sdk()

sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/_attestation_management_client.py

Lines changed: 44 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,28 @@
88

99
from copy import deepcopy
1010
from typing import Any, TYPE_CHECKING
11+
from typing_extensions import Self
1112

13+
from azure.core.pipeline import policies
1214
from azure.core.rest import HttpRequest, HttpResponse
1315
from azure.mgmt.core import ARMPipelineClient
16+
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
1417

15-
from . import models
18+
from . import models as _models
1619
from ._configuration import AttestationManagementClientConfiguration
1720
from ._serialization import Deserializer, Serializer
18-
from .operations import AttestationProvidersOperations, Operations, PrivateEndpointConnectionsOperations
21+
from .operations import (
22+
AttestationProvidersOperations,
23+
Operations,
24+
PrivateEndpointConnectionsOperations,
25+
PrivateLinkResourcesOperations,
26+
)
1927

2028
if TYPE_CHECKING:
21-
# pylint: disable=unused-import,ungrouped-imports
2229
from azure.core.credentials import TokenCredential
2330

2431

25-
class AttestationManagementClient: # pylint: disable=client-accepts-api-version-keyword
32+
class AttestationManagementClient:
2633
"""Various APIs for managing resources in attestation service. This primarily encompasses
2734
per-provider management.
2835
@@ -34,13 +41,16 @@ class AttestationManagementClient: # pylint: disable=client-accepts-api-version
3441
:ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations
3542
:vartype private_endpoint_connections:
3643
azure.mgmt.attestation.operations.PrivateEndpointConnectionsOperations
44+
:ivar private_link_resources: PrivateLinkResourcesOperations operations
45+
:vartype private_link_resources:
46+
azure.mgmt.attestation.operations.PrivateLinkResourcesOperations
3747
:param credential: Credential needed for the client to connect to Azure. Required.
3848
:type credential: ~azure.core.credentials.TokenCredential
3949
:param subscription_id: The ID of the target subscription. Required.
4050
:type subscription_id: str
4151
:param base_url: Service URL. Default value is "https://management.azure.com".
4252
:type base_url: str
43-
:keyword api_version: Api Version. Default value is "2020-10-01". Note that overriding this
53+
:keyword api_version: Api Version. Default value is "2021-06-01". Note that overriding this
4454
default value may result in unsupported behavior.
4555
:paramtype api_version: str
4656
"""
@@ -55,9 +65,27 @@ def __init__(
5565
self._config = AttestationManagementClientConfiguration(
5666
credential=credential, subscription_id=subscription_id, **kwargs
5767
)
58-
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
59-
60-
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
68+
_policies = kwargs.pop("policies", None)
69+
if _policies is None:
70+
_policies = [
71+
policies.RequestIdPolicy(**kwargs),
72+
self._config.headers_policy,
73+
self._config.user_agent_policy,
74+
self._config.proxy_policy,
75+
policies.ContentDecodePolicy(**kwargs),
76+
ARMAutoResourceProviderRegistrationPolicy(),
77+
self._config.redirect_policy,
78+
self._config.retry_policy,
79+
self._config.authentication_policy,
80+
self._config.custom_hook_policy,
81+
self._config.logging_policy,
82+
policies.DistributedTracingPolicy(**kwargs),
83+
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
84+
self._config.http_logging_policy,
85+
]
86+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
87+
88+
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
6189
self._serialize = Serializer(client_models)
6290
self._deserialize = Deserializer(client_models)
6391
self._serialize.client_side_validation = False
@@ -68,8 +96,11 @@ def __init__(
6896
self.private_endpoint_connections = PrivateEndpointConnectionsOperations(
6997
self._client, self._config, self._serialize, self._deserialize
7098
)
99+
self.private_link_resources = PrivateLinkResourcesOperations(
100+
self._client, self._config, self._serialize, self._deserialize
101+
)
71102

72-
def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
103+
def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
73104
"""Runs the network request through the client's chained policies.
74105
75106
>>> from azure.core.rest import HttpRequest
@@ -89,17 +120,14 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
89120

90121
request_copy = deepcopy(request)
91122
request_copy.url = self._client.format_url(request_copy.url)
92-
return self._client.send_request(request_copy, **kwargs)
123+
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
93124

94-
def close(self):
95-
# type: () -> None
125+
def close(self) -> None:
96126
self._client.close()
97127

98-
def __enter__(self):
99-
# type: () -> AttestationManagementClient
128+
def __enter__(self) -> Self:
100129
self._client.__enter__()
101130
return self
102131

103-
def __exit__(self, *exc_details):
104-
# type: (Any) -> None
132+
def __exit__(self, *exc_details: Any) -> None:
105133
self._client.__exit__(*exc_details)

0 commit comments

Comments
 (0)