Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR azure-mgmt-resource] Microsoft.Authorization 2020-09-01 policy entity APIs #2962

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,11 @@ def __init__(self, **kwargs):


class ErrorResponse(Model):
"""The resource management error response.
"""Error Response.

Common error response for all Azure Resource Manager APIs to return error
details for failed operations. (This also follows the OData error response
format.).

Variables are only populated by the server, and will be ignored when
sending a request.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,11 @@ def __init__(self, **kwargs) -> None:


class ErrorResponse(Model):
"""The resource management error response.
"""Error Response.

Common error response for all Azure Resource Manager APIs to return error
details for failed operations. (This also follows the OData error response
format.).

Variables are only populated by the server, and will be ignored when
sending a request.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,11 @@ def __init__(self, **kwargs):


class ErrorResponse(Model):
"""The resource management error response.
"""Error Response.

Common error response for all Azure Resource Manager APIs to return error
details for failed operations. (This also follows the OData error response
format.).

Variables are only populated by the server, and will be ignored when
sending a request.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,11 @@ def __init__(self, **kwargs) -> None:


class ErrorResponse(Model):
"""The resource management error response.
"""Error Response.

Common error response for all Azure Resource Manager APIs to return error
details for failed operations. (This also follows the OData error response
format.).

Variables are only populated by the server, and will be ignored when
sending a request.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ def __init__(self, **kwargs):


class ErrorResponse(Model):
"""The resource management error response.
"""Error Response.

Common error response for all Azure Resource Manager APIs to return error
details for failed operations. (This also follows the OData error response
format.).

Variables are only populated by the server, and will be ignored when
sending a request.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ def __init__(self, **kwargs) -> None:


class ErrorResponse(Model):
"""The resource management error response.
"""Error Response.

Common error response for all Azure Resource Manager APIs to return error
details for failed operations. (This also follows the OData error response
format.).

Variables are only populated by the server, and will be ignored when
sending a request.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +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.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from ._configuration import PolicyClientConfiguration
from ._policy_client import PolicyClient
__all__ = ['PolicyClient', 'PolicyClientConfiguration']

from .version import VERSION

__version__ = VERSION

Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# 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 msrestazure import AzureConfiguration

from .version import VERSION


class PolicyClientConfiguration(AzureConfiguration):
"""Configuration for PolicyClient
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 ID of the target subscription.
: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.")
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(PolicyClientConfiguration, self).__init__(base_url)

# Starting Autorest.Python 4.0.64, make connection pool activated by default
self.keep_alive = True

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

self.credentials = credentials
self.subscription_id = subscription_id
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# 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 msrest.service_client import SDKClient
from msrest import Serializer, Deserializer

from ._configuration import PolicyClientConfiguration
from .operations import DataPolicyManifestsOperations
from .operations import PolicyAssignmentsOperations
from .operations import PolicyDefinitionsOperations
from .operations import PolicySetDefinitionsOperations
from . import models


class PolicyClient(SDKClient):
"""To manage and control access to your resources, you can define customized policies and assign them at a scope.

:ivar config: Configuration for client.
:vartype config: PolicyClientConfiguration

:ivar data_policy_manifests: DataPolicyManifests operations
:vartype data_policy_manifests: azure.mgmt.resource.policy.v2020_09_01.operations.DataPolicyManifestsOperations
:ivar policy_assignments: PolicyAssignments operations
:vartype policy_assignments: azure.mgmt.resource.policy.v2020_09_01.operations.PolicyAssignmentsOperations
:ivar policy_definitions: PolicyDefinitions operations
:vartype policy_definitions: azure.mgmt.resource.policy.v2020_09_01.operations.PolicyDefinitionsOperations
:ivar policy_set_definitions: PolicySetDefinitions operations
:vartype policy_set_definitions: azure.mgmt.resource.policy.v2020_09_01.operations.PolicySetDefinitionsOperations

: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 ID of the target subscription.
:type subscription_id: str
:param str base_url: Service URL
"""

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

self.config = PolicyClientConfiguration(credentials, subscription_id, base_url)
super(PolicyClient, self).__init__(self.config.credentials, self.config)

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

self.data_policy_manifests = DataPolicyManifestsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.policy_assignments = PolicyAssignmentsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.policy_definitions = PolicyDefinitionsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.policy_set_definitions = PolicySetDefinitionsOperations(
self._client, self.config, self._serialize, self._deserialize)
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# 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.
# --------------------------------------------------------------------------

try:
from ._models_py3 import Alias
from ._models_py3 import AliasPath
from ._models_py3 import AliasPathMetadata
from ._models_py3 import AliasPattern
from ._models_py3 import CloudError, CloudErrorException
from ._models_py3 import DataEffect
from ._models_py3 import DataManifestCustomResourceFunctionDefinition
from ._models_py3 import DataPolicyManifest
from ._models_py3 import ErrorAdditionalInfo
from ._models_py3 import ErrorDetail
from ._models_py3 import Identity
from ._models_py3 import NonComplianceMessage
from ._models_py3 import ParameterDefinitionsValue
from ._models_py3 import ParameterDefinitionsValueMetadata
from ._models_py3 import ParameterValuesValue
from ._models_py3 import PolicyAssignment
from ._models_py3 import PolicyDefinition
from ._models_py3 import PolicyDefinitionGroup
from ._models_py3 import PolicyDefinitionReference
from ._models_py3 import PolicySetDefinition
from ._models_py3 import ResourceTypeAliases
except (SyntaxError, ImportError):
from ._models import Alias
from ._models import AliasPath
from ._models import AliasPathMetadata
from ._models import AliasPattern
from ._models import CloudError, CloudErrorException
from ._models import DataEffect
from ._models import DataManifestCustomResourceFunctionDefinition
from ._models import DataPolicyManifest
from ._models import ErrorAdditionalInfo
from ._models import ErrorDetail
from ._models import Identity
from ._models import NonComplianceMessage
from ._models import ParameterDefinitionsValue
from ._models import ParameterDefinitionsValueMetadata
from ._models import ParameterValuesValue
from ._models import PolicyAssignment
from ._models import PolicyDefinition
from ._models import PolicyDefinitionGroup
from ._models import PolicyDefinitionReference
from ._models import PolicySetDefinition
from ._models import ResourceTypeAliases
from ._paged_models import DataPolicyManifestPaged
from ._paged_models import PolicyAssignmentPaged
from ._paged_models import PolicyDefinitionPaged
from ._paged_models import PolicySetDefinitionPaged
from ._policy_client_enums import (
AliasPatternType,
AliasPathTokenType,
AliasPathAttributes,
AliasType,
EnforcementMode,
ResourceIdentityType,
PolicyType,
ParameterType,
)

__all__ = [
'Alias',
'AliasPath',
'AliasPathMetadata',
'AliasPattern',
'CloudError', 'CloudErrorException',
'DataEffect',
'DataManifestCustomResourceFunctionDefinition',
'DataPolicyManifest',
'ErrorAdditionalInfo',
'ErrorDetail',
'Identity',
'NonComplianceMessage',
'ParameterDefinitionsValue',
'ParameterDefinitionsValueMetadata',
'ParameterValuesValue',
'PolicyAssignment',
'PolicyDefinition',
'PolicyDefinitionGroup',
'PolicyDefinitionReference',
'PolicySetDefinition',
'ResourceTypeAliases',
'DataPolicyManifestPaged',
'PolicyAssignmentPaged',
'PolicyDefinitionPaged',
'PolicySetDefinitionPaged',
'AliasPatternType',
'AliasPathTokenType',
'AliasPathAttributes',
'AliasType',
'EnforcementMode',
'ResourceIdentityType',
'PolicyType',
'ParameterType',
]
Loading