Skip to content

Commit 7dab9ad

Browse files
author
SDKAuto
committed
CodeGen from PR 12567 in Azure/azure-rest-api-specs
Merge b1d8528007bb0bda962fd43ba2826c87249e794d into a35bdde
1 parent c12a9c0 commit 7dab9ad

26 files changed

+8593
-0
lines changed
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 ._microsoft_postgre_sql_hyperscale import MicrosoftPostgreSQLHyperscale
10+
__all__ = ['MicrosoftPostgreSQLHyperscale']
11+
12+
try:
13+
from ._patch import patch_sdk # type: ignore
14+
patch_sdk()
15+
except ImportError:
16+
pass
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
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+
if TYPE_CHECKING:
16+
# pylint: disable=unused-import,ungrouped-imports
17+
from typing import Any
18+
19+
from azure.core.credentials import TokenCredential
20+
21+
VERSION = "unknown"
22+
23+
class MicrosoftPostgreSQLHyperscaleConfiguration(Configuration):
24+
"""Configuration for MicrosoftPostgreSQLHyperscale.
25+
26+
Note that all parameters used to create this instance are saved as instance
27+
attributes.
28+
29+
:param credential: Credential needed for the client to connect to Azure.
30+
:type credential: ~azure.core.credentials.TokenCredential
31+
:param subscription_id: The ID of the target subscription.
32+
:type subscription_id: str
33+
"""
34+
35+
def __init__(
36+
self,
37+
credential, # type: "TokenCredential"
38+
subscription_id, # type: str
39+
**kwargs # type: Any
40+
):
41+
# type: (...) -> None
42+
if credential is None:
43+
raise ValueError("Parameter 'credential' must not be None.")
44+
if subscription_id is None:
45+
raise ValueError("Parameter 'subscription_id' must not be None.")
46+
super(MicrosoftPostgreSQLHyperscaleConfiguration, self).__init__(**kwargs)
47+
48+
self.credential = credential
49+
self.subscription_id = subscription_id
50+
self.api_version = "2020-10-05-privatepreview"
51+
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
52+
kwargs.setdefault('sdk_moniker', 'mgmt-rdbms/{}'.format(VERSION))
53+
self._configure(**kwargs)
54+
55+
def _configure(
56+
self,
57+
**kwargs # type: Any
58+
):
59+
# type: (...) -> None
60+
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
61+
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
62+
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
63+
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
64+
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
65+
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
66+
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
67+
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
68+
self.authentication_policy = kwargs.get('authentication_policy')
69+
if self.credential and not self.authentication_policy:
70+
self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{
2+
"chosen_version": "2020-10-05-privatepreview",
3+
"total_api_version_list": ["2020-10-05-privatepreview"],
4+
"client": {
5+
"name": "MicrosoftPostgreSQLHyperscale",
6+
"filename": "_microsoft_postgre_sql_hyperscale",
7+
"description": "The Microsoft Azure management API provides create, read, update, and delete functionality for Azure PostgreSQL Hyperscale (Citus) resources including server groups, servers, databases, firewall rules, VNET rules, security alert policies, log files and configurations.",
8+
"base_url": "\u0027https://management.azure.com\u0027",
9+
"custom_base_url": null,
10+
"azure_arm": true,
11+
"has_lro_operations": true,
12+
"client_side_validation": true
13+
},
14+
"global_parameters": {
15+
"sync": {
16+
"credential": {
17+
"signature": "credential, # type: \"TokenCredential\"",
18+
"description": "Credential needed for the client to connect to Azure.",
19+
"docstring_type": "~azure.core.credentials.TokenCredential",
20+
"required": true
21+
},
22+
"subscription_id": {
23+
"signature": "subscription_id, # type: str",
24+
"description": "The ID of the target subscription.",
25+
"docstring_type": "str",
26+
"required": true
27+
}
28+
},
29+
"async": {
30+
"credential": {
31+
"signature": "credential, # type: \"AsyncTokenCredential\"",
32+
"description": "Credential needed for the client to connect to Azure.",
33+
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
34+
"required": true
35+
},
36+
"subscription_id": {
37+
"signature": "subscription_id, # type: str",
38+
"description": "The ID of the target subscription.",
39+
"docstring_type": "str",
40+
"required": true
41+
}
42+
},
43+
"constant": {
44+
},
45+
"call": "credential, subscription_id"
46+
},
47+
"config": {
48+
"credential": true,
49+
"credential_scopes": ["https://management.azure.com/.default"],
50+
"credential_default_policy_type": "BearerTokenCredentialPolicy",
51+
"credential_default_policy_type_has_async_version": true,
52+
"credential_key_header_name": null
53+
},
54+
"operation_groups": {
55+
"server_groups": "ServerGroupsOperations",
56+
"servers": "ServersOperations",
57+
"configurations": "ConfigurationsOperations",
58+
"firewall_rules": "FirewallRulesOperations",
59+
"roles": "RolesOperations",
60+
"operations": "Operations"
61+
},
62+
"operation_mixins": {
63+
},
64+
"sync_imports": "None",
65+
"async_imports": "None"
66+
}
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
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 MicrosoftPostgreSQLHyperscaleConfiguration
21+
from .operations import ServerGroupsOperations
22+
from .operations import ServersOperations
23+
from .operations import ConfigurationsOperations
24+
from .operations import FirewallRulesOperations
25+
from .operations import RolesOperations
26+
from .operations import Operations
27+
from . import models
28+
29+
30+
class MicrosoftPostgreSQLHyperscale(object):
31+
"""The Microsoft Azure management API provides create, read, update, and delete functionality for Azure PostgreSQL Hyperscale (Citus) resources including server groups, servers, databases, firewall rules, VNET rules, security alert policies, log files and configurations.
32+
33+
:ivar server_groups: ServerGroupsOperations operations
34+
:vartype server_groups: azure.mgmt.rdbms.postgresqlhsc.operations.ServerGroupsOperations
35+
:ivar servers: ServersOperations operations
36+
:vartype servers: azure.mgmt.rdbms.postgresqlhsc.operations.ServersOperations
37+
:ivar configurations: ConfigurationsOperations operations
38+
:vartype configurations: azure.mgmt.rdbms.postgresqlhsc.operations.ConfigurationsOperations
39+
:ivar firewall_rules: FirewallRulesOperations operations
40+
:vartype firewall_rules: azure.mgmt.rdbms.postgresqlhsc.operations.FirewallRulesOperations
41+
:ivar roles: RolesOperations operations
42+
:vartype roles: azure.mgmt.rdbms.postgresqlhsc.operations.RolesOperations
43+
:ivar operations: Operations operations
44+
:vartype operations: azure.mgmt.rdbms.postgresqlhsc.operations.Operations
45+
:param credential: Credential needed for the client to connect to Azure.
46+
:type credential: ~azure.core.credentials.TokenCredential
47+
:param subscription_id: The ID of the target subscription.
48+
:type subscription_id: str
49+
:param str base_url: Service URL
50+
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
51+
"""
52+
53+
def __init__(
54+
self,
55+
credential, # type: "TokenCredential"
56+
subscription_id, # type: str
57+
base_url=None, # type: Optional[str]
58+
**kwargs # type: Any
59+
):
60+
# type: (...) -> None
61+
if not base_url:
62+
base_url = 'https://management.azure.com'
63+
self._config = MicrosoftPostgreSQLHyperscaleConfiguration(credential, subscription_id, **kwargs)
64+
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
65+
66+
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
67+
self._serialize = Serializer(client_models)
68+
self._deserialize = Deserializer(client_models)
69+
70+
self.server_groups = ServerGroupsOperations(
71+
self._client, self._config, self._serialize, self._deserialize)
72+
self.servers = ServersOperations(
73+
self._client, self._config, self._serialize, self._deserialize)
74+
self.configurations = ConfigurationsOperations(
75+
self._client, self._config, self._serialize, self._deserialize)
76+
self.firewall_rules = FirewallRulesOperations(
77+
self._client, self._config, self._serialize, self._deserialize)
78+
self.roles = RolesOperations(
79+
self._client, self._config, self._serialize, self._deserialize)
80+
self.operations = Operations(
81+
self._client, self._config, self._serialize, self._deserialize)
82+
83+
def close(self):
84+
# type: () -> None
85+
self._client.close()
86+
87+
def __enter__(self):
88+
# type: () -> MicrosoftPostgreSQLHyperscale
89+
self._client.__enter__()
90+
return self
91+
92+
def __exit__(self, *exc_details):
93+
# type: (Any) -> None
94+
self._client.__exit__(*exc_details)
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 ._microsoft_postgre_sql_hyperscale import MicrosoftPostgreSQLHyperscale
10+
__all__ = ['MicrosoftPostgreSQLHyperscale']
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 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, 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+
if TYPE_CHECKING:
16+
# pylint: disable=unused-import,ungrouped-imports
17+
from azure.core.credentials_async import AsyncTokenCredential
18+
19+
VERSION = "unknown"
20+
21+
class MicrosoftPostgreSQLHyperscaleConfiguration(Configuration):
22+
"""Configuration for MicrosoftPostgreSQLHyperscale.
23+
24+
Note that all parameters used to create this instance are saved as instance
25+
attributes.
26+
27+
:param credential: Credential needed for the client to connect to Azure.
28+
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
29+
:param subscription_id: The ID of the target subscription.
30+
:type subscription_id: str
31+
"""
32+
33+
def __init__(
34+
self,
35+
credential: "AsyncTokenCredential",
36+
subscription_id: str,
37+
**kwargs: Any
38+
) -> 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(MicrosoftPostgreSQLHyperscaleConfiguration, self).__init__(**kwargs)
44+
45+
self.credential = credential
46+
self.subscription_id = subscription_id
47+
self.api_version = "2020-10-05-privatepreview"
48+
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
49+
kwargs.setdefault('sdk_moniker', 'mgmt-rdbms/{}'.format(VERSION))
50+
self._configure(**kwargs)
51+
52+
def _configure(
53+
self,
54+
**kwargs: Any
55+
) -> 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.AsyncRetryPolicy(**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.AsyncRedirectPolicy(**kwargs)
64+
self.authentication_policy = kwargs.get('authentication_policy')
65+
if self.credential and not self.authentication_policy:
66+
self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)

0 commit comments

Comments
 (0)