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

[ReleasePR azure-mgmt-policyinsights] Fix to support nextLink with post calls for python sdk #15384

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 @@ -21,14 +21,18 @@ class PolicyInsightsClientConfiguration(AzureConfiguration):
:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param subscription_id2: The ID of the target subscription.
:type subscription_id2: str
:param str base_url: Service URL
"""

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

if credentials is None:
raise ValueError("Parameter 'credentials' must not be None.")
if subscription_id2 is None:
raise ValueError("Parameter 'subscription_id2' must not be None.")
if not base_url:
base_url = 'https://management.azure.com'

Expand All @@ -41,3 +45,4 @@ def __init__(
self.add_user_agent('Azure-SDK-For-Python')

self.credentials = credentials
self.subscription_id2 = subscription_id2
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from .operations import PolicyStatesOperations
from .operations import Operations
from .operations import PolicyMetadataOperations
from .operations import PolicyRestrictionsOperations
from . import models


Expand All @@ -40,17 +41,21 @@ class PolicyInsightsClient(SDKClient):
:vartype operations: azure.mgmt.policyinsights.operations.Operations
:ivar policy_metadata: PolicyMetadata operations
:vartype policy_metadata: azure.mgmt.policyinsights.operations.PolicyMetadataOperations
:ivar policy_restrictions: PolicyRestrictions operations
:vartype policy_restrictions: azure.mgmt.policyinsights.operations.PolicyRestrictionsOperations

:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param subscription_id2: The ID of the target subscription.
:type subscription_id2: str
:param str base_url: Service URL
"""

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

self.config = PolicyInsightsClientConfiguration(credentials, base_url)
self.config = PolicyInsightsClientConfiguration(credentials, subscription_id2, base_url)
super(PolicyInsightsClient, self).__init__(self.config.credentials, self.config)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
Expand All @@ -69,3 +74,5 @@ def __init__(
self._client, self.config, self._serialize, self._deserialize)
self.policy_metadata = PolicyMetadataOperations(
self._client, self.config, self._serialize, self._deserialize)
self.policy_restrictions = PolicyRestrictionsOperations(
self._client, self.config, self._serialize, self._deserialize)
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,32 @@
# --------------------------------------------------------------------------

try:
from ._models_py3 import CheckRestrictionsRequest
from ._models_py3 import CheckRestrictionsResourceDetails
from ._models_py3 import CheckRestrictionsResult
from ._models_py3 import CheckRestrictionsResultContentEvaluationResult
from ._models_py3 import ComplianceDetail
from ._models_py3 import ComponentEventDetails
from ._models_py3 import ComponentStateDetails
from ._models_py3 import ErrorDefinition
from ._models_py3 import ErrorResponse, ErrorResponseException
from ._models_py3 import ExpressionEvaluationDetails
from ._models_py3 import FieldRestriction
from ._models_py3 import FieldRestrictions
from ._models_py3 import IfNotExistsEvaluationDetails
from ._models_py3 import Operation
from ._models_py3 import OperationDisplay
from ._models_py3 import OperationsListResults
from ._models_py3 import PendingField
from ._models_py3 import PolicyAssignmentSummary
from ._models_py3 import PolicyDefinitionSummary
from ._models_py3 import PolicyDetails
from ._models_py3 import PolicyEvaluationDetails
from ._models_py3 import PolicyEvaluationResult
from ._models_py3 import PolicyEvent
from ._models_py3 import PolicyGroupSummary
from ._models_py3 import PolicyMetadata
from ._models_py3 import PolicyReference
from ._models_py3 import PolicyState
from ._models_py3 import PolicyTrackedResource
from ._models_py3 import QueryFailure, QueryFailureException
Expand All @@ -43,23 +52,32 @@
from ._models_py3 import TrackedResourceModificationDetails
from ._models_py3 import TypedErrorInfo
except (SyntaxError, ImportError):
from ._models import CheckRestrictionsRequest
from ._models import CheckRestrictionsResourceDetails
from ._models import CheckRestrictionsResult
from ._models import CheckRestrictionsResultContentEvaluationResult
from ._models import ComplianceDetail
from ._models import ComponentEventDetails
from ._models import ComponentStateDetails
from ._models import ErrorDefinition
from ._models import ErrorResponse, ErrorResponseException
from ._models import ExpressionEvaluationDetails
from ._models import FieldRestriction
from ._models import FieldRestrictions
from ._models import IfNotExistsEvaluationDetails
from ._models import Operation
from ._models import OperationDisplay
from ._models import OperationsListResults
from ._models import PendingField
from ._models import PolicyAssignmentSummary
from ._models import PolicyDefinitionSummary
from ._models import PolicyDetails
from ._models import PolicyEvaluationDetails
from ._models import PolicyEvaluationResult
from ._models import PolicyEvent
from ._models import PolicyGroupSummary
from ._models import PolicyMetadata
from ._models import PolicyReference
from ._models import PolicyState
from ._models import PolicyTrackedResource
from ._models import QueryFailure, QueryFailureException
Expand All @@ -83,27 +101,37 @@
from ._paged_models import SlimPolicyMetadataPaged
from ._policy_insights_client_enums import (
ResourceDiscoveryMode,
FieldRestrictionResult,
PolicyStatesResource,
)

__all__ = [
'CheckRestrictionsRequest',
'CheckRestrictionsResourceDetails',
'CheckRestrictionsResult',
'CheckRestrictionsResultContentEvaluationResult',
'ComplianceDetail',
'ComponentEventDetails',
'ComponentStateDetails',
'ErrorDefinition',
'ErrorResponse', 'ErrorResponseException',
'ExpressionEvaluationDetails',
'FieldRestriction',
'FieldRestrictions',
'IfNotExistsEvaluationDetails',
'Operation',
'OperationDisplay',
'OperationsListResults',
'PendingField',
'PolicyAssignmentSummary',
'PolicyDefinitionSummary',
'PolicyDetails',
'PolicyEvaluationDetails',
'PolicyEvaluationResult',
'PolicyEvent',
'PolicyGroupSummary',
'PolicyMetadata',
'PolicyReference',
'PolicyState',
'PolicyTrackedResource',
'QueryFailure', 'QueryFailureException',
Expand All @@ -126,5 +154,6 @@
'PolicyStatePaged',
'SlimPolicyMetadataPaged',
'ResourceDiscoveryMode',
'FieldRestrictionResult',
'PolicyStatesResource',
]
Loading