Skip to content

Commit

Permalink
CodeGen from PR 12831 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
[T2] python track2 config for frontdoor (Azure#12831)

* add python track2 config for frontdoor

* fix
  • Loading branch information
SDKAuto committed Feb 8, 2021
1 parent 8622843 commit fb3e04b
Show file tree
Hide file tree
Showing 41 changed files with 11,817 additions and 4,184 deletions.
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from ._configuration import FrontDoorManagementClientConfiguration
from ._front_door_management_client import FrontDoorManagementClient
__all__ = ['FrontDoorManagementClient', 'FrontDoorManagementClientConfiguration']

from .version import VERSION
from ._version import VERSION

__version__ = VERSION
__all__ = ['FrontDoorManagementClient']

try:
from ._patch import patch_sdk # type: ignore
patch_sdk()
except ImportError:
pass
Original file line number Diff line number Diff line change
@@ -1,50 +1,70 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from msrestazure import AzureConfiguration

from .version import VERSION
from typing import TYPE_CHECKING

from azure.core.configuration import Configuration
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMHttpLoggingPolicy

from ._version import VERSION

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from typing import Any

from azure.core.credentials import TokenCredential


class FrontDoorManagementClientConfiguration(Configuration):
"""Configuration for FrontDoorManagementClient.
class FrontDoorManagementClientConfiguration(AzureConfiguration):
"""Configuration for FrontDoorManagementClient
Note that all parameters used to create this instance are saved as instance
attributes.
:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param subscription_id: The subscription credentials which uniquely
identify the Microsoft Azure subscription. The subscription ID forms part
of the URI for every service call.
:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
:type subscription_id: str
:param str base_url: Service URL
"""

def __init__(
self, credentials, subscription_id, base_url=None):

if credentials is None:
raise ValueError("Parameter 'credentials' must not be None.")
self,
credential, # type: "TokenCredential"
subscription_id, # type: str
**kwargs # type: Any
):
# type: (...) -> None
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
if not base_url:
base_url = 'https://management.azure.com'

super(FrontDoorManagementClientConfiguration, self).__init__(base_url)

# Starting Autorest.Python 4.0.64, make connection pool activated by default
self.keep_alive = True
super(FrontDoorManagementClientConfiguration, self).__init__(**kwargs)

self.add_user_agent('azure-mgmt-frontdoor/{}'.format(VERSION))
self.add_user_agent('Azure-SDK-For-Python')

self.credentials = credentials
self.credential = credential
self.subscription_id = subscription_id
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-frontdoor/{}'.format(VERSION))
self._configure(**kwargs)

def _configure(
self,
**kwargs # type: Any
):
# type: (...) -> None
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
self.authentication_policy = kwargs.get('authentication_policy')
if self.credential and not self.authentication_policy:
self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
Original file line number Diff line number Diff line change
@@ -1,91 +1,124 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from msrest.service_client import SDKClient
from msrest import Serializer, Deserializer
from typing import TYPE_CHECKING

from azure.mgmt.core import ARMPipelineClient
from msrest import Deserializer, Serializer

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from typing import Any, Optional

from azure.core.credentials import TokenCredential

from ._configuration import FrontDoorManagementClientConfiguration
from .operations import FrontDoorManagementClientOperationsMixin
from .operations import NetworkExperimentProfilesOperations
from .operations import PreconfiguredEndpointsOperations
from .operations import ExperimentsOperations
from .operations import ReportsOperations
from .operations import FrontDoorNameAvailabilityOperations
from .operations import FrontDoorNameAvailabilityWithSubscriptionOperations
from .operations import FrontDoorsOperations
from .operations import FrontendEndpointsOperations
from .operations import EndpointsOperations
from .operations import RulesEnginesOperations
from .operations import PoliciesOperations
from .operations import ManagedRuleSetsOperations
from . import models


class FrontDoorManagementClient(FrontDoorManagementClientOperationsMixin, SDKClient):
"""FrontDoor Client
class FrontDoorManagementClient(object):
"""FrontDoor Client.
:ivar config: Configuration for client.
:vartype config: FrontDoorManagementClientConfiguration
:ivar network_experiment_profiles: NetworkExperimentProfiles operations
:ivar network_experiment_profiles: NetworkExperimentProfilesOperations operations
:vartype network_experiment_profiles: azure.mgmt.frontdoor.operations.NetworkExperimentProfilesOperations
:ivar preconfigured_endpoints: PreconfiguredEndpoints operations
:ivar preconfigured_endpoints: PreconfiguredEndpointsOperations operations
:vartype preconfigured_endpoints: azure.mgmt.frontdoor.operations.PreconfiguredEndpointsOperations
:ivar experiments: Experiments operations
:ivar experiments: ExperimentsOperations operations
:vartype experiments: azure.mgmt.frontdoor.operations.ExperimentsOperations
:ivar reports: Reports operations
:ivar reports: ReportsOperations operations
:vartype reports: azure.mgmt.frontdoor.operations.ReportsOperations
:ivar front_doors: FrontDoors operations
:ivar front_door_name_availability: FrontDoorNameAvailabilityOperations operations
:vartype front_door_name_availability: azure.mgmt.frontdoor.operations.FrontDoorNameAvailabilityOperations
:ivar front_door_name_availability_with_subscription: FrontDoorNameAvailabilityWithSubscriptionOperations operations
:vartype front_door_name_availability_with_subscription: azure.mgmt.frontdoor.operations.FrontDoorNameAvailabilityWithSubscriptionOperations
:ivar front_doors: FrontDoorsOperations operations
:vartype front_doors: azure.mgmt.frontdoor.operations.FrontDoorsOperations
:ivar frontend_endpoints: FrontendEndpoints operations
:ivar frontend_endpoints: FrontendEndpointsOperations operations
:vartype frontend_endpoints: azure.mgmt.frontdoor.operations.FrontendEndpointsOperations
:ivar endpoints: Endpoints operations
:ivar endpoints: EndpointsOperations operations
:vartype endpoints: azure.mgmt.frontdoor.operations.EndpointsOperations
:ivar policies: Policies operations
:ivar rules_engines: RulesEnginesOperations operations
:vartype rules_engines: azure.mgmt.frontdoor.operations.RulesEnginesOperations
:ivar policies: PoliciesOperations operations
:vartype policies: azure.mgmt.frontdoor.operations.PoliciesOperations
:ivar managed_rule_sets: ManagedRuleSets operations
:ivar managed_rule_sets: ManagedRuleSetsOperations operations
:vartype managed_rule_sets: azure.mgmt.frontdoor.operations.ManagedRuleSetsOperations
:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param subscription_id: The subscription credentials which uniquely
identify the Microsoft Azure subscription. The subscription ID forms part
of the URI for every service call.
:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
:type subscription_id: str
:param str base_url: Service URL
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
"""

def __init__(
self, credentials, subscription_id, base_url=None):

self.config = FrontDoorManagementClientConfiguration(credentials, subscription_id, base_url)
super(FrontDoorManagementClient, self).__init__(self.config.credentials, self.config)
self,
credential, # type: "TokenCredential"
subscription_id, # type: str
base_url=None, # type: Optional[str]
**kwargs # type: Any
):
# type: (...) -> None
if not base_url:
base_url = 'https://management.azure.com'
self._config = FrontDoorManagementClientConfiguration(credential, subscription_id, **kwargs)
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

self.network_experiment_profiles = NetworkExperimentProfilesOperations(
self._client, self.config, self._serialize, self._deserialize)
self._client, self._config, self._serialize, self._deserialize)
self.preconfigured_endpoints = PreconfiguredEndpointsOperations(
self._client, self.config, self._serialize, self._deserialize)
self._client, self._config, self._serialize, self._deserialize)
self.experiments = ExperimentsOperations(
self._client, self.config, self._serialize, self._deserialize)
self._client, self._config, self._serialize, self._deserialize)
self.reports = ReportsOperations(
self._client, self.config, self._serialize, self._deserialize)
self._client, self._config, self._serialize, self._deserialize)
self.front_door_name_availability = FrontDoorNameAvailabilityOperations(
self._client, self._config, self._serialize, self._deserialize)
self.front_door_name_availability_with_subscription = FrontDoorNameAvailabilityWithSubscriptionOperations(
self._client, self._config, self._serialize, self._deserialize)
self.front_doors = FrontDoorsOperations(
self._client, self.config, self._serialize, self._deserialize)
self._client, self._config, self._serialize, self._deserialize)
self.frontend_endpoints = FrontendEndpointsOperations(
self._client, self.config, self._serialize, self._deserialize)
self._client, self._config, self._serialize, self._deserialize)
self.endpoints = EndpointsOperations(
self._client, self.config, self._serialize, self._deserialize)
self._client, self._config, self._serialize, self._deserialize)
self.rules_engines = RulesEnginesOperations(
self._client, self._config, self._serialize, self._deserialize)
self.policies = PoliciesOperations(
self._client, self.config, self._serialize, self._deserialize)
self._client, self._config, self._serialize, self._deserialize)
self.managed_rule_sets = ManagedRuleSetsOperations(
self._client, self.config, self._serialize, self._deserialize)
self._client, self._config, self._serialize, self._deserialize)

def close(self):
# type: () -> None
self._client.close()

def __enter__(self):
# type: () -> FrontDoorManagementClient
self._client.__enter__()
return self

def __exit__(self, *exc_details):
# type: (Any) -> None
self._client.__exit__(*exc_details)
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"chosen_version": "",
"total_api_version_list": ["2019-11-01", "2020-05-01", "2020-11-01"],
"client": {
"name": "FrontDoorManagementClient",
"filename": "_front_door_management_client",
"description": "FrontDoor Client.",
"base_url": "\u0027https://management.azure.com\u0027",
"custom_base_url": null,
"azure_arm": true,
"has_lro_operations": true,
"client_side_validation": true
},
"global_parameters": {
"sync": {
"credential": {
"signature": "credential, # type: \"TokenCredential\"",
"description": "Credential needed for the client to connect to Azure.",
"docstring_type": "~azure.core.credentials.TokenCredential",
"required": true
},
"subscription_id": {
"signature": "subscription_id, # type: str",
"description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.",
"docstring_type": "str",
"required": true
}
},
"async": {
"credential": {
"signature": "credential, # type: \"AsyncTokenCredential\"",
"description": "Credential needed for the client to connect to Azure.",
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
"required": true
},
"subscription_id": {
"signature": "subscription_id, # type: str",
"description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.",
"docstring_type": "str",
"required": true
}
},
"constant": {
},
"call": "credential, subscription_id"
},
"config": {
"credential": true,
"credential_scopes": ["https://management.azure.com/.default"],
"credential_default_policy_type": "BearerTokenCredentialPolicy",
"credential_default_policy_type_has_async_version": true,
"credential_key_header_name": null
},
"operation_groups": {
"network_experiment_profiles": "NetworkExperimentProfilesOperations",
"preconfigured_endpoints": "PreconfiguredEndpointsOperations",
"experiments": "ExperimentsOperations",
"reports": "ReportsOperations",
"front_door_name_availability": "FrontDoorNameAvailabilityOperations",
"front_door_name_availability_with_subscription": "FrontDoorNameAvailabilityWithSubscriptionOperations",
"front_doors": "FrontDoorsOperations",
"frontend_endpoints": "FrontendEndpointsOperations",
"endpoints": "EndpointsOperations",
"rules_engines": "RulesEnginesOperations",
"policies": "PoliciesOperations",
"managed_rule_sets": "ManagedRuleSetsOperations"
},
"operation_mixins": {
},
"sync_imports": "None",
"async_imports": "None"
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "0.3.0"

VERSION = "0.1.0"
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from ._front_door_management_client import FrontDoorManagementClient
__all__ = ['FrontDoorManagementClient']
Loading

0 comments on commit fb3e04b

Please sign in to comment.