Skip to content

Commit 91018f4

Browse files
azure-sdkmsyyc
andauthored
[AutoRelease] t2-iotfirmwaredefense-2024-03-07-08506(can only be merged by SDK owner) (#34683)
* code and test * Update CHANGELOG.md --------- Co-authored-by: azure-sdk <PythonSdkPipelines> Co-authored-by: Yuchao Yan <[email protected]>
1 parent 28a603a commit 91018f4

File tree

102 files changed

+6163
-6155
lines changed

Some content is hidden

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

102 files changed

+6163
-6155
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,51 @@
11
# Release History
22

3+
## 1.0.0 (2024-03-27)
4+
5+
### Features Added
6+
7+
- Added operation group BinaryHardeningOperations
8+
- Added operation group CryptoCertificatesOperations
9+
- Added operation group CryptoKeysOperations
10+
- Added operation group CvesOperations
11+
- Added operation group FirmwaresOperations
12+
- Added operation group PasswordHashesOperations
13+
- Added operation group SbomComponentsOperations
14+
- Added operation group SummariesOperations
15+
- Model Firmware has a new parameter properties
16+
- Model FirmwareUpdateDefinition has a new parameter properties
17+
- Model Workspace has a new parameter properties
18+
- Model WorkspaceUpdateDefinition has a new parameter properties
19+
20+
### Breaking Changes
21+
22+
- Model CveSummary has a new required parameter summary_type
23+
- Model CveSummary no longer has parameter undefined
24+
- Model Firmware no longer has parameter description
25+
- Model Firmware no longer has parameter file_name
26+
- Model Firmware no longer has parameter file_size
27+
- Model Firmware no longer has parameter model
28+
- Model Firmware no longer has parameter provisioning_state
29+
- Model Firmware no longer has parameter status
30+
- Model Firmware no longer has parameter status_messages
31+
- Model Firmware no longer has parameter vendor
32+
- Model Firmware no longer has parameter version
33+
- Model FirmwareSummary has a new required parameter summary_type
34+
- Model FirmwareUpdateDefinition no longer has parameter description
35+
- Model FirmwareUpdateDefinition no longer has parameter file_name
36+
- Model FirmwareUpdateDefinition no longer has parameter file_size
37+
- Model FirmwareUpdateDefinition no longer has parameter model
38+
- Model FirmwareUpdateDefinition no longer has parameter provisioning_state
39+
- Model FirmwareUpdateDefinition no longer has parameter status
40+
- Model FirmwareUpdateDefinition no longer has parameter status_messages
41+
- Model FirmwareUpdateDefinition no longer has parameter vendor
42+
- Model FirmwareUpdateDefinition no longer has parameter version
43+
- Model PairedKey no longer has parameter additional_properties
44+
- Model UrlToken no longer has parameter upload_url
45+
- Model Workspace no longer has parameter provisioning_state
46+
- Model WorkspaceUpdateDefinition no longer has parameter provisioning_state
47+
- Removed operation group FirmwareOperations
48+
349
## 1.0.0b1 (2023-07-24)
450

551
* Initial Release

sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Microsoft Azure SDK for Python
22

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

77
## _Disclaimer_
@@ -12,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For
1212

1313
### Prerequisites
1414

15-
- Python 3.7+ is required to use this package.
15+
- Python 3.8+ is required to use this package.
1616
- [Azure subscription](https://azure.microsoft.com/free/)
1717

1818
### Install the package
@@ -59,6 +59,3 @@ Code samples for this package can be found at:
5959
If you encounter any bugs or have suggestions, please file an issue in the
6060
[Issues](https://github.com/Azure/azure-sdk-for-python/issues)
6161
section of the project.
62-
63-
64-
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-iotfirmwaredefense%2FREADME.png)
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "d03c1964cb76ffd6884d10a1871bbe779a2f68ef",
2+
"commit": "90fc96af52257944371b95428245bce0f218c7f5",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4-
"autorest": "3.9.2",
4+
"autorest": "3.9.7",
55
"use": [
6-
"@autorest/python@6.6.0",
7-
"@autorest/modelerfour@4.24.3"
6+
"@autorest/python@6.7.1",
7+
"@autorest/modelerfour@4.26.2"
88
],
9-
"autorest_command": "autorest specification/fist/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.6.0 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
9+
"autorest_command": "autorest specification/fist/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.7.1 --use=@autorest/modelerfour@4.26.2 --version=3.9.7 --version-tolerant=False",
1010
"readme": "specification/fist/resource-manager/readme.md"
1111
}

sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/_configuration.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@ class IoTFirmwareDefenseMgmtClientConfiguration(Configuration): # pylint: disab
2727
2828
:param credential: Credential needed for the client to connect to Azure. Required.
2929
:type credential: ~azure.core.credentials.TokenCredential
30-
:param subscription_id: The ID of the target subscription. Required.
30+
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
3131
:type subscription_id: str
32-
:keyword api_version: Api Version. Default value is "2023-02-08-preview". Note that overriding
33-
this default value may result in unsupported behavior.
32+
:keyword api_version: Api Version. Default value is "2024-01-10". Note that overriding this
33+
default value may result in unsupported behavior.
3434
:paramtype api_version: str
3535
"""
3636

3737
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
3838
super(IoTFirmwareDefenseMgmtClientConfiguration, self).__init__(**kwargs)
39-
api_version: str = kwargs.pop("api_version", "2023-02-08-preview")
39+
api_version: str = kwargs.pop("api_version", "2024-01-10")
4040

4141
if credential is None:
4242
raise ValueError("Parameter 'credential' must not be None.")

sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/_io_tfirmware_defense_mgmt_client.py

Lines changed: 50 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,31 +15,56 @@
1515
from . import models as _models
1616
from ._configuration import IoTFirmwareDefenseMgmtClientConfiguration
1717
from ._serialization import Deserializer, Serializer
18-
from .operations import FirmwareOperations, Operations, WorkspacesOperations
18+
from .operations import (
19+
BinaryHardeningOperations,
20+
CryptoCertificatesOperations,
21+
CryptoKeysOperations,
22+
CvesOperations,
23+
FirmwaresOperations,
24+
Operations,
25+
PasswordHashesOperations,
26+
SbomComponentsOperations,
27+
SummariesOperations,
28+
WorkspacesOperations,
29+
)
1930

2031
if TYPE_CHECKING:
2132
# pylint: disable=unused-import,ungrouped-imports
2233
from azure.core.credentials import TokenCredential
2334

2435

25-
class IoTFirmwareDefenseMgmtClient: # pylint: disable=client-accepts-api-version-keyword
26-
"""The definitions and parameters in this swagger specification will be used to manage the IoT
27-
Firmware Defense resources.
28-
29-
:ivar firmware: FirmwareOperations operations
30-
:vartype firmware: azure.mgmt.iotfirmwaredefense.operations.FirmwareOperations
31-
:ivar workspaces: WorkspacesOperations operations
32-
:vartype workspaces: azure.mgmt.iotfirmwaredefense.operations.WorkspacesOperations
36+
class IoTFirmwareDefenseMgmtClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
37+
"""Firmware & IoT Security REST API.
38+
39+
:ivar binary_hardening: BinaryHardeningOperations operations
40+
:vartype binary_hardening: azure.mgmt.iotfirmwaredefense.operations.BinaryHardeningOperations
41+
:ivar crypto_certificates: CryptoCertificatesOperations operations
42+
:vartype crypto_certificates:
43+
azure.mgmt.iotfirmwaredefense.operations.CryptoCertificatesOperations
44+
:ivar crypto_keys: CryptoKeysOperations operations
45+
:vartype crypto_keys: azure.mgmt.iotfirmwaredefense.operations.CryptoKeysOperations
46+
:ivar cves: CvesOperations operations
47+
:vartype cves: azure.mgmt.iotfirmwaredefense.operations.CvesOperations
48+
:ivar firmwares: FirmwaresOperations operations
49+
:vartype firmwares: azure.mgmt.iotfirmwaredefense.operations.FirmwaresOperations
3350
:ivar operations: Operations operations
3451
:vartype operations: azure.mgmt.iotfirmwaredefense.operations.Operations
52+
:ivar password_hashes: PasswordHashesOperations operations
53+
:vartype password_hashes: azure.mgmt.iotfirmwaredefense.operations.PasswordHashesOperations
54+
:ivar sbom_components: SbomComponentsOperations operations
55+
:vartype sbom_components: azure.mgmt.iotfirmwaredefense.operations.SbomComponentsOperations
56+
:ivar summaries: SummariesOperations operations
57+
:vartype summaries: azure.mgmt.iotfirmwaredefense.operations.SummariesOperations
58+
:ivar workspaces: WorkspacesOperations operations
59+
:vartype workspaces: azure.mgmt.iotfirmwaredefense.operations.WorkspacesOperations
3560
:param credential: Credential needed for the client to connect to Azure. Required.
3661
:type credential: ~azure.core.credentials.TokenCredential
37-
:param subscription_id: The ID of the target subscription. Required.
62+
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
3863
:type subscription_id: str
3964
:param base_url: Service URL. Default value is "https://management.azure.com".
4065
:type base_url: str
41-
:keyword api_version: Api Version. Default value is "2023-02-08-preview". Note that overriding
42-
this default value may result in unsupported behavior.
66+
:keyword api_version: Api Version. Default value is "2024-01-10". Note that overriding this
67+
default value may result in unsupported behavior.
4368
:paramtype api_version: str
4469
"""
4570

@@ -59,9 +84,20 @@ def __init__(
5984
self._serialize = Serializer(client_models)
6085
self._deserialize = Deserializer(client_models)
6186
self._serialize.client_side_validation = False
62-
self.firmware = FirmwareOperations(self._client, self._config, self._serialize, self._deserialize)
63-
self.workspaces = WorkspacesOperations(self._client, self._config, self._serialize, self._deserialize)
87+
self.binary_hardening = BinaryHardeningOperations(
88+
self._client, self._config, self._serialize, self._deserialize
89+
)
90+
self.crypto_certificates = CryptoCertificatesOperations(
91+
self._client, self._config, self._serialize, self._deserialize
92+
)
93+
self.crypto_keys = CryptoKeysOperations(self._client, self._config, self._serialize, self._deserialize)
94+
self.cves = CvesOperations(self._client, self._config, self._serialize, self._deserialize)
95+
self.firmwares = FirmwaresOperations(self._client, self._config, self._serialize, self._deserialize)
6496
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
97+
self.password_hashes = PasswordHashesOperations(self._client, self._config, self._serialize, self._deserialize)
98+
self.sbom_components = SbomComponentsOperations(self._client, self._config, self._serialize, self._deserialize)
99+
self.summaries = SummariesOperations(self._client, self._config, self._serialize, self._deserialize)
100+
self.workspaces = WorkspacesOperations(self._client, self._config, self._serialize, self._deserialize)
65101

66102
def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
67103
"""Runs the network request through the client's chained policies.

sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/_serialization.py

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -662,8 +662,9 @@ def _serialize(self, target_obj, data_type=None, **kwargs):
662662
_serialized.update(_new_attr) # type: ignore
663663
_new_attr = _new_attr[k] # type: ignore
664664
_serialized = _serialized[k]
665-
except ValueError:
666-
continue
665+
except ValueError as err:
666+
if isinstance(err, SerializationError):
667+
raise
667668

668669
except (AttributeError, KeyError, TypeError) as err:
669670
msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj))
@@ -741,6 +742,8 @@ def query(self, name, data, data_type, **kwargs):
741742
742743
:param data: The data to be serialized.
743744
:param str data_type: The type to be serialized from.
745+
:keyword bool skip_quote: Whether to skip quote the serialized result.
746+
Defaults to False.
744747
:rtype: str
745748
:raises: TypeError if serialization fails.
746749
:raises: ValueError if data is None
@@ -749,10 +752,8 @@ def query(self, name, data, data_type, **kwargs):
749752
# Treat the list aside, since we don't want to encode the div separator
750753
if data_type.startswith("["):
751754
internal_data_type = data_type[1:-1]
752-
data = [self.serialize_data(d, internal_data_type, **kwargs) if d is not None else "" for d in data]
753-
if not kwargs.get("skip_quote", False):
754-
data = [quote(str(d), safe="") for d in data]
755-
return str(self.serialize_iter(data, internal_data_type, **kwargs))
755+
do_quote = not kwargs.get("skip_quote", False)
756+
return str(self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs))
756757

757758
# Not a list, regular serialization
758759
output = self.serialize_data(data, data_type, **kwargs)
@@ -891,6 +892,8 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs):
891892
not be None or empty.
892893
:param str div: If set, this str will be used to combine the elements
893894
in the iterable into a combined string. Default is 'None'.
895+
:keyword bool do_quote: Whether to quote the serialized result of each iterable element.
896+
Defaults to False.
894897
:rtype: list, str
895898
"""
896899
if isinstance(data, str):
@@ -903,9 +906,14 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs):
903906
for d in data:
904907
try:
905908
serialized.append(self.serialize_data(d, iter_type, **kwargs))
906-
except ValueError:
909+
except ValueError as err:
910+
if isinstance(err, SerializationError):
911+
raise
907912
serialized.append(None)
908913

914+
if kwargs.get("do_quote", False):
915+
serialized = ["" if s is None else quote(str(s), safe="") for s in serialized]
916+
909917
if div:
910918
serialized = ["" if s is None else str(s) for s in serialized]
911919
serialized = div.join(serialized)
@@ -950,7 +958,9 @@ def serialize_dict(self, attr, dict_type, **kwargs):
950958
for key, value in attr.items():
951959
try:
952960
serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs)
953-
except ValueError:
961+
except ValueError as err:
962+
if isinstance(err, SerializationError):
963+
raise
954964
serialized[self.serialize_unicode(key)] = None
955965

956966
if "xml" in serialization_ctxt:

sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/_vendor.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
66
# --------------------------------------------------------------------------
77

8-
from typing import List, cast
9-
108
from azure.core.pipeline.transport import HttpRequest
119

1210

@@ -16,15 +14,3 @@ def _convert_request(request, files=None):
1614
if files:
1715
request.set_formdata_body(files)
1816
return request
19-
20-
21-
def _format_url_section(template, **kwargs):
22-
components = template.split("/")
23-
while components:
24-
try:
25-
return template.format(**kwargs)
26-
except KeyError as key:
27-
# Need the cast, as for some reasons "split" is typed as list[str | Any]
28-
formatted_components = cast(List[str], template.split("/"))
29-
components = [c for c in formatted_components if "{}".format(key.args[0]) not in c]
30-
template = "/".join(components)

sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
VERSION = "1.0.0b1"
9+
VERSION = "1.0.0"

sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/aio/_configuration.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@ class IoTFirmwareDefenseMgmtClientConfiguration(Configuration): # pylint: disab
2727
2828
:param credential: Credential needed for the client to connect to Azure. Required.
2929
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
30-
:param subscription_id: The ID of the target subscription. Required.
30+
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
3131
:type subscription_id: str
32-
:keyword api_version: Api Version. Default value is "2023-02-08-preview". Note that overriding
33-
this default value may result in unsupported behavior.
32+
:keyword api_version: Api Version. Default value is "2024-01-10". Note that overriding this
33+
default value may result in unsupported behavior.
3434
:paramtype api_version: str
3535
"""
3636

3737
def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None:
3838
super(IoTFirmwareDefenseMgmtClientConfiguration, self).__init__(**kwargs)
39-
api_version: str = kwargs.pop("api_version", "2023-02-08-preview")
39+
api_version: str = kwargs.pop("api_version", "2024-01-10")
4040

4141
if credential is None:
4242
raise ValueError("Parameter 'credential' must not be None.")

0 commit comments

Comments
 (0)