Skip to content

Commit 01982cf

Browse files
msyycSDK Automationmitchdenny
authored
Track2-azure-mgmt-baremetalinfrastructure-2020-9-22 (#13941)
* Generated from b267289aa22920e99a52cf707523902efd9a9f4f * first version * Remove unnecessary includes. Co-authored-by: SDK Automation <[email protected]> Co-authored-by: Mitch Denny <[email protected]>
1 parent 7f5eb62 commit 01982cf

28 files changed

+3649
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Release History
2+
3+
## 1.0.0b1 (2020-09-22)
4+
5+
* Initial Release
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
recursive-include tests *.py *.yaml
2+
include *.md
3+
include azure/__init__.py
4+
include azure/mgmt/__init__.py
5+
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Microsoft Azure SDK for Python
2+
3+
This is the Microsoft Azure MyService Management Client Library.
4+
This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8.
5+
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).
6+
7+
8+
# Usage
9+
10+
For code examples, see [MyService Management](https://docs.microsoft.com/python/api/overview/azure/)
11+
on docs.microsoft.com.
12+
13+
14+
# Provide Feedback
15+
16+
If you encounter any bugs or have suggestions, please file an issue in the
17+
[Issues](https://github.com/Azure/azure-sdk-for-python/issues)
18+
section of the project.
19+
20+
21+
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-baremetalinfrastructure%2FREADME.png)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# Code generated by Microsoft (R) AutoRest Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------
8+
9+
from ._bare_metal_infrastructure_client import BareMetalInfrastructureClient
10+
from ._version import VERSION
11+
12+
__version__ = VERSION
13+
__all__ = ['BareMetalInfrastructureClient']
14+
15+
try:
16+
from ._patch import patch_sdk # type: ignore
17+
patch_sdk()
18+
except ImportError:
19+
pass
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# Code generated by Microsoft (R) AutoRest Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------
8+
9+
from typing import TYPE_CHECKING
10+
11+
from azure.mgmt.core import ARMPipelineClient
12+
from msrest import Deserializer, Serializer
13+
14+
if TYPE_CHECKING:
15+
# pylint: disable=unused-import,ungrouped-imports
16+
from typing import Any, Optional
17+
18+
from azure.core.credentials import TokenCredential
19+
20+
from ._configuration import BareMetalInfrastructureClientConfiguration
21+
from .operations import AzureBareMetalInstancesOperations
22+
from .operations import Operations
23+
from . import models
24+
25+
26+
class BareMetalInfrastructureClient(object):
27+
"""The BareMetalInfrastructure Management client.
28+
29+
:ivar azure_bare_metal_instances: AzureBareMetalInstancesOperations operations
30+
:vartype azure_bare_metal_instances: bare_metal_infrastructure_client.operations.AzureBareMetalInstancesOperations
31+
:ivar operations: Operations operations
32+
:vartype operations: bare_metal_infrastructure_client.operations.Operations
33+
:param credential: Credential needed for the client to connect to Azure.
34+
:type credential: ~azure.core.credentials.TokenCredential
35+
:param subscription_id: The ID of the target subscription.
36+
:type subscription_id: str
37+
: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.
39+
"""
40+
41+
def __init__(
42+
self,
43+
credential, # type: "TokenCredential"
44+
subscription_id, # type: str
45+
base_url=None, # type: Optional[str]
46+
**kwargs # type: Any
47+
):
48+
# type: (...) -> None
49+
if not base_url:
50+
base_url = 'https://management.azure.com'
51+
self._config = BareMetalInfrastructureClientConfiguration(credential, subscription_id, **kwargs)
52+
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
53+
54+
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
55+
self._serialize = Serializer(client_models)
56+
self._deserialize = Deserializer(client_models)
57+
58+
self.azure_bare_metal_instances = AzureBareMetalInstancesOperations(
59+
self._client, self._config, self._serialize, self._deserialize)
60+
self.operations = Operations(
61+
self._client, self._config, self._serialize, self._deserialize)
62+
63+
def close(self):
64+
# type: () -> None
65+
self._client.close()
66+
67+
def __enter__(self):
68+
# type: () -> BareMetalInfrastructureClient
69+
self._client.__enter__()
70+
return self
71+
72+
def __exit__(self, *exc_details):
73+
# type: (Any) -> None
74+
self._client.__exit__(*exc_details)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# Code generated by Microsoft (R) AutoRest Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------
8+
9+
from typing import TYPE_CHECKING
10+
11+
from azure.core.configuration import Configuration
12+
from azure.core.pipeline import policies
13+
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
14+
15+
from ._version import VERSION
16+
17+
if TYPE_CHECKING:
18+
# pylint: disable=unused-import,ungrouped-imports
19+
from typing import Any
20+
21+
from azure.core.credentials import TokenCredential
22+
23+
24+
class BareMetalInfrastructureClientConfiguration(Configuration):
25+
"""Configuration for BareMetalInfrastructureClient.
26+
27+
Note that all parameters used to create this instance are saved as instance
28+
attributes.
29+
30+
:param credential: Credential needed for the client to connect to Azure.
31+
:type credential: ~azure.core.credentials.TokenCredential
32+
:param subscription_id: The ID of the target subscription.
33+
:type subscription_id: str
34+
"""
35+
36+
def __init__(
37+
self,
38+
credential, # type: "TokenCredential"
39+
subscription_id, # type: str
40+
**kwargs # type: Any
41+
):
42+
# type: (...) -> None
43+
if credential is None:
44+
raise ValueError("Parameter 'credential' must not be None.")
45+
if subscription_id is None:
46+
raise ValueError("Parameter 'subscription_id' must not be None.")
47+
super(BareMetalInfrastructureClientConfiguration, self).__init__(**kwargs)
48+
49+
self.credential = credential
50+
self.subscription_id = subscription_id
51+
self.api_version = "2020-08-06-preview"
52+
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
53+
kwargs.setdefault('sdk_moniker', 'mgmt-baremetalinfrastructure/{}'.format(VERSION))
54+
self._configure(**kwargs)
55+
56+
def _configure(
57+
self,
58+
**kwargs # type: Any
59+
):
60+
# type: (...) -> None
61+
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
62+
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
63+
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
64+
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
65+
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
66+
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
67+
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
68+
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
69+
self.authentication_policy = kwargs.get('authentication_policy')
70+
if self.credential and not self.authentication_policy:
71+
self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
"chosen_version": "2020-08-06-preview",
3+
"total_api_version_list": ["2020-08-06-preview"],
4+
"client": {
5+
"name": "BareMetalInfrastructureClient",
6+
"filename": "_bare_metal_infrastructure_client",
7+
"description": "The BareMetalInfrastructure Management client.",
8+
"base_url": "\u0027https://management.azure.com\u0027",
9+
"custom_base_url": null,
10+
"azure_arm": true,
11+
"has_lro_operations": true
12+
},
13+
"global_parameters": {
14+
"sync_method": {
15+
"credential": {
16+
"method_signature": "credential, # type: \"TokenCredential\"",
17+
"description": "Credential needed for the client to connect to Azure.",
18+
"docstring_type": "~azure.core.credentials.TokenCredential",
19+
"required": true
20+
},
21+
"subscription_id": {
22+
"method_signature": "subscription_id, # type: str",
23+
"description": "The ID of the target subscription.",
24+
"docstring_type": "str",
25+
"required": true
26+
}
27+
},
28+
"async_method": {
29+
"credential": {
30+
"method_signature": "credential, # type: \"AsyncTokenCredential\"",
31+
"description": "Credential needed for the client to connect to Azure.",
32+
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
33+
"required": true
34+
},
35+
"subscription_id": {
36+
"method_signature": "subscription_id, # type: str",
37+
"description": "The ID of the target subscription.",
38+
"docstring_type": "str",
39+
"required": true
40+
}
41+
},
42+
"constant": {
43+
},
44+
"call": "credential, subscription_id"
45+
},
46+
"config": {
47+
"credential": true,
48+
"credential_scopes": ["https://management.azure.com/.default"],
49+
"credential_default_policy_type": "BearerTokenCredentialPolicy",
50+
"credential_default_policy_type_has_async_version": true,
51+
"credential_key_header_name": null
52+
},
53+
"operation_groups": {
54+
"azure_bare_metal_instances": "AzureBareMetalInstancesOperations",
55+
"operations": "Operations"
56+
},
57+
"operation_mixins": {
58+
},
59+
"sync_imports": "None",
60+
"async_imports": "None"
61+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# Code generated by Microsoft (R) AutoRest Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------
8+
9+
VERSION = "1.0.0b1"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# Code generated by Microsoft (R) AutoRest Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------
8+
9+
from ._bare_metal_infrastructure_client import BareMetalInfrastructureClient
10+
__all__ = ['BareMetalInfrastructureClient']
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# Code generated by Microsoft (R) AutoRest Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------
8+
9+
from typing import Any, Optional, TYPE_CHECKING
10+
11+
from azure.mgmt.core import AsyncARMPipelineClient
12+
from msrest import Deserializer, Serializer
13+
14+
if TYPE_CHECKING:
15+
# pylint: disable=unused-import,ungrouped-imports
16+
from azure.core.credentials_async import AsyncTokenCredential
17+
18+
from ._configuration import BareMetalInfrastructureClientConfiguration
19+
from .operations import AzureBareMetalInstancesOperations
20+
from .operations import Operations
21+
from .. import models
22+
23+
24+
class BareMetalInfrastructureClient(object):
25+
"""The BareMetalInfrastructure Management client.
26+
27+
:ivar azure_bare_metal_instances: AzureBareMetalInstancesOperations operations
28+
:vartype azure_bare_metal_instances: bare_metal_infrastructure_client.aio.operations.AzureBareMetalInstancesOperations
29+
:ivar operations: Operations operations
30+
:vartype operations: bare_metal_infrastructure_client.aio.operations.Operations
31+
:param credential: Credential needed for the client to connect to Azure.
32+
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
33+
:param subscription_id: The ID of the target subscription.
34+
:type subscription_id: str
35+
: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.
37+
"""
38+
39+
def __init__(
40+
self,
41+
credential: "AsyncTokenCredential",
42+
subscription_id: str,
43+
base_url: Optional[str] = None,
44+
**kwargs: Any
45+
) -> None:
46+
if not base_url:
47+
base_url = 'https://management.azure.com'
48+
self._config = BareMetalInfrastructureClientConfiguration(credential, subscription_id, **kwargs)
49+
self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
50+
51+
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
52+
self._serialize = Serializer(client_models)
53+
self._deserialize = Deserializer(client_models)
54+
55+
self.azure_bare_metal_instances = AzureBareMetalInstancesOperations(
56+
self._client, self._config, self._serialize, self._deserialize)
57+
self.operations = Operations(
58+
self._client, self._config, self._serialize, self._deserialize)
59+
60+
async def close(self) -> None:
61+
await self._client.close()
62+
63+
async def __aenter__(self) -> "BareMetalInfrastructureClient":
64+
await self._client.__aenter__()
65+
return self
66+
67+
async def __aexit__(self, *exc_details) -> None:
68+
await self._client.__aexit__(*exc_details)

0 commit comments

Comments
 (0)