Skip to content

Commit f40a0ff

Browse files
msyycSDKAutoArcturusZhang
authored
[T2] azureadb2c 2020 12 15 (Azure#15807)
* CodeGen from PR 11292 in Azure/azure-rest-api-specs Azure ad b2c tenant resource management APIs swagger, merge into public repo (Azure#11292) * tenant creation azure ad b2c swagger merge into public repo * adding custom word and formatting json files * fixing readmes * removing conflict with master branch * fixing readme * fixing go readme * updated service name and output folder paths * csharp reeadme for multiple versions? * csharp reeadme for multiple versions? * trimming non-public preview platform targets;cleaning up chsarp/go/python readmes * reesolving custom-words conflict * Update specification/cpim/resource-manager/readme.md Co-authored-by: Arcturus <ufo54153@gmail.com> * removing space before the yaml * restoring and appending azureresourceschema.md * Update specification/cpim/resource-manager/readme.go.md Co-authored-by: Arcturus <ufo54153@gmail.com> * Update specification/cpim/resource-manager/readme.go.md Co-authored-by: Arcturus <ufo54153@gmail.com> * api version and subscription paremeter not in method location * python readme updates * python readme updates * fixing extra commas * trying variation for go readme * Update readme.md * Update readme.python.md * Update readme.python.md * Update readme.python.md * trying to match with azure monitor readme Co-authored-by: Arcturus <ufo54153@gmail.com> Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com> * version,changelog Co-authored-by: SDKAuto <sdkautomation@microsoft.com> Co-authored-by: Arcturus <ufo54153@gmail.com>
1 parent da34e9d commit f40a0ff

Some content is hidden

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

53 files changed

+6027
-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-12-16)
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: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Microsoft Azure SDK for Python
2+
3+
This is the Microsoft Azure Azureadb2c 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+
11+
To learn how to use this package, see the [quickstart guide](https://aka.ms/azsdk/python/mgmt)
12+
13+
14+
15+
For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure/)
16+
Code samples for this package can be found at [Azureadb2c Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com.
17+
Additional code samples for different Azure services are available at [Samples Repo](https://aka.ms/azsdk/python/mgmt/samples)
18+
19+
20+
# Provide Feedback
21+
22+
If you encounter any bugs or have suggestions, please file an issue in the
23+
[Issues](https://github.com/Azure/azure-sdk-for-python/issues)
24+
section of the project.
25+
26+
27+
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-workloadmonitor%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__)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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 ._cpim_configuration_client import CPIMConfigurationClient
10+
__all__ = ['CPIMConfigurationClient']
11+
12+
try:
13+
from ._patch import patch_sdk # type: ignore
14+
patch_sdk()
15+
except ImportError:
16+
pass
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
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
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
from typing import Any
12+
13+
from azure.core.configuration import Configuration
14+
from azure.core.pipeline import policies
15+
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
16+
17+
from ._version import VERSION
18+
19+
20+
class CPIMConfigurationClientConfiguration(Configuration):
21+
"""Configuration for CPIMConfigurationClient.
22+
23+
Note that all parameters used to create this instance are saved as instance
24+
attributes.
25+
26+
:param credential: Credential needed for the client to connect to Azure.
27+
:type credential: ~azure.core.credentials.TokenCredential
28+
:param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).
29+
:type subscription_id: str
30+
"""
31+
32+
def __init__(
33+
self,
34+
credential, # type: "TokenCredential"
35+
subscription_id, # type: str
36+
**kwargs # type: Any
37+
):
38+
# type: (...) -> None
39+
if credential is None:
40+
raise ValueError("Parameter 'credential' must not be None.")
41+
if subscription_id is None:
42+
raise ValueError("Parameter 'subscription_id' must not be None.")
43+
super(CPIMConfigurationClientConfiguration, self).__init__(**kwargs)
44+
45+
self.credential = credential
46+
self.subscription_id = subscription_id
47+
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
48+
kwargs.setdefault('sdk_moniker', 'azure-mgmt-azureadb2c/{}'.format(VERSION))
49+
self._configure(**kwargs)
50+
51+
def _configure(
52+
self,
53+
**kwargs # type: Any
54+
):
55+
# type: (...) -> None
56+
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
57+
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
58+
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
59+
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
60+
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
61+
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
62+
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
63+
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
64+
self.authentication_policy = kwargs.get('authentication_policy')
65+
if self.credential and not self.authentication_policy:
66+
self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
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
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
12+
from azure.mgmt.core import ARMPipelineClient
13+
from msrest import Serializer, Deserializer
14+
15+
from azure.profiles import KnownProfiles, ProfileDefinition
16+
from azure.profiles.multiapiclient import MultiApiClientMixin
17+
from ._configuration import CPIMConfigurationClientConfiguration
18+
19+
class _SDKClient(object):
20+
def __init__(self, *args, **kwargs):
21+
"""This is a fake class to support current implemetation of MultiApiClientMixin."
22+
Will be removed in final version of multiapi azure-core based client
23+
"""
24+
pass
25+
26+
class CPIMConfigurationClient(MultiApiClientMixin, _SDKClient):
27+
"""CPIM Configuration Client.
28+
29+
This ready contains multiple API versions, to help you deal with all of the Azure clouds
30+
(Azure Stack, Azure Government, Azure China, etc.).
31+
By default, it uses the latest API version available on public Azure.
32+
For production, you should stick to a particular api-version and/or profile.
33+
The profile sets a mapping between an operation group and its API version.
34+
The api-version parameter sets the default API version if the operation
35+
group is not described in the profile.
36+
37+
:param credential: Credential needed for the client to connect to Azure.
38+
:type credential: ~azure.core.credentials.TokenCredential
39+
:param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).
40+
:type subscription_id: str
41+
:param str api_version: API version to use if no profile is provided, or if
42+
missing in profile.
43+
:param str base_url: Service URL
44+
:param profile: A profile definition, from KnownProfiles to dict.
45+
:type profile: azure.profiles.KnownProfiles
46+
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
47+
"""
48+
49+
DEFAULT_API_VERSION = '2020-05-01-preview'
50+
_PROFILE_TAG = "azure.mgmt.azureadb2c.CPIMConfigurationClient"
51+
LATEST_PROFILE = ProfileDefinition({
52+
_PROFILE_TAG: {
53+
None: DEFAULT_API_VERSION,
54+
'b2_ctenants': '2019-01-01-preview',
55+
}},
56+
_PROFILE_TAG + " latest"
57+
)
58+
59+
def __init__(
60+
self,
61+
credential, # type: "TokenCredential"
62+
subscription_id, # type: str
63+
api_version=None,
64+
base_url=None,
65+
profile=KnownProfiles.default,
66+
**kwargs # type: Any
67+
):
68+
if not base_url:
69+
base_url = 'https://management.azure.com'
70+
self._config = CPIMConfigurationClientConfiguration(credential, subscription_id, **kwargs)
71+
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
72+
super(CPIMConfigurationClient, self).__init__(
73+
api_version=api_version,
74+
profile=profile
75+
)
76+
77+
@classmethod
78+
def _models_dict(cls, api_version):
79+
return {k: v for k, v in cls.models(api_version).__dict__.items() if isinstance(v, type)}
80+
81+
@classmethod
82+
def models(cls, api_version=DEFAULT_API_VERSION):
83+
"""Module depends on the API version:
84+
85+
* 2019-01-01-preview: :mod:`v2019_01_01_preview.models<azure.mgmt.azureadb2c.v2019_01_01_preview.models>`
86+
* 2020-05-01-preview: :mod:`v2020_05_01_preview.models<azure.mgmt.azureadb2c.v2020_05_01_preview.models>`
87+
"""
88+
if api_version == '2019-01-01-preview':
89+
from .v2019_01_01_preview import models
90+
return models
91+
elif api_version == '2020-05-01-preview':
92+
from .v2020_05_01_preview import models
93+
return models
94+
raise ValueError("API version {} is not available".format(api_version))
95+
96+
@property
97+
def b2_ctenants(self):
98+
"""Instance depends on the API version:
99+
100+
* 2019-01-01-preview: :class:`B2CTenantsOperations<azure.mgmt.azureadb2c.v2019_01_01_preview.operations.B2CTenantsOperations>`
101+
"""
102+
api_version = self._get_api_version('b2_ctenants')
103+
if api_version == '2019-01-01-preview':
104+
from .v2019_01_01_preview.operations import B2CTenantsOperations as OperationClass
105+
else:
106+
raise ValueError("API version {} does not have operation group 'b2_ctenants'".format(api_version))
107+
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
108+
109+
@property
110+
def guest_usages(self):
111+
"""Instance depends on the API version:
112+
113+
* 2020-05-01-preview: :class:`GuestUsagesOperations<azure.mgmt.azureadb2c.v2020_05_01_preview.operations.GuestUsagesOperations>`
114+
"""
115+
api_version = self._get_api_version('guest_usages')
116+
if api_version == '2020-05-01-preview':
117+
from .v2020_05_01_preview.operations import GuestUsagesOperations as OperationClass
118+
else:
119+
raise ValueError("API version {} does not have operation group 'guest_usages'".format(api_version))
120+
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
121+
122+
@property
123+
def operations(self):
124+
"""Instance depends on the API version:
125+
126+
* 2019-01-01-preview: :class:`Operations<azure.mgmt.azureadb2c.v2019_01_01_preview.operations.Operations>`
127+
* 2020-05-01-preview: :class:`Operations<azure.mgmt.azureadb2c.v2020_05_01_preview.operations.Operations>`
128+
"""
129+
api_version = self._get_api_version('operations')
130+
if api_version == '2019-01-01-preview':
131+
from .v2019_01_01_preview.operations import Operations as OperationClass
132+
elif api_version == '2020-05-01-preview':
133+
from .v2020_05_01_preview.operations import Operations as OperationClass
134+
else:
135+
raise ValueError("API version {} does not have operation group 'operations'".format(api_version))
136+
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
137+
138+
def close(self):
139+
self._client.close()
140+
def __enter__(self):
141+
self._client.__enter__()
142+
return self
143+
def __exit__(self, *exc_details):
144+
self._client.__exit__(*exc_details)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
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
5+
# license information.
6+
# --------------------------------------------------------------------------
7+
8+
VERSION = "1.0.0b1"
Lines changed: 10 additions & 0 deletions
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 ._cpim_configuration_client import CPIMConfigurationClient
10+
__all__ = ['CPIMConfigurationClient']

0 commit comments

Comments
 (0)