Skip to content

Commit bfc7fc0

Browse files
SDKAutoArcturusZhang
andcommitted
CodeGen from PR 15680 in Azure/azure-rest-api-specs
Microsoft.BareMetalInfrastructure: add stable API version 2021-08-09 (Azure#15680) * Microsoft.BareMetalInfrastructure: add stable API version 2021-08-09 * Remove preview from output-folder in readme.go.md Co-authored-by: Arcturus <[email protected]> * Correct spelling of operation ID failing Swagger SpellCheck * Change json indents from 4 to 2 spaces * Ran 'npm prettier' tool Co-authored-by: Arcturus <[email protected]>
1 parent 7373db2 commit bfc7fc0

File tree

16 files changed

+343
-996
lines changed

16 files changed

+343
-996
lines changed

sdk/baremetalinfrastructure/azure-mgmt-baremetalinfrastructure/MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
include _meta.json
12
recursive-include tests *.py *.yaml
23
include *.md
34
include azure/__init__.py
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"autorest": "3.4.5",
3+
"use": [
4+
"@autorest/[email protected]",
5+
"@autorest/[email protected]"
6+
],
7+
"commit": "1e42e81660d1bc0be000477a4659b29a7ce7d67b",
8+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
9+
"autorest_command": "autorest specification/baremetalinfrastructure/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.5",
10+
"readme": "specification/baremetalinfrastructure/resource-manager/readme.md"
11+
}

sdk/baremetalinfrastructure/azure-mgmt-baremetalinfrastructure/azure/mgmt/baremetalinfrastructure/_bare_metal_infrastructure_client.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from typing import Any, Optional
1717

1818
from azure.core.credentials import TokenCredential
19+
from azure.core.pipeline.transport import HttpRequest, HttpResponse
1920

2021
from ._configuration import BareMetalInfrastructureClientConfiguration
2122
from .operations import AzureBareMetalInstancesOperations
@@ -35,7 +36,6 @@ class BareMetalInfrastructureClient(object):
3536
:param subscription_id: The ID of the target subscription.
3637
:type subscription_id: str
3738
:param str base_url: Service URL
38-
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
3939
"""
4040

4141
def __init__(
@@ -53,13 +53,32 @@ def __init__(
5353

5454
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
5555
self._serialize = Serializer(client_models)
56+
self._serialize.client_side_validation = False
5657
self._deserialize = Deserializer(client_models)
5758

5859
self.azure_bare_metal_instances = AzureBareMetalInstancesOperations(
5960
self._client, self._config, self._serialize, self._deserialize)
6061
self.operations = Operations(
6162
self._client, self._config, self._serialize, self._deserialize)
6263

64+
def _send_request(self, http_request, **kwargs):
65+
# type: (HttpRequest, Any) -> HttpResponse
66+
"""Runs the network request through the client's chained policies.
67+
68+
:param http_request: The network request you want to make. Required.
69+
:type http_request: ~azure.core.pipeline.transport.HttpRequest
70+
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
71+
:return: The response of your network call. Does not do error handling on your response.
72+
:rtype: ~azure.core.pipeline.transport.HttpResponse
73+
"""
74+
path_format_arguments = {
75+
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1),
76+
}
77+
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
78+
stream = kwargs.pop("stream", True)
79+
pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs)
80+
return pipeline_response.http_response
81+
6382
def close(self):
6483
# type: () -> None
6584
self._client.close()

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def __init__(
4848

4949
self.credential = credential
5050
self.subscription_id = subscription_id
51-
self.api_version = "2020-08-06-preview"
51+
self.api_version = "2021-08-09"
5252
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
5353
kwargs.setdefault('sdk_moniker', 'mgmt-baremetalinfrastructure/{}'.format(VERSION))
5454
self._configure(**kwargs)
Lines changed: 59 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,104 @@
11
{
2-
"chosen_version": "2020-08-06-preview",
3-
"total_api_version_list": ["2020-08-06-preview"],
2+
"chosen_version": "2021-08-09",
3+
"total_api_version_list": ["2021-08-09"],
44
"client": {
55
"name": "BareMetalInfrastructureClient",
66
"filename": "_bare_metal_infrastructure_client",
77
"description": "The BareMetalInfrastructure Management client.",
88
"base_url": "\u0027https://management.azure.com\u0027",
99
"custom_base_url": null,
1010
"azure_arm": true,
11-
"has_lro_operations": true
11+
"has_lro_operations": false,
12+
"client_side_validation": false,
13+
"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\": [\"BareMetalInfrastructureClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}",
14+
"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\": [\"BareMetalInfrastructureClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}"
1215
},
1316
"global_parameters": {
14-
"sync_method": {
17+
"sync": {
1518
"credential": {
16-
"method_signature": "credential, # type: \"TokenCredential\"",
19+
"signature": "credential, # type: \"TokenCredential\"",
1720
"description": "Credential needed for the client to connect to Azure.",
1821
"docstring_type": "~azure.core.credentials.TokenCredential",
1922
"required": true
2023
},
2124
"subscription_id": {
22-
"method_signature": "subscription_id, # type: str",
25+
"signature": "subscription_id, # type: str",
2326
"description": "The ID of the target subscription.",
2427
"docstring_type": "str",
2528
"required": true
2629
}
2730
},
28-
"async_method": {
31+
"async": {
2932
"credential": {
30-
"method_signature": "credential, # type: \"AsyncTokenCredential\"",
33+
"signature": "credential: \"AsyncTokenCredential\",",
3134
"description": "Credential needed for the client to connect to Azure.",
3235
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
3336
"required": true
3437
},
3538
"subscription_id": {
36-
"method_signature": "subscription_id, # type: str",
39+
"signature": "subscription_id: str,",
3740
"description": "The ID of the target subscription.",
3841
"docstring_type": "str",
3942
"required": true
4043
}
4144
},
4245
"constant": {
4346
},
44-
"call": "credential, subscription_id"
47+
"call": "credential, subscription_id",
48+
"service_client_specific": {
49+
"sync": {
50+
"api_version": {
51+
"signature": "api_version=None, # type: Optional[str]",
52+
"description": "API version to use if no profile is provided, or if missing in profile.",
53+
"docstring_type": "str",
54+
"required": false
55+
},
56+
"base_url": {
57+
"signature": "base_url=None, # type: Optional[str]",
58+
"description": "Service URL",
59+
"docstring_type": "str",
60+
"required": false
61+
},
62+
"profile": {
63+
"signature": "profile=KnownProfiles.default, # type: KnownProfiles",
64+
"description": "A profile definition, from KnownProfiles to dict.",
65+
"docstring_type": "azure.profiles.KnownProfiles",
66+
"required": false
67+
}
68+
},
69+
"async": {
70+
"api_version": {
71+
"signature": "api_version: Optional[str] = None,",
72+
"description": "API version to use if no profile is provided, or if missing in profile.",
73+
"docstring_type": "str",
74+
"required": false
75+
},
76+
"base_url": {
77+
"signature": "base_url: Optional[str] = None,",
78+
"description": "Service URL",
79+
"docstring_type": "str",
80+
"required": false
81+
},
82+
"profile": {
83+
"signature": "profile: KnownProfiles = KnownProfiles.default,",
84+
"description": "A profile definition, from KnownProfiles to dict.",
85+
"docstring_type": "azure.profiles.KnownProfiles",
86+
"required": false
87+
}
88+
}
89+
}
4590
},
4691
"config": {
4792
"credential": true,
4893
"credential_scopes": ["https://management.azure.com/.default"],
4994
"credential_default_policy_type": "BearerTokenCredentialPolicy",
5095
"credential_default_policy_type_has_async_version": true,
51-
"credential_key_header_name": null
96+
"credential_key_header_name": null,
97+
"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\"]}}}",
98+
"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\"]}}}"
5299
},
53100
"operation_groups": {
54101
"azure_bare_metal_instances": "AzureBareMetalInstancesOperations",
55102
"operations": "Operations"
56-
},
57-
"operation_mixins": {
58-
},
59-
"sync_imports": "None",
60-
"async_imports": "None"
103+
}
61104
}

sdk/baremetalinfrastructure/azure-mgmt-baremetalinfrastructure/azure/mgmt/baremetalinfrastructure/_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.0b2"
9+
VERSION = "1.0.0b1"

sdk/baremetalinfrastructure/azure-mgmt-baremetalinfrastructure/azure/mgmt/baremetalinfrastructure/aio/_bare_metal_infrastructure_client.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
from typing import Any, Optional, TYPE_CHECKING
1010

11+
from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
1112
from azure.mgmt.core import AsyncARMPipelineClient
1213
from msrest import Deserializer, Serializer
1314

@@ -33,7 +34,6 @@ class BareMetalInfrastructureClient(object):
3334
:param subscription_id: The ID of the target subscription.
3435
:type subscription_id: str
3536
:param str base_url: Service URL
36-
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
3737
"""
3838

3939
def __init__(
@@ -50,13 +50,31 @@ def __init__(
5050

5151
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
5252
self._serialize = Serializer(client_models)
53+
self._serialize.client_side_validation = False
5354
self._deserialize = Deserializer(client_models)
5455

5556
self.azure_bare_metal_instances = AzureBareMetalInstancesOperations(
5657
self._client, self._config, self._serialize, self._deserialize)
5758
self.operations = Operations(
5859
self._client, self._config, self._serialize, self._deserialize)
5960

61+
async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse:
62+
"""Runs the network request through the client's chained policies.
63+
64+
:param http_request: The network request you want to make. Required.
65+
:type http_request: ~azure.core.pipeline.transport.HttpRequest
66+
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
67+
:return: The response of your network call. Does not do error handling on your response.
68+
:rtype: ~azure.core.pipeline.transport.AsyncHttpResponse
69+
"""
70+
path_format_arguments = {
71+
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1),
72+
}
73+
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
74+
stream = kwargs.pop("stream", True)
75+
pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs)
76+
return pipeline_response.http_response
77+
6078
async def close(self) -> None:
6179
await self._client.close()
6280

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def __init__(
4545

4646
self.credential = credential
4747
self.subscription_id = subscription_id
48-
self.api_version = "2020-08-06-preview"
48+
self.api_version = "2021-08-09"
4949
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
5050
kwargs.setdefault('sdk_moniker', 'mgmt-baremetalinfrastructure/{}'.format(VERSION))
5151
self._configure(**kwargs)

0 commit comments

Comments
 (0)