diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/CHANGELOG.md b/sdk/policyinsights/azure-mgmt-policyinsights/CHANGELOG.md index 89d50114e3ab..03d67a379c0f 100644 --- a/sdk/policyinsights/azure-mgmt-policyinsights/CHANGELOG.md +++ b/sdk/policyinsights/azure-mgmt-policyinsights/CHANGELOG.md @@ -1,5 +1,336 @@ # Release History +## 1.1.0b6 (2026-03-30) + +### Features Added + + - Client `PolicyInsightsClient` added method `send_request` + - Model `FieldRestriction` added property `values_property` + - Model `PendingField` added property `values_property` + - Model `PolicyMetadata` added property `properties` + - Model `PolicyMetadata` added property `system_data` + - Model `Resource` added property `system_data` + - Model `SlimPolicyMetadata` added property `properties` + - Added model `ProxyResource` + - Model `AttestationsOperations` added parameter `top` in method `list_for_resource` + - Model `AttestationsOperations` added parameter `filter` in method `list_for_resource` + - Model `AttestationsOperations` added parameter `top` in method `list_for_resource_group` + - Model `AttestationsOperations` added parameter `filter` in method `list_for_resource_group` + - Model `AttestationsOperations` added parameter `top` in method `list_for_subscription` + - Model `AttestationsOperations` added parameter `filter` in method `list_for_subscription` + - Model `PolicyEventsOperations` added parameter `top` in method `list_query_results_for_management_group` + - Model `PolicyEventsOperations` added parameter `order_by` in method `list_query_results_for_management_group` + - Model `PolicyEventsOperations` added parameter `select` in method `list_query_results_for_management_group` + - Model `PolicyEventsOperations` added parameter `from_parameter` in method `list_query_results_for_management_group` + - Model `PolicyEventsOperations` added parameter `to` in method `list_query_results_for_management_group` + - Model `PolicyEventsOperations` added parameter `filter` in method `list_query_results_for_management_group` + - Model `PolicyEventsOperations` added parameter `apply` in method `list_query_results_for_management_group` + - Model `PolicyEventsOperations` added parameter `skip_token` in method `list_query_results_for_management_group` + - Model `PolicyEventsOperations` added parameter `top` in method `list_query_results_for_policy_definition` + - Model `PolicyEventsOperations` added parameter `order_by` in method `list_query_results_for_policy_definition` + - Model `PolicyEventsOperations` added parameter `select` in method `list_query_results_for_policy_definition` + - Model `PolicyEventsOperations` added parameter `from_parameter` in method `list_query_results_for_policy_definition` + - Model `PolicyEventsOperations` added parameter `to` in method `list_query_results_for_policy_definition` + - Model `PolicyEventsOperations` added parameter `filter` in method `list_query_results_for_policy_definition` + - Model `PolicyEventsOperations` added parameter `apply` in method `list_query_results_for_policy_definition` + - Model `PolicyEventsOperations` added parameter `skip_token` in method `list_query_results_for_policy_definition` + - Model `PolicyEventsOperations` added parameter `top` in method `list_query_results_for_policy_set_definition` + - Model `PolicyEventsOperations` added parameter `order_by` in method `list_query_results_for_policy_set_definition` + - Model `PolicyEventsOperations` added parameter `select` in method `list_query_results_for_policy_set_definition` + - Model `PolicyEventsOperations` added parameter `from_parameter` in method `list_query_results_for_policy_set_definition` + - Model `PolicyEventsOperations` added parameter `to` in method `list_query_results_for_policy_set_definition` + - Model `PolicyEventsOperations` added parameter `filter` in method `list_query_results_for_policy_set_definition` + - Model `PolicyEventsOperations` added parameter `apply` in method `list_query_results_for_policy_set_definition` + - Model `PolicyEventsOperations` added parameter `skip_token` in method `list_query_results_for_policy_set_definition` + - Model `PolicyEventsOperations` added parameter `top` in method `list_query_results_for_resource` + - Model `PolicyEventsOperations` added parameter `order_by` in method `list_query_results_for_resource` + - Model `PolicyEventsOperations` added parameter `select` in method `list_query_results_for_resource` + - Model `PolicyEventsOperations` added parameter `from_parameter` in method `list_query_results_for_resource` + - Model `PolicyEventsOperations` added parameter `to` in method `list_query_results_for_resource` + - Model `PolicyEventsOperations` added parameter `filter` in method `list_query_results_for_resource` + - Model `PolicyEventsOperations` added parameter `apply` in method `list_query_results_for_resource` + - Model `PolicyEventsOperations` added parameter `expand` in method `list_query_results_for_resource` + - Model `PolicyEventsOperations` added parameter `skip_token` in method `list_query_results_for_resource` + - Model `PolicyEventsOperations` added parameter `top` in method `list_query_results_for_resource_group` + - Model `PolicyEventsOperations` added parameter `order_by` in method `list_query_results_for_resource_group` + - Model `PolicyEventsOperations` added parameter `select` in method `list_query_results_for_resource_group` + - Model `PolicyEventsOperations` added parameter `from_parameter` in method `list_query_results_for_resource_group` + - Model `PolicyEventsOperations` added parameter `to` in method `list_query_results_for_resource_group` + - Model `PolicyEventsOperations` added parameter `filter` in method `list_query_results_for_resource_group` + - Model `PolicyEventsOperations` added parameter `apply` in method `list_query_results_for_resource_group` + - Model `PolicyEventsOperations` added parameter `skip_token` in method `list_query_results_for_resource_group` + - Model `PolicyEventsOperations` added parameter `top` in method `list_query_results_for_resource_group_level_policy_assignment` + - Model `PolicyEventsOperations` added parameter `order_by` in method `list_query_results_for_resource_group_level_policy_assignment` + - Model `PolicyEventsOperations` added parameter `select` in method `list_query_results_for_resource_group_level_policy_assignment` + - Model `PolicyEventsOperations` added parameter `from_parameter` in method `list_query_results_for_resource_group_level_policy_assignment` + - Model `PolicyEventsOperations` added parameter `to` in method `list_query_results_for_resource_group_level_policy_assignment` + - Model `PolicyEventsOperations` added parameter `filter` in method `list_query_results_for_resource_group_level_policy_assignment` + - Model `PolicyEventsOperations` added parameter `apply` in method `list_query_results_for_resource_group_level_policy_assignment` + - Model `PolicyEventsOperations` added parameter `skip_token` in method `list_query_results_for_resource_group_level_policy_assignment` + - Model `PolicyEventsOperations` added parameter `top` in method `list_query_results_for_subscription` + - Model `PolicyEventsOperations` added parameter `order_by` in method `list_query_results_for_subscription` + - Model `PolicyEventsOperations` added parameter `select` in method `list_query_results_for_subscription` + - Model `PolicyEventsOperations` added parameter `from_parameter` in method `list_query_results_for_subscription` + - Model `PolicyEventsOperations` added parameter `to` in method `list_query_results_for_subscription` + - Model `PolicyEventsOperations` added parameter `filter` in method `list_query_results_for_subscription` + - Model `PolicyEventsOperations` added parameter `apply` in method `list_query_results_for_subscription` + - Model `PolicyEventsOperations` added parameter `skip_token` in method `list_query_results_for_subscription` + - Model `PolicyEventsOperations` added parameter `top` in method `list_query_results_for_subscription_level_policy_assignment` + - Model `PolicyEventsOperations` added parameter `order_by` in method `list_query_results_for_subscription_level_policy_assignment` + - Model `PolicyEventsOperations` added parameter `select` in method `list_query_results_for_subscription_level_policy_assignment` + - Model `PolicyEventsOperations` added parameter `from_parameter` in method `list_query_results_for_subscription_level_policy_assignment` + - Model `PolicyEventsOperations` added parameter `to` in method `list_query_results_for_subscription_level_policy_assignment` + - Model `PolicyEventsOperations` added parameter `filter` in method `list_query_results_for_subscription_level_policy_assignment` + - Model `PolicyEventsOperations` added parameter `apply` in method `list_query_results_for_subscription_level_policy_assignment` + - Model `PolicyEventsOperations` added parameter `skip_token` in method `list_query_results_for_subscription_level_policy_assignment` + - Model `PolicyMetadataOperations` added parameter `top` in method `list` + - Model `PolicyStatesOperations` added parameter `top` in method `list_query_results_for_management_group` + - Model `PolicyStatesOperations` added parameter `order_by` in method `list_query_results_for_management_group` + - Model `PolicyStatesOperations` added parameter `select` in method `list_query_results_for_management_group` + - Model `PolicyStatesOperations` added parameter `from_parameter` in method `list_query_results_for_management_group` + - Model `PolicyStatesOperations` added parameter `to` in method `list_query_results_for_management_group` + - Model `PolicyStatesOperations` added parameter `filter` in method `list_query_results_for_management_group` + - Model `PolicyStatesOperations` added parameter `apply` in method `list_query_results_for_management_group` + - Model `PolicyStatesOperations` added parameter `skip_token` in method `list_query_results_for_management_group` + - Model `PolicyStatesOperations` added parameter `top` in method `list_query_results_for_policy_definition` + - Model `PolicyStatesOperations` added parameter `order_by` in method `list_query_results_for_policy_definition` + - Model `PolicyStatesOperations` added parameter `select` in method `list_query_results_for_policy_definition` + - Model `PolicyStatesOperations` added parameter `from_parameter` in method `list_query_results_for_policy_definition` + - Model `PolicyStatesOperations` added parameter `to` in method `list_query_results_for_policy_definition` + - Model `PolicyStatesOperations` added parameter `filter` in method `list_query_results_for_policy_definition` + - Model `PolicyStatesOperations` added parameter `apply` in method `list_query_results_for_policy_definition` + - Model `PolicyStatesOperations` added parameter `skip_token` in method `list_query_results_for_policy_definition` + - Model `PolicyStatesOperations` added parameter `top` in method `list_query_results_for_policy_set_definition` + - Model `PolicyStatesOperations` added parameter `order_by` in method `list_query_results_for_policy_set_definition` + - Model `PolicyStatesOperations` added parameter `select` in method `list_query_results_for_policy_set_definition` + - Model `PolicyStatesOperations` added parameter `from_parameter` in method `list_query_results_for_policy_set_definition` + - Model `PolicyStatesOperations` added parameter `to` in method `list_query_results_for_policy_set_definition` + - Model `PolicyStatesOperations` added parameter `filter` in method `list_query_results_for_policy_set_definition` + - Model `PolicyStatesOperations` added parameter `apply` in method `list_query_results_for_policy_set_definition` + - Model `PolicyStatesOperations` added parameter `skip_token` in method `list_query_results_for_policy_set_definition` + - Model `PolicyStatesOperations` added parameter `top` in method `list_query_results_for_resource` + - Model `PolicyStatesOperations` added parameter `order_by` in method `list_query_results_for_resource` + - Model `PolicyStatesOperations` added parameter `select` in method `list_query_results_for_resource` + - Model `PolicyStatesOperations` added parameter `from_parameter` in method `list_query_results_for_resource` + - Model `PolicyStatesOperations` added parameter `to` in method `list_query_results_for_resource` + - Model `PolicyStatesOperations` added parameter `filter` in method `list_query_results_for_resource` + - Model `PolicyStatesOperations` added parameter `apply` in method `list_query_results_for_resource` + - Model `PolicyStatesOperations` added parameter `expand` in method `list_query_results_for_resource` + - Model `PolicyStatesOperations` added parameter `skip_token` in method `list_query_results_for_resource` + - Model `PolicyStatesOperations` added parameter `top` in method `list_query_results_for_resource_group` + - Model `PolicyStatesOperations` added parameter `order_by` in method `list_query_results_for_resource_group` + - Model `PolicyStatesOperations` added parameter `select` in method `list_query_results_for_resource_group` + - Model `PolicyStatesOperations` added parameter `from_parameter` in method `list_query_results_for_resource_group` + - Model `PolicyStatesOperations` added parameter `to` in method `list_query_results_for_resource_group` + - Model `PolicyStatesOperations` added parameter `filter` in method `list_query_results_for_resource_group` + - Model `PolicyStatesOperations` added parameter `apply` in method `list_query_results_for_resource_group` + - Model `PolicyStatesOperations` added parameter `skip_token` in method `list_query_results_for_resource_group` + - Model `PolicyStatesOperations` added parameter `top` in method `list_query_results_for_resource_group_level_policy_assignment` + - Model `PolicyStatesOperations` added parameter `order_by` in method `list_query_results_for_resource_group_level_policy_assignment` + - Model `PolicyStatesOperations` added parameter `select` in method `list_query_results_for_resource_group_level_policy_assignment` + - Model `PolicyStatesOperations` added parameter `from_parameter` in method `list_query_results_for_resource_group_level_policy_assignment` + - Model `PolicyStatesOperations` added parameter `to` in method `list_query_results_for_resource_group_level_policy_assignment` + - Model `PolicyStatesOperations` added parameter `filter` in method `list_query_results_for_resource_group_level_policy_assignment` + - Model `PolicyStatesOperations` added parameter `apply` in method `list_query_results_for_resource_group_level_policy_assignment` + - Model `PolicyStatesOperations` added parameter `skip_token` in method `list_query_results_for_resource_group_level_policy_assignment` + - Model `PolicyStatesOperations` added parameter `top` in method `list_query_results_for_subscription` + - Model `PolicyStatesOperations` added parameter `order_by` in method `list_query_results_for_subscription` + - Model `PolicyStatesOperations` added parameter `select` in method `list_query_results_for_subscription` + - Model `PolicyStatesOperations` added parameter `from_parameter` in method `list_query_results_for_subscription` + - Model `PolicyStatesOperations` added parameter `to` in method `list_query_results_for_subscription` + - Model `PolicyStatesOperations` added parameter `filter` in method `list_query_results_for_subscription` + - Model `PolicyStatesOperations` added parameter `apply` in method `list_query_results_for_subscription` + - Model `PolicyStatesOperations` added parameter `skip_token` in method `list_query_results_for_subscription` + - Model `PolicyStatesOperations` added parameter `top` in method `list_query_results_for_subscription_level_policy_assignment` + - Model `PolicyStatesOperations` added parameter `order_by` in method `list_query_results_for_subscription_level_policy_assignment` + - Model `PolicyStatesOperations` added parameter `select` in method `list_query_results_for_subscription_level_policy_assignment` + - Model `PolicyStatesOperations` added parameter `from_parameter` in method `list_query_results_for_subscription_level_policy_assignment` + - Model `PolicyStatesOperations` added parameter `to` in method `list_query_results_for_subscription_level_policy_assignment` + - Model `PolicyStatesOperations` added parameter `filter` in method `list_query_results_for_subscription_level_policy_assignment` + - Model `PolicyStatesOperations` added parameter `apply` in method `list_query_results_for_subscription_level_policy_assignment` + - Model `PolicyStatesOperations` added parameter `skip_token` in method `list_query_results_for_subscription_level_policy_assignment` + - Model `PolicyStatesOperations` added parameter `top` in method `summarize_for_management_group` + - Model `PolicyStatesOperations` added parameter `from_parameter` in method `summarize_for_management_group` + - Model `PolicyStatesOperations` added parameter `to` in method `summarize_for_management_group` + - Model `PolicyStatesOperations` added parameter `filter` in method `summarize_for_management_group` + - Model `PolicyStatesOperations` added parameter `top` in method `summarize_for_policy_definition` + - Model `PolicyStatesOperations` added parameter `from_parameter` in method `summarize_for_policy_definition` + - Model `PolicyStatesOperations` added parameter `to` in method `summarize_for_policy_definition` + - Model `PolicyStatesOperations` added parameter `filter` in method `summarize_for_policy_definition` + - Model `PolicyStatesOperations` added parameter `top` in method `summarize_for_policy_set_definition` + - Model `PolicyStatesOperations` added parameter `from_parameter` in method `summarize_for_policy_set_definition` + - Model `PolicyStatesOperations` added parameter `to` in method `summarize_for_policy_set_definition` + - Model `PolicyStatesOperations` added parameter `filter` in method `summarize_for_policy_set_definition` + - Model `PolicyStatesOperations` added parameter `top` in method `summarize_for_resource` + - Model `PolicyStatesOperations` added parameter `from_parameter` in method `summarize_for_resource` + - Model `PolicyStatesOperations` added parameter `to` in method `summarize_for_resource` + - Model `PolicyStatesOperations` added parameter `filter` in method `summarize_for_resource` + - Model `PolicyStatesOperations` added parameter `top` in method `summarize_for_resource_group` + - Model `PolicyStatesOperations` added parameter `from_parameter` in method `summarize_for_resource_group` + - Model `PolicyStatesOperations` added parameter `to` in method `summarize_for_resource_group` + - Model `PolicyStatesOperations` added parameter `filter` in method `summarize_for_resource_group` + - Model `PolicyStatesOperations` added parameter `top` in method `summarize_for_resource_group_level_policy_assignment` + - Model `PolicyStatesOperations` added parameter `from_parameter` in method `summarize_for_resource_group_level_policy_assignment` + - Model `PolicyStatesOperations` added parameter `to` in method `summarize_for_resource_group_level_policy_assignment` + - Model `PolicyStatesOperations` added parameter `filter` in method `summarize_for_resource_group_level_policy_assignment` + - Model `PolicyStatesOperations` added parameter `top` in method `summarize_for_subscription` + - Model `PolicyStatesOperations` added parameter `from_parameter` in method `summarize_for_subscription` + - Model `PolicyStatesOperations` added parameter `to` in method `summarize_for_subscription` + - Model `PolicyStatesOperations` added parameter `filter` in method `summarize_for_subscription` + - Model `PolicyStatesOperations` added parameter `top` in method `summarize_for_subscription_level_policy_assignment` + - Model `PolicyStatesOperations` added parameter `from_parameter` in method `summarize_for_subscription_level_policy_assignment` + - Model `PolicyStatesOperations` added parameter `to` in method `summarize_for_subscription_level_policy_assignment` + - Model `PolicyStatesOperations` added parameter `filter` in method `summarize_for_subscription_level_policy_assignment` + - Model `PolicyTrackedResourcesOperations` added parameter `top` in method `list_query_results_for_management_group` + - Model `PolicyTrackedResourcesOperations` added parameter `filter` in method `list_query_results_for_management_group` + - Model `PolicyTrackedResourcesOperations` added parameter `top` in method `list_query_results_for_resource` + - Model `PolicyTrackedResourcesOperations` added parameter `filter` in method `list_query_results_for_resource` + - Model `PolicyTrackedResourcesOperations` added parameter `top` in method `list_query_results_for_resource_group` + - Model `PolicyTrackedResourcesOperations` added parameter `filter` in method `list_query_results_for_resource_group` + - Model `PolicyTrackedResourcesOperations` added parameter `top` in method `list_query_results_for_subscription` + - Model `PolicyTrackedResourcesOperations` added parameter `filter` in method `list_query_results_for_subscription` + - Model `RemediationsOperations` added parameter `top` in method `list_deployments_at_management_group` + - Model `RemediationsOperations` added parameter `top` in method `list_deployments_at_resource` + - Model `RemediationsOperations` added parameter `top` in method `list_deployments_at_resource_group` + - Model `RemediationsOperations` added parameter `top` in method `list_deployments_at_subscription` + - Model `RemediationsOperations` added parameter `top` in method `list_for_management_group` + - Model `RemediationsOperations` added parameter `filter` in method `list_for_management_group` + - Model `RemediationsOperations` added parameter `top` in method `list_for_resource` + - Model `RemediationsOperations` added parameter `filter` in method `list_for_resource` + - Model `RemediationsOperations` added parameter `top` in method `list_for_resource_group` + - Model `RemediationsOperations` added parameter `filter` in method `list_for_resource_group` + - Model `RemediationsOperations` added parameter `top` in method `list_for_subscription` + - Model `RemediationsOperations` added parameter `filter` in method `list_for_subscription` + +### Breaking Changes + + - Model `FieldRestriction` deleted or renamed its instance variable `values` + - Model `PendingField` deleted or renamed its instance variable `values` + - Model `PolicyMetadata` deleted or renamed its instance variable `metadata_id` + - Model `PolicyMetadata` deleted or renamed its instance variable `category` + - Model `PolicyMetadata` deleted or renamed its instance variable `title` + - Model `PolicyMetadata` deleted or renamed its instance variable `owner` + - Model `PolicyMetadata` deleted or renamed its instance variable `additional_content_url` + - Model `PolicyMetadata` deleted or renamed its instance variable `metadata` + - Model `PolicyMetadata` deleted or renamed its instance variable `description` + - Model `PolicyMetadata` deleted or renamed its instance variable `requirements` + - Model `SlimPolicyMetadata` deleted or renamed its instance variable `metadata_id` + - Model `SlimPolicyMetadata` deleted or renamed its instance variable `category` + - Model `SlimPolicyMetadata` deleted or renamed its instance variable `title` + - Model `SlimPolicyMetadata` deleted or renamed its instance variable `owner` + - Model `SlimPolicyMetadata` deleted or renamed its instance variable `additional_content_url` + - Model `SlimPolicyMetadata` deleted or renamed its instance variable `metadata` + - Deleted or renamed model `ErrorDefinitionAutoGenerated` + - Deleted or renamed model `ErrorDefinitionAutoGenerated2` + - Deleted or renamed model `ErrorResponseAutoGenerated` + - Deleted or renamed model `ErrorResponseAutoGenerated2` + - Deleted or renamed model `PolicyEventsQueryResults` + - Deleted or renamed model `PolicyMetadataCollection` + - Deleted or renamed model `PolicyStatesQueryResults` + - Deleted or renamed model `PolicyTrackedResourcesQueryResults` + - Deleted or renamed model `QueryOptions` + - Method `AttestationsOperations.list_for_resource` deleted or renamed its parameter `query_options` of kind `positional_or_keyword` + - Method `AttestationsOperations.list_for_resource_group` deleted or renamed its parameter `query_options` of kind `positional_or_keyword` + - Method `AttestationsOperations.list_for_subscription` deleted or renamed its parameter `query_options` of kind `positional_or_keyword` + - Method `ComponentPolicyStatesOperations.list_query_results_for_policy_definition` changed its parameter `order_by` from `positional_or_keyword` to `keyword_only` + - Method `ComponentPolicyStatesOperations.list_query_results_for_policy_definition` changed its parameter `select` from `positional_or_keyword` to `keyword_only` + - Method `ComponentPolicyStatesOperations.list_query_results_for_policy_definition` changed its parameter `from_parameter` from `positional_or_keyword` to `keyword_only` + - Method `ComponentPolicyStatesOperations.list_query_results_for_policy_definition` changed its parameter `to` from `positional_or_keyword` to `keyword_only` + - Method `ComponentPolicyStatesOperations.list_query_results_for_policy_definition` changed its parameter `apply` from `positional_or_keyword` to `keyword_only` + - Method `ComponentPolicyStatesOperations.list_query_results_for_policy_definition` deleted or renamed its parameter `subscription_id` of kind `positional_or_keyword` + - Method `ComponentPolicyStatesOperations.list_query_results_for_resource` changed its parameter `order_by` from `positional_or_keyword` to `keyword_only` + - Method `ComponentPolicyStatesOperations.list_query_results_for_resource` changed its parameter `select` from `positional_or_keyword` to `keyword_only` + - Method `ComponentPolicyStatesOperations.list_query_results_for_resource` changed its parameter `from_parameter` from `positional_or_keyword` to `keyword_only` + - Method `ComponentPolicyStatesOperations.list_query_results_for_resource` changed its parameter `to` from `positional_or_keyword` to `keyword_only` + - Method `ComponentPolicyStatesOperations.list_query_results_for_resource` changed its parameter `apply` from `positional_or_keyword` to `keyword_only` + - Method `ComponentPolicyStatesOperations.list_query_results_for_resource` changed its parameter `expand` from `positional_or_keyword` to `keyword_only` + - Method `ComponentPolicyStatesOperations.list_query_results_for_resource_group` changed its parameter `order_by` from `positional_or_keyword` to `keyword_only` + - Method `ComponentPolicyStatesOperations.list_query_results_for_resource_group` changed its parameter `select` from `positional_or_keyword` to `keyword_only` + - Method `ComponentPolicyStatesOperations.list_query_results_for_resource_group` changed its parameter `from_parameter` from `positional_or_keyword` to `keyword_only` + - Method `ComponentPolicyStatesOperations.list_query_results_for_resource_group` changed its parameter `to` from `positional_or_keyword` to `keyword_only` + - Method `ComponentPolicyStatesOperations.list_query_results_for_resource_group` changed its parameter `apply` from `positional_or_keyword` to `keyword_only` + - Method `ComponentPolicyStatesOperations.list_query_results_for_resource_group` deleted or renamed its parameter `subscription_id` of kind `positional_or_keyword` + - Method `ComponentPolicyStatesOperations.list_query_results_for_resource_group_level_policy_assignment` changed its parameter `order_by` from `positional_or_keyword` to `keyword_only` + - Method `ComponentPolicyStatesOperations.list_query_results_for_resource_group_level_policy_assignment` changed its parameter `select` from `positional_or_keyword` to `keyword_only` + - Method `ComponentPolicyStatesOperations.list_query_results_for_resource_group_level_policy_assignment` changed its parameter `from_parameter` from `positional_or_keyword` to `keyword_only` + - Method `ComponentPolicyStatesOperations.list_query_results_for_resource_group_level_policy_assignment` changed its parameter `to` from `positional_or_keyword` to `keyword_only` + - Method `ComponentPolicyStatesOperations.list_query_results_for_resource_group_level_policy_assignment` changed its parameter `apply` from `positional_or_keyword` to `keyword_only` + - Method `ComponentPolicyStatesOperations.list_query_results_for_resource_group_level_policy_assignment` deleted or renamed its parameter `subscription_id` of kind `positional_or_keyword` + - Method `ComponentPolicyStatesOperations.list_query_results_for_subscription` changed its parameter `order_by` from `positional_or_keyword` to `keyword_only` + - Method `ComponentPolicyStatesOperations.list_query_results_for_subscription` changed its parameter `select` from `positional_or_keyword` to `keyword_only` + - Method `ComponentPolicyStatesOperations.list_query_results_for_subscription` changed its parameter `from_parameter` from `positional_or_keyword` to `keyword_only` + - Method `ComponentPolicyStatesOperations.list_query_results_for_subscription` changed its parameter `to` from `positional_or_keyword` to `keyword_only` + - Method `ComponentPolicyStatesOperations.list_query_results_for_subscription` changed its parameter `apply` from `positional_or_keyword` to `keyword_only` + - Method `ComponentPolicyStatesOperations.list_query_results_for_subscription` deleted or renamed its parameter `subscription_id` of kind `positional_or_keyword` + - Method `ComponentPolicyStatesOperations.list_query_results_for_subscription_level_policy_assignment` changed its parameter `order_by` from `positional_or_keyword` to `keyword_only` + - Method `ComponentPolicyStatesOperations.list_query_results_for_subscription_level_policy_assignment` changed its parameter `select` from `positional_or_keyword` to `keyword_only` + - Method `ComponentPolicyStatesOperations.list_query_results_for_subscription_level_policy_assignment` changed its parameter `from_parameter` from `positional_or_keyword` to `keyword_only` + - Method `ComponentPolicyStatesOperations.list_query_results_for_subscription_level_policy_assignment` changed its parameter `to` from `positional_or_keyword` to `keyword_only` + - Method `ComponentPolicyStatesOperations.list_query_results_for_subscription_level_policy_assignment` changed its parameter `apply` from `positional_or_keyword` to `keyword_only` + - Method `ComponentPolicyStatesOperations.list_query_results_for_subscription_level_policy_assignment` deleted or renamed its parameter `subscription_id` of kind `positional_or_keyword` + - Method `PolicyEventsOperations.list_query_results_for_management_group` deleted or renamed its parameter `query_options` of kind `positional_or_keyword` + - Method `PolicyEventsOperations.list_query_results_for_policy_definition` deleted or renamed its parameter `subscription_id` of kind `positional_or_keyword` + - Method `PolicyEventsOperations.list_query_results_for_policy_definition` deleted or renamed its parameter `query_options` of kind `positional_or_keyword` + - Method `PolicyEventsOperations.list_query_results_for_policy_set_definition` deleted or renamed its parameter `subscription_id` of kind `positional_or_keyword` + - Method `PolicyEventsOperations.list_query_results_for_policy_set_definition` deleted or renamed its parameter `query_options` of kind `positional_or_keyword` + - Method `PolicyEventsOperations.list_query_results_for_resource` deleted or renamed its parameter `query_options` of kind `positional_or_keyword` + - Method `PolicyEventsOperations.list_query_results_for_resource_group` deleted or renamed its parameter `subscription_id` of kind `positional_or_keyword` + - Method `PolicyEventsOperations.list_query_results_for_resource_group` deleted or renamed its parameter `query_options` of kind `positional_or_keyword` + - Method `PolicyEventsOperations.list_query_results_for_resource_group_level_policy_assignment` deleted or renamed its parameter `subscription_id` of kind `positional_or_keyword` + - Method `PolicyEventsOperations.list_query_results_for_resource_group_level_policy_assignment` deleted or renamed its parameter `query_options` of kind `positional_or_keyword` + - Method `PolicyEventsOperations.list_query_results_for_subscription` deleted or renamed its parameter `subscription_id` of kind `positional_or_keyword` + - Method `PolicyEventsOperations.list_query_results_for_subscription` deleted or renamed its parameter `query_options` of kind `positional_or_keyword` + - Method `PolicyEventsOperations.list_query_results_for_subscription_level_policy_assignment` deleted or renamed its parameter `subscription_id` of kind `positional_or_keyword` + - Method `PolicyEventsOperations.list_query_results_for_subscription_level_policy_assignment` deleted or renamed its parameter `query_options` of kind `positional_or_keyword` + - Method `PolicyMetadataOperations.list` deleted or renamed its parameter `query_options` of kind `positional_or_keyword` + - Method `PolicyStatesOperations.begin_trigger_resource_group_evaluation` deleted or renamed its parameter `subscription_id` of kind `positional_or_keyword` + - Method `PolicyStatesOperations.begin_trigger_subscription_evaluation` deleted or renamed its parameter `subscription_id` of kind `positional_or_keyword` + - Method `PolicyStatesOperations.list_query_results_for_management_group` deleted or renamed its parameter `query_options` of kind `positional_or_keyword` + - Method `PolicyStatesOperations.list_query_results_for_policy_definition` deleted or renamed its parameter `subscription_id` of kind `positional_or_keyword` + - Method `PolicyStatesOperations.list_query_results_for_policy_definition` deleted or renamed its parameter `query_options` of kind `positional_or_keyword` + - Method `PolicyStatesOperations.list_query_results_for_policy_set_definition` deleted or renamed its parameter `subscription_id` of kind `positional_or_keyword` + - Method `PolicyStatesOperations.list_query_results_for_policy_set_definition` deleted or renamed its parameter `query_options` of kind `positional_or_keyword` + - Method `PolicyStatesOperations.list_query_results_for_resource` deleted or renamed its parameter `query_options` of kind `positional_or_keyword` + - Method `PolicyStatesOperations.list_query_results_for_resource_group` deleted or renamed its parameter `subscription_id` of kind `positional_or_keyword` + - Method `PolicyStatesOperations.list_query_results_for_resource_group` deleted or renamed its parameter `query_options` of kind `positional_or_keyword` + - Method `PolicyStatesOperations.list_query_results_for_resource_group_level_policy_assignment` deleted or renamed its parameter `subscription_id` of kind `positional_or_keyword` + - Method `PolicyStatesOperations.list_query_results_for_resource_group_level_policy_assignment` deleted or renamed its parameter `query_options` of kind `positional_or_keyword` + - Method `PolicyStatesOperations.list_query_results_for_subscription` deleted or renamed its parameter `subscription_id` of kind `positional_or_keyword` + - Method `PolicyStatesOperations.list_query_results_for_subscription` deleted or renamed its parameter `query_options` of kind `positional_or_keyword` + - Method `PolicyStatesOperations.list_query_results_for_subscription_level_policy_assignment` deleted or renamed its parameter `subscription_id` of kind `positional_or_keyword` + - Method `PolicyStatesOperations.list_query_results_for_subscription_level_policy_assignment` deleted or renamed its parameter `query_options` of kind `positional_or_keyword` + - Method `PolicyStatesOperations.summarize_for_management_group` deleted or renamed its parameter `query_options` of kind `positional_or_keyword` + - Method `PolicyStatesOperations.summarize_for_policy_definition` deleted or renamed its parameter `subscription_id` of kind `positional_or_keyword` + - Method `PolicyStatesOperations.summarize_for_policy_definition` deleted or renamed its parameter `query_options` of kind `positional_or_keyword` + - Method `PolicyStatesOperations.summarize_for_policy_set_definition` deleted or renamed its parameter `subscription_id` of kind `positional_or_keyword` + - Method `PolicyStatesOperations.summarize_for_policy_set_definition` deleted or renamed its parameter `query_options` of kind `positional_or_keyword` + - Method `PolicyStatesOperations.summarize_for_resource` deleted or renamed its parameter `query_options` of kind `positional_or_keyword` + - Method `PolicyStatesOperations.summarize_for_resource_group` deleted or renamed its parameter `subscription_id` of kind `positional_or_keyword` + - Method `PolicyStatesOperations.summarize_for_resource_group` deleted or renamed its parameter `query_options` of kind `positional_or_keyword` + - Method `PolicyStatesOperations.summarize_for_resource_group_level_policy_assignment` deleted or renamed its parameter `subscription_id` of kind `positional_or_keyword` + - Method `PolicyStatesOperations.summarize_for_resource_group_level_policy_assignment` deleted or renamed its parameter `query_options` of kind `positional_or_keyword` + - Method `PolicyStatesOperations.summarize_for_subscription` deleted or renamed its parameter `subscription_id` of kind `positional_or_keyword` + - Method `PolicyStatesOperations.summarize_for_subscription` deleted or renamed its parameter `query_options` of kind `positional_or_keyword` + - Method `PolicyStatesOperations.summarize_for_subscription_level_policy_assignment` deleted or renamed its parameter `subscription_id` of kind `positional_or_keyword` + - Method `PolicyStatesOperations.summarize_for_subscription_level_policy_assignment` deleted or renamed its parameter `query_options` of kind `positional_or_keyword` + - Method `PolicyTrackedResourcesOperations.list_query_results_for_management_group` deleted or renamed its parameter `query_options` of kind `positional_or_keyword` + - Method `PolicyTrackedResourcesOperations.list_query_results_for_resource` deleted or renamed its parameter `query_options` of kind `positional_or_keyword` + - Method `PolicyTrackedResourcesOperations.list_query_results_for_resource_group` deleted or renamed its parameter `query_options` of kind `positional_or_keyword` + - Method `PolicyTrackedResourcesOperations.list_query_results_for_subscription` deleted or renamed its parameter `query_options` of kind `positional_or_keyword` + - Method `RemediationsOperations.list_deployments_at_management_group` deleted or renamed its parameter `query_options` of kind `positional_or_keyword` + - Method `RemediationsOperations.list_deployments_at_resource` deleted or renamed its parameter `query_options` of kind `positional_or_keyword` + - Method `RemediationsOperations.list_deployments_at_resource_group` deleted or renamed its parameter `query_options` of kind `positional_or_keyword` + - Method `RemediationsOperations.list_deployments_at_subscription` deleted or renamed its parameter `query_options` of kind `positional_or_keyword` + - Method `RemediationsOperations.list_for_management_group` deleted or renamed its parameter `query_options` of kind `positional_or_keyword` + - Method `RemediationsOperations.list_for_resource` deleted or renamed its parameter `query_options` of kind `positional_or_keyword` + - Method `RemediationsOperations.list_for_resource_group` deleted or renamed its parameter `query_options` of kind `positional_or_keyword` + - Method `RemediationsOperations.list_for_subscription` deleted or renamed its parameter `query_options` of kind `positional_or_keyword` + - Method `RemediationsOperations.list_deployments_at_subscription` re-ordered its parameters from `['self', 'remediation_name', 'query_options', 'kwargs']` to `['self', 'remediation_name', 'top', 'kwargs']` + - Method `RemediationsOperations.list_deployments_at_management_group` re-ordered its parameters from `['self', 'management_group_id', 'remediation_name', 'query_options', 'kwargs']` to `['self', 'management_group_id', 'remediation_name', 'top', 'kwargs']` + - Method `RemediationsOperations.list_deployments_at_resource_group` re-ordered its parameters from `['self', 'resource_group_name', 'remediation_name', 'query_options', 'kwargs']` to `['self', 'resource_group_name', 'remediation_name', 'top', 'kwargs']` + - Method `RemediationsOperations.list_deployments_at_resource` re-ordered its parameters from `['self', 'resource_id', 'remediation_name', 'query_options', 'kwargs']` to `['self', 'resource_id', 'remediation_name', 'top', 'kwargs']` + - Method `PolicyMetadataOperations.list` re-ordered its parameters from `['self', 'query_options', 'kwargs']` to `['self', 'top', 'kwargs']` + ## 1.1.0b5 (2025-07-21) ### Features Added diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/MANIFEST.in b/sdk/policyinsights/azure-mgmt-policyinsights/MANIFEST.in index 18dbe2ffa8e0..42e22943a999 100644 --- a/sdk/policyinsights/azure-mgmt-policyinsights/MANIFEST.in +++ b/sdk/policyinsights/azure-mgmt-policyinsights/MANIFEST.in @@ -1,7 +1,7 @@ -recursive-include tests *.py *.json -recursive-include samples *.py *.md include *.md -include azure/__init__.py -include azure/mgmt/__init__.py include LICENSE include azure/mgmt/policyinsights/py.typed +recursive-include tests *.py +recursive-include samples *.py *.md +include azure/__init__.py +include azure/mgmt/__init__.py diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/_metadata.json b/sdk/policyinsights/azure-mgmt-policyinsights/_metadata.json index 931fbe436c0b..125977d899c3 100644 --- a/sdk/policyinsights/azure-mgmt-policyinsights/_metadata.json +++ b/sdk/policyinsights/azure-mgmt-policyinsights/_metadata.json @@ -1,11 +1,10 @@ { - "commit": "6c548b0bd279f5e233661b1c81fb5b61b19965cd", + "apiVersions": { + "PolicyInsightsApi": "2024-10-01", + "PolicyTrackedResourcesApi": "2018-07-01-preview" + }, + "commit": "cf32d44a757a20b34b33f5e22f85bea90dd0e4d3", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest": "3.10.2", - "use": [ - "@autorest/python@6.35.0", - "@autorest/modelerfour@4.27.0" - ], - "autorest_command": "autorest specification/policyinsights/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.35.0 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False", - "readme": "specification/policyinsights/resource-manager/readme.md" + "typespec_src": "specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyInsights", + "emitterVersion": "0.61.1" } \ No newline at end of file diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/apiview-properties.json b/sdk/policyinsights/azure-mgmt-policyinsights/apiview-properties.json new file mode 100644 index 000000000000..a7d22a2bc759 --- /dev/null +++ b/sdk/policyinsights/azure-mgmt-policyinsights/apiview-properties.json @@ -0,0 +1,227 @@ +{ + "CrossLanguagePackageId": "PolicyInsightsApi", + "CrossLanguageDefinitionId": { + "azure.mgmt.policyinsights.models.Resource": "Azure.ResourceManager.CommonTypes.Resource", + "azure.mgmt.policyinsights.models.ProxyResource": "Azure.ResourceManager.CommonTypes.ProxyResource", + "azure.mgmt.policyinsights.models.Attestation": "PolicyInsightsApi.Attestation", + "azure.mgmt.policyinsights.models.AttestationEvidence": "PolicyInsightsApi.AttestationEvidence", + "azure.mgmt.policyinsights.models.AttestationProperties": "PolicyInsightsApi.AttestationProperties", + "azure.mgmt.policyinsights.models.CheckManagementGroupRestrictionsRequest": "PolicyInsightsApi.CheckManagementGroupRestrictionsRequest", + "azure.mgmt.policyinsights.models.CheckRestrictionEvaluationDetails": "PolicyInsightsApi.CheckRestrictionEvaluationDetails", + "azure.mgmt.policyinsights.models.CheckRestrictionsRequest": "PolicyInsightsApi.CheckRestrictionsRequest", + "azure.mgmt.policyinsights.models.CheckRestrictionsResourceDetails": "PolicyInsightsApi.CheckRestrictionsResourceDetails", + "azure.mgmt.policyinsights.models.CheckRestrictionsResult": "PolicyInsightsApi.CheckRestrictionsResult", + "azure.mgmt.policyinsights.models.CheckRestrictionsResultContentEvaluationResult": "PolicyInsightsApi.CheckRestrictionsResultContentEvaluationResult", + "azure.mgmt.policyinsights.models.ComplianceDetail": "PolicyInsightsApi.ComplianceDetail", + "azure.mgmt.policyinsights.models.ComponentEventDetails": "PolicyInsightsApi.ComponentEventDetails", + "azure.mgmt.policyinsights.models.ComponentExpressionEvaluationDetails": "PolicyInsightsApi.ComponentExpressionEvaluationDetails", + "azure.mgmt.policyinsights.models.ComponentPolicyEvaluationDetails": "PolicyInsightsApi.ComponentPolicyEvaluationDetails", + "azure.mgmt.policyinsights.models.ComponentPolicyState": "PolicyInsightsApi.ComponentPolicyState", + "azure.mgmt.policyinsights.models.ComponentPolicyStatesQueryResults": "PolicyInsightsApi.ComponentPolicyStatesQueryResults", + "azure.mgmt.policyinsights.models.ComponentStateDetails": "PolicyInsightsApi.ComponentStateDetails", + "azure.mgmt.policyinsights.models.ErrorDefinition": "PolicyInsightsApi.ErrorDefinition", + "azure.mgmt.policyinsights.models.ErrorResponse": "PolicyInsightsApi.ErrorResponse", + "azure.mgmt.policyinsights.models.ExpressionEvaluationDetails": "PolicyInsightsApi.ExpressionEvaluationDetails", + "azure.mgmt.policyinsights.models.FieldRestriction": "PolicyInsightsApi.FieldRestriction", + "azure.mgmt.policyinsights.models.FieldRestrictions": "PolicyInsightsApi.FieldRestrictions", + "azure.mgmt.policyinsights.models.IfNotExistsEvaluationDetails": "PolicyInsightsApi.IfNotExistsEvaluationDetails", + "azure.mgmt.policyinsights.models.Operation": "PolicyInsightsApi.Operation", + "azure.mgmt.policyinsights.models.OperationDisplay": "PolicyInsightsApi.OperationDisplay", + "azure.mgmt.policyinsights.models.OperationsListResults": "PolicyInsightsApi.OperationsListResults", + "azure.mgmt.policyinsights.models.PendingField": "PolicyInsightsApi.PendingField", + "azure.mgmt.policyinsights.models.PolicyAssignmentSummary": "PolicyInsightsApi.PolicyAssignmentSummary", + "azure.mgmt.policyinsights.models.PolicyDefinitionSummary": "PolicyInsightsApi.PolicyDefinitionSummary", + "azure.mgmt.policyinsights.models.PolicyDetails": "PolicyTrackedResourcesApi.PolicyDetails", + "azure.mgmt.policyinsights.models.PolicyEffectDetails": "PolicyInsightsApi.PolicyEffectDetails", + "azure.mgmt.policyinsights.models.PolicyEvaluationDetails": "PolicyInsightsApi.PolicyEvaluationDetails", + "azure.mgmt.policyinsights.models.PolicyEvaluationResult": "PolicyInsightsApi.PolicyEvaluationResult", + "azure.mgmt.policyinsights.models.PolicyEvent": "PolicyInsightsApi.PolicyEvent", + "azure.mgmt.policyinsights.models.PolicyGroupSummary": "PolicyInsightsApi.PolicyGroupSummary", + "azure.mgmt.policyinsights.models.PolicyMetadata": "PolicyInsightsApi.PolicyMetadata", + "azure.mgmt.policyinsights.models.PolicyMetadataSlimProperties": "PolicyInsightsApi.PolicyMetadataSlimProperties", + "azure.mgmt.policyinsights.models.PolicyMetadataProperties": "PolicyInsightsApi.PolicyMetadataProperties", + "azure.mgmt.policyinsights.models.PolicyReference": "PolicyInsightsApi.PolicyReference", + "azure.mgmt.policyinsights.models.PolicyState": "PolicyInsightsApi.PolicyState", + "azure.mgmt.policyinsights.models.PolicyTrackedResource": "PolicyTrackedResourcesApi.PolicyTrackedResource", + "azure.mgmt.policyinsights.models.QueryFailure": "PolicyInsightsCommon.QueryFailure", + "azure.mgmt.policyinsights.models.QueryFailureError": "PolicyInsightsCommon.QueryFailureError", + "azure.mgmt.policyinsights.models.Remediation": "PolicyInsightsApi.Remediation", + "azure.mgmt.policyinsights.models.RemediationDeployment": "PolicyInsightsApi.RemediationDeployment", + "azure.mgmt.policyinsights.models.RemediationDeploymentSummary": "PolicyInsightsApi.RemediationDeploymentSummary", + "azure.mgmt.policyinsights.models.RemediationFilters": "PolicyInsightsApi.RemediationFilters", + "azure.mgmt.policyinsights.models.RemediationProperties": "PolicyInsightsApi.RemediationProperties", + "azure.mgmt.policyinsights.models.RemediationPropertiesFailureThreshold": "PolicyInsightsApi.RemediationPropertiesFailureThreshold", + "azure.mgmt.policyinsights.models.SlimPolicyMetadata": "PolicyInsightsApi.SlimPolicyMetadata", + "azure.mgmt.policyinsights.models.SummarizeResults": "PolicyInsightsApi.SummarizeResults", + "azure.mgmt.policyinsights.models.Summary": "PolicyInsightsApi.Summary", + "azure.mgmt.policyinsights.models.SummaryResults": "PolicyInsightsApi.SummaryResults", + "azure.mgmt.policyinsights.models.SystemData": "Azure.ResourceManager.CommonTypes.SystemData", + "azure.mgmt.policyinsights.models.TrackedResourceModificationDetails": "PolicyTrackedResourcesApi.TrackedResourceModificationDetails", + "azure.mgmt.policyinsights.models.TypedErrorInfo": "PolicyInsightsApi.TypedErrorInfo", + "azure.mgmt.policyinsights.models.CreatedByType": "Azure.ResourceManager.CommonTypes.createdByType", + "azure.mgmt.policyinsights.models.ResourceDiscoveryMode": "PolicyInsightsApi.ResourceDiscoveryMode", + "azure.mgmt.policyinsights.models.ComplianceState": "PolicyInsightsApi.ComplianceState", + "azure.mgmt.policyinsights.models.PolicyEventsResourceType": "PolicyInsightsApi.PolicyEventsResourceType", + "azure.mgmt.policyinsights.models.PolicyStatesResource": "PolicyInsightsApi.PolicyStatesResource", + "azure.mgmt.policyinsights.models.PolicyStatesSummaryResourceType": "PolicyInsightsApi.PolicyStatesSummaryResourceType", + "azure.mgmt.policyinsights.models.FieldRestrictionResult": "PolicyInsightsApi.FieldRestrictionResult", + "azure.mgmt.policyinsights.models.ComponentPolicyStatesResource": "PolicyInsightsApi.ComponentPolicyStatesResource", + "azure.mgmt.policyinsights.models.PolicyTrackedResourcesResourceType": "PolicyTrackedResourcesApi.PolicyTrackedResourcesResourceType", + "azure.mgmt.policyinsights.operations.Operations.list": "PolicyInsightsApi.Operations.list", + "azure.mgmt.policyinsights.aio.operations.Operations.list": "PolicyInsightsApi.Operations.list", + "azure.mgmt.policyinsights.operations.RemediationsOperations.get_at_management_group": "PolicyInsightsApi.Remediations.getAtManagementGroup", + "azure.mgmt.policyinsights.aio.operations.RemediationsOperations.get_at_management_group": "PolicyInsightsApi.Remediations.getAtManagementGroup", + "azure.mgmt.policyinsights.operations.RemediationsOperations.create_or_update_at_management_group": "PolicyInsightsApi.Remediations.createOrUpdateAtManagementGroup", + "azure.mgmt.policyinsights.aio.operations.RemediationsOperations.create_or_update_at_management_group": "PolicyInsightsApi.Remediations.createOrUpdateAtManagementGroup", + "azure.mgmt.policyinsights.operations.RemediationsOperations.delete_at_management_group": "PolicyInsightsApi.Remediations.deleteAtManagementGroup", + "azure.mgmt.policyinsights.aio.operations.RemediationsOperations.delete_at_management_group": "PolicyInsightsApi.Remediations.deleteAtManagementGroup", + "azure.mgmt.policyinsights.operations.RemediationsOperations.list_for_management_group": "PolicyInsightsApi.Remediations.listForManagementGroup", + "azure.mgmt.policyinsights.aio.operations.RemediationsOperations.list_for_management_group": "PolicyInsightsApi.Remediations.listForManagementGroup", + "azure.mgmt.policyinsights.operations.RemediationsOperations.get_at_subscription": "PolicyInsightsApi.RemediationSubscriptionOperations.getAtSubscription", + "azure.mgmt.policyinsights.aio.operations.RemediationsOperations.get_at_subscription": "PolicyInsightsApi.RemediationSubscriptionOperations.getAtSubscription", + "azure.mgmt.policyinsights.operations.RemediationsOperations.create_or_update_at_subscription": "PolicyInsightsApi.RemediationSubscriptionOperations.createOrUpdateAtSubscription", + "azure.mgmt.policyinsights.aio.operations.RemediationsOperations.create_or_update_at_subscription": "PolicyInsightsApi.RemediationSubscriptionOperations.createOrUpdateAtSubscription", + "azure.mgmt.policyinsights.operations.RemediationsOperations.delete_at_subscription": "PolicyInsightsApi.RemediationSubscriptionOperations.deleteAtSubscription", + "azure.mgmt.policyinsights.aio.operations.RemediationsOperations.delete_at_subscription": "PolicyInsightsApi.RemediationSubscriptionOperations.deleteAtSubscription", + "azure.mgmt.policyinsights.operations.RemediationsOperations.list_for_subscription": "PolicyInsightsApi.RemediationSubscriptionOperations.listForSubscription", + "azure.mgmt.policyinsights.aio.operations.RemediationsOperations.list_for_subscription": "PolicyInsightsApi.RemediationSubscriptionOperations.listForSubscription", + "azure.mgmt.policyinsights.operations.RemediationsOperations.list_deployments_at_subscription": "PolicyInsightsApi.RemediationSubscriptionOperations.listDeploymentsAtSubscription", + "azure.mgmt.policyinsights.aio.operations.RemediationsOperations.list_deployments_at_subscription": "PolicyInsightsApi.RemediationSubscriptionOperations.listDeploymentsAtSubscription", + "azure.mgmt.policyinsights.operations.RemediationsOperations.cancel_at_subscription": "PolicyInsightsApi.RemediationSubscriptionOperations.cancelAtSubscription", + "azure.mgmt.policyinsights.aio.operations.RemediationsOperations.cancel_at_subscription": "PolicyInsightsApi.RemediationSubscriptionOperations.cancelAtSubscription", + "azure.mgmt.policyinsights.operations.RemediationsOperations.get_at_resource_group": "PolicyInsightsApi.RemediationResourceGroupOperations.getAtResourceGroup", + "azure.mgmt.policyinsights.aio.operations.RemediationsOperations.get_at_resource_group": "PolicyInsightsApi.RemediationResourceGroupOperations.getAtResourceGroup", + "azure.mgmt.policyinsights.operations.RemediationsOperations.create_or_update_at_resource_group": "PolicyInsightsApi.RemediationResourceGroupOperations.createOrUpdateAtResourceGroup", + "azure.mgmt.policyinsights.aio.operations.RemediationsOperations.create_or_update_at_resource_group": "PolicyInsightsApi.RemediationResourceGroupOperations.createOrUpdateAtResourceGroup", + "azure.mgmt.policyinsights.operations.RemediationsOperations.delete_at_resource_group": "PolicyInsightsApi.RemediationResourceGroupOperations.deleteAtResourceGroup", + "azure.mgmt.policyinsights.aio.operations.RemediationsOperations.delete_at_resource_group": "PolicyInsightsApi.RemediationResourceGroupOperations.deleteAtResourceGroup", + "azure.mgmt.policyinsights.operations.RemediationsOperations.list_for_resource_group": "PolicyInsightsApi.RemediationResourceGroupOperations.listForResourceGroup", + "azure.mgmt.policyinsights.aio.operations.RemediationsOperations.list_for_resource_group": "PolicyInsightsApi.RemediationResourceGroupOperations.listForResourceGroup", + "azure.mgmt.policyinsights.operations.RemediationsOperations.list_deployments_at_resource_group": "PolicyInsightsApi.RemediationResourceGroupOperations.listDeploymentsAtResourceGroup", + "azure.mgmt.policyinsights.aio.operations.RemediationsOperations.list_deployments_at_resource_group": "PolicyInsightsApi.RemediationResourceGroupOperations.listDeploymentsAtResourceGroup", + "azure.mgmt.policyinsights.operations.RemediationsOperations.cancel_at_resource_group": "PolicyInsightsApi.RemediationResourceGroupOperations.cancelAtResourceGroup", + "azure.mgmt.policyinsights.aio.operations.RemediationsOperations.cancel_at_resource_group": "PolicyInsightsApi.RemediationResourceGroupOperations.cancelAtResourceGroup", + "azure.mgmt.policyinsights.operations.RemediationsOperations.get_at_resource": "PolicyInsightsApi.RemediationResourceOperations.getAtResource", + "azure.mgmt.policyinsights.aio.operations.RemediationsOperations.get_at_resource": "PolicyInsightsApi.RemediationResourceOperations.getAtResource", + "azure.mgmt.policyinsights.operations.RemediationsOperations.create_or_update_at_resource": "PolicyInsightsApi.RemediationResourceOperations.createOrUpdateAtResource", + "azure.mgmt.policyinsights.aio.operations.RemediationsOperations.create_or_update_at_resource": "PolicyInsightsApi.RemediationResourceOperations.createOrUpdateAtResource", + "azure.mgmt.policyinsights.operations.RemediationsOperations.delete_at_resource": "PolicyInsightsApi.RemediationResourceOperations.deleteAtResource", + "azure.mgmt.policyinsights.aio.operations.RemediationsOperations.delete_at_resource": "PolicyInsightsApi.RemediationResourceOperations.deleteAtResource", + "azure.mgmt.policyinsights.operations.RemediationsOperations.list_for_resource": "PolicyInsightsApi.RemediationResourceOperations.listForResource", + "azure.mgmt.policyinsights.aio.operations.RemediationsOperations.list_for_resource": "PolicyInsightsApi.RemediationResourceOperations.listForResource", + "azure.mgmt.policyinsights.operations.RemediationsOperations.list_deployments_at_resource": "PolicyInsightsApi.RemediationResourceOperations.listDeploymentsAtResource", + "azure.mgmt.policyinsights.aio.operations.RemediationsOperations.list_deployments_at_resource": "PolicyInsightsApi.RemediationResourceOperations.listDeploymentsAtResource", + "azure.mgmt.policyinsights.operations.RemediationsOperations.cancel_at_resource": "PolicyInsightsApi.RemediationResourceOperations.cancelAtResource", + "azure.mgmt.policyinsights.aio.operations.RemediationsOperations.cancel_at_resource": "PolicyInsightsApi.RemediationResourceOperations.cancelAtResource", + "azure.mgmt.policyinsights.operations.RemediationsOperations.list_deployments_at_management_group": "PolicyInsightsApi.RemediationsOperationGroup.listDeploymentsAtManagementGroup", + "azure.mgmt.policyinsights.aio.operations.RemediationsOperations.list_deployments_at_management_group": "PolicyInsightsApi.RemediationsOperationGroup.listDeploymentsAtManagementGroup", + "azure.mgmt.policyinsights.operations.RemediationsOperations.cancel_at_management_group": "PolicyInsightsApi.RemediationsOperationGroup.cancelAtManagementGroup", + "azure.mgmt.policyinsights.aio.operations.RemediationsOperations.cancel_at_management_group": "PolicyInsightsApi.RemediationsOperationGroup.cancelAtManagementGroup", + "azure.mgmt.policyinsights.operations.AttestationsOperations.get_at_subscription": "PolicyInsightsApi.Attestations.getAtSubscription", + "azure.mgmt.policyinsights.aio.operations.AttestationsOperations.get_at_subscription": "PolicyInsightsApi.Attestations.getAtSubscription", + "azure.mgmt.policyinsights.operations.AttestationsOperations.begin_create_or_update_at_subscription": "PolicyInsightsApi.Attestations.createOrUpdateAtSubscription", + "azure.mgmt.policyinsights.aio.operations.AttestationsOperations.begin_create_or_update_at_subscription": "PolicyInsightsApi.Attestations.createOrUpdateAtSubscription", + "azure.mgmt.policyinsights.operations.AttestationsOperations.delete_at_subscription": "PolicyInsightsApi.Attestations.deleteAtSubscription", + "azure.mgmt.policyinsights.aio.operations.AttestationsOperations.delete_at_subscription": "PolicyInsightsApi.Attestations.deleteAtSubscription", + "azure.mgmt.policyinsights.operations.AttestationsOperations.list_for_subscription": "PolicyInsightsApi.Attestations.listForSubscription", + "azure.mgmt.policyinsights.aio.operations.AttestationsOperations.list_for_subscription": "PolicyInsightsApi.Attestations.listForSubscription", + "azure.mgmt.policyinsights.operations.AttestationsOperations.get_at_resource_group": "PolicyInsightsApi.AttestationResourceGroupOperations.getAtResourceGroup", + "azure.mgmt.policyinsights.aio.operations.AttestationsOperations.get_at_resource_group": "PolicyInsightsApi.AttestationResourceGroupOperations.getAtResourceGroup", + "azure.mgmt.policyinsights.operations.AttestationsOperations.begin_create_or_update_at_resource_group": "PolicyInsightsApi.AttestationResourceGroupOperations.createOrUpdateAtResourceGroup", + "azure.mgmt.policyinsights.aio.operations.AttestationsOperations.begin_create_or_update_at_resource_group": "PolicyInsightsApi.AttestationResourceGroupOperations.createOrUpdateAtResourceGroup", + "azure.mgmt.policyinsights.operations.AttestationsOperations.delete_at_resource_group": "PolicyInsightsApi.AttestationResourceGroupOperations.deleteAtResourceGroup", + "azure.mgmt.policyinsights.aio.operations.AttestationsOperations.delete_at_resource_group": "PolicyInsightsApi.AttestationResourceGroupOperations.deleteAtResourceGroup", + "azure.mgmt.policyinsights.operations.AttestationsOperations.list_for_resource_group": "PolicyInsightsApi.AttestationResourceGroupOperations.listForResourceGroup", + "azure.mgmt.policyinsights.aio.operations.AttestationsOperations.list_for_resource_group": "PolicyInsightsApi.AttestationResourceGroupOperations.listForResourceGroup", + "azure.mgmt.policyinsights.operations.AttestationsOperations.get_at_resource": "PolicyInsightsApi.AttestationOperationGroup.getAtResource", + "azure.mgmt.policyinsights.aio.operations.AttestationsOperations.get_at_resource": "PolicyInsightsApi.AttestationOperationGroup.getAtResource", + "azure.mgmt.policyinsights.operations.AttestationsOperations.begin_create_or_update_at_resource": "PolicyInsightsApi.AttestationOperationGroup.createOrUpdateAtResource", + "azure.mgmt.policyinsights.aio.operations.AttestationsOperations.begin_create_or_update_at_resource": "PolicyInsightsApi.AttestationOperationGroup.createOrUpdateAtResource", + "azure.mgmt.policyinsights.operations.AttestationsOperations.delete_at_resource": "PolicyInsightsApi.AttestationOperationGroup.deleteAtResource", + "azure.mgmt.policyinsights.aio.operations.AttestationsOperations.delete_at_resource": "PolicyInsightsApi.AttestationOperationGroup.deleteAtResource", + "azure.mgmt.policyinsights.operations.AttestationsOperations.list_for_resource": "PolicyInsightsApi.AttestationOperationGroup.listForResource", + "azure.mgmt.policyinsights.aio.operations.AttestationsOperations.list_for_resource": "PolicyInsightsApi.AttestationOperationGroup.listForResource", + "azure.mgmt.policyinsights.operations.PolicyMetadataOperations.get_resource": "PolicyInsightsApi.PolicyMetadataOperationGroup.getResource", + "azure.mgmt.policyinsights.aio.operations.PolicyMetadataOperations.get_resource": "PolicyInsightsApi.PolicyMetadataOperationGroup.getResource", + "azure.mgmt.policyinsights.operations.PolicyMetadataOperations.list": "PolicyInsightsApi.PolicyMetadataNonResourceOperationGroup.list", + "azure.mgmt.policyinsights.aio.operations.PolicyMetadataOperations.list": "PolicyInsightsApi.PolicyMetadataNonResourceOperationGroup.list", + "azure.mgmt.policyinsights.operations.PolicyEventsOperations.list_query_results_for_management_group": "PolicyInsightsApi.PolicyEventsOperationGroup.listQueryResultsForManagementGroup", + "azure.mgmt.policyinsights.aio.operations.PolicyEventsOperations.list_query_results_for_management_group": "PolicyInsightsApi.PolicyEventsOperationGroup.listQueryResultsForManagementGroup", + "azure.mgmt.policyinsights.operations.PolicyEventsOperations.list_query_results_for_subscription": "PolicyInsightsApi.PolicyEventsOperationGroup.listQueryResultsForSubscription", + "azure.mgmt.policyinsights.aio.operations.PolicyEventsOperations.list_query_results_for_subscription": "PolicyInsightsApi.PolicyEventsOperationGroup.listQueryResultsForSubscription", + "azure.mgmt.policyinsights.operations.PolicyEventsOperations.list_query_results_for_resource_group": "PolicyInsightsApi.PolicyEventsOperationGroup.listQueryResultsForResourceGroup", + "azure.mgmt.policyinsights.aio.operations.PolicyEventsOperations.list_query_results_for_resource_group": "PolicyInsightsApi.PolicyEventsOperationGroup.listQueryResultsForResourceGroup", + "azure.mgmt.policyinsights.operations.PolicyEventsOperations.list_query_results_for_resource": "PolicyInsightsApi.PolicyEventsOperationGroup.listQueryResultsForResource", + "azure.mgmt.policyinsights.aio.operations.PolicyEventsOperations.list_query_results_for_resource": "PolicyInsightsApi.PolicyEventsOperationGroup.listQueryResultsForResource", + "azure.mgmt.policyinsights.operations.PolicyEventsOperations.list_query_results_for_policy_set_definition": "PolicyInsightsApi.PolicyEventsOperationGroup.listQueryResultsForPolicySetDefinition", + "azure.mgmt.policyinsights.aio.operations.PolicyEventsOperations.list_query_results_for_policy_set_definition": "PolicyInsightsApi.PolicyEventsOperationGroup.listQueryResultsForPolicySetDefinition", + "azure.mgmt.policyinsights.operations.PolicyEventsOperations.list_query_results_for_policy_definition": "PolicyInsightsApi.PolicyEventsOperationGroup.listQueryResultsForPolicyDefinition", + "azure.mgmt.policyinsights.aio.operations.PolicyEventsOperations.list_query_results_for_policy_definition": "PolicyInsightsApi.PolicyEventsOperationGroup.listQueryResultsForPolicyDefinition", + "azure.mgmt.policyinsights.operations.PolicyEventsOperations.list_query_results_for_subscription_level_policy_assignment": "PolicyInsightsApi.PolicyEventsOperationGroup.listQueryResultsForSubscriptionLevelPolicyAssignment", + "azure.mgmt.policyinsights.aio.operations.PolicyEventsOperations.list_query_results_for_subscription_level_policy_assignment": "PolicyInsightsApi.PolicyEventsOperationGroup.listQueryResultsForSubscriptionLevelPolicyAssignment", + "azure.mgmt.policyinsights.operations.PolicyEventsOperations.list_query_results_for_resource_group_level_policy_assignment": "PolicyInsightsApi.PolicyEventsOperationGroup.listQueryResultsForResourceGroupLevelPolicyAssignment", + "azure.mgmt.policyinsights.aio.operations.PolicyEventsOperations.list_query_results_for_resource_group_level_policy_assignment": "PolicyInsightsApi.PolicyEventsOperationGroup.listQueryResultsForResourceGroupLevelPolicyAssignment", + "azure.mgmt.policyinsights.operations.PolicyStatesOperations.list_query_results_for_management_group": "PolicyInsightsApi.PolicyStatesOperationGroup.listQueryResultsForManagementGroup", + "azure.mgmt.policyinsights.aio.operations.PolicyStatesOperations.list_query_results_for_management_group": "PolicyInsightsApi.PolicyStatesOperationGroup.listQueryResultsForManagementGroup", + "azure.mgmt.policyinsights.operations.PolicyStatesOperations.summarize_for_management_group": "PolicyInsightsApi.PolicyStatesOperationGroup.summarizeForManagementGroup", + "azure.mgmt.policyinsights.aio.operations.PolicyStatesOperations.summarize_for_management_group": "PolicyInsightsApi.PolicyStatesOperationGroup.summarizeForManagementGroup", + "azure.mgmt.policyinsights.operations.PolicyStatesOperations.list_query_results_for_subscription": "PolicyInsightsApi.PolicyStatesOperationGroup.listQueryResultsForSubscription", + "azure.mgmt.policyinsights.aio.operations.PolicyStatesOperations.list_query_results_for_subscription": "PolicyInsightsApi.PolicyStatesOperationGroup.listQueryResultsForSubscription", + "azure.mgmt.policyinsights.operations.PolicyStatesOperations.summarize_for_subscription": "PolicyInsightsApi.PolicyStatesOperationGroup.summarizeForSubscription", + "azure.mgmt.policyinsights.aio.operations.PolicyStatesOperations.summarize_for_subscription": "PolicyInsightsApi.PolicyStatesOperationGroup.summarizeForSubscription", + "azure.mgmt.policyinsights.operations.PolicyStatesOperations.list_query_results_for_resource_group": "PolicyInsightsApi.PolicyStatesOperationGroup.listQueryResultsForResourceGroup", + "azure.mgmt.policyinsights.aio.operations.PolicyStatesOperations.list_query_results_for_resource_group": "PolicyInsightsApi.PolicyStatesOperationGroup.listQueryResultsForResourceGroup", + "azure.mgmt.policyinsights.operations.PolicyStatesOperations.summarize_for_resource_group": "PolicyInsightsApi.PolicyStatesOperationGroup.summarizeForResourceGroup", + "azure.mgmt.policyinsights.aio.operations.PolicyStatesOperations.summarize_for_resource_group": "PolicyInsightsApi.PolicyStatesOperationGroup.summarizeForResourceGroup", + "azure.mgmt.policyinsights.operations.PolicyStatesOperations.list_query_results_for_resource": "PolicyInsightsApi.PolicyStatesOperationGroup.listQueryResultsForResource", + "azure.mgmt.policyinsights.aio.operations.PolicyStatesOperations.list_query_results_for_resource": "PolicyInsightsApi.PolicyStatesOperationGroup.listQueryResultsForResource", + "azure.mgmt.policyinsights.operations.PolicyStatesOperations.summarize_for_resource": "PolicyInsightsApi.PolicyStatesOperationGroup.summarizeForResource", + "azure.mgmt.policyinsights.aio.operations.PolicyStatesOperations.summarize_for_resource": "PolicyInsightsApi.PolicyStatesOperationGroup.summarizeForResource", + "azure.mgmt.policyinsights.operations.PolicyStatesOperations.begin_trigger_subscription_evaluation": "PolicyInsightsApi.PolicyStatesOperationGroup.triggerSubscriptionEvaluation", + "azure.mgmt.policyinsights.aio.operations.PolicyStatesOperations.begin_trigger_subscription_evaluation": "PolicyInsightsApi.PolicyStatesOperationGroup.triggerSubscriptionEvaluation", + "azure.mgmt.policyinsights.operations.PolicyStatesOperations.begin_trigger_resource_group_evaluation": "PolicyInsightsApi.PolicyStatesOperationGroup.triggerResourceGroupEvaluation", + "azure.mgmt.policyinsights.aio.operations.PolicyStatesOperations.begin_trigger_resource_group_evaluation": "PolicyInsightsApi.PolicyStatesOperationGroup.triggerResourceGroupEvaluation", + "azure.mgmt.policyinsights.operations.PolicyStatesOperations.list_query_results_for_policy_set_definition": "PolicyInsightsApi.PolicyStatesOperationGroup.listQueryResultsForPolicySetDefinition", + "azure.mgmt.policyinsights.aio.operations.PolicyStatesOperations.list_query_results_for_policy_set_definition": "PolicyInsightsApi.PolicyStatesOperationGroup.listQueryResultsForPolicySetDefinition", + "azure.mgmt.policyinsights.operations.PolicyStatesOperations.summarize_for_policy_set_definition": "PolicyInsightsApi.PolicyStatesOperationGroup.summarizeForPolicySetDefinition", + "azure.mgmt.policyinsights.aio.operations.PolicyStatesOperations.summarize_for_policy_set_definition": "PolicyInsightsApi.PolicyStatesOperationGroup.summarizeForPolicySetDefinition", + "azure.mgmt.policyinsights.operations.PolicyStatesOperations.list_query_results_for_policy_definition": "PolicyInsightsApi.PolicyStatesOperationGroup.listQueryResultsForPolicyDefinition", + "azure.mgmt.policyinsights.aio.operations.PolicyStatesOperations.list_query_results_for_policy_definition": "PolicyInsightsApi.PolicyStatesOperationGroup.listQueryResultsForPolicyDefinition", + "azure.mgmt.policyinsights.operations.PolicyStatesOperations.summarize_for_policy_definition": "PolicyInsightsApi.PolicyStatesOperationGroup.summarizeForPolicyDefinition", + "azure.mgmt.policyinsights.aio.operations.PolicyStatesOperations.summarize_for_policy_definition": "PolicyInsightsApi.PolicyStatesOperationGroup.summarizeForPolicyDefinition", + "azure.mgmt.policyinsights.operations.PolicyStatesOperations.list_query_results_for_subscription_level_policy_assignment": "PolicyInsightsApi.PolicyStatesOperationGroup.listQueryResultsForSubscriptionLevelPolicyAssignment", + "azure.mgmt.policyinsights.aio.operations.PolicyStatesOperations.list_query_results_for_subscription_level_policy_assignment": "PolicyInsightsApi.PolicyStatesOperationGroup.listQueryResultsForSubscriptionLevelPolicyAssignment", + "azure.mgmt.policyinsights.operations.PolicyStatesOperations.summarize_for_subscription_level_policy_assignment": "PolicyInsightsApi.PolicyStatesOperationGroup.summarizeForSubscriptionLevelPolicyAssignment", + "azure.mgmt.policyinsights.aio.operations.PolicyStatesOperations.summarize_for_subscription_level_policy_assignment": "PolicyInsightsApi.PolicyStatesOperationGroup.summarizeForSubscriptionLevelPolicyAssignment", + "azure.mgmt.policyinsights.operations.PolicyStatesOperations.list_query_results_for_resource_group_level_policy_assignment": "PolicyInsightsApi.PolicyStatesOperationGroup.listQueryResultsForResourceGroupLevelPolicyAssignment", + "azure.mgmt.policyinsights.aio.operations.PolicyStatesOperations.list_query_results_for_resource_group_level_policy_assignment": "PolicyInsightsApi.PolicyStatesOperationGroup.listQueryResultsForResourceGroupLevelPolicyAssignment", + "azure.mgmt.policyinsights.operations.PolicyStatesOperations.summarize_for_resource_group_level_policy_assignment": "PolicyInsightsApi.PolicyStatesOperationGroup.summarizeForResourceGroupLevelPolicyAssignment", + "azure.mgmt.policyinsights.aio.operations.PolicyStatesOperations.summarize_for_resource_group_level_policy_assignment": "PolicyInsightsApi.PolicyStatesOperationGroup.summarizeForResourceGroupLevelPolicyAssignment", + "azure.mgmt.policyinsights.operations.PolicyRestrictionsOperations.check_at_subscription_scope": "PolicyInsightsApi.PolicyRestrictionsOperationGroup.checkAtSubscriptionScope", + "azure.mgmt.policyinsights.aio.operations.PolicyRestrictionsOperations.check_at_subscription_scope": "PolicyInsightsApi.PolicyRestrictionsOperationGroup.checkAtSubscriptionScope", + "azure.mgmt.policyinsights.operations.PolicyRestrictionsOperations.check_at_resource_group_scope": "PolicyInsightsApi.PolicyRestrictionsOperationGroup.checkAtResourceGroupScope", + "azure.mgmt.policyinsights.aio.operations.PolicyRestrictionsOperations.check_at_resource_group_scope": "PolicyInsightsApi.PolicyRestrictionsOperationGroup.checkAtResourceGroupScope", + "azure.mgmt.policyinsights.operations.PolicyRestrictionsOperations.check_at_management_group_scope": "PolicyInsightsApi.PolicyRestrictionsOperationGroup.checkAtManagementGroupScope", + "azure.mgmt.policyinsights.aio.operations.PolicyRestrictionsOperations.check_at_management_group_scope": "PolicyInsightsApi.PolicyRestrictionsOperationGroup.checkAtManagementGroupScope", + "azure.mgmt.policyinsights.operations.ComponentPolicyStatesOperations.list_query_results_for_subscription": "PolicyInsightsApi.ComponentPolicyStatesOperationGroup.listQueryResultsForSubscription", + "azure.mgmt.policyinsights.aio.operations.ComponentPolicyStatesOperations.list_query_results_for_subscription": "PolicyInsightsApi.ComponentPolicyStatesOperationGroup.listQueryResultsForSubscription", + "azure.mgmt.policyinsights.operations.ComponentPolicyStatesOperations.list_query_results_for_resource_group": "PolicyInsightsApi.ComponentPolicyStatesOperationGroup.listQueryResultsForResourceGroup", + "azure.mgmt.policyinsights.aio.operations.ComponentPolicyStatesOperations.list_query_results_for_resource_group": "PolicyInsightsApi.ComponentPolicyStatesOperationGroup.listQueryResultsForResourceGroup", + "azure.mgmt.policyinsights.operations.ComponentPolicyStatesOperations.list_query_results_for_resource": "PolicyInsightsApi.ComponentPolicyStatesOperationGroup.listQueryResultsForResource", + "azure.mgmt.policyinsights.aio.operations.ComponentPolicyStatesOperations.list_query_results_for_resource": "PolicyInsightsApi.ComponentPolicyStatesOperationGroup.listQueryResultsForResource", + "azure.mgmt.policyinsights.operations.ComponentPolicyStatesOperations.list_query_results_for_policy_definition": "PolicyInsightsApi.ComponentPolicyStatesOperationGroup.listQueryResultsForPolicyDefinition", + "azure.mgmt.policyinsights.aio.operations.ComponentPolicyStatesOperations.list_query_results_for_policy_definition": "PolicyInsightsApi.ComponentPolicyStatesOperationGroup.listQueryResultsForPolicyDefinition", + "azure.mgmt.policyinsights.operations.ComponentPolicyStatesOperations.list_query_results_for_subscription_level_policy_assignment": "PolicyInsightsApi.ComponentPolicyStatesOperationGroup.listQueryResultsForSubscriptionLevelPolicyAssignment", + "azure.mgmt.policyinsights.aio.operations.ComponentPolicyStatesOperations.list_query_results_for_subscription_level_policy_assignment": "PolicyInsightsApi.ComponentPolicyStatesOperationGroup.listQueryResultsForSubscriptionLevelPolicyAssignment", + "azure.mgmt.policyinsights.operations.ComponentPolicyStatesOperations.list_query_results_for_resource_group_level_policy_assignment": "PolicyInsightsApi.ComponentPolicyStatesOperationGroup.listQueryResultsForResourceGroupLevelPolicyAssignment", + "azure.mgmt.policyinsights.aio.operations.ComponentPolicyStatesOperations.list_query_results_for_resource_group_level_policy_assignment": "PolicyInsightsApi.ComponentPolicyStatesOperationGroup.listQueryResultsForResourceGroupLevelPolicyAssignment", + "azure.mgmt.policyinsights.operations.PolicyTrackedResourcesOperations.list_query_results_for_management_group": "PolicyTrackedResourcesApi.PolicyTrackedResourcesOperationGroup.listQueryResultsForManagementGroup", + "azure.mgmt.policyinsights.aio.operations.PolicyTrackedResourcesOperations.list_query_results_for_management_group": "PolicyTrackedResourcesApi.PolicyTrackedResourcesOperationGroup.listQueryResultsForManagementGroup", + "azure.mgmt.policyinsights.operations.PolicyTrackedResourcesOperations.list_query_results_for_subscription": "PolicyTrackedResourcesApi.PolicyTrackedResourcesOperationGroup.listQueryResultsForSubscription", + "azure.mgmt.policyinsights.aio.operations.PolicyTrackedResourcesOperations.list_query_results_for_subscription": "PolicyTrackedResourcesApi.PolicyTrackedResourcesOperationGroup.listQueryResultsForSubscription", + "azure.mgmt.policyinsights.operations.PolicyTrackedResourcesOperations.list_query_results_for_resource_group": "PolicyTrackedResourcesApi.PolicyTrackedResourcesOperationGroup.listQueryResultsForResourceGroup", + "azure.mgmt.policyinsights.aio.operations.PolicyTrackedResourcesOperations.list_query_results_for_resource_group": "PolicyTrackedResourcesApi.PolicyTrackedResourcesOperationGroup.listQueryResultsForResourceGroup", + "azure.mgmt.policyinsights.operations.PolicyTrackedResourcesOperations.list_query_results_for_resource": "PolicyTrackedResourcesApi.PolicyTrackedResourcesOperationGroup.listQueryResultsForResource", + "azure.mgmt.policyinsights.aio.operations.PolicyTrackedResourcesOperations.list_query_results_for_resource": "PolicyTrackedResourcesApi.PolicyTrackedResourcesOperationGroup.listQueryResultsForResource" + } +} \ No newline at end of file diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/azure/__init__.py b/sdk/policyinsights/azure-mgmt-policyinsights/azure/__init__.py index 8db66d3d0f0f..d55ccad1f573 100644 --- a/sdk/policyinsights/azure-mgmt-policyinsights/azure/__init__.py +++ b/sdk/policyinsights/azure-mgmt-policyinsights/azure/__init__.py @@ -1 +1 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/__init__.py b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/__init__.py index 8db66d3d0f0f..d55ccad1f573 100644 --- a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/__init__.py +++ b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/__init__.py @@ -1 +1 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/__init__.py b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/__init__.py index 8461746b6906..81bce0c19faf 100644 --- a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/__init__.py +++ b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/__init__.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- # pylint: disable=wrong-import-position @@ -12,7 +12,7 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import -from ._policy_insights_client import PolicyInsightsClient # type: ignore +from ._client import PolicyInsightsClient # type: ignore from ._version import VERSION __version__ = VERSION diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/_policy_insights_client.py b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/_client.py similarity index 81% rename from sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/_policy_insights_client.py rename to sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/_client.py index e3939b49adb6..545f2910fcc5 100644 --- a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/_policy_insights_client.py +++ b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/_client.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -17,7 +17,6 @@ from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy from azure.mgmt.core.tools import get_arm_endpoints -from . import models as _models from ._configuration import PolicyInsightsClientConfiguration from ._utils.serialization import Deserializer, Serializer from .operations import ( @@ -33,52 +32,68 @@ ) if TYPE_CHECKING: + from azure.core import AzureClouds from azure.core.credentials import TokenCredential class PolicyInsightsClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes - """Query component policy states at varying resource scopes for Resource Provider mode policies. + """PolicyInsightsClient. - :ivar policy_tracked_resources: PolicyTrackedResourcesOperations operations - :vartype policy_tracked_resources: - azure.mgmt.policyinsights.operations.PolicyTrackedResourcesOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.policyinsights.operations.Operations :ivar remediations: RemediationsOperations operations :vartype remediations: azure.mgmt.policyinsights.operations.RemediationsOperations + :ivar attestations: AttestationsOperations operations + :vartype attestations: azure.mgmt.policyinsights.operations.AttestationsOperations + :ivar policy_metadata: PolicyMetadataOperations operations + :vartype policy_metadata: azure.mgmt.policyinsights.operations.PolicyMetadataOperations :ivar policy_events: PolicyEventsOperations operations :vartype policy_events: azure.mgmt.policyinsights.operations.PolicyEventsOperations :ivar policy_states: PolicyStatesOperations operations :vartype policy_states: azure.mgmt.policyinsights.operations.PolicyStatesOperations - :ivar policy_metadata: PolicyMetadataOperations operations - :vartype policy_metadata: azure.mgmt.policyinsights.operations.PolicyMetadataOperations :ivar policy_restrictions: PolicyRestrictionsOperations operations :vartype policy_restrictions: azure.mgmt.policyinsights.operations.PolicyRestrictionsOperations :ivar component_policy_states: ComponentPolicyStatesOperations operations :vartype component_policy_states: azure.mgmt.policyinsights.operations.ComponentPolicyStatesOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.policyinsights.operations.Operations - :ivar attestations: AttestationsOperations operations - :vartype attestations: azure.mgmt.policyinsights.operations.AttestationsOperations - :param credential: Credential needed for the client to connect to Azure. Required. + :ivar policy_tracked_resources: PolicyTrackedResourcesOperations operations + :vartype policy_tracked_resources: + azure.mgmt.policyinsights.operations.PolicyTrackedResourcesOperations + :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: Microsoft Azure subscription ID. Required. + :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :param base_url: Service URL. Default value is None. + :param base_url: Service host. Default value is None. :type base_url: str + :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is + None. + :paramtype cloud_setting: ~azure.core.AzureClouds :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( - self, credential: "TokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any + self, + credential: "TokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + *, + cloud_setting: Optional["AzureClouds"] = None, + **kwargs: Any ) -> None: - _cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore + _endpoint = "{endpoint}" + _cloud = cloud_setting or settings.current.azure_cloud # type: ignore _endpoints = get_arm_endpoints(_cloud) if not base_url: base_url = _endpoints["resource_manager"] credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"]) self._config = PolicyInsightsClientConfiguration( - credential=credential, subscription_id=subscription_id, credential_scopes=credential_scopes, **kwargs + credential=credential, + subscription_id=subscription_id, + base_url=cast(str, base_url), + cloud_setting=cloud_setting, + credential_scopes=credential_scopes, + **kwargs ) _policies = kwargs.pop("policies", None) @@ -99,35 +114,34 @@ def __init__( policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, self._config.http_logging_policy, ] - self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, base_url), policies=_policies, **kwargs) + self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, _endpoint), policies=_policies, **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._serialize = Serializer() + self._deserialize = Deserializer() self._serialize.client_side_validation = False - self.policy_tracked_resources = PolicyTrackedResourcesOperations( - self._client, self._config, self._serialize, self._deserialize - ) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) self.remediations = RemediationsOperations(self._client, self._config, self._serialize, self._deserialize) + self.attestations = AttestationsOperations(self._client, self._config, self._serialize, self._deserialize) + self.policy_metadata = PolicyMetadataOperations(self._client, self._config, self._serialize, self._deserialize) self.policy_events = PolicyEventsOperations(self._client, self._config, self._serialize, self._deserialize) self.policy_states = PolicyStatesOperations(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 ) self.component_policy_states = ComponentPolicyStatesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.attestations = AttestationsOperations(self._client, self._config, self._serialize, self._deserialize) + self.policy_tracked_resources = PolicyTrackedResourcesOperations( + self._client, self._config, self._serialize, self._deserialize + ) - def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: + def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest >>> request = HttpRequest("GET", "https://www.example.org/") - >>> response = client._send_request(request) + >>> response = client.send_request(request) For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request @@ -140,7 +154,11 @@ def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: """ request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore def close(self) -> None: diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/_configuration.py b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/_configuration.py index 641d213da409..63cdda06fc5f 100644 --- a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/_configuration.py +++ b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/_configuration.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, TYPE_CHECKING +from typing import Any, Optional, TYPE_CHECKING from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy @@ -14,6 +14,7 @@ from ._version import VERSION if TYPE_CHECKING: + from azure.core import AzureClouds from azure.core.credentials import TokenCredential @@ -23,13 +24,25 @@ class PolicyInsightsClientConfiguration: # pylint: disable=too-many-instance-at Note that all parameters used to create this instance are saved as instance attributes. - :param credential: Credential needed for the client to connect to Azure. Required. + :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: Microsoft Azure subscription ID. Required. + :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str + :param base_url: Service host. Default value is "https://management.azure.com". + :type base_url: str + :param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is + None. + :type cloud_setting: ~azure.core.AzureClouds """ - def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: + def __init__( + self, + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + cloud_setting: Optional["AzureClouds"] = None, + **kwargs: Any + ) -> None: if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: @@ -37,6 +50,8 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs self.credential = credential self.subscription_id = subscription_id + self.base_url = base_url + self.cloud_setting = cloud_setting self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-policyinsights/{}".format(VERSION)) self.polling_interval = kwargs.get("polling_interval", 30) diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/_patch.py b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/_patch.py index f7dd32510333..87676c65a8f0 100644 --- a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/_patch.py +++ b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/_patch.py @@ -1,14 +1,15 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# 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. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/_utils/__init__.py b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/_utils/__init__.py index 0af9b28f6607..8026245c2abc 100644 --- a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/_utils/__init__.py +++ b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/_utils/__init__.py @@ -1,6 +1,6 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/_utils/model_base.py b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/_utils/model_base.py new file mode 100644 index 000000000000..a75a22adbb97 --- /dev/null +++ b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/_utils/model_base.py @@ -0,0 +1,1368 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=protected-access, broad-except + +import copy +import calendar +import decimal +import functools +import sys +import logging +import base64 +import re +import typing +import enum +import email.utils +from datetime import datetime, date, time, timedelta, timezone +from json import JSONEncoder +import xml.etree.ElementTree as ET +from collections.abc import MutableMapping +from typing_extensions import Self +import isodate +from azure.core.exceptions import DeserializationError +from azure.core import CaseInsensitiveEnumMeta +from azure.core.pipeline import PipelineResponse +from azure.core.serialization import _Null +from azure.core.rest import HttpResponse + +_LOGGER = logging.getLogger(__name__) + +__all__ = ["SdkJSONEncoder", "Model", "rest_field", "rest_discriminator"] + +TZ_UTC = timezone.utc +_T = typing.TypeVar("_T") +_NONE_TYPE = type(None) + + +def _timedelta_as_isostr(td: timedelta) -> str: + """Converts a datetime.timedelta object into an ISO 8601 formatted string, e.g. 'P4DT12H30M05S' + + Function adapted from the Tin Can Python project: https://github.com/RusticiSoftware/TinCanPython + + :param timedelta td: The timedelta to convert + :rtype: str + :return: ISO8601 version of this timedelta + """ + + # Split seconds to larger units + seconds = td.total_seconds() + minutes, seconds = divmod(seconds, 60) + hours, minutes = divmod(minutes, 60) + days, hours = divmod(hours, 24) + + days, hours, minutes = list(map(int, (days, hours, minutes))) + seconds = round(seconds, 6) + + # Build date + date_str = "" + if days: + date_str = "%sD" % days + + if hours or minutes or seconds: + # Build time + time_str = "T" + + # Hours + bigger_exists = date_str or hours + if bigger_exists: + time_str += "{:02}H".format(hours) + + # Minutes + bigger_exists = bigger_exists or minutes + if bigger_exists: + time_str += "{:02}M".format(minutes) + + # Seconds + try: + if seconds.is_integer(): + seconds_string = "{:02}".format(int(seconds)) + else: + # 9 chars long w/ leading 0, 6 digits after decimal + seconds_string = "%09.6f" % seconds + # Remove trailing zeros + seconds_string = seconds_string.rstrip("0") + except AttributeError: # int.is_integer() raises + seconds_string = "{:02}".format(seconds) + + time_str += "{}S".format(seconds_string) + else: + time_str = "" + + return "P" + date_str + time_str + + +def _serialize_bytes(o, format: typing.Optional[str] = None) -> str: + encoded = base64.b64encode(o).decode() + if format == "base64url": + return encoded.strip("=").replace("+", "-").replace("/", "_") + return encoded + + +def _serialize_datetime(o, format: typing.Optional[str] = None): + if hasattr(o, "year") and hasattr(o, "hour"): + if format == "rfc7231": + return email.utils.format_datetime(o, usegmt=True) + if format == "unix-timestamp": + return int(calendar.timegm(o.utctimetuple())) + + # astimezone() fails for naive times in Python 2.7, so make make sure o is aware (tzinfo is set) + if not o.tzinfo: + iso_formatted = o.replace(tzinfo=TZ_UTC).isoformat() + else: + iso_formatted = o.astimezone(TZ_UTC).isoformat() + # Replace the trailing "+00:00" UTC offset with "Z" (RFC 3339: https://www.ietf.org/rfc/rfc3339.txt) + return iso_formatted.replace("+00:00", "Z") + # Next try datetime.date or datetime.time + return o.isoformat() + + +def _is_readonly(p): + try: + return p._visibility == ["read"] + except AttributeError: + return False + + +class SdkJSONEncoder(JSONEncoder): + """A JSON encoder that's capable of serializing datetime objects and bytes.""" + + def __init__(self, *args, exclude_readonly: bool = False, format: typing.Optional[str] = None, **kwargs): + super().__init__(*args, **kwargs) + self.exclude_readonly = exclude_readonly + self.format = format + + def default(self, o): # pylint: disable=too-many-return-statements + if _is_model(o): + if self.exclude_readonly: + readonly_props = [p._rest_name for p in o._attr_to_rest_field.values() if _is_readonly(p)] + return {k: v for k, v in o.items() if k not in readonly_props} + return dict(o.items()) + try: + return super(SdkJSONEncoder, self).default(o) + except TypeError: + if isinstance(o, _Null): + return None + if isinstance(o, decimal.Decimal): + return float(o) + if isinstance(o, (bytes, bytearray)): + return _serialize_bytes(o, self.format) + try: + # First try datetime.datetime + return _serialize_datetime(o, self.format) + except AttributeError: + pass + # Last, try datetime.timedelta + try: + return _timedelta_as_isostr(o) + except AttributeError: + # This will be raised when it hits value.total_seconds in the method above + pass + return super(SdkJSONEncoder, self).default(o) + + +_VALID_DATE = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" + r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") +_VALID_RFC7231 = re.compile( + r"(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s\d{2}\s" + r"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s\d{4}\s\d{2}:\d{2}:\d{2}\sGMT" +) + +_ARRAY_ENCODE_MAPPING = { + "pipeDelimited": "|", + "spaceDelimited": " ", + "commaDelimited": ",", + "newlineDelimited": "\n", +} + + +def _deserialize_array_encoded(delimit: str, attr): + if isinstance(attr, str): + if attr == "": + return [] + return attr.split(delimit) + return attr + + +def _deserialize_datetime(attr: typing.Union[str, datetime]) -> datetime: + """Deserialize ISO-8601 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: ~datetime.datetime + :returns: The datetime object from that input + """ + if isinstance(attr, datetime): + # i'm already deserialized + return attr + attr = attr.upper() + match = _VALID_DATE.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + check_decimal = attr.split(".") + if len(check_decimal) > 1: + decimal_str = "" + for digit in check_decimal[1]: + if digit.isdigit(): + decimal_str += digit + else: + break + if len(decimal_str) > 6: + attr = attr.replace(decimal_str, decimal_str[0:6]) + + date_obj = isodate.parse_datetime(attr) + test_utc = date_obj.utctimetuple() + if test_utc.tm_year > 9999 or test_utc.tm_year < 1: + raise OverflowError("Hit max or min date") + return date_obj # type: ignore[no-any-return] + + +def _deserialize_datetime_rfc7231(attr: typing.Union[str, datetime]) -> datetime: + """Deserialize RFC7231 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: ~datetime.datetime + :returns: The datetime object from that input + """ + if isinstance(attr, datetime): + # i'm already deserialized + return attr + match = _VALID_RFC7231.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + return email.utils.parsedate_to_datetime(attr) + + +def _deserialize_datetime_unix_timestamp(attr: typing.Union[float, datetime]) -> datetime: + """Deserialize unix timestamp into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: ~datetime.datetime + :returns: The datetime object from that input + """ + if isinstance(attr, datetime): + # i'm already deserialized + return attr + return datetime.fromtimestamp(attr, TZ_UTC) + + +def _deserialize_date(attr: typing.Union[str, date]) -> date: + """Deserialize ISO-8601 formatted string into Date object. + :param str attr: response string to be deserialized. + :rtype: date + :returns: The date object from that input + """ + # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. + if isinstance(attr, date): + return attr + return isodate.parse_date(attr, defaultmonth=None, defaultday=None) # type: ignore + + +def _deserialize_time(attr: typing.Union[str, time]) -> time: + """Deserialize ISO-8601 formatted string into time object. + + :param str attr: response string to be deserialized. + :rtype: datetime.time + :returns: The time object from that input + """ + if isinstance(attr, time): + return attr + return isodate.parse_time(attr) # type: ignore[no-any-return] + + +def _deserialize_bytes(attr): + if isinstance(attr, (bytes, bytearray)): + return attr + return bytes(base64.b64decode(attr)) + + +def _deserialize_bytes_base64(attr): + if isinstance(attr, (bytes, bytearray)): + return attr + padding = "=" * (3 - (len(attr) + 3) % 4) # type: ignore + attr = attr + padding # type: ignore + encoded = attr.replace("-", "+").replace("_", "/") + return bytes(base64.b64decode(encoded)) + + +def _deserialize_duration(attr): + if isinstance(attr, timedelta): + return attr + return isodate.parse_duration(attr) + + +def _deserialize_decimal(attr): + if isinstance(attr, decimal.Decimal): + return attr + return decimal.Decimal(str(attr)) + + +def _deserialize_int_as_str(attr): + if isinstance(attr, int): + return attr + return int(attr) + + +_DESERIALIZE_MAPPING = { + datetime: _deserialize_datetime, + date: _deserialize_date, + time: _deserialize_time, + bytes: _deserialize_bytes, + bytearray: _deserialize_bytes, + timedelta: _deserialize_duration, + typing.Any: lambda x: x, + decimal.Decimal: _deserialize_decimal, +} + +_DESERIALIZE_MAPPING_WITHFORMAT = { + "rfc3339": _deserialize_datetime, + "rfc7231": _deserialize_datetime_rfc7231, + "unix-timestamp": _deserialize_datetime_unix_timestamp, + "base64": _deserialize_bytes, + "base64url": _deserialize_bytes_base64, +} + + +def get_deserializer(annotation: typing.Any, rf: typing.Optional["_RestField"] = None): + if annotation is int and rf and rf._format == "str": + return _deserialize_int_as_str + if annotation is str and rf and rf._format in _ARRAY_ENCODE_MAPPING: + return functools.partial(_deserialize_array_encoded, _ARRAY_ENCODE_MAPPING[rf._format]) + if rf and rf._format: + return _DESERIALIZE_MAPPING_WITHFORMAT.get(rf._format) + return _DESERIALIZE_MAPPING.get(annotation) # pyright: ignore + + +def _get_type_alias_type(module_name: str, alias_name: str): + types = { + k: v + for k, v in sys.modules[module_name].__dict__.items() + if isinstance(v, typing._GenericAlias) # type: ignore + } + if alias_name not in types: + return alias_name + return types[alias_name] + + +def _get_model(module_name: str, model_name: str): + models = {k: v for k, v in sys.modules[module_name].__dict__.items() if isinstance(v, type)} + module_end = module_name.rsplit(".", 1)[0] + models.update({k: v for k, v in sys.modules[module_end].__dict__.items() if isinstance(v, type)}) + if isinstance(model_name, str): + model_name = model_name.split(".")[-1] + if model_name not in models: + return model_name + return models[model_name] + + +_UNSET = object() + + +class _MyMutableMapping(MutableMapping[str, typing.Any]): + def __init__(self, data: dict[str, typing.Any]) -> None: + self._data = data + + def __contains__(self, key: typing.Any) -> bool: + return key in self._data + + def __getitem__(self, key: str) -> typing.Any: + # If this key has been deserialized (for mutable types), we need to handle serialization + if hasattr(self, "_attr_to_rest_field"): + cache_attr = f"_deserialized_{key}" + if hasattr(self, cache_attr): + rf = _get_rest_field(getattr(self, "_attr_to_rest_field"), key) + if rf: + value = self._data.get(key) + if isinstance(value, (dict, list, set)): + # For mutable types, serialize and return + # But also update _data with serialized form and clear flag + # so mutations via this returned value affect _data + serialized = _serialize(value, rf._format) + # If serialized form is same type (no transformation needed), + # return _data directly so mutations work + if isinstance(serialized, type(value)) and serialized == value: + return self._data.get(key) + # Otherwise return serialized copy and clear flag + try: + object.__delattr__(self, cache_attr) + except AttributeError: + pass + # Store serialized form back + self._data[key] = serialized + return serialized + return self._data.__getitem__(key) + + def __setitem__(self, key: str, value: typing.Any) -> None: + # Clear any cached deserialized value when setting through dictionary access + cache_attr = f"_deserialized_{key}" + try: + object.__delattr__(self, cache_attr) + except AttributeError: + pass + self._data.__setitem__(key, value) + + def __delitem__(self, key: str) -> None: + self._data.__delitem__(key) + + def __iter__(self) -> typing.Iterator[typing.Any]: + return self._data.__iter__() + + def __len__(self) -> int: + return self._data.__len__() + + def __ne__(self, other: typing.Any) -> bool: + return not self.__eq__(other) + + def keys(self) -> typing.KeysView[str]: + """ + :returns: a set-like object providing a view on D's keys + :rtype: ~typing.KeysView + """ + return self._data.keys() + + def values(self) -> typing.ValuesView[typing.Any]: + """ + :returns: an object providing a view on D's values + :rtype: ~typing.ValuesView + """ + return self._data.values() + + def items(self) -> typing.ItemsView[str, typing.Any]: + """ + :returns: set-like object providing a view on D's items + :rtype: ~typing.ItemsView + """ + return self._data.items() + + def get(self, key: str, default: typing.Any = None) -> typing.Any: + """ + Get the value for key if key is in the dictionary, else default. + :param str key: The key to look up. + :param any default: The value to return if key is not in the dictionary. Defaults to None + :returns: D[k] if k in D, else d. + :rtype: any + """ + try: + return self[key] + except KeyError: + return default + + @typing.overload + def pop(self, key: str) -> typing.Any: ... # pylint: disable=arguments-differ + + @typing.overload + def pop(self, key: str, default: _T) -> _T: ... # pylint: disable=signature-differs + + @typing.overload + def pop(self, key: str, default: typing.Any) -> typing.Any: ... # pylint: disable=signature-differs + + def pop(self, key: str, default: typing.Any = _UNSET) -> typing.Any: + """ + Removes specified key and return the corresponding value. + :param str key: The key to pop. + :param any default: The value to return if key is not in the dictionary + :returns: The value corresponding to the key. + :rtype: any + :raises KeyError: If key is not found and default is not given. + """ + if default is _UNSET: + return self._data.pop(key) + return self._data.pop(key, default) + + def popitem(self) -> tuple[str, typing.Any]: + """ + Removes and returns some (key, value) pair + :returns: The (key, value) pair. + :rtype: tuple + :raises KeyError: if D is empty. + """ + return self._data.popitem() + + def clear(self) -> None: + """ + Remove all items from D. + """ + self._data.clear() + + def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: # pylint: disable=arguments-differ + """ + Updates D from mapping/iterable E and F. + :param any args: Either a mapping object or an iterable of key-value pairs. + """ + self._data.update(*args, **kwargs) + + @typing.overload + def setdefault(self, key: str, default: None = None) -> None: ... + + @typing.overload + def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... # pylint: disable=signature-differs + + def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: + """ + Same as calling D.get(k, d), and setting D[k]=d if k not found + :param str key: The key to look up. + :param any default: The value to set if key is not in the dictionary + :returns: D[k] if k in D, else d. + :rtype: any + """ + if default is _UNSET: + return self._data.setdefault(key) + return self._data.setdefault(key, default) + + def __eq__(self, other: typing.Any) -> bool: + if isinstance(other, _MyMutableMapping): + return self._data == other._data + try: + other_model = self.__class__(other) + except Exception: + return False + return self._data == other_model._data + + def __repr__(self) -> str: + return str(self._data) + + +def _is_model(obj: typing.Any) -> bool: + return getattr(obj, "_is_model", False) + + +def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-many-return-statements + if isinstance(o, list): + if format in _ARRAY_ENCODE_MAPPING and all(isinstance(x, str) for x in o): + return _ARRAY_ENCODE_MAPPING[format].join(o) + return [_serialize(x, format) for x in o] + if isinstance(o, dict): + return {k: _serialize(v, format) for k, v in o.items()} + if isinstance(o, set): + return {_serialize(x, format) for x in o} + if isinstance(o, tuple): + return tuple(_serialize(x, format) for x in o) + if isinstance(o, (bytes, bytearray)): + return _serialize_bytes(o, format) + if isinstance(o, decimal.Decimal): + return float(o) + if isinstance(o, enum.Enum): + return o.value + if isinstance(o, int): + if format == "str": + return str(o) + return o + try: + # First try datetime.datetime + return _serialize_datetime(o, format) + except AttributeError: + pass + # Last, try datetime.timedelta + try: + return _timedelta_as_isostr(o) + except AttributeError: + # This will be raised when it hits value.total_seconds in the method above + pass + return o + + +def _get_rest_field(attr_to_rest_field: dict[str, "_RestField"], rest_name: str) -> typing.Optional["_RestField"]: + try: + return next(rf for rf in attr_to_rest_field.values() if rf._rest_name == rest_name) + except StopIteration: + return None + + +def _create_value(rf: typing.Optional["_RestField"], value: typing.Any) -> typing.Any: + if not rf: + return _serialize(value, None) + if rf._is_multipart_file_input: + return value + if rf._is_model: + return _deserialize(rf._type, value) + if isinstance(value, ET.Element): + value = _deserialize(rf._type, value) + return _serialize(value, rf._format) + + +class Model(_MyMutableMapping): + _is_model = True + # label whether current class's _attr_to_rest_field has been calculated + # could not see _attr_to_rest_field directly because subclass inherits it from parent class + _calculated: set[str] = set() + + def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: + class_name = self.__class__.__name__ + if len(args) > 1: + raise TypeError(f"{class_name}.__init__() takes 2 positional arguments but {len(args) + 1} were given") + dict_to_pass = { + rest_field._rest_name: rest_field._default + for rest_field in self._attr_to_rest_field.values() + if rest_field._default is not _UNSET + } + if args: # pylint: disable=too-many-nested-blocks + if isinstance(args[0], ET.Element): + existed_attr_keys = [] + model_meta = getattr(self, "_xml", {}) + + for rf in self._attr_to_rest_field.values(): + prop_meta = getattr(rf, "_xml", {}) + xml_name = prop_meta.get("name", rf._rest_name) + xml_ns = prop_meta.get("ns", model_meta.get("ns", None)) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + # attribute + if prop_meta.get("attribute", False) and args[0].get(xml_name) is not None: + existed_attr_keys.append(xml_name) + dict_to_pass[rf._rest_name] = _deserialize(rf._type, args[0].get(xml_name)) + continue + + # unwrapped element is array + if prop_meta.get("unwrapped", False): + # unwrapped array could either use prop items meta/prop meta + if prop_meta.get("itemsName"): + xml_name = prop_meta.get("itemsName") + xml_ns = prop_meta.get("itemNs") + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + items = args[0].findall(xml_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(xml_name) + dict_to_pass[rf._rest_name] = _deserialize(rf._type, items) + elif not rf._is_optional: + existed_attr_keys.append(xml_name) + dict_to_pass[rf._rest_name] = [] + continue + + # text element is primitive type + if prop_meta.get("text", False): + if args[0].text is not None: + dict_to_pass[rf._rest_name] = _deserialize(rf._type, args[0].text) + continue + + # wrapped element could be normal property or array, it should only have one element + item = args[0].find(xml_name) + if item is not None: + existed_attr_keys.append(xml_name) + dict_to_pass[rf._rest_name] = _deserialize(rf._type, item) + + # rest thing is additional properties + for e in args[0]: + if e.tag not in existed_attr_keys: + dict_to_pass[e.tag] = _convert_element(e) + else: + dict_to_pass.update( + {k: _create_value(_get_rest_field(self._attr_to_rest_field, k), v) for k, v in args[0].items()} + ) + else: + non_attr_kwargs = [k for k in kwargs if k not in self._attr_to_rest_field] + if non_attr_kwargs: + # actual type errors only throw the first wrong keyword arg they see, so following that. + raise TypeError(f"{class_name}.__init__() got an unexpected keyword argument '{non_attr_kwargs[0]}'") + dict_to_pass.update( + { + self._attr_to_rest_field[k]._rest_name: _create_value(self._attr_to_rest_field[k], v) + for k, v in kwargs.items() + if v is not None + } + ) + super().__init__(dict_to_pass) + + def copy(self) -> "Model": + return Model(self.__dict__) + + def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: + if f"{cls.__module__}.{cls.__qualname__}" not in cls._calculated: + # we know the last nine classes in mro are going to be 'Model', '_MyMutableMapping', 'MutableMapping', + # 'Mapping', 'Collection', 'Sized', 'Iterable', 'Container' and 'object' + mros = cls.__mro__[:-9][::-1] # ignore parents, and reverse the mro order + attr_to_rest_field: dict[str, _RestField] = { # map attribute name to rest_field property + k: v for mro_class in mros for k, v in mro_class.__dict__.items() if k[0] != "_" and hasattr(v, "_type") + } + annotations = { + k: v + for mro_class in mros + if hasattr(mro_class, "__annotations__") + for k, v in mro_class.__annotations__.items() + } + for attr, rf in attr_to_rest_field.items(): + rf._module = cls.__module__ + if not rf._type: + rf._type = rf._get_deserialize_callable_from_annotation(annotations.get(attr, None)) + if not rf._rest_name_input: + rf._rest_name_input = attr + cls._attr_to_rest_field: dict[str, _RestField] = dict(attr_to_rest_field.items()) + cls._backcompat_attr_to_rest_field: dict[str, _RestField] = { + Model._get_backcompat_attribute_name(cls._attr_to_rest_field, attr): rf + for attr, rf in cls._attr_to_rest_field.items() + } + cls._calculated.add(f"{cls.__module__}.{cls.__qualname__}") + + return super().__new__(cls) + + def __init_subclass__(cls, discriminator: typing.Optional[str] = None) -> None: + for base in cls.__bases__: + if hasattr(base, "__mapping__"): + base.__mapping__[discriminator or cls.__name__] = cls # type: ignore + + @classmethod + def _get_backcompat_attribute_name(cls, attr_to_rest_field: dict[str, "_RestField"], attr_name: str) -> str: + rest_field_obj = attr_to_rest_field.get(attr_name) # pylint: disable=protected-access + if rest_field_obj is None: + return attr_name + original_tsp_name = getattr(rest_field_obj, "_original_tsp_name", None) # pylint: disable=protected-access + if original_tsp_name: + return original_tsp_name + return attr_name + + @classmethod + def _get_discriminator(cls, exist_discriminators) -> typing.Optional["_RestField"]: + for v in cls.__dict__.values(): + if isinstance(v, _RestField) and v._is_discriminator and v._rest_name not in exist_discriminators: + return v + return None + + @classmethod + def _deserialize(cls, data, exist_discriminators): + if not hasattr(cls, "__mapping__"): + return cls(data) + discriminator = cls._get_discriminator(exist_discriminators) + if discriminator is None: + return cls(data) + exist_discriminators.append(discriminator._rest_name) + if isinstance(data, ET.Element): + model_meta = getattr(cls, "_xml", {}) + prop_meta = getattr(discriminator, "_xml", {}) + xml_name = prop_meta.get("name", discriminator._rest_name) + xml_ns = prop_meta.get("ns", model_meta.get("ns", None)) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + if data.get(xml_name) is not None: + discriminator_value = data.get(xml_name) + else: + discriminator_value = data.find(xml_name).text # pyright: ignore + else: + discriminator_value = data.get(discriminator._rest_name) + mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore # pylint: disable=no-member + return mapped_cls._deserialize(data, exist_discriminators) + + def as_dict(self, *, exclude_readonly: bool = False) -> dict[str, typing.Any]: + """Return a dict that can be turned into json using json.dump. + + :keyword bool exclude_readonly: Whether to remove the readonly properties. + :returns: A dict JSON compatible object + :rtype: dict + """ + + result = {} + readonly_props = [] + if exclude_readonly: + readonly_props = [p._rest_name for p in self._attr_to_rest_field.values() if _is_readonly(p)] + for k, v in self.items(): + if exclude_readonly and k in readonly_props: # pyright: ignore + continue + is_multipart_file_input = False + try: + is_multipart_file_input = next( + rf for rf in self._attr_to_rest_field.values() if rf._rest_name == k + )._is_multipart_file_input + except StopIteration: + pass + result[k] = v if is_multipart_file_input else Model._as_dict_value(v, exclude_readonly=exclude_readonly) + return result + + @staticmethod + def _as_dict_value(v: typing.Any, exclude_readonly: bool = False) -> typing.Any: + if v is None or isinstance(v, _Null): + return None + if isinstance(v, (list, tuple, set)): + return type(v)(Model._as_dict_value(x, exclude_readonly=exclude_readonly) for x in v) + if isinstance(v, dict): + return {dk: Model._as_dict_value(dv, exclude_readonly=exclude_readonly) for dk, dv in v.items()} + return v.as_dict(exclude_readonly=exclude_readonly) if hasattr(v, "as_dict") else v + + +def _deserialize_model(model_deserializer: typing.Optional[typing.Callable], obj): + if _is_model(obj): + return obj + return _deserialize(model_deserializer, obj) + + +def _deserialize_with_optional(if_obj_deserializer: typing.Optional[typing.Callable], obj): + if obj is None: + return obj + return _deserialize_with_callable(if_obj_deserializer, obj) + + +def _deserialize_with_union(deserializers, obj): + for deserializer in deserializers: + try: + return _deserialize(deserializer, obj) + except DeserializationError: + pass + raise DeserializationError() + + +def _deserialize_dict( + value_deserializer: typing.Optional[typing.Callable], + module: typing.Optional[str], + obj: dict[typing.Any, typing.Any], +): + if obj is None: + return obj + if isinstance(obj, ET.Element): + obj = {child.tag: child for child in obj} + return {k: _deserialize(value_deserializer, v, module) for k, v in obj.items()} + + +def _deserialize_multiple_sequence( + entry_deserializers: list[typing.Optional[typing.Callable]], + module: typing.Optional[str], + obj, +): + if obj is None: + return obj + return type(obj)(_deserialize(deserializer, entry, module) for entry, deserializer in zip(obj, entry_deserializers)) + + +def _is_array_encoded_deserializer(deserializer: functools.partial) -> bool: + return ( + isinstance(deserializer, functools.partial) + and isinstance(deserializer.args[0], functools.partial) + and deserializer.args[0].func == _deserialize_array_encoded # pylint: disable=comparison-with-callable + ) + + +def _deserialize_sequence( + deserializer: typing.Optional[typing.Callable], + module: typing.Optional[str], + obj, +): + if obj is None: + return obj + if isinstance(obj, ET.Element): + obj = list(obj) + + # encoded string may be deserialized to sequence + if isinstance(obj, str) and isinstance(deserializer, functools.partial): + # for list[str] + if _is_array_encoded_deserializer(deserializer): + return deserializer(obj) + + # for list[Union[...]] + if isinstance(deserializer.args[0], list): + for sub_deserializer in deserializer.args[0]: + if _is_array_encoded_deserializer(sub_deserializer): + return sub_deserializer(obj) + + return type(obj)(_deserialize(deserializer, entry, module) for entry in obj) + + +def _sorted_annotations(types: list[typing.Any]) -> list[typing.Any]: + return sorted( + types, + key=lambda x: hasattr(x, "__name__") and x.__name__.lower() in ("str", "float", "int", "bool"), + ) + + +def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-return-statements, too-many-statements, too-many-branches + annotation: typing.Any, + module: typing.Optional[str], + rf: typing.Optional["_RestField"] = None, +) -> typing.Optional[typing.Callable[[typing.Any], typing.Any]]: + if not annotation: + return None + + # is it a type alias? + if isinstance(annotation, str): + if module is not None: + annotation = _get_type_alias_type(module, annotation) + + # is it a forward ref / in quotes? + if isinstance(annotation, (str, typing.ForwardRef)): + try: + model_name = annotation.__forward_arg__ # type: ignore + except AttributeError: + model_name = annotation + if module is not None: + annotation = _get_model(module, model_name) # type: ignore + + try: + if module and _is_model(annotation): + if rf: + rf._is_model = True + + return functools.partial(_deserialize_model, annotation) # pyright: ignore + except Exception: + pass + + # is it a literal? + try: + if annotation.__origin__ is typing.Literal: # pyright: ignore + return None + except AttributeError: + pass + + # is it optional? + try: + if any(a is _NONE_TYPE for a in annotation.__args__): # pyright: ignore + if rf: + rf._is_optional = True + if len(annotation.__args__) <= 2: # pyright: ignore + if_obj_deserializer = _get_deserialize_callable_from_annotation( + next(a for a in annotation.__args__ if a is not _NONE_TYPE), module, rf # pyright: ignore + ) + + return functools.partial(_deserialize_with_optional, if_obj_deserializer) + # the type is Optional[Union[...]], we need to remove the None type from the Union + annotation_copy = copy.copy(annotation) + annotation_copy.__args__ = [a for a in annotation_copy.__args__ if a is not _NONE_TYPE] # pyright: ignore + return _get_deserialize_callable_from_annotation(annotation_copy, module, rf) + except AttributeError: + pass + + # is it union? + if getattr(annotation, "__origin__", None) is typing.Union: + # initial ordering is we make `string` the last deserialization option, because it is often them most generic + deserializers = [ + _get_deserialize_callable_from_annotation(arg, module, rf) + for arg in _sorted_annotations(annotation.__args__) # pyright: ignore + ] + + return functools.partial(_deserialize_with_union, deserializers) + + try: + annotation_name = ( + annotation.__name__ if hasattr(annotation, "__name__") else annotation._name # pyright: ignore + ) + if annotation_name.lower() == "dict": + value_deserializer = _get_deserialize_callable_from_annotation( + annotation.__args__[1], module, rf # pyright: ignore + ) + + return functools.partial( + _deserialize_dict, + value_deserializer, + module, + ) + except (AttributeError, IndexError): + pass + try: + annotation_name = ( + annotation.__name__ if hasattr(annotation, "__name__") else annotation._name # pyright: ignore + ) + if annotation_name.lower() in ["list", "set", "tuple", "sequence"]: + if len(annotation.__args__) > 1: # pyright: ignore + entry_deserializers = [ + _get_deserialize_callable_from_annotation(dt, module, rf) + for dt in annotation.__args__ # pyright: ignore + ] + return functools.partial(_deserialize_multiple_sequence, entry_deserializers, module) + deserializer = _get_deserialize_callable_from_annotation( + annotation.__args__[0], module, rf # pyright: ignore + ) + + return functools.partial(_deserialize_sequence, deserializer, module) + except (TypeError, IndexError, AttributeError, SyntaxError): + pass + + def _deserialize_default( + deserializer, + obj, + ): + if obj is None: + return obj + try: + return _deserialize_with_callable(deserializer, obj) + except Exception: + pass + return obj + + if get_deserializer(annotation, rf): + return functools.partial(_deserialize_default, get_deserializer(annotation, rf)) + + return functools.partial(_deserialize_default, annotation) + + +def _deserialize_with_callable( + deserializer: typing.Optional[typing.Callable[[typing.Any], typing.Any]], + value: typing.Any, +): # pylint: disable=too-many-return-statements + try: + if value is None or isinstance(value, _Null): + return None + if isinstance(value, ET.Element): + if deserializer is str: + return value.text or "" + if deserializer is int: + return int(value.text) if value.text else None + if deserializer is float: + return float(value.text) if value.text else None + if deserializer is bool: + return value.text == "true" if value.text else None + if deserializer and deserializer in _DESERIALIZE_MAPPING.values(): + return deserializer(value.text) if value.text else None + if deserializer and deserializer in _DESERIALIZE_MAPPING_WITHFORMAT.values(): + return deserializer(value.text) if value.text else None + if deserializer is None: + return value + if deserializer in [int, float, bool]: + return deserializer(value) + if isinstance(deserializer, CaseInsensitiveEnumMeta): + try: + return deserializer(value.text if isinstance(value, ET.Element) else value) + except ValueError: + # for unknown value, return raw value + return value.text if isinstance(value, ET.Element) else value + if isinstance(deserializer, type) and issubclass(deserializer, Model): + return deserializer._deserialize(value, []) + return typing.cast(typing.Callable[[typing.Any], typing.Any], deserializer)(value) + except Exception as e: + raise DeserializationError() from e + + +def _deserialize( + deserializer: typing.Any, + value: typing.Any, + module: typing.Optional[str] = None, + rf: typing.Optional["_RestField"] = None, + format: typing.Optional[str] = None, +) -> typing.Any: + if isinstance(value, PipelineResponse): + value = value.http_response.json() + if rf is None and format: + rf = _RestField(format=format) + if not isinstance(deserializer, functools.partial): + deserializer = _get_deserialize_callable_from_annotation(deserializer, module, rf) + return _deserialize_with_callable(deserializer, value) + + +def _failsafe_deserialize( + deserializer: typing.Any, + response: HttpResponse, + module: typing.Optional[str] = None, + rf: typing.Optional["_RestField"] = None, + format: typing.Optional[str] = None, +) -> typing.Any: + try: + return _deserialize(deserializer, response.json(), module, rf, format) + except Exception: # pylint: disable=broad-except + _LOGGER.warning( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + +def _failsafe_deserialize_xml( + deserializer: typing.Any, + response: HttpResponse, +) -> typing.Any: + try: + return _deserialize_xml(deserializer, response.text()) + except Exception: # pylint: disable=broad-except + _LOGGER.warning( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + +# pylint: disable=too-many-instance-attributes +class _RestField: + def __init__( + self, + *, + name: typing.Optional[str] = None, + type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin + is_discriminator: bool = False, + visibility: typing.Optional[list[str]] = None, + default: typing.Any = _UNSET, + format: typing.Optional[str] = None, + is_multipart_file_input: bool = False, + xml: typing.Optional[dict[str, typing.Any]] = None, + original_tsp_name: typing.Optional[str] = None, + ): + self._type = type + self._rest_name_input = name + self._module: typing.Optional[str] = None + self._is_discriminator = is_discriminator + self._visibility = visibility + self._is_model = False + self._is_optional = False + self._default = default + self._format = format + self._is_multipart_file_input = is_multipart_file_input + self._xml = xml if xml is not None else {} + self._original_tsp_name = original_tsp_name + + @property + def _class_type(self) -> typing.Any: + result = getattr(self._type, "args", [None])[0] + # type may be wrapped by nested functools.partial so we need to check for that + if isinstance(result, functools.partial): + return getattr(result, "args", [None])[0] + return result + + @property + def _rest_name(self) -> str: + if self._rest_name_input is None: + raise ValueError("Rest name was never set") + return self._rest_name_input + + def __get__(self, obj: Model, type=None): # pylint: disable=redefined-builtin + # by this point, type and rest_name will have a value bc we default + # them in __new__ of the Model class + # Use _data.get() directly to avoid triggering __getitem__ which clears the cache + item = obj._data.get(self._rest_name) + if item is None: + return item + if self._is_model: + return item + + # For mutable types, we want mutations to directly affect _data + # Check if we've already deserialized this value + cache_attr = f"_deserialized_{self._rest_name}" + if hasattr(obj, cache_attr): + # Return the value from _data directly (it's been deserialized in place) + return obj._data.get(self._rest_name) + + deserialized = _deserialize(self._type, _serialize(item, self._format), rf=self) + + # For mutable types, store the deserialized value back in _data + # so mutations directly affect _data + if isinstance(deserialized, (dict, list, set)): + obj._data[self._rest_name] = deserialized + object.__setattr__(obj, cache_attr, True) # Mark as deserialized + return deserialized + + return deserialized + + def __set__(self, obj: Model, value) -> None: + # Clear the cached deserialized object when setting a new value + cache_attr = f"_deserialized_{self._rest_name}" + if hasattr(obj, cache_attr): + object.__delattr__(obj, cache_attr) + + if value is None: + # we want to wipe out entries if users set attr to None + try: + obj.__delitem__(self._rest_name) + except KeyError: + pass + return + if self._is_model: + if not _is_model(value): + value = _deserialize(self._type, value) + obj.__setitem__(self._rest_name, value) + return + obj.__setitem__(self._rest_name, _serialize(value, self._format)) + + def _get_deserialize_callable_from_annotation( + self, annotation: typing.Any + ) -> typing.Optional[typing.Callable[[typing.Any], typing.Any]]: + return _get_deserialize_callable_from_annotation(annotation, self._module, self) + + +def rest_field( + *, + name: typing.Optional[str] = None, + type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin + visibility: typing.Optional[list[str]] = None, + default: typing.Any = _UNSET, + format: typing.Optional[str] = None, + is_multipart_file_input: bool = False, + xml: typing.Optional[dict[str, typing.Any]] = None, + original_tsp_name: typing.Optional[str] = None, +) -> typing.Any: + return _RestField( + name=name, + type=type, + visibility=visibility, + default=default, + format=format, + is_multipart_file_input=is_multipart_file_input, + xml=xml, + original_tsp_name=original_tsp_name, + ) + + +def rest_discriminator( + *, + name: typing.Optional[str] = None, + type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin + visibility: typing.Optional[list[str]] = None, + xml: typing.Optional[dict[str, typing.Any]] = None, +) -> typing.Any: + return _RestField(name=name, type=type, is_discriminator=True, visibility=visibility, xml=xml) + + +def serialize_xml(model: Model, exclude_readonly: bool = False) -> str: + """Serialize a model to XML. + + :param Model model: The model to serialize. + :param bool exclude_readonly: Whether to exclude readonly properties. + :returns: The XML representation of the model. + :rtype: str + """ + return ET.tostring(_get_element(model, exclude_readonly), encoding="unicode") # type: ignore + + +def _get_element( + o: typing.Any, + exclude_readonly: bool = False, + parent_meta: typing.Optional[dict[str, typing.Any]] = None, + wrapped_element: typing.Optional[ET.Element] = None, +) -> typing.Union[ET.Element, list[ET.Element]]: + if _is_model(o): + model_meta = getattr(o, "_xml", {}) + + # if prop is a model, then use the prop element directly, else generate a wrapper of model + if wrapped_element is None: + wrapped_element = _create_xml_element( + model_meta.get("name", o.__class__.__name__), + model_meta.get("prefix"), + model_meta.get("ns"), + ) + + readonly_props = [] + if exclude_readonly: + readonly_props = [p._rest_name for p in o._attr_to_rest_field.values() if _is_readonly(p)] + + for k, v in o.items(): + # do not serialize readonly properties + if exclude_readonly and k in readonly_props: + continue + + prop_rest_field = _get_rest_field(o._attr_to_rest_field, k) + if prop_rest_field: + prop_meta = getattr(prop_rest_field, "_xml").copy() + # use the wire name as xml name if no specific name is set + if prop_meta.get("name") is None: + prop_meta["name"] = k + else: + # additional properties will not have rest field, use the wire name as xml name + prop_meta = {"name": k} + + # if no ns for prop, use model's + if prop_meta.get("ns") is None and model_meta.get("ns"): + prop_meta["ns"] = model_meta.get("ns") + prop_meta["prefix"] = model_meta.get("prefix") + + if prop_meta.get("unwrapped", False): + # unwrapped could only set on array + wrapped_element.extend(_get_element(v, exclude_readonly, prop_meta)) + elif prop_meta.get("text", False): + # text could only set on primitive type + wrapped_element.text = _get_primitive_type_value(v) + elif prop_meta.get("attribute", False): + xml_name = prop_meta.get("name", k) + if prop_meta.get("ns"): + ET.register_namespace(prop_meta.get("prefix"), prop_meta.get("ns")) # pyright: ignore + xml_name = "{" + prop_meta.get("ns") + "}" + xml_name # pyright: ignore + # attribute should be primitive type + wrapped_element.set(xml_name, _get_primitive_type_value(v)) + else: + # other wrapped prop element + wrapped_element.append(_get_wrapped_element(v, exclude_readonly, prop_meta)) + return wrapped_element + if isinstance(o, list): + return [_get_element(x, exclude_readonly, parent_meta) for x in o] # type: ignore + if isinstance(o, dict): + result = [] + for k, v in o.items(): + result.append( + _get_wrapped_element( + v, + exclude_readonly, + { + "name": k, + "ns": parent_meta.get("ns") if parent_meta else None, + "prefix": parent_meta.get("prefix") if parent_meta else None, + }, + ) + ) + return result + + # primitive case need to create element based on parent_meta + if parent_meta: + return _get_wrapped_element( + o, + exclude_readonly, + { + "name": parent_meta.get("itemsName", parent_meta.get("name")), + "prefix": parent_meta.get("itemsPrefix", parent_meta.get("prefix")), + "ns": parent_meta.get("itemsNs", parent_meta.get("ns")), + }, + ) + + raise ValueError("Could not serialize value into xml: " + o) + + +def _get_wrapped_element( + v: typing.Any, + exclude_readonly: bool, + meta: typing.Optional[dict[str, typing.Any]], +) -> ET.Element: + wrapped_element = _create_xml_element( + meta.get("name") if meta else None, meta.get("prefix") if meta else None, meta.get("ns") if meta else None + ) + if isinstance(v, (dict, list)): + wrapped_element.extend(_get_element(v, exclude_readonly, meta)) + elif _is_model(v): + _get_element(v, exclude_readonly, meta, wrapped_element) + else: + wrapped_element.text = _get_primitive_type_value(v) + return wrapped_element # type: ignore[no-any-return] + + +def _get_primitive_type_value(v) -> str: + if v is True: + return "true" + if v is False: + return "false" + if isinstance(v, _Null): + return "" + return str(v) + + +def _create_xml_element( + tag: typing.Any, prefix: typing.Optional[str] = None, ns: typing.Optional[str] = None +) -> ET.Element: + if prefix and ns: + ET.register_namespace(prefix, ns) + if ns: + return ET.Element("{" + ns + "}" + tag) + return ET.Element(tag) + + +def _deserialize_xml( + deserializer: typing.Any, + value: str, +) -> typing.Any: + element = ET.fromstring(value) # nosec + return _deserialize(deserializer, element) + + +def _convert_element(e: ET.Element): + # dict case + if len(e.attrib) > 0 or len({child.tag for child in e}) > 1: + dict_result: dict[str, typing.Any] = {} + for child in e: + if dict_result.get(child.tag) is not None: + if isinstance(dict_result[child.tag], list): + dict_result[child.tag].append(_convert_element(child)) + else: + dict_result[child.tag] = [dict_result[child.tag], _convert_element(child)] + else: + dict_result[child.tag] = _convert_element(child) + dict_result.update(e.attrib) + return dict_result + # array case + if len(e) > 0: + array_result: list[typing.Any] = [] + for child in e: + array_result.append(_convert_element(child)) + return array_result + # primitive case + return e.text diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/_utils/serialization.py b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/_utils/serialization.py index f5187701d7be..81ec1de5922b 100644 --- a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/_utils/serialization.py +++ b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/_utils/serialization.py @@ -3,7 +3,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -21,7 +21,6 @@ import sys import codecs from typing import ( - Dict, Any, cast, Optional, @@ -31,7 +30,6 @@ Mapping, Callable, MutableMapping, - List, ) try: @@ -229,12 +227,12 @@ class Model: serialization and deserialization. """ - _subtype_map: Dict[str, Dict[str, Any]] = {} - _attribute_map: Dict[str, Dict[str, Any]] = {} - _validation: Dict[str, Dict[str, Any]] = {} + _subtype_map: dict[str, dict[str, Any]] = {} + _attribute_map: dict[str, dict[str, Any]] = {} + _validation: dict[str, dict[str, Any]] = {} def __init__(self, **kwargs: Any) -> None: - self.additional_properties: Optional[Dict[str, Any]] = {} + self.additional_properties: Optional[dict[str, Any]] = {} for k in kwargs: # pylint: disable=consider-using-dict-items if k not in self._attribute_map: _LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__) @@ -311,7 +309,7 @@ def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: def as_dict( self, keep_readonly: bool = True, - key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer, + key_transformer: Callable[[str, dict[str, Any], Any], Any] = attribute_transformer, **kwargs: Any ) -> JSON: """Return a dict that can be serialized using json.dump. @@ -380,7 +378,7 @@ def deserialize(cls, data: Any, content_type: Optional[str] = None) -> Self: def from_dict( cls, data: Any, - key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, + key_extractors: Optional[Callable[[str, dict[str, Any], Any], Any]] = None, content_type: Optional[str] = None, ) -> Self: """Parse a dict using given key extractor return a model. @@ -414,7 +412,7 @@ def _flatten_subtype(cls, key, objects): return {} result = dict(cls._subtype_map[key]) for valuetype in cls._subtype_map[key].values(): - result.update(objects[valuetype]._flatten_subtype(key, objects)) # pylint: disable=protected-access + result |= objects[valuetype]._flatten_subtype(key, objects) # pylint: disable=protected-access return result @classmethod @@ -528,7 +526,7 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: "[]": self.serialize_iter, "{}": self.serialize_dict, } - self.dependencies: Dict[str, type] = dict(classes) if classes else {} + self.dependencies: dict[str, type] = dict(classes) if classes else {} self.key_transformer = full_restapi_key_transformer self.client_side_validation = True @@ -579,7 +577,7 @@ def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, to if attr_name == "additional_properties" and attr_desc["key"] == "": if target_obj.additional_properties is not None: - serialized.update(target_obj.additional_properties) + serialized |= target_obj.additional_properties continue try: @@ -789,7 +787,7 @@ def serialize_data(self, data, data_type, **kwargs): # If dependencies is empty, try with current data class # It has to be a subclass of Enum anyway - enum_type = self.dependencies.get(data_type, data.__class__) + enum_type = self.dependencies.get(data_type, cast(type, data.__class__)) if issubclass(enum_type, Enum): return Serializer.serialize_enum(data, enum_obj=enum_type) @@ -823,13 +821,20 @@ def serialize_basic(cls, data, data_type, **kwargs): :param str data_type: Type of object in the iterable. :rtype: str, int, float, bool :return: serialized object + :raises TypeError: raise if data_type is not one of str, int, float, bool. """ custom_serializer = cls._get_custom_serializers(data_type, **kwargs) if custom_serializer: return custom_serializer(data) if data_type == "str": return cls.serialize_unicode(data) - return eval(data_type)(data) # nosec # pylint: disable=eval-used + if data_type == "int": + return int(data) + if data_type == "float": + return float(data) + if data_type == "bool": + return bool(data) + raise TypeError("Unknown basic data type: {}".format(data_type)) @classmethod def serialize_unicode(cls, data): @@ -1184,7 +1189,7 @@ def rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argumen while "." in key: # Need the cast, as for some reasons "split" is typed as list[str | Any] - dict_keys = cast(List[str], _FLATTEN.split(key)) + dict_keys = cast(list[str], _FLATTEN.split(key)) if len(dict_keys) == 1: key = _decode_attribute_map_key(dict_keys[0]) break @@ -1386,7 +1391,7 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: "duration": (isodate.Duration, datetime.timedelta), "iso-8601": (datetime.datetime), } - self.dependencies: Dict[str, type] = dict(classes) if classes else {} + self.dependencies: dict[str, type] = dict(classes) if classes else {} self.key_extractors = [rest_key_extractor, xml_key_extractor] # Additional properties only works if the "rest_key_extractor" is used to # extract the keys. Making it to work whatever the key extractor is too much @@ -1759,7 +1764,7 @@ def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return :param str data_type: deserialization data type. :return: Deserialized basic type. :rtype: str, int, float or bool - :raises TypeError: if string format is not valid. + :raises TypeError: if string format is not valid or data_type is not one of str, int, float, bool. """ # If we're here, data is supposed to be a basic type. # If it's still an XML node, take the text @@ -1785,7 +1790,11 @@ def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return if data_type == "str": return self.deserialize_unicode(attr) - return eval(data_type)(attr) # nosec # pylint: disable=eval-used + if data_type == "int": + return int(attr) + if data_type == "float": + return float(attr) + raise TypeError("Unknown basic data type: {}".format(data_type)) @staticmethod def deserialize_unicode(data): diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/_version.py b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/_version.py index 44192a0f2b11..1298cba4f125 100644 --- a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/_version.py +++ b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/_version.py @@ -2,8 +2,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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.1.0b5" +VERSION = "1.1.0b6" diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/aio/__init__.py b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/aio/__init__.py index 78e779b05c32..577146739dc2 100644 --- a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/aio/__init__.py +++ b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/aio/__init__.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- # pylint: disable=wrong-import-position @@ -12,7 +12,7 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import -from ._policy_insights_client import PolicyInsightsClient # type: ignore +from ._client import PolicyInsightsClient # type: ignore try: from ._patch import __all__ as _patch_all diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/aio/_policy_insights_client.py b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/aio/_client.py similarity index 82% rename from sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/aio/_policy_insights_client.py rename to sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/aio/_client.py index 2653b2e84748..7b9819a08532 100644 --- a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/aio/_policy_insights_client.py +++ b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/aio/_client.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -17,7 +17,6 @@ from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy from azure.mgmt.core.tools import get_arm_endpoints -from .. import models as _models from .._utils.serialization import Deserializer, Serializer from ._configuration import PolicyInsightsClientConfiguration from .operations import ( @@ -33,53 +32,69 @@ ) if TYPE_CHECKING: + from azure.core import AzureClouds from azure.core.credentials_async import AsyncTokenCredential class PolicyInsightsClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes - """Query component policy states at varying resource scopes for Resource Provider mode policies. + """PolicyInsightsClient. - :ivar policy_tracked_resources: PolicyTrackedResourcesOperations operations - :vartype policy_tracked_resources: - azure.mgmt.policyinsights.aio.operations.PolicyTrackedResourcesOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.policyinsights.aio.operations.Operations :ivar remediations: RemediationsOperations operations :vartype remediations: azure.mgmt.policyinsights.aio.operations.RemediationsOperations + :ivar attestations: AttestationsOperations operations + :vartype attestations: azure.mgmt.policyinsights.aio.operations.AttestationsOperations + :ivar policy_metadata: PolicyMetadataOperations operations + :vartype policy_metadata: azure.mgmt.policyinsights.aio.operations.PolicyMetadataOperations :ivar policy_events: PolicyEventsOperations operations :vartype policy_events: azure.mgmt.policyinsights.aio.operations.PolicyEventsOperations :ivar policy_states: PolicyStatesOperations operations :vartype policy_states: azure.mgmt.policyinsights.aio.operations.PolicyStatesOperations - :ivar policy_metadata: PolicyMetadataOperations operations - :vartype policy_metadata: azure.mgmt.policyinsights.aio.operations.PolicyMetadataOperations :ivar policy_restrictions: PolicyRestrictionsOperations operations :vartype policy_restrictions: azure.mgmt.policyinsights.aio.operations.PolicyRestrictionsOperations :ivar component_policy_states: ComponentPolicyStatesOperations operations :vartype component_policy_states: azure.mgmt.policyinsights.aio.operations.ComponentPolicyStatesOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.policyinsights.aio.operations.Operations - :ivar attestations: AttestationsOperations operations - :vartype attestations: azure.mgmt.policyinsights.aio.operations.AttestationsOperations - :param credential: Credential needed for the client to connect to Azure. Required. + :ivar policy_tracked_resources: PolicyTrackedResourcesOperations operations + :vartype policy_tracked_resources: + azure.mgmt.policyinsights.aio.operations.PolicyTrackedResourcesOperations + :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: Microsoft Azure subscription ID. Required. + :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :param base_url: Service URL. Default value is None. + :param base_url: Service host. Default value is None. :type base_url: str + :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is + None. + :paramtype cloud_setting: ~azure.core.AzureClouds :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( - self, credential: "AsyncTokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + *, + cloud_setting: Optional["AzureClouds"] = None, + **kwargs: Any ) -> None: - _cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore + _endpoint = "{endpoint}" + _cloud = cloud_setting or settings.current.azure_cloud # type: ignore _endpoints = get_arm_endpoints(_cloud) if not base_url: base_url = _endpoints["resource_manager"] credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"]) self._config = PolicyInsightsClientConfiguration( - credential=credential, subscription_id=subscription_id, credential_scopes=credential_scopes, **kwargs + credential=credential, + subscription_id=subscription_id, + base_url=cast(str, base_url), + cloud_setting=cloud_setting, + credential_scopes=credential_scopes, + **kwargs ) _policies = kwargs.pop("policies", None) @@ -101,30 +116,29 @@ def __init__( self._config.http_logging_policy, ] self._client: AsyncARMPipelineClient = AsyncARMPipelineClient( - base_url=cast(str, base_url), policies=_policies, **kwargs + base_url=cast(str, _endpoint), policies=_policies, **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._serialize = Serializer() + self._deserialize = Deserializer() self._serialize.client_side_validation = False - self.policy_tracked_resources = PolicyTrackedResourcesOperations( - self._client, self._config, self._serialize, self._deserialize - ) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) self.remediations = RemediationsOperations(self._client, self._config, self._serialize, self._deserialize) + self.attestations = AttestationsOperations(self._client, self._config, self._serialize, self._deserialize) + self.policy_metadata = PolicyMetadataOperations(self._client, self._config, self._serialize, self._deserialize) self.policy_events = PolicyEventsOperations(self._client, self._config, self._serialize, self._deserialize) self.policy_states = PolicyStatesOperations(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 ) self.component_policy_states = ComponentPolicyStatesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.attestations = AttestationsOperations(self._client, self._config, self._serialize, self._deserialize) + self.policy_tracked_resources = PolicyTrackedResourcesOperations( + self._client, self._config, self._serialize, self._deserialize + ) - def _send_request( + def send_request( self, request: HttpRequest, *, stream: bool = False, **kwargs: Any ) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. @@ -132,7 +146,7 @@ def _send_request( >>> from azure.core.rest import HttpRequest >>> request = HttpRequest("GET", "https://www.example.org/") - >>> response = await client._send_request(request) + >>> response = await client.send_request(request) For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request @@ -145,7 +159,11 @@ def _send_request( """ request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore async def close(self) -> None: diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/aio/_configuration.py b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/aio/_configuration.py index dc8dd2d6bff6..554783ca0c7a 100644 --- a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/aio/_configuration.py +++ b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/aio/_configuration.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, TYPE_CHECKING +from typing import Any, Optional, TYPE_CHECKING from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy @@ -14,6 +14,7 @@ from .._version import VERSION if TYPE_CHECKING: + from azure.core import AzureClouds from azure.core.credentials_async import AsyncTokenCredential @@ -23,13 +24,25 @@ class PolicyInsightsClientConfiguration: # pylint: disable=too-many-instance-at Note that all parameters used to create this instance are saved as instance attributes. - :param credential: Credential needed for the client to connect to Azure. Required. + :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: Microsoft Azure subscription ID. Required. + :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str + :param base_url: Service host. Default value is "https://management.azure.com". + :type base_url: str + :param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is + None. + :type cloud_setting: ~azure.core.AzureClouds """ - def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + cloud_setting: Optional["AzureClouds"] = None, + **kwargs: Any + ) -> None: if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: @@ -37,6 +50,8 @@ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **k self.credential = credential self.subscription_id = subscription_id + self.base_url = base_url + self.cloud_setting = cloud_setting self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-policyinsights/{}".format(VERSION)) self.polling_interval = kwargs.get("polling_interval", 30) diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/aio/_patch.py b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/aio/_patch.py index f7dd32510333..87676c65a8f0 100644 --- a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/aio/_patch.py +++ b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/aio/_patch.py @@ -1,14 +1,15 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# 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. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/aio/operations/__init__.py b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/aio/operations/__init__.py index 4ff80dcf0f86..0da3fdcef222 100644 --- a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/aio/operations/__init__.py +++ b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/aio/operations/__init__.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- # pylint: disable=wrong-import-position @@ -12,30 +12,30 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import -from ._policy_tracked_resources_operations import PolicyTrackedResourcesOperations # type: ignore -from ._remediations_operations import RemediationsOperations # type: ignore -from ._policy_events_operations import PolicyEventsOperations # type: ignore -from ._policy_states_operations import PolicyStatesOperations # type: ignore -from ._policy_metadata_operations import PolicyMetadataOperations # type: ignore -from ._policy_restrictions_operations import PolicyRestrictionsOperations # type: ignore -from ._component_policy_states_operations import ComponentPolicyStatesOperations # type: ignore from ._operations import Operations # type: ignore -from ._attestations_operations import AttestationsOperations # type: ignore +from ._operations import RemediationsOperations # type: ignore +from ._operations import AttestationsOperations # type: ignore +from ._operations import PolicyMetadataOperations # type: ignore +from ._operations import PolicyEventsOperations # type: ignore +from ._operations import PolicyStatesOperations # type: ignore +from ._operations import PolicyRestrictionsOperations # type: ignore +from ._operations import ComponentPolicyStatesOperations # type: ignore +from ._operations import PolicyTrackedResourcesOperations # type: ignore from ._patch import __all__ as _patch_all from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ - "PolicyTrackedResourcesOperations", + "Operations", "RemediationsOperations", + "AttestationsOperations", + "PolicyMetadataOperations", "PolicyEventsOperations", "PolicyStatesOperations", - "PolicyMetadataOperations", "PolicyRestrictionsOperations", "ComponentPolicyStatesOperations", - "Operations", - "AttestationsOperations", + "PolicyTrackedResourcesOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/aio/operations/_attestations_operations.py b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/aio/operations/_attestations_operations.py deleted file mode 100644 index b2eb360fcad9..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/aio/operations/_attestations_operations.py +++ /dev/null @@ -1,1159 +0,0 @@ -# pylint: disable=too-many-lines -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._attestations_operations import ( - build_create_or_update_at_resource_group_request, - build_create_or_update_at_resource_request, - build_create_or_update_at_subscription_request, - build_delete_at_resource_group_request, - build_delete_at_resource_request, - build_delete_at_subscription_request, - build_get_at_resource_group_request, - build_get_at_resource_request, - build_get_at_subscription_request, - build_list_for_resource_group_request, - build_list_for_resource_request, - build_list_for_subscription_request, -) -from .._configuration import PolicyInsightsClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class AttestationsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.policyinsights.aio.PolicyInsightsClient`'s - :attr:`attestations` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: PolicyInsightsClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_for_subscription( - self, query_options: Optional[_models.QueryOptions] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.Attestation"]: - """Gets all attestations for the subscription. - - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either Attestation or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.Attestation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.AttestationListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - _filter = None - if query_options is not None: - _filter = query_options.filter - _top = query_options.top - - _request = build_list_for_subscription_request( - subscription_id=self._config.subscription_id, - top=_top, - filter=_filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("AttestationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated2, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - async def _create_or_update_at_subscription_initial( # pylint: disable=name-too-long - self, attestation_name: str, parameters: Union[_models.Attestation, IO[bytes]], **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "Attestation") - - _request = build_create_or_update_at_subscription_request( - attestation_name=attestation_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated2, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update_at_subscription( - self, - attestation_name: str, - parameters: _models.Attestation, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Attestation]: - """Creates or updates an attestation at subscription scope. - - :param attestation_name: The name of the attestation. Required. - :type attestation_name: str - :param parameters: The attestation parameters. Required. - :type parameters: ~azure.mgmt.policyinsights.models.Attestation - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either Attestation or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.policyinsights.models.Attestation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update_at_subscription( - self, attestation_name: str, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.Attestation]: - """Creates or updates an attestation at subscription scope. - - :param attestation_name: The name of the attestation. Required. - :type attestation_name: str - :param parameters: The attestation parameters. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either Attestation or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.policyinsights.models.Attestation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update_at_subscription( - self, attestation_name: str, parameters: Union[_models.Attestation, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.Attestation]: - """Creates or updates an attestation at subscription scope. - - :param attestation_name: The name of the attestation. Required. - :type attestation_name: str - :param parameters: The attestation parameters. Is either a Attestation type or a IO[bytes] - type. Required. - :type parameters: ~azure.mgmt.policyinsights.models.Attestation or IO[bytes] - :return: An instance of AsyncLROPoller that returns either Attestation or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.policyinsights.models.Attestation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Attestation] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_at_subscription_initial( - attestation_name=attestation_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Attestation", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.Attestation].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.Attestation]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace_async - async def get_at_subscription(self, attestation_name: str, **kwargs: Any) -> _models.Attestation: - """Gets an existing attestation at subscription scope. - - :param attestation_name: The name of the attestation. Required. - :type attestation_name: str - :return: Attestation or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.Attestation - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.Attestation] = kwargs.pop("cls", None) - - _request = build_get_at_subscription_request( - attestation_name=attestation_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated2, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Attestation", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete_at_subscription(self, attestation_name: str, **kwargs: Any) -> None: - """Deletes an existing attestation at subscription scope. - - :param attestation_name: The name of the attestation. Required. - :type attestation_name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_at_subscription_request( - attestation_name=attestation_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated2, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list_for_resource_group( - self, resource_group_name: str, query_options: Optional[_models.QueryOptions] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.Attestation"]: - """Gets all attestations for the resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either Attestation or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.Attestation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.AttestationListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - _filter = None - if query_options is not None: - _filter = query_options.filter - _top = query_options.top - - _request = build_list_for_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - top=_top, - filter=_filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("AttestationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated2, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - async def _create_or_update_at_resource_group_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - attestation_name: str, - parameters: Union[_models.Attestation, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "Attestation") - - _request = build_create_or_update_at_resource_group_request( - resource_group_name=resource_group_name, - attestation_name=attestation_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated2, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update_at_resource_group( - self, - resource_group_name: str, - attestation_name: str, - parameters: _models.Attestation, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Attestation]: - """Creates or updates an attestation at resource group scope. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param attestation_name: The name of the attestation. Required. - :type attestation_name: str - :param parameters: The attestation parameters. Required. - :type parameters: ~azure.mgmt.policyinsights.models.Attestation - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either Attestation or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.policyinsights.models.Attestation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update_at_resource_group( - self, - resource_group_name: str, - attestation_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Attestation]: - """Creates or updates an attestation at resource group scope. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param attestation_name: The name of the attestation. Required. - :type attestation_name: str - :param parameters: The attestation parameters. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either Attestation or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.policyinsights.models.Attestation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update_at_resource_group( - self, - resource_group_name: str, - attestation_name: str, - parameters: Union[_models.Attestation, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.Attestation]: - """Creates or updates an attestation at resource group scope. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param attestation_name: The name of the attestation. Required. - :type attestation_name: str - :param parameters: The attestation parameters. Is either a Attestation type or a IO[bytes] - type. Required. - :type parameters: ~azure.mgmt.policyinsights.models.Attestation or IO[bytes] - :return: An instance of AsyncLROPoller that returns either Attestation or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.policyinsights.models.Attestation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Attestation] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_at_resource_group_initial( - resource_group_name=resource_group_name, - attestation_name=attestation_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Attestation", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.Attestation].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.Attestation]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace_async - async def get_at_resource_group( - self, resource_group_name: str, attestation_name: str, **kwargs: Any - ) -> _models.Attestation: - """Gets an existing attestation at resource group scope. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param attestation_name: The name of the attestation. Required. - :type attestation_name: str - :return: Attestation or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.Attestation - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.Attestation] = kwargs.pop("cls", None) - - _request = build_get_at_resource_group_request( - resource_group_name=resource_group_name, - attestation_name=attestation_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated2, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Attestation", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete_at_resource_group(self, resource_group_name: str, attestation_name: str, **kwargs: Any) -> None: - """Deletes an existing attestation at resource group scope. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param attestation_name: The name of the attestation. Required. - :type attestation_name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_at_resource_group_request( - resource_group_name=resource_group_name, - attestation_name=attestation_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated2, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list_for_resource( - self, resource_id: str, query_options: Optional[_models.QueryOptions] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.Attestation"]: - """Gets all attestations for a resource. - - :param resource_id: Resource ID. Required. - :type resource_id: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either Attestation or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.Attestation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.AttestationListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - _filter = None - if query_options is not None: - _filter = query_options.filter - _top = query_options.top - - _request = build_list_for_resource_request( - resource_id=resource_id, - top=_top, - filter=_filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("AttestationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated2, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - async def _create_or_update_at_resource_initial( - self, resource_id: str, attestation_name: str, parameters: Union[_models.Attestation, IO[bytes]], **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "Attestation") - - _request = build_create_or_update_at_resource_request( - resource_id=resource_id, - attestation_name=attestation_name, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated2, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update_at_resource( - self, - resource_id: str, - attestation_name: str, - parameters: _models.Attestation, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Attestation]: - """Creates or updates an attestation at resource scope. - - :param resource_id: Resource ID. Required. - :type resource_id: str - :param attestation_name: The name of the attestation. Required. - :type attestation_name: str - :param parameters: The attestation parameters. Required. - :type parameters: ~azure.mgmt.policyinsights.models.Attestation - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either Attestation or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.policyinsights.models.Attestation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update_at_resource( - self, - resource_id: str, - attestation_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Attestation]: - """Creates or updates an attestation at resource scope. - - :param resource_id: Resource ID. Required. - :type resource_id: str - :param attestation_name: The name of the attestation. Required. - :type attestation_name: str - :param parameters: The attestation parameters. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either Attestation or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.policyinsights.models.Attestation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update_at_resource( - self, resource_id: str, attestation_name: str, parameters: Union[_models.Attestation, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.Attestation]: - """Creates or updates an attestation at resource scope. - - :param resource_id: Resource ID. Required. - :type resource_id: str - :param attestation_name: The name of the attestation. Required. - :type attestation_name: str - :param parameters: The attestation parameters. Is either a Attestation type or a IO[bytes] - type. Required. - :type parameters: ~azure.mgmt.policyinsights.models.Attestation or IO[bytes] - :return: An instance of AsyncLROPoller that returns either Attestation or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.policyinsights.models.Attestation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Attestation] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_at_resource_initial( - resource_id=resource_id, - attestation_name=attestation_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Attestation", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.Attestation].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.Attestation]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace_async - async def get_at_resource(self, resource_id: str, attestation_name: str, **kwargs: Any) -> _models.Attestation: - """Gets an existing attestation at resource scope. - - :param resource_id: Resource ID. Required. - :type resource_id: str - :param attestation_name: The name of the attestation. Required. - :type attestation_name: str - :return: Attestation or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.Attestation - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.Attestation] = kwargs.pop("cls", None) - - _request = build_get_at_resource_request( - resource_id=resource_id, - attestation_name=attestation_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated2, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Attestation", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete_at_resource(self, resource_id: str, attestation_name: str, **kwargs: Any) -> None: - """Deletes an existing attestation at individual resource scope. - - :param resource_id: Resource ID. Required. - :type resource_id: str - :param attestation_name: The name of the attestation. Required. - :type attestation_name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_at_resource_request( - resource_id=resource_id, - attestation_name=attestation_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated2, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/aio/operations/_component_policy_states_operations.py b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/aio/operations/_component_policy_states_operations.py deleted file mode 100644 index fc8804e30563..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/aio/operations/_component_policy_states_operations.py +++ /dev/null @@ -1,666 +0,0 @@ -# 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 collections.abc import MutableMapping -import datetime -from typing import Any, Callable, Dict, Literal, Optional, TypeVar, Union - -from azure.core import AsyncPipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._component_policy_states_operations import ( - build_list_query_results_for_policy_definition_request, - build_list_query_results_for_resource_group_level_policy_assignment_request, - build_list_query_results_for_resource_group_request, - build_list_query_results_for_resource_request, - build_list_query_results_for_subscription_level_policy_assignment_request, - build_list_query_results_for_subscription_request, -) -from .._configuration import PolicyInsightsClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class ComponentPolicyStatesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.policyinsights.aio.PolicyInsightsClient`'s - :attr:`component_policy_states` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: PolicyInsightsClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def list_query_results_for_subscription( - self, - subscription_id: str, - component_policy_states_resource: Union[str, _models.ComponentPolicyStatesResource], - top: Optional[int] = None, - order_by: Optional[str] = None, - select: Optional[str] = None, - from_parameter: Optional[datetime.datetime] = None, - to: Optional[datetime.datetime] = None, - filter: Optional[str] = None, - apply: Optional[str] = None, - **kwargs: Any - ) -> _models.ComponentPolicyStatesQueryResults: - """Queries component policy states under subscription scope. - - :param subscription_id: Microsoft Azure subscription ID. Required. - :type subscription_id: str - :param component_policy_states_resource: The virtual resource under ComponentPolicyStates - resource type. In a given time range, 'latest' represents the latest component policy state(s). - "latest" Required. - :type component_policy_states_resource: str or - ~azure.mgmt.policyinsights.models.ComponentPolicyStatesResource - :param top: Maximum number of records to return. Default value is None. - :type top: int - :param order_by: Ordering expression using OData notation. One or more comma-separated column - names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, - ResourceId asc". Default value is None. - :type order_by: str - :param select: Select expression using OData notation. Limits the columns on each record to - just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Default value is None. - :type select: str - :param from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval - to query. When not specified, the service uses ($to - 1-day). Default value is None. - :type from_parameter: ~datetime.datetime - :param to: ISO 8601 formatted timestamp specifying the end time of the interval to query. When - not specified, the service uses request time. Default value is None. - :type to: ~datetime.datetime - :param filter: OData filter expression. Default value is None. - :type filter: str - :param apply: OData apply expression for aggregations. Default value is None. - :type apply: str - :return: ComponentPolicyStatesQueryResults or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.ComponentPolicyStatesQueryResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.ComponentPolicyStatesQueryResults] = kwargs.pop("cls", None) - - _request = build_list_query_results_for_subscription_request( - subscription_id=subscription_id, - component_policy_states_resource=component_policy_states_resource, - top=top, - order_by=order_by, - select=select, - from_parameter=from_parameter, - to=to, - filter=filter, - apply=apply, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ComponentPolicyStatesQueryResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def list_query_results_for_resource_group( - self, - subscription_id: str, - resource_group_name: str, - component_policy_states_resource: Union[str, _models.ComponentPolicyStatesResource], - top: Optional[int] = None, - order_by: Optional[str] = None, - select: Optional[str] = None, - from_parameter: Optional[datetime.datetime] = None, - to: Optional[datetime.datetime] = None, - filter: Optional[str] = None, - apply: Optional[str] = None, - **kwargs: Any - ) -> _models.ComponentPolicyStatesQueryResults: - """Queries component policy states under resource group scope. - - :param subscription_id: Microsoft Azure subscription ID. Required. - :type subscription_id: str - :param resource_group_name: Resource group name. Required. - :type resource_group_name: str - :param component_policy_states_resource: The virtual resource under ComponentPolicyStates - resource type. In a given time range, 'latest' represents the latest component policy state(s). - "latest" Required. - :type component_policy_states_resource: str or - ~azure.mgmt.policyinsights.models.ComponentPolicyStatesResource - :param top: Maximum number of records to return. Default value is None. - :type top: int - :param order_by: Ordering expression using OData notation. One or more comma-separated column - names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, - ResourceId asc". Default value is None. - :type order_by: str - :param select: Select expression using OData notation. Limits the columns on each record to - just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Default value is None. - :type select: str - :param from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval - to query. When not specified, the service uses ($to - 1-day). Default value is None. - :type from_parameter: ~datetime.datetime - :param to: ISO 8601 formatted timestamp specifying the end time of the interval to query. When - not specified, the service uses request time. Default value is None. - :type to: ~datetime.datetime - :param filter: OData filter expression. Default value is None. - :type filter: str - :param apply: OData apply expression for aggregations. Default value is None. - :type apply: str - :return: ComponentPolicyStatesQueryResults or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.ComponentPolicyStatesQueryResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.ComponentPolicyStatesQueryResults] = kwargs.pop("cls", None) - - _request = build_list_query_results_for_resource_group_request( - subscription_id=subscription_id, - resource_group_name=resource_group_name, - component_policy_states_resource=component_policy_states_resource, - top=top, - order_by=order_by, - select=select, - from_parameter=from_parameter, - to=to, - filter=filter, - apply=apply, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ComponentPolicyStatesQueryResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def list_query_results_for_resource( - self, - resource_id: str, - component_policy_states_resource: Union[str, _models.ComponentPolicyStatesResource], - top: Optional[int] = None, - order_by: Optional[str] = None, - select: Optional[str] = None, - from_parameter: Optional[datetime.datetime] = None, - to: Optional[datetime.datetime] = None, - filter: Optional[str] = None, - apply: Optional[str] = None, - expand: Optional[str] = None, - **kwargs: Any - ) -> _models.ComponentPolicyStatesQueryResults: - """Queries component policy states for the resource. - - :param resource_id: Resource ID. Required. - :type resource_id: str - :param component_policy_states_resource: The virtual resource under ComponentPolicyStates - resource type. In a given time range, 'latest' represents the latest component policy state(s). - "latest" Required. - :type component_policy_states_resource: str or - ~azure.mgmt.policyinsights.models.ComponentPolicyStatesResource - :param top: Maximum number of records to return. Default value is None. - :type top: int - :param order_by: Ordering expression using OData notation. One or more comma-separated column - names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, - ResourceId asc". Default value is None. - :type order_by: str - :param select: Select expression using OData notation. Limits the columns on each record to - just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Default value is None. - :type select: str - :param from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval - to query. When not specified, the service uses ($to - 1-day). Default value is None. - :type from_parameter: ~datetime.datetime - :param to: ISO 8601 formatted timestamp specifying the end time of the interval to query. When - not specified, the service uses request time. Default value is None. - :type to: ~datetime.datetime - :param filter: OData filter expression. Default value is None. - :type filter: str - :param apply: OData apply expression for aggregations. Default value is None. - :type apply: str - :param expand: The $expand query parameter. Default value is None. - :type expand: str - :return: ComponentPolicyStatesQueryResults or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.ComponentPolicyStatesQueryResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.ComponentPolicyStatesQueryResults] = kwargs.pop("cls", None) - - _request = build_list_query_results_for_resource_request( - resource_id=resource_id, - component_policy_states_resource=component_policy_states_resource, - top=top, - order_by=order_by, - select=select, - from_parameter=from_parameter, - to=to, - filter=filter, - apply=apply, - expand=expand, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ComponentPolicyStatesQueryResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def list_query_results_for_policy_definition( - self, - subscription_id: str, - policy_definition_name: str, - component_policy_states_resource: Union[str, _models.ComponentPolicyStatesResource], - top: Optional[int] = None, - order_by: Optional[str] = None, - select: Optional[str] = None, - from_parameter: Optional[datetime.datetime] = None, - to: Optional[datetime.datetime] = None, - filter: Optional[str] = None, - apply: Optional[str] = None, - **kwargs: Any - ) -> _models.ComponentPolicyStatesQueryResults: - """Queries component policy states for the subscription level policy definition. - - :param subscription_id: Microsoft Azure subscription ID. Required. - :type subscription_id: str - :param policy_definition_name: Policy definition name. Required. - :type policy_definition_name: str - :param component_policy_states_resource: The virtual resource under ComponentPolicyStates - resource type. In a given time range, 'latest' represents the latest component policy state(s). - "latest" Required. - :type component_policy_states_resource: str or - ~azure.mgmt.policyinsights.models.ComponentPolicyStatesResource - :param top: Maximum number of records to return. Default value is None. - :type top: int - :param order_by: Ordering expression using OData notation. One or more comma-separated column - names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, - ResourceId asc". Default value is None. - :type order_by: str - :param select: Select expression using OData notation. Limits the columns on each record to - just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Default value is None. - :type select: str - :param from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval - to query. When not specified, the service uses ($to - 1-day). Default value is None. - :type from_parameter: ~datetime.datetime - :param to: ISO 8601 formatted timestamp specifying the end time of the interval to query. When - not specified, the service uses request time. Default value is None. - :type to: ~datetime.datetime - :param filter: OData filter expression. Default value is None. - :type filter: str - :param apply: OData apply expression for aggregations. Default value is None. - :type apply: str - :return: ComponentPolicyStatesQueryResults or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.ComponentPolicyStatesQueryResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( - "authorization_namespace", "Microsoft.Authorization" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.ComponentPolicyStatesQueryResults] = kwargs.pop("cls", None) - - _request = build_list_query_results_for_policy_definition_request( - subscription_id=subscription_id, - policy_definition_name=policy_definition_name, - component_policy_states_resource=component_policy_states_resource, - top=top, - order_by=order_by, - select=select, - from_parameter=from_parameter, - to=to, - filter=filter, - apply=apply, - authorization_namespace=authorization_namespace, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ComponentPolicyStatesQueryResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def list_query_results_for_subscription_level_policy_assignment( # pylint: disable=name-too-long - self, - subscription_id: str, - policy_assignment_name: str, - component_policy_states_resource: Union[str, _models.ComponentPolicyStatesResource], - top: Optional[int] = None, - order_by: Optional[str] = None, - select: Optional[str] = None, - from_parameter: Optional[datetime.datetime] = None, - to: Optional[datetime.datetime] = None, - filter: Optional[str] = None, - apply: Optional[str] = None, - **kwargs: Any - ) -> _models.ComponentPolicyStatesQueryResults: - """Queries component policy states for the subscription level policy assignment. - - :param subscription_id: Microsoft Azure subscription ID. Required. - :type subscription_id: str - :param policy_assignment_name: Policy assignment name. Required. - :type policy_assignment_name: str - :param component_policy_states_resource: The virtual resource under ComponentPolicyStates - resource type. In a given time range, 'latest' represents the latest component policy state(s). - "latest" Required. - :type component_policy_states_resource: str or - ~azure.mgmt.policyinsights.models.ComponentPolicyStatesResource - :param top: Maximum number of records to return. Default value is None. - :type top: int - :param order_by: Ordering expression using OData notation. One or more comma-separated column - names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, - ResourceId asc". Default value is None. - :type order_by: str - :param select: Select expression using OData notation. Limits the columns on each record to - just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Default value is None. - :type select: str - :param from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval - to query. When not specified, the service uses ($to - 1-day). Default value is None. - :type from_parameter: ~datetime.datetime - :param to: ISO 8601 formatted timestamp specifying the end time of the interval to query. When - not specified, the service uses request time. Default value is None. - :type to: ~datetime.datetime - :param filter: OData filter expression. Default value is None. - :type filter: str - :param apply: OData apply expression for aggregations. Default value is None. - :type apply: str - :return: ComponentPolicyStatesQueryResults or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.ComponentPolicyStatesQueryResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( - "authorization_namespace", "Microsoft.Authorization" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.ComponentPolicyStatesQueryResults] = kwargs.pop("cls", None) - - _request = build_list_query_results_for_subscription_level_policy_assignment_request( - subscription_id=subscription_id, - policy_assignment_name=policy_assignment_name, - component_policy_states_resource=component_policy_states_resource, - top=top, - order_by=order_by, - select=select, - from_parameter=from_parameter, - to=to, - filter=filter, - apply=apply, - authorization_namespace=authorization_namespace, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ComponentPolicyStatesQueryResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def list_query_results_for_resource_group_level_policy_assignment( # pylint: disable=name-too-long - self, - subscription_id: str, - resource_group_name: str, - policy_assignment_name: str, - component_policy_states_resource: Union[str, _models.ComponentPolicyStatesResource], - top: Optional[int] = None, - order_by: Optional[str] = None, - select: Optional[str] = None, - from_parameter: Optional[datetime.datetime] = None, - to: Optional[datetime.datetime] = None, - filter: Optional[str] = None, - apply: Optional[str] = None, - **kwargs: Any - ) -> _models.ComponentPolicyStatesQueryResults: - """Queries component policy states for the resource group level policy assignment. - - :param subscription_id: Microsoft Azure subscription ID. Required. - :type subscription_id: str - :param resource_group_name: Resource group name. Required. - :type resource_group_name: str - :param policy_assignment_name: Policy assignment name. Required. - :type policy_assignment_name: str - :param component_policy_states_resource: The virtual resource under ComponentPolicyStates - resource type. In a given time range, 'latest' represents the latest component policy state(s). - "latest" Required. - :type component_policy_states_resource: str or - ~azure.mgmt.policyinsights.models.ComponentPolicyStatesResource - :param top: Maximum number of records to return. Default value is None. - :type top: int - :param order_by: Ordering expression using OData notation. One or more comma-separated column - names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, - ResourceId asc". Default value is None. - :type order_by: str - :param select: Select expression using OData notation. Limits the columns on each record to - just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Default value is None. - :type select: str - :param from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval - to query. When not specified, the service uses ($to - 1-day). Default value is None. - :type from_parameter: ~datetime.datetime - :param to: ISO 8601 formatted timestamp specifying the end time of the interval to query. When - not specified, the service uses request time. Default value is None. - :type to: ~datetime.datetime - :param filter: OData filter expression. Default value is None. - :type filter: str - :param apply: OData apply expression for aggregations. Default value is None. - :type apply: str - :return: ComponentPolicyStatesQueryResults or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.ComponentPolicyStatesQueryResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( - "authorization_namespace", "Microsoft.Authorization" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.ComponentPolicyStatesQueryResults] = kwargs.pop("cls", None) - - _request = build_list_query_results_for_resource_group_level_policy_assignment_request( - subscription_id=subscription_id, - resource_group_name=resource_group_name, - policy_assignment_name=policy_assignment_name, - component_policy_states_resource=component_policy_states_resource, - top=top, - order_by=order_by, - select=select, - from_parameter=from_parameter, - to=to, - filter=filter, - apply=apply, - authorization_namespace=authorization_namespace, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ComponentPolicyStatesQueryResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/aio/operations/_operations.py b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/aio/operations/_operations.py index d266dbe28254..eba51df33fff 100644 --- a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/aio/operations/_operations.py +++ b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/aio/operations/_operations.py @@ -1,35 +1,127 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from collections.abc import MutableMapping -from typing import Any, Callable, Dict, Optional, TypeVar +import datetime +from io import IOBase +import json +from typing import Any, AsyncIterator, Callable, IO, Literal, Optional, TypeVar, Union, cast, overload from azure.core import AsyncPipelineClient +from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, map_error, ) from azure.core.pipeline import PipelineResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize from ..._utils.serialization import Deserializer, Serializer -from ...operations._operations import build_list_request +from ...operations._operations import ( + build_attestations_create_or_update_at_resource_group_request, + build_attestations_create_or_update_at_resource_request, + build_attestations_create_or_update_at_subscription_request, + build_attestations_delete_at_resource_group_request, + build_attestations_delete_at_resource_request, + build_attestations_delete_at_subscription_request, + build_attestations_get_at_resource_group_request, + build_attestations_get_at_resource_request, + build_attestations_get_at_subscription_request, + build_attestations_list_for_resource_group_request, + build_attestations_list_for_resource_request, + build_attestations_list_for_subscription_request, + build_component_policy_states_list_query_results_for_policy_definition_request, + build_component_policy_states_list_query_results_for_resource_group_level_policy_assignment_request, + build_component_policy_states_list_query_results_for_resource_group_request, + build_component_policy_states_list_query_results_for_resource_request, + build_component_policy_states_list_query_results_for_subscription_level_policy_assignment_request, + build_component_policy_states_list_query_results_for_subscription_request, + build_operations_list_request, + build_policy_events_list_query_results_for_management_group_request, + build_policy_events_list_query_results_for_policy_definition_request, + build_policy_events_list_query_results_for_policy_set_definition_request, + build_policy_events_list_query_results_for_resource_group_level_policy_assignment_request, + build_policy_events_list_query_results_for_resource_group_request, + build_policy_events_list_query_results_for_resource_request, + build_policy_events_list_query_results_for_subscription_level_policy_assignment_request, + build_policy_events_list_query_results_for_subscription_request, + build_policy_metadata_get_resource_request, + build_policy_metadata_list_request, + build_policy_restrictions_check_at_management_group_scope_request, + build_policy_restrictions_check_at_resource_group_scope_request, + build_policy_restrictions_check_at_subscription_scope_request, + build_policy_states_list_query_results_for_management_group_request, + build_policy_states_list_query_results_for_policy_definition_request, + build_policy_states_list_query_results_for_policy_set_definition_request, + build_policy_states_list_query_results_for_resource_group_level_policy_assignment_request, + build_policy_states_list_query_results_for_resource_group_request, + build_policy_states_list_query_results_for_resource_request, + build_policy_states_list_query_results_for_subscription_level_policy_assignment_request, + build_policy_states_list_query_results_for_subscription_request, + build_policy_states_summarize_for_management_group_request, + build_policy_states_summarize_for_policy_definition_request, + build_policy_states_summarize_for_policy_set_definition_request, + build_policy_states_summarize_for_resource_group_level_policy_assignment_request, + build_policy_states_summarize_for_resource_group_request, + build_policy_states_summarize_for_resource_request, + build_policy_states_summarize_for_subscription_level_policy_assignment_request, + build_policy_states_summarize_for_subscription_request, + build_policy_states_trigger_resource_group_evaluation_request, + build_policy_states_trigger_subscription_evaluation_request, + build_policy_tracked_resources_list_query_results_for_management_group_request, + build_policy_tracked_resources_list_query_results_for_resource_group_request, + build_policy_tracked_resources_list_query_results_for_resource_request, + build_policy_tracked_resources_list_query_results_for_subscription_request, + build_remediations_cancel_at_management_group_request, + build_remediations_cancel_at_resource_group_request, + build_remediations_cancel_at_resource_request, + build_remediations_cancel_at_subscription_request, + build_remediations_create_or_update_at_management_group_request, + build_remediations_create_or_update_at_resource_group_request, + build_remediations_create_or_update_at_resource_request, + build_remediations_create_or_update_at_subscription_request, + build_remediations_delete_at_management_group_request, + build_remediations_delete_at_resource_group_request, + build_remediations_delete_at_resource_request, + build_remediations_delete_at_subscription_request, + build_remediations_get_at_management_group_request, + build_remediations_get_at_resource_group_request, + build_remediations_get_at_resource_request, + build_remediations_get_at_subscription_request, + build_remediations_list_deployments_at_management_group_request, + build_remediations_list_deployments_at_resource_group_request, + build_remediations_list_deployments_at_resource_request, + build_remediations_list_deployments_at_subscription_request, + build_remediations_list_for_management_group_request, + build_remediations_list_for_resource_group_request, + build_remediations_list_for_resource_request, + build_remediations_list_for_subscription_request, +) from .._configuration import PolicyInsightsClientConfiguration T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] +JSON = MutableMapping[str, Any] +List = list class Operations: @@ -42,8 +134,6 @@ class Operations: :attr:`operations` attribute. """ - models = _models - def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") @@ -55,7 +145,7 @@ def __init__(self, *args, **kwargs) -> None: async def list(self, **kwargs: Any) -> _models.OperationsListResults: """Lists available operations. - :return: OperationsListResults or the result of cls(response) + :return: OperationsListResults. The OperationsListResults is compatible with MutableMapping :rtype: ~azure.mgmt.policyinsights.models.OperationsListResults :raises ~azure.core.exceptions.HttpResponseError: """ @@ -73,14 +163,523 @@ async def list(self, **kwargs: Any) -> _models.OperationsListResults: api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) cls: ClsType[_models.OperationsListResults] = kwargs.pop("cls", None) - _request = build_list_request( + _request = build_operations_list_request( api_version=api_version, headers=_headers, params=_params, ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.OperationsListResults, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class RemediationsOperations: # pylint: disable=too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.policyinsights.aio.PolicyInsightsClient`'s + :attr:`remediations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: PolicyInsightsClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get_at_management_group( + self, management_group_id: str, remediation_name: str, **kwargs: Any + ) -> _models.Remediation: + """Gets an existing remediation at management group scope. + + :param management_group_id: Management group ID. Required. + :type management_group_id: str + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :return: Remediation. The Remediation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Remediation + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( + "management_groups_namespace", "Microsoft.Management" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[_models.Remediation] = kwargs.pop("cls", None) + + _request = build_remediations_get_at_management_group_request( + management_group_id=management_group_id, + remediation_name=remediation_name, + management_groups_namespace=management_groups_namespace, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Remediation, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update_at_management_group( + self, + management_group_id: str, + remediation_name: str, + parameters: _models.Remediation, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Remediation: + """Creates or updates a remediation at management group scope. + + :param management_group_id: Management group ID. Required. + :type management_group_id: str + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :param parameters: The remediation parameters. Required. + :type parameters: ~azure.mgmt.policyinsights.models.Remediation + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Remediation. The Remediation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Remediation + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update_at_management_group( + self, + management_group_id: str, + remediation_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Remediation: + """Creates or updates a remediation at management group scope. + + :param management_group_id: Management group ID. Required. + :type management_group_id: str + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :param parameters: The remediation parameters. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Remediation. The Remediation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Remediation + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update_at_management_group( + self, + management_group_id: str, + remediation_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Remediation: + """Creates or updates a remediation at management group scope. + + :param management_group_id: Management group ID. Required. + :type management_group_id: str + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :param parameters: The remediation parameters. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Remediation. The Remediation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Remediation + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update_at_management_group( + self, + management_group_id: str, + remediation_name: str, + parameters: Union[_models.Remediation, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.Remediation: + """Creates or updates a remediation at management group scope. + + :param management_group_id: Management group ID. Required. + :type management_group_id: str + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :param parameters: The remediation parameters. Is one of the following types: Remediation, + JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.policyinsights.models.Remediation or JSON or IO[bytes] + :return: Remediation. The Remediation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Remediation + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( + "management_groups_namespace", "Microsoft.Management" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Remediation] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_remediations_create_or_update_at_management_group_request( + management_group_id=management_group_id, + remediation_name=remediation_name, + management_groups_namespace=management_groups_namespace, + api_version=api_version, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Remediation, response.json()) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete_at_management_group( + self, management_group_id: str, remediation_name: str, **kwargs: Any + ) -> Optional[_models.Remediation]: + """Deletes an existing remediation at management group scope. + + :param management_group_id: Management group ID. Required. + :type management_group_id: str + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :return: Remediation or None. The Remediation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Remediation or None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( + "management_groups_namespace", "Microsoft.Management" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[Optional[_models.Remediation]] = kwargs.pop("cls", None) + + _request = build_remediations_delete_at_management_group_request( + management_group_id=management_group_id, + remediation_name=remediation_name, + management_groups_namespace=management_groups_namespace, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Remediation, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_for_management_group( + self, management_group_id: str, *, top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any + ) -> AsyncItemPaged["_models.Remediation"]: + """Gets all remediations for the management group. + + :param management_group_id: Management group ID. Required. + :type management_group_id: str + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :return: An iterator like instance of Remediation + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.Remediation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( + "management_groups_namespace", "Microsoft.Management" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[List[_models.Remediation]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_remediations_list_for_management_group_request( + management_group_id=management_group_id, + top=top, + filter=filter, + management_groups_namespace=management_groups_namespace, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Remediation], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get_at_subscription(self, remediation_name: str, **kwargs: Any) -> _models.Remediation: + """Gets an existing remediation at subscription scope. + + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :return: Remediation. The Remediation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Remediation + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[_models.Remediation] = kwargs.pop("cls", None) + + _request = build_remediations_get_at_subscription_request( + remediation_name=remediation_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -88,13 +687,8085 @@ async def list(self, **kwargs: Any) -> _models.OperationsListResults: response = pipeline_response.http_response if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("OperationsListResults", pipeline_response.http_response) + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Remediation, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore + + @overload + async def create_or_update_at_subscription( + self, + remediation_name: str, + parameters: _models.Remediation, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Remediation: + """Creates or updates a remediation at subscription scope. + + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :param parameters: The remediation parameters. Required. + :type parameters: ~azure.mgmt.policyinsights.models.Remediation + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Remediation. The Remediation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Remediation + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update_at_subscription( + self, remediation_name: str, parameters: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Remediation: + """Creates or updates a remediation at subscription scope. + + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :param parameters: The remediation parameters. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Remediation. The Remediation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Remediation + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update_at_subscription( + self, remediation_name: str, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Remediation: + """Creates or updates a remediation at subscription scope. + + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :param parameters: The remediation parameters. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Remediation. The Remediation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Remediation + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update_at_subscription( + self, remediation_name: str, parameters: Union[_models.Remediation, JSON, IO[bytes]], **kwargs: Any + ) -> _models.Remediation: + """Creates or updates a remediation at subscription scope. + + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :param parameters: The remediation parameters. Is one of the following types: Remediation, + JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.policyinsights.models.Remediation or JSON or IO[bytes] + :return: Remediation. The Remediation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Remediation + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Remediation] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_remediations_create_or_update_at_subscription_request( + remediation_name=remediation_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Remediation, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete_at_subscription(self, remediation_name: str, **kwargs: Any) -> Optional[_models.Remediation]: + """Deletes an existing remediation at subscription scope. + + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :return: Remediation or None. The Remediation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Remediation or None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[Optional[_models.Remediation]] = kwargs.pop("cls", None) + + _request = build_remediations_delete_at_subscription_request( + remediation_name=remediation_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Remediation, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_for_subscription( + self, *, top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any + ) -> AsyncItemPaged["_models.Remediation"]: + """Gets all remediations for the subscription. + + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :return: An iterator like instance of Remediation + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.Remediation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[List[_models.Remediation]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_remediations_list_for_subscription_request( + subscription_id=self._config.subscription_id, + top=top, + filter=filter, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Remediation], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_deployments_at_subscription( + self, remediation_name: str, *, top: Optional[int] = None, **kwargs: Any + ) -> AsyncItemPaged["_models.RemediationDeployment"]: + """Gets all deployments for a remediation at subscription scope. + + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :return: An iterator like instance of RemediationDeployment + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.RemediationDeployment] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[List[_models.RemediationDeployment]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_remediations_list_deployments_at_subscription_request( + remediation_name=remediation_name, + subscription_id=self._config.subscription_id, + top=top, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.RemediationDeployment], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def cancel_at_subscription(self, remediation_name: str, **kwargs: Any) -> _models.Remediation: + """Cancels a remediation at subscription scope. + + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :return: Remediation. The Remediation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Remediation + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[_models.Remediation] = kwargs.pop("cls", None) + + _request = build_remediations_cancel_at_subscription_request( + remediation_name=remediation_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Remediation, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_at_resource_group( + self, resource_group_name: str, remediation_name: str, **kwargs: Any + ) -> _models.Remediation: + """Gets an existing remediation at resource group scope. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :return: Remediation. The Remediation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Remediation + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[_models.Remediation] = kwargs.pop("cls", None) + + _request = build_remediations_get_at_resource_group_request( + resource_group_name=resource_group_name, + remediation_name=remediation_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Remediation, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update_at_resource_group( + self, + resource_group_name: str, + remediation_name: str, + parameters: _models.Remediation, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Remediation: + """Creates or updates a remediation at resource group scope. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :param parameters: The remediation parameters. Required. + :type parameters: ~azure.mgmt.policyinsights.models.Remediation + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Remediation. The Remediation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Remediation + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update_at_resource_group( + self, + resource_group_name: str, + remediation_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Remediation: + """Creates or updates a remediation at resource group scope. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :param parameters: The remediation parameters. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Remediation. The Remediation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Remediation + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update_at_resource_group( + self, + resource_group_name: str, + remediation_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Remediation: + """Creates or updates a remediation at resource group scope. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :param parameters: The remediation parameters. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Remediation. The Remediation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Remediation + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update_at_resource_group( + self, + resource_group_name: str, + remediation_name: str, + parameters: Union[_models.Remediation, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.Remediation: + """Creates or updates a remediation at resource group scope. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :param parameters: The remediation parameters. Is one of the following types: Remediation, + JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.policyinsights.models.Remediation or JSON or IO[bytes] + :return: Remediation. The Remediation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Remediation + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Remediation] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_remediations_create_or_update_at_resource_group_request( + resource_group_name=resource_group_name, + remediation_name=remediation_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Remediation, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete_at_resource_group( + self, resource_group_name: str, remediation_name: str, **kwargs: Any + ) -> Optional[_models.Remediation]: + """Deletes an existing remediation at resource group scope. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :return: Remediation or None. The Remediation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Remediation or None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[Optional[_models.Remediation]] = kwargs.pop("cls", None) + + _request = build_remediations_delete_at_resource_group_request( + resource_group_name=resource_group_name, + remediation_name=remediation_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Remediation, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_for_resource_group( + self, resource_group_name: str, *, top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any + ) -> AsyncItemPaged["_models.Remediation"]: + """Gets all remediations for the subscription. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :return: An iterator like instance of Remediation + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.Remediation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[List[_models.Remediation]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_remediations_list_for_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + top=top, + filter=filter, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Remediation], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_deployments_at_resource_group( + self, resource_group_name: str, remediation_name: str, *, top: Optional[int] = None, **kwargs: Any + ) -> AsyncItemPaged["_models.RemediationDeployment"]: + """Gets all deployments for a remediation at resource group scope. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :return: An iterator like instance of RemediationDeployment + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.RemediationDeployment] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[List[_models.RemediationDeployment]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_remediations_list_deployments_at_resource_group_request( + resource_group_name=resource_group_name, + remediation_name=remediation_name, + subscription_id=self._config.subscription_id, + top=top, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.RemediationDeployment], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def cancel_at_resource_group( + self, resource_group_name: str, remediation_name: str, **kwargs: Any + ) -> _models.Remediation: + """Cancels a remediation at resource group scope. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :return: Remediation. The Remediation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Remediation + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[_models.Remediation] = kwargs.pop("cls", None) + + _request = build_remediations_cancel_at_resource_group_request( + resource_group_name=resource_group_name, + remediation_name=remediation_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Remediation, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_at_resource(self, resource_id: str, remediation_name: str, **kwargs: Any) -> _models.Remediation: + """Gets an existing remediation at resource scope. + + :param resource_id: Resource ID. Required. + :type resource_id: str + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :return: Remediation. The Remediation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Remediation + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[_models.Remediation] = kwargs.pop("cls", None) + + _request = build_remediations_get_at_resource_request( + resource_id=resource_id, + remediation_name=remediation_name, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Remediation, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update_at_resource( + self, + resource_id: str, + remediation_name: str, + parameters: _models.Remediation, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Remediation: + """Creates or updates a remediation at resource scope. + + :param resource_id: Resource ID. Required. + :type resource_id: str + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :param parameters: The remediation parameters. Required. + :type parameters: ~azure.mgmt.policyinsights.models.Remediation + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Remediation. The Remediation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Remediation + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update_at_resource( + self, + resource_id: str, + remediation_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Remediation: + """Creates or updates a remediation at resource scope. + + :param resource_id: Resource ID. Required. + :type resource_id: str + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :param parameters: The remediation parameters. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Remediation. The Remediation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Remediation + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update_at_resource( + self, + resource_id: str, + remediation_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Remediation: + """Creates or updates a remediation at resource scope. + + :param resource_id: Resource ID. Required. + :type resource_id: str + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :param parameters: The remediation parameters. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Remediation. The Remediation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Remediation + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update_at_resource( + self, + resource_id: str, + remediation_name: str, + parameters: Union[_models.Remediation, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.Remediation: + """Creates or updates a remediation at resource scope. + + :param resource_id: Resource ID. Required. + :type resource_id: str + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :param parameters: The remediation parameters. Is one of the following types: Remediation, + JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.policyinsights.models.Remediation or JSON or IO[bytes] + :return: Remediation. The Remediation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Remediation + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Remediation] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_remediations_create_or_update_at_resource_request( + resource_id=resource_id, + remediation_name=remediation_name, + api_version=api_version, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Remediation, response.json()) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete_at_resource( + self, resource_id: str, remediation_name: str, **kwargs: Any + ) -> Optional[_models.Remediation]: + """Deletes an existing remediation at individual resource scope. + + :param resource_id: Resource ID. Required. + :type resource_id: str + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :return: Remediation or None. The Remediation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Remediation or None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[Optional[_models.Remediation]] = kwargs.pop("cls", None) + + _request = build_remediations_delete_at_resource_request( + resource_id=resource_id, + remediation_name=remediation_name, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Remediation, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_for_resource( + self, resource_id: str, *, top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any + ) -> AsyncItemPaged["_models.Remediation"]: + """Gets all remediations for a resource. + + :param resource_id: Resource ID. Required. + :type resource_id: str + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :return: An iterator like instance of Remediation + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.Remediation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[List[_models.Remediation]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_remediations_list_for_resource_request( + resource_id=resource_id, + top=top, + filter=filter, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Remediation], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_deployments_at_resource( + self, resource_id: str, remediation_name: str, *, top: Optional[int] = None, **kwargs: Any + ) -> AsyncItemPaged["_models.RemediationDeployment"]: + """Gets all deployments for a remediation at resource scope. + + :param resource_id: Resource ID. Required. + :type resource_id: str + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :return: An iterator like instance of RemediationDeployment + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.RemediationDeployment] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[List[_models.RemediationDeployment]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_remediations_list_deployments_at_resource_request( + resource_id=resource_id, + remediation_name=remediation_name, + top=top, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.RemediationDeployment], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def cancel_at_resource(self, resource_id: str, remediation_name: str, **kwargs: Any) -> _models.Remediation: + """Cancel a remediation at resource scope. + + :param resource_id: Resource ID. Required. + :type resource_id: str + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :return: Remediation. The Remediation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Remediation + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[_models.Remediation] = kwargs.pop("cls", None) + + _request = build_remediations_cancel_at_resource_request( + resource_id=resource_id, + remediation_name=remediation_name, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Remediation, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_deployments_at_management_group( + self, management_group_id: str, remediation_name: str, *, top: Optional[int] = None, **kwargs: Any + ) -> AsyncItemPaged["_models.RemediationDeployment"]: + """Gets all deployments for a remediation at management group scope. + + :param management_group_id: Management group ID. Required. + :type management_group_id: str + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :return: An iterator like instance of RemediationDeployment + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.RemediationDeployment] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( + "management_groups_namespace", "Microsoft.Management" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[List[_models.RemediationDeployment]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_remediations_list_deployments_at_management_group_request( + management_group_id=management_group_id, + remediation_name=remediation_name, + top=top, + management_groups_namespace=management_groups_namespace, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.RemediationDeployment], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def cancel_at_management_group( + self, management_group_id: str, remediation_name: str, **kwargs: Any + ) -> _models.Remediation: + """Cancels a remediation at management group scope. + + :param management_group_id: Management group ID. Required. + :type management_group_id: str + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :return: Remediation. The Remediation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Remediation + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( + "management_groups_namespace", "Microsoft.Management" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[_models.Remediation] = kwargs.pop("cls", None) + + _request = build_remediations_cancel_at_management_group_request( + management_group_id=management_group_id, + remediation_name=remediation_name, + management_groups_namespace=management_groups_namespace, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Remediation, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class AttestationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.policyinsights.aio.PolicyInsightsClient`'s + :attr:`attestations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: PolicyInsightsClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get_at_subscription(self, attestation_name: str, **kwargs: Any) -> _models.Attestation: + """Gets an existing attestation at subscription scope. + + :param attestation_name: The name of the attestation. Required. + :type attestation_name: str + :return: Attestation. The Attestation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Attestation + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[_models.Attestation] = kwargs.pop("cls", None) + + _request = build_attestations_get_at_subscription_request( + attestation_name=attestation_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Attestation, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_at_subscription_initial( # pylint: disable=name-too-long + self, attestation_name: str, parameters: Union[_models.Attestation, JSON, IO[bytes]], **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_attestations_create_or_update_at_subscription_request( + attestation_name=attestation_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update_at_subscription( + self, + attestation_name: str, + parameters: _models.Attestation, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Attestation]: + """Creates or updates an attestation at subscription scope. + + :param attestation_name: The name of the attestation. Required. + :type attestation_name: str + :param parameters: The attestation parameters. Required. + :type parameters: ~azure.mgmt.policyinsights.models.Attestation + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Attestation. The Attestation is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.policyinsights.models.Attestation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update_at_subscription( + self, attestation_name: str, parameters: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> AsyncLROPoller[_models.Attestation]: + """Creates or updates an attestation at subscription scope. + + :param attestation_name: The name of the attestation. Required. + :type attestation_name: str + :param parameters: The attestation parameters. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Attestation. The Attestation is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.policyinsights.models.Attestation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update_at_subscription( + self, attestation_name: str, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> AsyncLROPoller[_models.Attestation]: + """Creates or updates an attestation at subscription scope. + + :param attestation_name: The name of the attestation. Required. + :type attestation_name: str + :param parameters: The attestation parameters. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Attestation. The Attestation is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.policyinsights.models.Attestation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update_at_subscription( + self, attestation_name: str, parameters: Union[_models.Attestation, JSON, IO[bytes]], **kwargs: Any + ) -> AsyncLROPoller[_models.Attestation]: + """Creates or updates an attestation at subscription scope. + + :param attestation_name: The name of the attestation. Required. + :type attestation_name: str + :param parameters: The attestation parameters. Is one of the following types: Attestation, + JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.policyinsights.models.Attestation or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns Attestation. The Attestation is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.policyinsights.models.Attestation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Attestation] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_at_subscription_initial( + attestation_name=attestation_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Attestation, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.Attestation].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Attestation]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace_async + async def delete_at_subscription(self, attestation_name: str, **kwargs: Any) -> None: + """Deletes an existing attestation at subscription scope. + + :param attestation_name: The name of the attestation. Required. + :type attestation_name: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_attestations_delete_at_subscription_request( + attestation_name=attestation_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_for_subscription( + self, *, top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any + ) -> AsyncItemPaged["_models.Attestation"]: + """Gets all attestations for the subscription. + + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :return: An iterator like instance of Attestation + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.Attestation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[List[_models.Attestation]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_attestations_list_for_subscription_request( + subscription_id=self._config.subscription_id, + top=top, + filter=filter, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Attestation], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get_at_resource_group( + self, resource_group_name: str, attestation_name: str, **kwargs: Any + ) -> _models.Attestation: + """Gets an existing attestation at resource group scope. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param attestation_name: The name of the attestation. Required. + :type attestation_name: str + :return: Attestation. The Attestation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Attestation + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[_models.Attestation] = kwargs.pop("cls", None) + + _request = build_attestations_get_at_resource_group_request( + resource_group_name=resource_group_name, + attestation_name=attestation_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Attestation, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_at_resource_group_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + attestation_name: str, + parameters: Union[_models.Attestation, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_attestations_create_or_update_at_resource_group_request( + resource_group_name=resource_group_name, + attestation_name=attestation_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update_at_resource_group( + self, + resource_group_name: str, + attestation_name: str, + parameters: _models.Attestation, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Attestation]: + """Creates or updates an attestation at resource group scope. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param attestation_name: The name of the attestation. Required. + :type attestation_name: str + :param parameters: The attestation parameters. Required. + :type parameters: ~azure.mgmt.policyinsights.models.Attestation + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Attestation. The Attestation is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.policyinsights.models.Attestation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update_at_resource_group( + self, + resource_group_name: str, + attestation_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Attestation]: + """Creates or updates an attestation at resource group scope. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param attestation_name: The name of the attestation. Required. + :type attestation_name: str + :param parameters: The attestation parameters. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Attestation. The Attestation is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.policyinsights.models.Attestation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update_at_resource_group( + self, + resource_group_name: str, + attestation_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Attestation]: + """Creates or updates an attestation at resource group scope. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param attestation_name: The name of the attestation. Required. + :type attestation_name: str + :param parameters: The attestation parameters. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Attestation. The Attestation is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.policyinsights.models.Attestation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update_at_resource_group( + self, + resource_group_name: str, + attestation_name: str, + parameters: Union[_models.Attestation, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.Attestation]: + """Creates or updates an attestation at resource group scope. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param attestation_name: The name of the attestation. Required. + :type attestation_name: str + :param parameters: The attestation parameters. Is one of the following types: Attestation, + JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.policyinsights.models.Attestation or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns Attestation. The Attestation is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.policyinsights.models.Attestation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Attestation] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_at_resource_group_initial( + resource_group_name=resource_group_name, + attestation_name=attestation_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Attestation, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.Attestation].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Attestation]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace_async + async def delete_at_resource_group(self, resource_group_name: str, attestation_name: str, **kwargs: Any) -> None: + """Deletes an existing attestation at resource group scope. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param attestation_name: The name of the attestation. Required. + :type attestation_name: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_attestations_delete_at_resource_group_request( + resource_group_name=resource_group_name, + attestation_name=attestation_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_for_resource_group( + self, resource_group_name: str, *, top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any + ) -> AsyncItemPaged["_models.Attestation"]: + """Gets all attestations for the resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :return: An iterator like instance of Attestation + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.Attestation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[List[_models.Attestation]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_attestations_list_for_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + top=top, + filter=filter, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Attestation], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get_at_resource(self, resource_id: str, attestation_name: str, **kwargs: Any) -> _models.Attestation: + """Gets an existing attestation at resource scope. + + :param resource_id: Resource ID. Required. + :type resource_id: str + :param attestation_name: The name of the attestation. Required. + :type attestation_name: str + :return: Attestation. The Attestation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Attestation + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[_models.Attestation] = kwargs.pop("cls", None) + + _request = build_attestations_get_at_resource_request( + resource_id=resource_id, + attestation_name=attestation_name, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Attestation, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_at_resource_initial( + self, + resource_id: str, + attestation_name: str, + parameters: Union[_models.Attestation, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_attestations_create_or_update_at_resource_request( + resource_id=resource_id, + attestation_name=attestation_name, + api_version=api_version, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update_at_resource( + self, + resource_id: str, + attestation_name: str, + parameters: _models.Attestation, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Attestation]: + """Creates or updates an attestation at resource scope. + + :param resource_id: Resource ID. Required. + :type resource_id: str + :param attestation_name: The name of the attestation. Required. + :type attestation_name: str + :param parameters: The attestation parameters. Required. + :type parameters: ~azure.mgmt.policyinsights.models.Attestation + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Attestation. The Attestation is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.policyinsights.models.Attestation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update_at_resource( + self, + resource_id: str, + attestation_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Attestation]: + """Creates or updates an attestation at resource scope. + + :param resource_id: Resource ID. Required. + :type resource_id: str + :param attestation_name: The name of the attestation. Required. + :type attestation_name: str + :param parameters: The attestation parameters. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Attestation. The Attestation is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.policyinsights.models.Attestation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update_at_resource( + self, + resource_id: str, + attestation_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Attestation]: + """Creates or updates an attestation at resource scope. + + :param resource_id: Resource ID. Required. + :type resource_id: str + :param attestation_name: The name of the attestation. Required. + :type attestation_name: str + :param parameters: The attestation parameters. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Attestation. The Attestation is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.policyinsights.models.Attestation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update_at_resource( + self, + resource_id: str, + attestation_name: str, + parameters: Union[_models.Attestation, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.Attestation]: + """Creates or updates an attestation at resource scope. + + :param resource_id: Resource ID. Required. + :type resource_id: str + :param attestation_name: The name of the attestation. Required. + :type attestation_name: str + :param parameters: The attestation parameters. Is one of the following types: Attestation, + JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.policyinsights.models.Attestation or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns Attestation. The Attestation is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.policyinsights.models.Attestation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Attestation] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_at_resource_initial( + resource_id=resource_id, + attestation_name=attestation_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Attestation, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.Attestation].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Attestation]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace_async + async def delete_at_resource(self, resource_id: str, attestation_name: str, **kwargs: Any) -> None: + """Deletes an existing attestation at individual resource scope. + + :param resource_id: Resource ID. Required. + :type resource_id: str + :param attestation_name: The name of the attestation. Required. + :type attestation_name: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_attestations_delete_at_resource_request( + resource_id=resource_id, + attestation_name=attestation_name, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_for_resource( + self, resource_id: str, *, top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any + ) -> AsyncItemPaged["_models.Attestation"]: + """Gets all attestations for a resource. + + :param resource_id: Resource ID. Required. + :type resource_id: str + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :return: An iterator like instance of Attestation + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.Attestation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[List[_models.Attestation]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_attestations_list_for_resource_request( + resource_id=resource_id, + top=top, + filter=filter, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Attestation], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class PolicyMetadataOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.policyinsights.aio.PolicyInsightsClient`'s + :attr:`policy_metadata` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: PolicyInsightsClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get_resource(self, resource_name: str, **kwargs: Any) -> _models.PolicyMetadata: + """Get policy metadata resource. + + :param resource_name: The name of the policy metadata resource. Required. + :type resource_name: str + :return: PolicyMetadata. The PolicyMetadata is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.PolicyMetadata + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[_models.PolicyMetadata] = kwargs.pop("cls", None) + + _request = build_policy_metadata_get_resource_request( + resource_name=resource_name, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.PolicyMetadata, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list(self, *, top: Optional[int] = None, **kwargs: Any) -> AsyncItemPaged["_models.SlimPolicyMetadata"]: + """Get a list of the policy metadata resources. + + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :return: An iterator like instance of SlimPolicyMetadata + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.SlimPolicyMetadata] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[List[_models.SlimPolicyMetadata]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_policy_metadata_list_request( + top=top, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SlimPolicyMetadata], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class PolicyEventsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.policyinsights.aio.PolicyInsightsClient`'s + :attr:`policy_events` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: PolicyInsightsClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_query_results_for_management_group( # pylint: disable=too-many-locals + self, + policy_events_resource: Union[str, _models.PolicyEventsResourceType], + management_group_name: str, + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.PolicyEvent"]: + """Queries policy events for the resources under the management group. + + :param policy_events_resource: The name of the virtual resource under PolicyEvents resource + type; only "default" is allowed. "default" Required. + :type policy_events_resource: str or ~azure.mgmt.policyinsights.models.PolicyEventsResourceType + :param management_group_name: Management group name. Required. + :type management_group_name: str + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword order_by: Ordering expression using OData notation. One or more comma-separated column + names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, + ResourceId asc". Default value is None. + :paramtype order_by: str + :keyword select: Select expression using OData notation. Limits the columns on each record to + just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Default value is None. + :paramtype select: str + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :keyword apply: OData apply expression for aggregations. Default value is None. + :paramtype apply: str + :keyword skip_token: Skiptoken is only provided if a previous response returned a partial + result as a part of nextLink element. Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of PolicyEvent + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.PolicyEvent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( + "management_groups_namespace", "Microsoft.Management" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[List[_models.PolicyEvent]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_policy_events_list_query_results_for_management_group_request( + policy_events_resource=policy_events_resource, + management_group_name=management_group_name, + top=top, + order_by=order_by, + select=select, + from_parameter=from_parameter, + to=to, + filter=filter, + apply=apply, + skip_token=skip_token, + management_groups_namespace=management_groups_namespace, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.PolicyEvent], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("@odata.nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_query_results_for_subscription( + self, + policy_events_resource: Union[str, _models.PolicyEventsResourceType], + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.PolicyEvent"]: + """Queries policy events for the resources under the subscription. + + :param policy_events_resource: The name of the virtual resource under PolicyEvents resource + type; only "default" is allowed. "default" Required. + :type policy_events_resource: str or ~azure.mgmt.policyinsights.models.PolicyEventsResourceType + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword order_by: Ordering expression using OData notation. One or more comma-separated column + names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, + ResourceId asc". Default value is None. + :paramtype order_by: str + :keyword select: Select expression using OData notation. Limits the columns on each record to + just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Default value is None. + :paramtype select: str + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :keyword apply: OData apply expression for aggregations. Default value is None. + :paramtype apply: str + :keyword skip_token: Skiptoken is only provided if a previous response returned a partial + result as a part of nextLink element. Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of PolicyEvent + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.PolicyEvent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[List[_models.PolicyEvent]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_policy_events_list_query_results_for_subscription_request( + policy_events_resource=policy_events_resource, + subscription_id=self._config.subscription_id, + top=top, + order_by=order_by, + select=select, + from_parameter=from_parameter, + to=to, + filter=filter, + apply=apply, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.PolicyEvent], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("@odata.nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_query_results_for_resource_group( + self, + resource_group_name: str, + policy_events_resource: Union[str, _models.PolicyEventsResourceType], + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.PolicyEvent"]: + """Queries policy events for the resources under the resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param policy_events_resource: The name of the virtual resource under PolicyEvents resource + type; only "default" is allowed. "default" Required. + :type policy_events_resource: str or ~azure.mgmt.policyinsights.models.PolicyEventsResourceType + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword order_by: Ordering expression using OData notation. One or more comma-separated column + names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, + ResourceId asc". Default value is None. + :paramtype order_by: str + :keyword select: Select expression using OData notation. Limits the columns on each record to + just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Default value is None. + :paramtype select: str + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :keyword apply: OData apply expression for aggregations. Default value is None. + :paramtype apply: str + :keyword skip_token: Skiptoken is only provided if a previous response returned a partial + result as a part of nextLink element. Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of PolicyEvent + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.PolicyEvent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[List[_models.PolicyEvent]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_policy_events_list_query_results_for_resource_group_request( + resource_group_name=resource_group_name, + policy_events_resource=policy_events_resource, + subscription_id=self._config.subscription_id, + top=top, + order_by=order_by, + select=select, + from_parameter=from_parameter, + to=to, + filter=filter, + apply=apply, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.PolicyEvent], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("@odata.nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_query_results_for_resource( # pylint: disable=too-many-locals + self, + policy_events_resource: Union[str, _models.PolicyEventsResourceType], + resource_id: str, + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + expand: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.PolicyEvent"]: + """Queries policy events for the resource. + + :param policy_events_resource: The name of the virtual resource under PolicyEvents resource + type; only "default" is allowed. "default" Required. + :type policy_events_resource: str or ~azure.mgmt.policyinsights.models.PolicyEventsResourceType + :param resource_id: Resource ID. Required. + :type resource_id: str + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword order_by: Ordering expression using OData notation. One or more comma-separated column + names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, + ResourceId asc". Default value is None. + :paramtype order_by: str + :keyword select: Select expression using OData notation. Limits the columns on each record to + just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Default value is None. + :paramtype select: str + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :keyword apply: OData apply expression for aggregations. Default value is None. + :paramtype apply: str + :keyword expand: The $expand query parameter. For example, to expand components use + $expand=components. Default value is None. + :paramtype expand: str + :keyword skip_token: Skiptoken is only provided if a previous response returned a partial + result as a part of nextLink element. Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of PolicyEvent + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.PolicyEvent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[List[_models.PolicyEvent]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_policy_events_list_query_results_for_resource_request( + policy_events_resource=policy_events_resource, + resource_id=resource_id, + top=top, + order_by=order_by, + select=select, + from_parameter=from_parameter, + to=to, + filter=filter, + apply=apply, + expand=expand, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.PolicyEvent], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("@odata.nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_query_results_for_policy_set_definition( # pylint: disable=name-too-long,too-many-locals + self, + policy_events_resource: Union[str, _models.PolicyEventsResourceType], + policy_set_definition_name: str, + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.PolicyEvent"]: + """Queries policy events for the subscription level policy set definition. + + :param policy_events_resource: The name of the virtual resource under PolicyEvents resource + type; only "default" is allowed. "default" Required. + :type policy_events_resource: str or ~azure.mgmt.policyinsights.models.PolicyEventsResourceType + :param policy_set_definition_name: Policy set definition name. Required. + :type policy_set_definition_name: str + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword order_by: Ordering expression using OData notation. One or more comma-separated column + names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, + ResourceId asc". Default value is None. + :paramtype order_by: str + :keyword select: Select expression using OData notation. Limits the columns on each record to + just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Default value is None. + :paramtype select: str + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :keyword apply: OData apply expression for aggregations. Default value is None. + :paramtype apply: str + :keyword skip_token: Skiptoken is only provided if a previous response returned a partial + result as a part of nextLink element. Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of PolicyEvent + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.PolicyEvent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( + "authorization_namespace", "Microsoft.Authorization" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[List[_models.PolicyEvent]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_policy_events_list_query_results_for_policy_set_definition_request( + policy_events_resource=policy_events_resource, + policy_set_definition_name=policy_set_definition_name, + subscription_id=self._config.subscription_id, + top=top, + order_by=order_by, + select=select, + from_parameter=from_parameter, + to=to, + filter=filter, + apply=apply, + skip_token=skip_token, + authorization_namespace=authorization_namespace, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.PolicyEvent], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("@odata.nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_query_results_for_policy_definition( # pylint: disable=too-many-locals + self, + policy_events_resource: Union[str, _models.PolicyEventsResourceType], + policy_definition_name: str, + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.PolicyEvent"]: + """Queries policy events for the subscription level policy definition. + + :param policy_events_resource: The name of the virtual resource under PolicyEvents resource + type; only "default" is allowed. "default" Required. + :type policy_events_resource: str or ~azure.mgmt.policyinsights.models.PolicyEventsResourceType + :param policy_definition_name: Policy definition name. Required. + :type policy_definition_name: str + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword order_by: Ordering expression using OData notation. One or more comma-separated column + names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, + ResourceId asc". Default value is None. + :paramtype order_by: str + :keyword select: Select expression using OData notation. Limits the columns on each record to + just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Default value is None. + :paramtype select: str + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :keyword apply: OData apply expression for aggregations. Default value is None. + :paramtype apply: str + :keyword skip_token: Skiptoken is only provided if a previous response returned a partial + result as a part of nextLink element. Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of PolicyEvent + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.PolicyEvent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( + "authorization_namespace", "Microsoft.Authorization" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[List[_models.PolicyEvent]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_policy_events_list_query_results_for_policy_definition_request( + policy_events_resource=policy_events_resource, + policy_definition_name=policy_definition_name, + subscription_id=self._config.subscription_id, + top=top, + order_by=order_by, + select=select, + from_parameter=from_parameter, + to=to, + filter=filter, + apply=apply, + skip_token=skip_token, + authorization_namespace=authorization_namespace, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.PolicyEvent], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("@odata.nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_query_results_for_subscription_level_policy_assignment( # pylint: disable=name-too-long,too-many-locals + self, + policy_events_resource: Union[str, _models.PolicyEventsResourceType], + policy_assignment_name: str, + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.PolicyEvent"]: + """Queries policy events for the subscription level policy assignment. + + :param policy_events_resource: The name of the virtual resource under PolicyEvents resource + type; only "default" is allowed. "default" Required. + :type policy_events_resource: str or ~azure.mgmt.policyinsights.models.PolicyEventsResourceType + :param policy_assignment_name: Policy assignment name. Required. + :type policy_assignment_name: str + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword order_by: Ordering expression using OData notation. One or more comma-separated column + names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, + ResourceId asc". Default value is None. + :paramtype order_by: str + :keyword select: Select expression using OData notation. Limits the columns on each record to + just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Default value is None. + :paramtype select: str + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :keyword apply: OData apply expression for aggregations. Default value is None. + :paramtype apply: str + :keyword skip_token: Skiptoken is only provided if a previous response returned a partial + result as a part of nextLink element. Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of PolicyEvent + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.PolicyEvent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( + "authorization_namespace", "Microsoft.Authorization" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[List[_models.PolicyEvent]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_policy_events_list_query_results_for_subscription_level_policy_assignment_request( + policy_events_resource=policy_events_resource, + policy_assignment_name=policy_assignment_name, + subscription_id=self._config.subscription_id, + top=top, + order_by=order_by, + select=select, + from_parameter=from_parameter, + to=to, + filter=filter, + apply=apply, + skip_token=skip_token, + authorization_namespace=authorization_namespace, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.PolicyEvent], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("@odata.nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_query_results_for_resource_group_level_policy_assignment( # pylint: disable=name-too-long,too-many-locals + self, + resource_group_name: str, + policy_events_resource: Union[str, _models.PolicyEventsResourceType], + policy_assignment_name: str, + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.PolicyEvent"]: + """Queries policy events for the resource group level policy assignment. + + :param resource_group_name: Resource group name. Required. + :type resource_group_name: str + :param policy_events_resource: The name of the virtual resource under PolicyEvents resource + type; only "default" is allowed. "default" Required. + :type policy_events_resource: str or ~azure.mgmt.policyinsights.models.PolicyEventsResourceType + :param policy_assignment_name: Policy assignment name. Required. + :type policy_assignment_name: str + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword order_by: Ordering expression using OData notation. One or more comma-separated column + names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, + ResourceId asc". Default value is None. + :paramtype order_by: str + :keyword select: Select expression using OData notation. Limits the columns on each record to + just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Default value is None. + :paramtype select: str + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :keyword apply: OData apply expression for aggregations. Default value is None. + :paramtype apply: str + :keyword skip_token: Skiptoken is only provided if a previous response returned a partial + result as a part of nextLink element. Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of PolicyEvent + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.PolicyEvent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( + "authorization_namespace", "Microsoft.Authorization" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[List[_models.PolicyEvent]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_policy_events_list_query_results_for_resource_group_level_policy_assignment_request( + resource_group_name=resource_group_name, + policy_events_resource=policy_events_resource, + policy_assignment_name=policy_assignment_name, + subscription_id=self._config.subscription_id, + top=top, + order_by=order_by, + select=select, + from_parameter=from_parameter, + to=to, + filter=filter, + apply=apply, + skip_token=skip_token, + authorization_namespace=authorization_namespace, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.PolicyEvent], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("@odata.nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class PolicyStatesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.policyinsights.aio.PolicyInsightsClient`'s + :attr:`policy_states` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: PolicyInsightsClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_query_results_for_management_group( # pylint: disable=too-many-locals + self, + policy_states_resource: Union[str, _models.PolicyStatesResource], + management_group_name: str, + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.PolicyState"]: + """Queries policy states for the resources under the management group. + + :param policy_states_resource: The virtual resource under PolicyStates resource type. In a + given time range, 'latest' represents the latest policy state(s), whereas 'default' represents + all policy state(s). Known values are: "default" and "latest". Required. + :type policy_states_resource: str or ~azure.mgmt.policyinsights.models.PolicyStatesResource + :param management_group_name: Management group name. Required. + :type management_group_name: str + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword order_by: Ordering expression using OData notation. One or more comma-separated column + names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, + ResourceId asc". Default value is None. + :paramtype order_by: str + :keyword select: Select expression using OData notation. Limits the columns on each record to + just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Default value is None. + :paramtype select: str + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :keyword apply: OData apply expression for aggregations. Default value is None. + :paramtype apply: str + :keyword skip_token: Skiptoken is only provided if a previous response returned a partial + result as a part of nextLink element. Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of PolicyState + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.PolicyState] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( + "management_groups_namespace", "Microsoft.Management" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[List[_models.PolicyState]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_policy_states_list_query_results_for_management_group_request( + policy_states_resource=policy_states_resource, + management_group_name=management_group_name, + top=top, + order_by=order_by, + select=select, + from_parameter=from_parameter, + to=to, + filter=filter, + apply=apply, + skip_token=skip_token, + management_groups_namespace=management_groups_namespace, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.PolicyState], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("@odata.nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def summarize_for_management_group( + self, + policy_states_summary_resource: Union[str, _models.PolicyStatesSummaryResourceType], + management_group_name: str, + *, + top: Optional[int] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> _models.SummarizeResults: + """Summarizes policy states for the resources under the management group. + + :param policy_states_summary_resource: The virtual resource under PolicyStates resource type + for summarize action. In a given time range, 'latest' represents the latest policy state(s) and + is the only allowed value. "latest" Required. + :type policy_states_summary_resource: str or + ~azure.mgmt.policyinsights.models.PolicyStatesSummaryResourceType + :param management_group_name: Management group name. Required. + :type management_group_name: str + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :return: SummarizeResults. The SummarizeResults is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.SummarizeResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( + "management_groups_namespace", "Microsoft.Management" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[_models.SummarizeResults] = kwargs.pop("cls", None) + + _request = build_policy_states_summarize_for_management_group_request( + policy_states_summary_resource=policy_states_summary_resource, + management_group_name=management_group_name, + top=top, + from_parameter=from_parameter, + to=to, + filter=filter, + management_groups_namespace=management_groups_namespace, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SummarizeResults, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_query_results_for_subscription( + self, + policy_states_resource: Union[str, _models.PolicyStatesResource], + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.PolicyState"]: + """Queries policy states for the resources under the subscription. + + :param policy_states_resource: The virtual resource under PolicyStates resource type. In a + given time range, 'latest' represents the latest policy state(s), whereas 'default' represents + all policy state(s). Known values are: "default" and "latest". Required. + :type policy_states_resource: str or ~azure.mgmt.policyinsights.models.PolicyStatesResource + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword order_by: Ordering expression using OData notation. One or more comma-separated column + names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, + ResourceId asc". Default value is None. + :paramtype order_by: str + :keyword select: Select expression using OData notation. Limits the columns on each record to + just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Default value is None. + :paramtype select: str + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :keyword apply: OData apply expression for aggregations. Default value is None. + :paramtype apply: str + :keyword skip_token: Skiptoken is only provided if a previous response returned a partial + result as a part of nextLink element. Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of PolicyState + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.PolicyState] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[List[_models.PolicyState]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_policy_states_list_query_results_for_subscription_request( + policy_states_resource=policy_states_resource, + subscription_id=self._config.subscription_id, + top=top, + order_by=order_by, + select=select, + from_parameter=from_parameter, + to=to, + filter=filter, + apply=apply, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.PolicyState], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("@odata.nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def summarize_for_subscription( + self, + policy_states_summary_resource: Union[str, _models.PolicyStatesSummaryResourceType], + *, + top: Optional[int] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> _models.SummarizeResults: + """Summarizes policy states for the resources under the subscription. + + :param policy_states_summary_resource: The virtual resource under PolicyStates resource type + for summarize action. In a given time range, 'latest' represents the latest policy state(s) and + is the only allowed value. "latest" Required. + :type policy_states_summary_resource: str or + ~azure.mgmt.policyinsights.models.PolicyStatesSummaryResourceType + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :return: SummarizeResults. The SummarizeResults is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.SummarizeResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[_models.SummarizeResults] = kwargs.pop("cls", None) + + _request = build_policy_states_summarize_for_subscription_request( + policy_states_summary_resource=policy_states_summary_resource, + subscription_id=self._config.subscription_id, + top=top, + from_parameter=from_parameter, + to=to, + filter=filter, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SummarizeResults, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_query_results_for_resource_group( + self, + resource_group_name: str, + policy_states_resource: Union[str, _models.PolicyStatesResource], + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.PolicyState"]: + """Queries policy states for the resources under the resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param policy_states_resource: The virtual resource under PolicyStates resource type. In a + given time range, 'latest' represents the latest policy state(s), whereas 'default' represents + all policy state(s). Known values are: "default" and "latest". Required. + :type policy_states_resource: str or ~azure.mgmt.policyinsights.models.PolicyStatesResource + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword order_by: Ordering expression using OData notation. One or more comma-separated column + names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, + ResourceId asc". Default value is None. + :paramtype order_by: str + :keyword select: Select expression using OData notation. Limits the columns on each record to + just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Default value is None. + :paramtype select: str + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :keyword apply: OData apply expression for aggregations. Default value is None. + :paramtype apply: str + :keyword skip_token: Skiptoken is only provided if a previous response returned a partial + result as a part of nextLink element. Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of PolicyState + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.PolicyState] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[List[_models.PolicyState]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_policy_states_list_query_results_for_resource_group_request( + resource_group_name=resource_group_name, + policy_states_resource=policy_states_resource, + subscription_id=self._config.subscription_id, + top=top, + order_by=order_by, + select=select, + from_parameter=from_parameter, + to=to, + filter=filter, + apply=apply, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.PolicyState], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("@odata.nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def summarize_for_resource_group( + self, + resource_group_name: str, + policy_states_summary_resource: Union[str, _models.PolicyStatesSummaryResourceType], + *, + top: Optional[int] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> _models.SummarizeResults: + """Summarizes policy states for the resources under the resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param policy_states_summary_resource: The virtual resource under PolicyStates resource type + for summarize action. In a given time range, 'latest' represents the latest policy state(s) and + is the only allowed value. "latest" Required. + :type policy_states_summary_resource: str or + ~azure.mgmt.policyinsights.models.PolicyStatesSummaryResourceType + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :return: SummarizeResults. The SummarizeResults is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.SummarizeResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[_models.SummarizeResults] = kwargs.pop("cls", None) + + _request = build_policy_states_summarize_for_resource_group_request( + resource_group_name=resource_group_name, + policy_states_summary_resource=policy_states_summary_resource, + subscription_id=self._config.subscription_id, + top=top, + from_parameter=from_parameter, + to=to, + filter=filter, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SummarizeResults, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_query_results_for_resource( # pylint: disable=too-many-locals + self, + policy_states_resource: Union[str, _models.PolicyStatesResource], + resource_id: str, + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + expand: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.PolicyState"]: + """Queries policy states for the resource. + + :param policy_states_resource: The virtual resource under PolicyStates resource type. In a + given time range, 'latest' represents the latest policy state(s), whereas 'default' represents + all policy state(s). Known values are: "default" and "latest". Required. + :type policy_states_resource: str or ~azure.mgmt.policyinsights.models.PolicyStatesResource + :param resource_id: Resource ID. Required. + :type resource_id: str + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword order_by: Ordering expression using OData notation. One or more comma-separated column + names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, + ResourceId asc". Default value is None. + :paramtype order_by: str + :keyword select: Select expression using OData notation. Limits the columns on each record to + just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Default value is None. + :paramtype select: str + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :keyword apply: OData apply expression for aggregations. Default value is None. + :paramtype apply: str + :keyword expand: The $expand query parameter. For example, to expand components use + $expand=components. Default value is None. + :paramtype expand: str + :keyword skip_token: Skiptoken is only provided if a previous response returned a partial + result as a part of nextLink element. Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of PolicyState + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.PolicyState] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[List[_models.PolicyState]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_policy_states_list_query_results_for_resource_request( + policy_states_resource=policy_states_resource, + resource_id=resource_id, + top=top, + order_by=order_by, + select=select, + from_parameter=from_parameter, + to=to, + filter=filter, + apply=apply, + expand=expand, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.PolicyState], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("@odata.nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def summarize_for_resource( + self, + policy_states_summary_resource: Union[str, _models.PolicyStatesSummaryResourceType], + resource_id: str, + *, + top: Optional[int] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> _models.SummarizeResults: + """Summarizes policy states for the resource. + + :param policy_states_summary_resource: The virtual resource under PolicyStates resource type + for summarize action. In a given time range, 'latest' represents the latest policy state(s) and + is the only allowed value. "latest" Required. + :type policy_states_summary_resource: str or + ~azure.mgmt.policyinsights.models.PolicyStatesSummaryResourceType + :param resource_id: Resource ID. Required. + :type resource_id: str + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :return: SummarizeResults. The SummarizeResults is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.SummarizeResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[_models.SummarizeResults] = kwargs.pop("cls", None) + + _request = build_policy_states_summarize_for_resource_request( + policy_states_summary_resource=policy_states_summary_resource, + resource_id=resource_id, + top=top, + from_parameter=from_parameter, + to=to, + filter=filter, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SummarizeResults, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _trigger_subscription_evaluation_initial(self, **kwargs: Any) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_policy_states_trigger_subscription_evaluation_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_trigger_subscription_evaluation(self, **kwargs: Any) -> AsyncLROPoller[None]: + """Triggers a policy evaluation scan for all the resources under the subscription. + + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._trigger_subscription_evaluation_initial( + api_version=api_version, cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _trigger_resource_group_evaluation_initial( # pylint: disable=name-too-long + self, resource_group_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_policy_states_trigger_resource_group_evaluation_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_trigger_resource_group_evaluation( + self, resource_group_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Triggers a policy evaluation scan for all the resources under the resource group. + + :param resource_group_name: Resource group name. Required. + :type resource_group_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._trigger_resource_group_evaluation_initial( + resource_group_name=resource_group_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_query_results_for_policy_set_definition( # pylint: disable=name-too-long,too-many-locals + self, + policy_states_resource: Union[str, _models.PolicyStatesResource], + policy_set_definition_name: str, + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.PolicyState"]: + """Queries policy states for the subscription level policy set definition. + + :param policy_states_resource: The virtual resource under PolicyStates resource type. In a + given time range, 'latest' represents the latest policy state(s), whereas 'default' represents + all policy state(s). Known values are: "default" and "latest". Required. + :type policy_states_resource: str or ~azure.mgmt.policyinsights.models.PolicyStatesResource + :param policy_set_definition_name: Policy set definition name. Required. + :type policy_set_definition_name: str + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword order_by: Ordering expression using OData notation. One or more comma-separated column + names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, + ResourceId asc". Default value is None. + :paramtype order_by: str + :keyword select: Select expression using OData notation. Limits the columns on each record to + just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Default value is None. + :paramtype select: str + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :keyword apply: OData apply expression for aggregations. Default value is None. + :paramtype apply: str + :keyword skip_token: Skiptoken is only provided if a previous response returned a partial + result as a part of nextLink element. Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of PolicyState + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.PolicyState] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( + "authorization_namespace", "Microsoft.Authorization" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[List[_models.PolicyState]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_policy_states_list_query_results_for_policy_set_definition_request( + policy_states_resource=policy_states_resource, + policy_set_definition_name=policy_set_definition_name, + subscription_id=self._config.subscription_id, + top=top, + order_by=order_by, + select=select, + from_parameter=from_parameter, + to=to, + filter=filter, + apply=apply, + skip_token=skip_token, + authorization_namespace=authorization_namespace, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.PolicyState], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("@odata.nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def summarize_for_policy_set_definition( + self, + policy_states_summary_resource: Union[str, _models.PolicyStatesSummaryResourceType], + policy_set_definition_name: str, + *, + top: Optional[int] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> _models.SummarizeResults: + """Summarizes policy states for the subscription level policy set definition. + + :param policy_states_summary_resource: The virtual resource under PolicyStates resource type + for summarize action. In a given time range, 'latest' represents the latest policy state(s) and + is the only allowed value. "latest" Required. + :type policy_states_summary_resource: str or + ~azure.mgmt.policyinsights.models.PolicyStatesSummaryResourceType + :param policy_set_definition_name: Policy set definition name. Required. + :type policy_set_definition_name: str + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :return: SummarizeResults. The SummarizeResults is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.SummarizeResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( + "authorization_namespace", "Microsoft.Authorization" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[_models.SummarizeResults] = kwargs.pop("cls", None) + + _request = build_policy_states_summarize_for_policy_set_definition_request( + policy_states_summary_resource=policy_states_summary_resource, + policy_set_definition_name=policy_set_definition_name, + subscription_id=self._config.subscription_id, + top=top, + from_parameter=from_parameter, + to=to, + filter=filter, + authorization_namespace=authorization_namespace, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SummarizeResults, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_query_results_for_policy_definition( # pylint: disable=too-many-locals + self, + policy_states_resource: Union[str, _models.PolicyStatesResource], + policy_definition_name: str, + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.PolicyState"]: + """Queries policy states for the subscription level policy definition. + + :param policy_states_resource: The virtual resource under PolicyStates resource type. In a + given time range, 'latest' represents the latest policy state(s), whereas 'default' represents + all policy state(s). Known values are: "default" and "latest". Required. + :type policy_states_resource: str or ~azure.mgmt.policyinsights.models.PolicyStatesResource + :param policy_definition_name: Policy definition name. Required. + :type policy_definition_name: str + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword order_by: Ordering expression using OData notation. One or more comma-separated column + names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, + ResourceId asc". Default value is None. + :paramtype order_by: str + :keyword select: Select expression using OData notation. Limits the columns on each record to + just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Default value is None. + :paramtype select: str + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :keyword apply: OData apply expression for aggregations. Default value is None. + :paramtype apply: str + :keyword skip_token: Skiptoken is only provided if a previous response returned a partial + result as a part of nextLink element. Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of PolicyState + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.PolicyState] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( + "authorization_namespace", "Microsoft.Authorization" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[List[_models.PolicyState]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_policy_states_list_query_results_for_policy_definition_request( + policy_states_resource=policy_states_resource, + policy_definition_name=policy_definition_name, + subscription_id=self._config.subscription_id, + top=top, + order_by=order_by, + select=select, + from_parameter=from_parameter, + to=to, + filter=filter, + apply=apply, + skip_token=skip_token, + authorization_namespace=authorization_namespace, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.PolicyState], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("@odata.nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def summarize_for_policy_definition( + self, + policy_states_summary_resource: Union[str, _models.PolicyStatesSummaryResourceType], + policy_definition_name: str, + *, + top: Optional[int] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> _models.SummarizeResults: + """Summarizes policy states for the subscription level policy definition. + + :param policy_states_summary_resource: The virtual resource under PolicyStates resource type + for summarize action. In a given time range, 'latest' represents the latest policy state(s) and + is the only allowed value. "latest" Required. + :type policy_states_summary_resource: str or + ~azure.mgmt.policyinsights.models.PolicyStatesSummaryResourceType + :param policy_definition_name: Policy definition name. Required. + :type policy_definition_name: str + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :return: SummarizeResults. The SummarizeResults is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.SummarizeResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( + "authorization_namespace", "Microsoft.Authorization" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[_models.SummarizeResults] = kwargs.pop("cls", None) + + _request = build_policy_states_summarize_for_policy_definition_request( + policy_states_summary_resource=policy_states_summary_resource, + policy_definition_name=policy_definition_name, + subscription_id=self._config.subscription_id, + top=top, + from_parameter=from_parameter, + to=to, + filter=filter, + authorization_namespace=authorization_namespace, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SummarizeResults, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_query_results_for_subscription_level_policy_assignment( # pylint: disable=name-too-long,too-many-locals + self, + policy_states_resource: Union[str, _models.PolicyStatesResource], + policy_assignment_name: str, + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.PolicyState"]: + """Queries policy states for the subscription level policy assignment. + + :param policy_states_resource: The virtual resource under PolicyStates resource type. In a + given time range, 'latest' represents the latest policy state(s), whereas 'default' represents + all policy state(s). Known values are: "default" and "latest". Required. + :type policy_states_resource: str or ~azure.mgmt.policyinsights.models.PolicyStatesResource + :param policy_assignment_name: Policy assignment name. Required. + :type policy_assignment_name: str + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword order_by: Ordering expression using OData notation. One or more comma-separated column + names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, + ResourceId asc". Default value is None. + :paramtype order_by: str + :keyword select: Select expression using OData notation. Limits the columns on each record to + just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Default value is None. + :paramtype select: str + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :keyword apply: OData apply expression for aggregations. Default value is None. + :paramtype apply: str + :keyword skip_token: Skiptoken is only provided if a previous response returned a partial + result as a part of nextLink element. Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of PolicyState + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.PolicyState] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( + "authorization_namespace", "Microsoft.Authorization" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[List[_models.PolicyState]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_policy_states_list_query_results_for_subscription_level_policy_assignment_request( + policy_states_resource=policy_states_resource, + policy_assignment_name=policy_assignment_name, + subscription_id=self._config.subscription_id, + top=top, + order_by=order_by, + select=select, + from_parameter=from_parameter, + to=to, + filter=filter, + apply=apply, + skip_token=skip_token, + authorization_namespace=authorization_namespace, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.PolicyState], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("@odata.nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def summarize_for_subscription_level_policy_assignment( # pylint: disable=name-too-long + self, + policy_states_summary_resource: Union[str, _models.PolicyStatesSummaryResourceType], + policy_assignment_name: str, + *, + top: Optional[int] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> _models.SummarizeResults: + """Summarizes policy states for the subscription level policy assignment. + + :param policy_states_summary_resource: The virtual resource under PolicyStates resource type + for summarize action. In a given time range, 'latest' represents the latest policy state(s) and + is the only allowed value. "latest" Required. + :type policy_states_summary_resource: str or + ~azure.mgmt.policyinsights.models.PolicyStatesSummaryResourceType + :param policy_assignment_name: Policy assignment name. Required. + :type policy_assignment_name: str + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :return: SummarizeResults. The SummarizeResults is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.SummarizeResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( + "authorization_namespace", "Microsoft.Authorization" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[_models.SummarizeResults] = kwargs.pop("cls", None) + + _request = build_policy_states_summarize_for_subscription_level_policy_assignment_request( + policy_states_summary_resource=policy_states_summary_resource, + policy_assignment_name=policy_assignment_name, + subscription_id=self._config.subscription_id, + top=top, + from_parameter=from_parameter, + to=to, + filter=filter, + authorization_namespace=authorization_namespace, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SummarizeResults, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_query_results_for_resource_group_level_policy_assignment( # pylint: disable=name-too-long,too-many-locals + self, + resource_group_name: str, + policy_states_resource: Union[str, _models.PolicyStatesResource], + policy_assignment_name: str, + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.PolicyState"]: + """Queries policy states for the resource group level policy assignment. + + :param resource_group_name: Resource group name. Required. + :type resource_group_name: str + :param policy_states_resource: The virtual resource under PolicyStates resource type. In a + given time range, 'latest' represents the latest policy state(s), whereas 'default' represents + all policy state(s). Known values are: "default" and "latest". Required. + :type policy_states_resource: str or ~azure.mgmt.policyinsights.models.PolicyStatesResource + :param policy_assignment_name: Policy assignment name. Required. + :type policy_assignment_name: str + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword order_by: Ordering expression using OData notation. One or more comma-separated column + names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, + ResourceId asc". Default value is None. + :paramtype order_by: str + :keyword select: Select expression using OData notation. Limits the columns on each record to + just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Default value is None. + :paramtype select: str + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :keyword apply: OData apply expression for aggregations. Default value is None. + :paramtype apply: str + :keyword skip_token: Skiptoken is only provided if a previous response returned a partial + result as a part of nextLink element. Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of PolicyState + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.PolicyState] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( + "authorization_namespace", "Microsoft.Authorization" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[List[_models.PolicyState]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_policy_states_list_query_results_for_resource_group_level_policy_assignment_request( + resource_group_name=resource_group_name, + policy_states_resource=policy_states_resource, + policy_assignment_name=policy_assignment_name, + subscription_id=self._config.subscription_id, + top=top, + order_by=order_by, + select=select, + from_parameter=from_parameter, + to=to, + filter=filter, + apply=apply, + skip_token=skip_token, + authorization_namespace=authorization_namespace, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.PolicyState], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("@odata.nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def summarize_for_resource_group_level_policy_assignment( # pylint: disable=name-too-long + self, + resource_group_name: str, + policy_states_summary_resource: Union[str, _models.PolicyStatesSummaryResourceType], + policy_assignment_name: str, + *, + top: Optional[int] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> _models.SummarizeResults: + """Summarizes policy states for the resource group level policy assignment. + + :param resource_group_name: Resource group name. Required. + :type resource_group_name: str + :param policy_states_summary_resource: The virtual resource under PolicyStates resource type + for summarize action. In a given time range, 'latest' represents the latest policy state(s) and + is the only allowed value. "latest" Required. + :type policy_states_summary_resource: str or + ~azure.mgmt.policyinsights.models.PolicyStatesSummaryResourceType + :param policy_assignment_name: Policy assignment name. Required. + :type policy_assignment_name: str + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :return: SummarizeResults. The SummarizeResults is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.SummarizeResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( + "authorization_namespace", "Microsoft.Authorization" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[_models.SummarizeResults] = kwargs.pop("cls", None) + + _request = build_policy_states_summarize_for_resource_group_level_policy_assignment_request( + resource_group_name=resource_group_name, + policy_states_summary_resource=policy_states_summary_resource, + policy_assignment_name=policy_assignment_name, + subscription_id=self._config.subscription_id, + top=top, + from_parameter=from_parameter, + to=to, + filter=filter, + authorization_namespace=authorization_namespace, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SummarizeResults, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class PolicyRestrictionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.policyinsights.aio.PolicyInsightsClient`'s + :attr:`policy_restrictions` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: PolicyInsightsClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + async def check_at_subscription_scope( + self, parameters: _models.CheckRestrictionsRequest, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.CheckRestrictionsResult: + """Checks what restrictions Azure Policy will place on a resource within a subscription. + + :param parameters: The request body. Required. + :type parameters: ~azure.mgmt.policyinsights.models.CheckRestrictionsRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: CheckRestrictionsResult. The CheckRestrictionsResult is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.CheckRestrictionsResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def check_at_subscription_scope( + self, parameters: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.CheckRestrictionsResult: + """Checks what restrictions Azure Policy will place on a resource within a subscription. + + :param parameters: The request body. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: CheckRestrictionsResult. The CheckRestrictionsResult is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.CheckRestrictionsResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def check_at_subscription_scope( + self, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.CheckRestrictionsResult: + """Checks what restrictions Azure Policy will place on a resource within a subscription. + + :param parameters: The request body. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: CheckRestrictionsResult. The CheckRestrictionsResult is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.CheckRestrictionsResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def check_at_subscription_scope( + self, parameters: Union[_models.CheckRestrictionsRequest, JSON, IO[bytes]], **kwargs: Any + ) -> _models.CheckRestrictionsResult: + """Checks what restrictions Azure Policy will place on a resource within a subscription. + + :param parameters: The request body. Is one of the following types: CheckRestrictionsRequest, + JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.policyinsights.models.CheckRestrictionsRequest or JSON or + IO[bytes] + :return: CheckRestrictionsResult. The CheckRestrictionsResult is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.CheckRestrictionsResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CheckRestrictionsResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_policy_restrictions_check_at_subscription_scope_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.CheckRestrictionsResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def check_at_resource_group_scope( + self, + resource_group_name: str, + parameters: _models.CheckRestrictionsRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.CheckRestrictionsResult: + """Checks what restrictions Azure Policy will place on a resource within a resource group. Use + this when the resource group the resource will be created in is already known. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param parameters: The request body. Required. + :type parameters: ~azure.mgmt.policyinsights.models.CheckRestrictionsRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: CheckRestrictionsResult. The CheckRestrictionsResult is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.CheckRestrictionsResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def check_at_resource_group_scope( + self, resource_group_name: str, parameters: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.CheckRestrictionsResult: + """Checks what restrictions Azure Policy will place on a resource within a resource group. Use + this when the resource group the resource will be created in is already known. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param parameters: The request body. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: CheckRestrictionsResult. The CheckRestrictionsResult is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.CheckRestrictionsResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def check_at_resource_group_scope( + self, resource_group_name: str, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.CheckRestrictionsResult: + """Checks what restrictions Azure Policy will place on a resource within a resource group. Use + this when the resource group the resource will be created in is already known. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param parameters: The request body. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: CheckRestrictionsResult. The CheckRestrictionsResult is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.CheckRestrictionsResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def check_at_resource_group_scope( + self, + resource_group_name: str, + parameters: Union[_models.CheckRestrictionsRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.CheckRestrictionsResult: + """Checks what restrictions Azure Policy will place on a resource within a resource group. Use + this when the resource group the resource will be created in is already known. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param parameters: The request body. Is one of the following types: CheckRestrictionsRequest, + JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.policyinsights.models.CheckRestrictionsRequest or JSON or + IO[bytes] + :return: CheckRestrictionsResult. The CheckRestrictionsResult is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.CheckRestrictionsResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CheckRestrictionsResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_policy_restrictions_check_at_resource_group_scope_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.CheckRestrictionsResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def check_at_management_group_scope( + self, + management_group_id: str, + parameters: _models.CheckManagementGroupRestrictionsRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.CheckRestrictionsResult: + """Checks what restrictions Azure Policy will place on resources within a management group. + + :param management_group_id: Management group ID. Required. + :type management_group_id: str + :param parameters: The check policy restrictions parameters. Required. + :type parameters: ~azure.mgmt.policyinsights.models.CheckManagementGroupRestrictionsRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: CheckRestrictionsResult. The CheckRestrictionsResult is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.CheckRestrictionsResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def check_at_management_group_scope( + self, management_group_id: str, parameters: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.CheckRestrictionsResult: + """Checks what restrictions Azure Policy will place on resources within a management group. + + :param management_group_id: Management group ID. Required. + :type management_group_id: str + :param parameters: The check policy restrictions parameters. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: CheckRestrictionsResult. The CheckRestrictionsResult is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.CheckRestrictionsResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def check_at_management_group_scope( + self, management_group_id: str, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.CheckRestrictionsResult: + """Checks what restrictions Azure Policy will place on resources within a management group. + + :param management_group_id: Management group ID. Required. + :type management_group_id: str + :param parameters: The check policy restrictions parameters. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: CheckRestrictionsResult. The CheckRestrictionsResult is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.CheckRestrictionsResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def check_at_management_group_scope( + self, + management_group_id: str, + parameters: Union[_models.CheckManagementGroupRestrictionsRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.CheckRestrictionsResult: + """Checks what restrictions Azure Policy will place on resources within a management group. + + :param management_group_id: Management group ID. Required. + :type management_group_id: str + :param parameters: The check policy restrictions parameters. Is one of the following types: + CheckManagementGroupRestrictionsRequest, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.policyinsights.models.CheckManagementGroupRestrictionsRequest or + JSON or IO[bytes] + :return: CheckRestrictionsResult. The CheckRestrictionsResult is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.CheckRestrictionsResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( + "management_groups_namespace", "Microsoft.Management" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CheckRestrictionsResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_policy_restrictions_check_at_management_group_scope_request( + management_group_id=management_group_id, + management_groups_namespace=management_groups_namespace, + api_version=api_version, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.CheckRestrictionsResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class ComponentPolicyStatesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.policyinsights.aio.PolicyInsightsClient`'s + :attr:`component_policy_states` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: PolicyInsightsClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def list_query_results_for_subscription( + self, + component_policy_states_resource: Union[str, _models.ComponentPolicyStatesResource], + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + **kwargs: Any + ) -> _models.ComponentPolicyStatesQueryResults: + """Queries component policy states under subscription scope. + + :param component_policy_states_resource: The virtual resource under ComponentPolicyStates + resource type. In a given time range, 'latest' represents the latest component policy state(s). + "latest" Required. + :type component_policy_states_resource: str or + ~azure.mgmt.policyinsights.models.ComponentPolicyStatesResource + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword order_by: Ordering expression using OData notation. One or more comma-separated column + names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, + ResourceId asc". Default value is None. + :paramtype order_by: str + :keyword select: Select expression using OData notation. Limits the columns on each record to + just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Default value is None. + :paramtype select: str + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :keyword apply: OData apply expression for aggregations. Default value is None. + :paramtype apply: str + :return: ComponentPolicyStatesQueryResults. The ComponentPolicyStatesQueryResults is compatible + with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.ComponentPolicyStatesQueryResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[_models.ComponentPolicyStatesQueryResults] = kwargs.pop("cls", None) + + _request = build_component_policy_states_list_query_results_for_subscription_request( + component_policy_states_resource=component_policy_states_resource, + subscription_id=self._config.subscription_id, + top=top, + order_by=order_by, + select=select, + from_parameter=from_parameter, + to=to, + filter=filter, + apply=apply, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ComponentPolicyStatesQueryResults, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def list_query_results_for_resource_group( + self, + resource_group_name: str, + component_policy_states_resource: Union[str, _models.ComponentPolicyStatesResource], + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + **kwargs: Any + ) -> _models.ComponentPolicyStatesQueryResults: + """Queries component policy states under resource group scope. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param component_policy_states_resource: The virtual resource under ComponentPolicyStates + resource type. In a given time range, 'latest' represents the latest component policy state(s). + "latest" Required. + :type component_policy_states_resource: str or + ~azure.mgmt.policyinsights.models.ComponentPolicyStatesResource + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword order_by: Ordering expression using OData notation. One or more comma-separated column + names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, + ResourceId asc". Default value is None. + :paramtype order_by: str + :keyword select: Select expression using OData notation. Limits the columns on each record to + just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Default value is None. + :paramtype select: str + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :keyword apply: OData apply expression for aggregations. Default value is None. + :paramtype apply: str + :return: ComponentPolicyStatesQueryResults. The ComponentPolicyStatesQueryResults is compatible + with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.ComponentPolicyStatesQueryResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[_models.ComponentPolicyStatesQueryResults] = kwargs.pop("cls", None) + + _request = build_component_policy_states_list_query_results_for_resource_group_request( + resource_group_name=resource_group_name, + component_policy_states_resource=component_policy_states_resource, + subscription_id=self._config.subscription_id, + top=top, + order_by=order_by, + select=select, + from_parameter=from_parameter, + to=to, + filter=filter, + apply=apply, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ComponentPolicyStatesQueryResults, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def list_query_results_for_resource( + self, + resource_id: str, + component_policy_states_resource: Union[str, _models.ComponentPolicyStatesResource], + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + expand: Optional[str] = None, + **kwargs: Any + ) -> _models.ComponentPolicyStatesQueryResults: + """Queries component policy states for the resource. + + :param resource_id: Resource ID. Required. + :type resource_id: str + :param component_policy_states_resource: The virtual resource under ComponentPolicyStates + resource type. In a given time range, 'latest' represents the latest component policy state(s). + "latest" Required. + :type component_policy_states_resource: str or + ~azure.mgmt.policyinsights.models.ComponentPolicyStatesResource + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword order_by: Ordering expression using OData notation. One or more comma-separated column + names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, + ResourceId asc". Default value is None. + :paramtype order_by: str + :keyword select: Select expression using OData notation. Limits the columns on each record to + just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Default value is None. + :paramtype select: str + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :keyword apply: OData apply expression for aggregations. Default value is None. + :paramtype apply: str + :keyword expand: The $expand query parameter. Default value is None. + :paramtype expand: str + :return: ComponentPolicyStatesQueryResults. The ComponentPolicyStatesQueryResults is compatible + with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.ComponentPolicyStatesQueryResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[_models.ComponentPolicyStatesQueryResults] = kwargs.pop("cls", None) + + _request = build_component_policy_states_list_query_results_for_resource_request( + resource_id=resource_id, + component_policy_states_resource=component_policy_states_resource, + top=top, + order_by=order_by, + select=select, + from_parameter=from_parameter, + to=to, + filter=filter, + apply=apply, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ComponentPolicyStatesQueryResults, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def list_query_results_for_policy_definition( + self, + policy_definition_name: str, + component_policy_states_resource: Union[str, _models.ComponentPolicyStatesResource], + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + **kwargs: Any + ) -> _models.ComponentPolicyStatesQueryResults: + """Queries component policy states for the subscription level policy definition. + + :param policy_definition_name: Policy definition name. Required. + :type policy_definition_name: str + :param component_policy_states_resource: The virtual resource under ComponentPolicyStates + resource type. In a given time range, 'latest' represents the latest component policy state(s). + "latest" Required. + :type component_policy_states_resource: str or + ~azure.mgmt.policyinsights.models.ComponentPolicyStatesResource + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword order_by: Ordering expression using OData notation. One or more comma-separated column + names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, + ResourceId asc". Default value is None. + :paramtype order_by: str + :keyword select: Select expression using OData notation. Limits the columns on each record to + just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Default value is None. + :paramtype select: str + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :keyword apply: OData apply expression for aggregations. Default value is None. + :paramtype apply: str + :return: ComponentPolicyStatesQueryResults. The ComponentPolicyStatesQueryResults is compatible + with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.ComponentPolicyStatesQueryResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( + "authorization_namespace", "Microsoft.Authorization" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[_models.ComponentPolicyStatesQueryResults] = kwargs.pop("cls", None) + + _request = build_component_policy_states_list_query_results_for_policy_definition_request( + policy_definition_name=policy_definition_name, + component_policy_states_resource=component_policy_states_resource, + subscription_id=self._config.subscription_id, + top=top, + order_by=order_by, + select=select, + from_parameter=from_parameter, + to=to, + filter=filter, + apply=apply, + authorization_namespace=authorization_namespace, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ComponentPolicyStatesQueryResults, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def list_query_results_for_subscription_level_policy_assignment( # pylint: disable=name-too-long + self, + policy_assignment_name: str, + component_policy_states_resource: Union[str, _models.ComponentPolicyStatesResource], + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + **kwargs: Any + ) -> _models.ComponentPolicyStatesQueryResults: + """Queries component policy states for the subscription level policy assignment. + + :param policy_assignment_name: Policy assignment name. Required. + :type policy_assignment_name: str + :param component_policy_states_resource: The virtual resource under ComponentPolicyStates + resource type. In a given time range, 'latest' represents the latest component policy state(s). + "latest" Required. + :type component_policy_states_resource: str or + ~azure.mgmt.policyinsights.models.ComponentPolicyStatesResource + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword order_by: Ordering expression using OData notation. One or more comma-separated column + names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, + ResourceId asc". Default value is None. + :paramtype order_by: str + :keyword select: Select expression using OData notation. Limits the columns on each record to + just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Default value is None. + :paramtype select: str + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :keyword apply: OData apply expression for aggregations. Default value is None. + :paramtype apply: str + :return: ComponentPolicyStatesQueryResults. The ComponentPolicyStatesQueryResults is compatible + with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.ComponentPolicyStatesQueryResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( + "authorization_namespace", "Microsoft.Authorization" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[_models.ComponentPolicyStatesQueryResults] = kwargs.pop("cls", None) + + _request = build_component_policy_states_list_query_results_for_subscription_level_policy_assignment_request( + policy_assignment_name=policy_assignment_name, + component_policy_states_resource=component_policy_states_resource, + subscription_id=self._config.subscription_id, + top=top, + order_by=order_by, + select=select, + from_parameter=from_parameter, + to=to, + filter=filter, + apply=apply, + authorization_namespace=authorization_namespace, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ComponentPolicyStatesQueryResults, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def list_query_results_for_resource_group_level_policy_assignment( # pylint: disable=name-too-long,too-many-locals + self, + resource_group_name: str, + policy_assignment_name: str, + component_policy_states_resource: Union[str, _models.ComponentPolicyStatesResource], + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + **kwargs: Any + ) -> _models.ComponentPolicyStatesQueryResults: + """Queries component policy states for the resource group level policy assignment. + + :param resource_group_name: Resource group name. Required. + :type resource_group_name: str + :param policy_assignment_name: Policy assignment name. Required. + :type policy_assignment_name: str + :param component_policy_states_resource: The virtual resource under ComponentPolicyStates + resource type. In a given time range, 'latest' represents the latest component policy state(s). + "latest" Required. + :type component_policy_states_resource: str or + ~azure.mgmt.policyinsights.models.ComponentPolicyStatesResource + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword order_by: Ordering expression using OData notation. One or more comma-separated column + names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, + ResourceId asc". Default value is None. + :paramtype order_by: str + :keyword select: Select expression using OData notation. Limits the columns on each record to + just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Default value is None. + :paramtype select: str + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :keyword apply: OData apply expression for aggregations. Default value is None. + :paramtype apply: str + :return: ComponentPolicyStatesQueryResults. The ComponentPolicyStatesQueryResults is compatible + with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.ComponentPolicyStatesQueryResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( + "authorization_namespace", "Microsoft.Authorization" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[_models.ComponentPolicyStatesQueryResults] = kwargs.pop("cls", None) + + _request = build_component_policy_states_list_query_results_for_resource_group_level_policy_assignment_request( + resource_group_name=resource_group_name, + policy_assignment_name=policy_assignment_name, + component_policy_states_resource=component_policy_states_resource, + subscription_id=self._config.subscription_id, + top=top, + order_by=order_by, + select=select, + from_parameter=from_parameter, + to=to, + filter=filter, + apply=apply, + authorization_namespace=authorization_namespace, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ComponentPolicyStatesQueryResults, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class PolicyTrackedResourcesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.policyinsights.aio.PolicyInsightsClient`'s + :attr:`policy_tracked_resources` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: PolicyInsightsClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_query_results_for_management_group( + self, + management_group_name: str, + policy_tracked_resources_resource: Union[str, _models.PolicyTrackedResourcesResourceType], + *, + top: Optional[int] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.PolicyTrackedResource"]: + """Queries policy tracked resources under the management group. + + :param management_group_name: Management group name. Required. + :type management_group_name: str + :param policy_tracked_resources_resource: The name of the virtual resource under + PolicyTrackedResources resource type; only "default" is allowed. "default" Required. + :type policy_tracked_resources_resource: str or + ~azure.mgmt.policyinsights.models.PolicyTrackedResourcesResourceType + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :return: An iterator like instance of PolicyTrackedResource + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.PolicyTrackedResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( + "management_groups_namespace", "Microsoft.Management" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01-preview")) + cls: ClsType[List[_models.PolicyTrackedResource]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_policy_tracked_resources_list_query_results_for_management_group_request( + management_group_name=management_group_name, + policy_tracked_resources_resource=policy_tracked_resources_resource, + top=top, + filter=filter, + management_groups_namespace=management_groups_namespace, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.PolicyTrackedResource], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_query_results_for_subscription( + self, + policy_tracked_resources_resource: Union[str, _models.PolicyTrackedResourcesResourceType], + *, + top: Optional[int] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.PolicyTrackedResource"]: + """Queries policy tracked resources under the subscription. + + :param policy_tracked_resources_resource: The name of the virtual resource under + PolicyTrackedResources resource type; only "default" is allowed. "default" Required. + :type policy_tracked_resources_resource: str or + ~azure.mgmt.policyinsights.models.PolicyTrackedResourcesResourceType + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :return: An iterator like instance of PolicyTrackedResource + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.PolicyTrackedResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01-preview")) + cls: ClsType[List[_models.PolicyTrackedResource]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_policy_tracked_resources_list_query_results_for_subscription_request( + policy_tracked_resources_resource=policy_tracked_resources_resource, + subscription_id=self._config.subscription_id, + top=top, + filter=filter, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.PolicyTrackedResource], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_query_results_for_resource_group( + self, + resource_group_name: str, + policy_tracked_resources_resource: Union[str, _models.PolicyTrackedResourcesResourceType], + *, + top: Optional[int] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.PolicyTrackedResource"]: + """Queries policy tracked resources under the resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param policy_tracked_resources_resource: The name of the virtual resource under + PolicyTrackedResources resource type; only "default" is allowed. "default" Required. + :type policy_tracked_resources_resource: str or + ~azure.mgmt.policyinsights.models.PolicyTrackedResourcesResourceType + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :return: An iterator like instance of PolicyTrackedResource + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.PolicyTrackedResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01-preview")) + cls: ClsType[List[_models.PolicyTrackedResource]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_policy_tracked_resources_list_query_results_for_resource_group_request( + resource_group_name=resource_group_name, + policy_tracked_resources_resource=policy_tracked_resources_resource, + subscription_id=self._config.subscription_id, + top=top, + filter=filter, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.PolicyTrackedResource], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_query_results_for_resource( + self, + resource_id: str, + policy_tracked_resources_resource: Union[str, _models.PolicyTrackedResourcesResourceType], + *, + top: Optional[int] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.PolicyTrackedResource"]: + """Queries policy tracked resources under the resource. + + :param resource_id: Resource ID. Required. + :type resource_id: str + :param policy_tracked_resources_resource: The name of the virtual resource under + PolicyTrackedResources resource type; only "default" is allowed. "default" Required. + :type policy_tracked_resources_resource: str or + ~azure.mgmt.policyinsights.models.PolicyTrackedResourcesResourceType + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :return: An iterator like instance of PolicyTrackedResource + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.PolicyTrackedResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01-preview")) + cls: ClsType[List[_models.PolicyTrackedResource]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_policy_tracked_resources_list_query_results_for_resource_request( + resource_id=resource_id, + policy_tracked_resources_resource=policy_tracked_resources_resource, + top=top, + filter=filter, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.PolicyTrackedResource], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/aio/operations/_patch.py b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/aio/operations/_patch.py index f7dd32510333..87676c65a8f0 100644 --- a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/aio/operations/_patch.py +++ b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/aio/operations/_patch.py @@ -1,14 +1,15 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# 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. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/aio/operations/_policy_events_operations.py b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/aio/operations/_policy_events_operations.py deleted file mode 100644 index 0b9d82b4e3db..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/aio/operations/_policy_events_operations.py +++ /dev/null @@ -1,1129 +0,0 @@ -# pylint: disable=too-many-lines -# 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 collections.abc import MutableMapping -from typing import Any, Callable, Dict, Literal, Optional, TypeVar, Union - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._policy_events_operations import ( - build_list_query_results_for_management_group_request, - build_list_query_results_for_policy_definition_request, - build_list_query_results_for_policy_set_definition_request, - build_list_query_results_for_resource_group_level_policy_assignment_request, - build_list_query_results_for_resource_group_request, - build_list_query_results_for_resource_request, - build_list_query_results_for_subscription_level_policy_assignment_request, - build_list_query_results_for_subscription_request, - build_next_link_request, -) -from .._configuration import PolicyInsightsClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class PolicyEventsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.policyinsights.aio.PolicyInsightsClient`'s - :attr:`policy_events` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: PolicyInsightsClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_query_results_for_management_group( - self, - policy_events_resource: Union[str, _models.PolicyEventsResourceType], - management_group_name: str, - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.PolicyEvent"]: - """Queries policy events for the resources under the management group. - - :param policy_events_resource: The name of the virtual resource under PolicyEvents resource - type; only "default" is allowed. "default" Required. - :type policy_events_resource: str or ~azure.mgmt.policyinsights.models.PolicyEventsResourceType - :param management_group_name: Management group name. Required. - :type management_group_name: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either PolicyEvent or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.PolicyEvent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( - "management_groups_namespace", "Microsoft.Management" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.PolicyEventsQueryResults] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_list_query_results_for_management_group_request( - policy_events_resource=policy_events_resource, - management_group_name=management_group_name, - top=_top, - order_by=_order_by, - select=_select, - from_property=_from_property, - to=_to, - filter=_filter, - apply=_apply, - skip_token=_skip_token, - management_groups_namespace=management_groups_namespace, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_next_link_request( - next_link=next_link, - skip_token=_skip_token, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("PolicyEventsQueryResults", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.odata_next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_query_results_for_subscription( - self, - policy_events_resource: Union[str, _models.PolicyEventsResourceType], - subscription_id: str, - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.PolicyEvent"]: - """Queries policy events for the resources under the subscription. - - :param policy_events_resource: The name of the virtual resource under PolicyEvents resource - type; only "default" is allowed. "default" Required. - :type policy_events_resource: str or ~azure.mgmt.policyinsights.models.PolicyEventsResourceType - :param subscription_id: Microsoft Azure subscription ID. Required. - :type subscription_id: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either PolicyEvent or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.PolicyEvent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.PolicyEventsQueryResults] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_list_query_results_for_subscription_request( - policy_events_resource=policy_events_resource, - subscription_id=subscription_id, - top=_top, - order_by=_order_by, - select=_select, - from_property=_from_property, - to=_to, - filter=_filter, - apply=_apply, - skip_token=_skip_token, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_next_link_request( - next_link=next_link, - skip_token=_skip_token, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("PolicyEventsQueryResults", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.odata_next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_query_results_for_resource_group( - self, - policy_events_resource: Union[str, _models.PolicyEventsResourceType], - subscription_id: str, - resource_group_name: str, - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.PolicyEvent"]: - """Queries policy events for the resources under the resource group. - - :param policy_events_resource: The name of the virtual resource under PolicyEvents resource - type; only "default" is allowed. "default" Required. - :type policy_events_resource: str or ~azure.mgmt.policyinsights.models.PolicyEventsResourceType - :param subscription_id: Microsoft Azure subscription ID. Required. - :type subscription_id: str - :param resource_group_name: Resource group name. Required. - :type resource_group_name: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either PolicyEvent or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.PolicyEvent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.PolicyEventsQueryResults] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_list_query_results_for_resource_group_request( - policy_events_resource=policy_events_resource, - subscription_id=subscription_id, - resource_group_name=resource_group_name, - top=_top, - order_by=_order_by, - select=_select, - from_property=_from_property, - to=_to, - filter=_filter, - apply=_apply, - skip_token=_skip_token, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_next_link_request( - next_link=next_link, - skip_token=_skip_token, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("PolicyEventsQueryResults", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.odata_next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_query_results_for_resource( - self, - policy_events_resource: Union[str, _models.PolicyEventsResourceType], - resource_id: str, - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.PolicyEvent"]: - """Queries policy events for the resource. - - :param policy_events_resource: The name of the virtual resource under PolicyEvents resource - type; only "default" is allowed. "default" Required. - :type policy_events_resource: str or ~azure.mgmt.policyinsights.models.PolicyEventsResourceType - :param resource_id: Resource ID. Required. - :type resource_id: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either PolicyEvent or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.PolicyEvent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.PolicyEventsQueryResults] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _expand = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _expand = query_options.expand - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_list_query_results_for_resource_request( - policy_events_resource=policy_events_resource, - resource_id=resource_id, - top=_top, - order_by=_order_by, - select=_select, - from_property=_from_property, - to=_to, - filter=_filter, - apply=_apply, - expand=_expand, - skip_token=_skip_token, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _expand = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _expand = query_options.expand - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_next_link_request( - next_link=next_link, - skip_token=_skip_token, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("PolicyEventsQueryResults", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.odata_next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_query_results_for_policy_set_definition( # pylint: disable=name-too-long - self, - policy_events_resource: Union[str, _models.PolicyEventsResourceType], - subscription_id: str, - policy_set_definition_name: str, - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.PolicyEvent"]: - """Queries policy events for the subscription level policy set definition. - - :param policy_events_resource: The name of the virtual resource under PolicyEvents resource - type; only "default" is allowed. "default" Required. - :type policy_events_resource: str or ~azure.mgmt.policyinsights.models.PolicyEventsResourceType - :param subscription_id: Microsoft Azure subscription ID. Required. - :type subscription_id: str - :param policy_set_definition_name: Policy set definition name. Required. - :type policy_set_definition_name: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either PolicyEvent or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.PolicyEvent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( - "authorization_namespace", "Microsoft.Authorization" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.PolicyEventsQueryResults] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_list_query_results_for_policy_set_definition_request( - policy_events_resource=policy_events_resource, - subscription_id=subscription_id, - policy_set_definition_name=policy_set_definition_name, - top=_top, - order_by=_order_by, - select=_select, - from_property=_from_property, - to=_to, - filter=_filter, - apply=_apply, - skip_token=_skip_token, - authorization_namespace=authorization_namespace, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_next_link_request( - next_link=next_link, - skip_token=_skip_token, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("PolicyEventsQueryResults", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.odata_next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_query_results_for_policy_definition( - self, - policy_events_resource: Union[str, _models.PolicyEventsResourceType], - subscription_id: str, - policy_definition_name: str, - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.PolicyEvent"]: - """Queries policy events for the subscription level policy definition. - - :param policy_events_resource: The name of the virtual resource under PolicyEvents resource - type; only "default" is allowed. "default" Required. - :type policy_events_resource: str or ~azure.mgmt.policyinsights.models.PolicyEventsResourceType - :param subscription_id: Microsoft Azure subscription ID. Required. - :type subscription_id: str - :param policy_definition_name: Policy definition name. Required. - :type policy_definition_name: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either PolicyEvent or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.PolicyEvent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( - "authorization_namespace", "Microsoft.Authorization" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.PolicyEventsQueryResults] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_list_query_results_for_policy_definition_request( - policy_events_resource=policy_events_resource, - subscription_id=subscription_id, - policy_definition_name=policy_definition_name, - top=_top, - order_by=_order_by, - select=_select, - from_property=_from_property, - to=_to, - filter=_filter, - apply=_apply, - skip_token=_skip_token, - authorization_namespace=authorization_namespace, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_next_link_request( - next_link=next_link, - skip_token=_skip_token, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("PolicyEventsQueryResults", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.odata_next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_query_results_for_subscription_level_policy_assignment( # pylint: disable=name-too-long - self, - policy_events_resource: Union[str, _models.PolicyEventsResourceType], - subscription_id: str, - policy_assignment_name: str, - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.PolicyEvent"]: - """Queries policy events for the subscription level policy assignment. - - :param policy_events_resource: The name of the virtual resource under PolicyEvents resource - type; only "default" is allowed. "default" Required. - :type policy_events_resource: str or ~azure.mgmt.policyinsights.models.PolicyEventsResourceType - :param subscription_id: Microsoft Azure subscription ID. Required. - :type subscription_id: str - :param policy_assignment_name: Policy assignment name. Required. - :type policy_assignment_name: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either PolicyEvent or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.PolicyEvent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( - "authorization_namespace", "Microsoft.Authorization" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.PolicyEventsQueryResults] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_list_query_results_for_subscription_level_policy_assignment_request( - policy_events_resource=policy_events_resource, - subscription_id=subscription_id, - policy_assignment_name=policy_assignment_name, - top=_top, - order_by=_order_by, - select=_select, - from_property=_from_property, - to=_to, - filter=_filter, - apply=_apply, - skip_token=_skip_token, - authorization_namespace=authorization_namespace, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_next_link_request( - next_link=next_link, - skip_token=_skip_token, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("PolicyEventsQueryResults", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.odata_next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_query_results_for_resource_group_level_policy_assignment( # pylint: disable=name-too-long - self, - policy_events_resource: Union[str, _models.PolicyEventsResourceType], - subscription_id: str, - resource_group_name: str, - policy_assignment_name: str, - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.PolicyEvent"]: - """Queries policy events for the resource group level policy assignment. - - :param policy_events_resource: The name of the virtual resource under PolicyEvents resource - type; only "default" is allowed. "default" Required. - :type policy_events_resource: str or ~azure.mgmt.policyinsights.models.PolicyEventsResourceType - :param subscription_id: Microsoft Azure subscription ID. Required. - :type subscription_id: str - :param resource_group_name: Resource group name. Required. - :type resource_group_name: str - :param policy_assignment_name: Policy assignment name. Required. - :type policy_assignment_name: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either PolicyEvent or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.PolicyEvent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( - "authorization_namespace", "Microsoft.Authorization" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.PolicyEventsQueryResults] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_list_query_results_for_resource_group_level_policy_assignment_request( - policy_events_resource=policy_events_resource, - subscription_id=subscription_id, - resource_group_name=resource_group_name, - policy_assignment_name=policy_assignment_name, - top=_top, - order_by=_order_by, - select=_select, - from_property=_from_property, - to=_to, - filter=_filter, - apply=_apply, - skip_token=_skip_token, - authorization_namespace=authorization_namespace, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_next_link_request( - next_link=next_link, - skip_token=_skip_token, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("PolicyEventsQueryResults", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.odata_next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/aio/operations/_policy_metadata_operations.py b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/aio/operations/_policy_metadata_operations.py deleted file mode 100644 index 43f364a65639..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/aio/operations/_policy_metadata_operations.py +++ /dev/null @@ -1,177 +0,0 @@ -# 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 collections.abc import MutableMapping -from typing import Any, Callable, Dict, Optional, TypeVar - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._policy_metadata_operations import build_get_resource_request, build_list_request -from .._configuration import PolicyInsightsClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class PolicyMetadataOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.policyinsights.aio.PolicyInsightsClient`'s - :attr:`policy_metadata` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: PolicyInsightsClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get_resource(self, resource_name: str, **kwargs: Any) -> _models.PolicyMetadata: - """Get policy metadata resource. - - :param resource_name: The name of the policy metadata resource. Required. - :type resource_name: str - :return: PolicyMetadata or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.PolicyMetadata - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.PolicyMetadata] = kwargs.pop("cls", None) - - _request = build_get_resource_request( - resource_name=resource_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("PolicyMetadata", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list( - self, query_options: Optional[_models.QueryOptions] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.SlimPolicyMetadata"]: - """Get a list of the policy metadata resources. - - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either SlimPolicyMetadata or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.SlimPolicyMetadata] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.PolicyMetadataCollection] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - if query_options is not None: - _top = query_options.top - - _request = build_list_request( - top=_top, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("PolicyMetadataCollection", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/aio/operations/_policy_restrictions_operations.py b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/aio/operations/_policy_restrictions_operations.py deleted file mode 100644 index 450b169a7645..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/aio/operations/_policy_restrictions_operations.py +++ /dev/null @@ -1,388 +0,0 @@ -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, Dict, IO, Literal, Optional, TypeVar, Union, overload - -from azure.core import AsyncPipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._policy_restrictions_operations import ( - build_check_at_management_group_scope_request, - build_check_at_resource_group_scope_request, - build_check_at_subscription_scope_request, -) -from .._configuration import PolicyInsightsClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class PolicyRestrictionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.policyinsights.aio.PolicyInsightsClient`'s - :attr:`policy_restrictions` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: PolicyInsightsClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - async def check_at_subscription_scope( - self, parameters: _models.CheckRestrictionsRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.CheckRestrictionsResult: - """Checks what restrictions Azure Policy will place on a resource within a subscription. - - :param parameters: The check policy restrictions parameters. Required. - :type parameters: ~azure.mgmt.policyinsights.models.CheckRestrictionsRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: CheckRestrictionsResult or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.CheckRestrictionsResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def check_at_subscription_scope( - self, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.CheckRestrictionsResult: - """Checks what restrictions Azure Policy will place on a resource within a subscription. - - :param parameters: The check policy restrictions parameters. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: CheckRestrictionsResult or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.CheckRestrictionsResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def check_at_subscription_scope( - self, parameters: Union[_models.CheckRestrictionsRequest, IO[bytes]], **kwargs: Any - ) -> _models.CheckRestrictionsResult: - """Checks what restrictions Azure Policy will place on a resource within a subscription. - - :param parameters: The check policy restrictions parameters. Is either a - CheckRestrictionsRequest type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.policyinsights.models.CheckRestrictionsRequest or IO[bytes] - :return: CheckRestrictionsResult or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.CheckRestrictionsResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CheckRestrictionsResult] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "CheckRestrictionsRequest") - - _request = build_check_at_subscription_scope_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("CheckRestrictionsResult", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def check_at_resource_group_scope( - self, - resource_group_name: str, - parameters: _models.CheckRestrictionsRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.CheckRestrictionsResult: - """Checks what restrictions Azure Policy will place on a resource within a resource group. Use - this when the resource group the resource will be created in is already known. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param parameters: The check policy restrictions parameters. Required. - :type parameters: ~azure.mgmt.policyinsights.models.CheckRestrictionsRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: CheckRestrictionsResult or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.CheckRestrictionsResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def check_at_resource_group_scope( - self, resource_group_name: str, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.CheckRestrictionsResult: - """Checks what restrictions Azure Policy will place on a resource within a resource group. Use - this when the resource group the resource will be created in is already known. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param parameters: The check policy restrictions parameters. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: CheckRestrictionsResult or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.CheckRestrictionsResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def check_at_resource_group_scope( - self, resource_group_name: str, parameters: Union[_models.CheckRestrictionsRequest, IO[bytes]], **kwargs: Any - ) -> _models.CheckRestrictionsResult: - """Checks what restrictions Azure Policy will place on a resource within a resource group. Use - this when the resource group the resource will be created in is already known. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param parameters: The check policy restrictions parameters. Is either a - CheckRestrictionsRequest type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.policyinsights.models.CheckRestrictionsRequest or IO[bytes] - :return: CheckRestrictionsResult or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.CheckRestrictionsResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CheckRestrictionsResult] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "CheckRestrictionsRequest") - - _request = build_check_at_resource_group_scope_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("CheckRestrictionsResult", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def check_at_management_group_scope( - self, - management_group_id: str, - parameters: _models.CheckManagementGroupRestrictionsRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.CheckRestrictionsResult: - """Checks what restrictions Azure Policy will place on resources within a management group. - - :param management_group_id: Management group ID. Required. - :type management_group_id: str - :param parameters: The check policy restrictions parameters. Required. - :type parameters: ~azure.mgmt.policyinsights.models.CheckManagementGroupRestrictionsRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: CheckRestrictionsResult or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.CheckRestrictionsResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def check_at_management_group_scope( - self, management_group_id: str, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.CheckRestrictionsResult: - """Checks what restrictions Azure Policy will place on resources within a management group. - - :param management_group_id: Management group ID. Required. - :type management_group_id: str - :param parameters: The check policy restrictions parameters. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: CheckRestrictionsResult or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.CheckRestrictionsResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def check_at_management_group_scope( - self, - management_group_id: str, - parameters: Union[_models.CheckManagementGroupRestrictionsRequest, IO[bytes]], - **kwargs: Any - ) -> _models.CheckRestrictionsResult: - """Checks what restrictions Azure Policy will place on resources within a management group. - - :param management_group_id: Management group ID. Required. - :type management_group_id: str - :param parameters: The check policy restrictions parameters. Is either a - CheckManagementGroupRestrictionsRequest type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.policyinsights.models.CheckManagementGroupRestrictionsRequest or - IO[bytes] - :return: CheckRestrictionsResult or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.CheckRestrictionsResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( - "management_groups_namespace", "Microsoft.Management" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CheckRestrictionsResult] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "CheckManagementGroupRestrictionsRequest") - - _request = build_check_at_management_group_scope_request( - management_group_id=management_group_id, - management_groups_namespace=management_groups_namespace, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("CheckRestrictionsResult", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/aio/operations/_policy_states_operations.py b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/aio/operations/_policy_states_operations.py deleted file mode 100644 index f4a9aaa3856e..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/aio/operations/_policy_states_operations.py +++ /dev/null @@ -1,2034 +0,0 @@ -# pylint: disable=too-many-lines -# 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 collections.abc import MutableMapping -from typing import Any, AsyncIterator, Callable, Dict, Literal, Optional, TypeVar, Union, cast - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._policy_states_operations import ( - build_list_query_results_for_management_group_request, - build_list_query_results_for_policy_definition_request, - build_list_query_results_for_policy_set_definition_request, - build_list_query_results_for_resource_group_level_policy_assignment_request, - build_list_query_results_for_resource_group_request, - build_list_query_results_for_resource_request, - build_list_query_results_for_subscription_level_policy_assignment_request, - build_list_query_results_for_subscription_request, - build_next_link_request, - build_summarize_for_management_group_request, - build_summarize_for_policy_definition_request, - build_summarize_for_policy_set_definition_request, - build_summarize_for_resource_group_level_policy_assignment_request, - build_summarize_for_resource_group_request, - build_summarize_for_resource_request, - build_summarize_for_subscription_level_policy_assignment_request, - build_summarize_for_subscription_request, - build_trigger_resource_group_evaluation_request, - build_trigger_subscription_evaluation_request, -) -from .._configuration import PolicyInsightsClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class PolicyStatesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.policyinsights.aio.PolicyInsightsClient`'s - :attr:`policy_states` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: PolicyInsightsClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_query_results_for_management_group( - self, - policy_states_resource: Union[str, _models.PolicyStatesResource], - management_group_name: str, - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.PolicyState"]: - """Queries policy states for the resources under the management group. - - :param policy_states_resource: The virtual resource under PolicyStates resource type. In a - given time range, 'latest' represents the latest policy state(s), whereas 'default' represents - all policy state(s). Known values are: "default" and "latest". Required. - :type policy_states_resource: str or ~azure.mgmt.policyinsights.models.PolicyStatesResource - :param management_group_name: Management group name. Required. - :type management_group_name: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either PolicyState or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.PolicyState] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( - "management_groups_namespace", "Microsoft.Management" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.PolicyStatesQueryResults] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_list_query_results_for_management_group_request( - policy_states_resource=policy_states_resource, - management_group_name=management_group_name, - top=_top, - order_by=_order_by, - select=_select, - from_property=_from_property, - to=_to, - filter=_filter, - apply=_apply, - skip_token=_skip_token, - management_groups_namespace=management_groups_namespace, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_next_link_request( - next_link=next_link, - skip_token=_skip_token, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("PolicyStatesQueryResults", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.odata_next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def summarize_for_management_group( - self, - policy_states_summary_resource: Union[str, _models.PolicyStatesSummaryResourceType], - management_group_name: str, - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> _models.SummarizeResults: - """Summarizes policy states for the resources under the management group. - - :param policy_states_summary_resource: The virtual resource under PolicyStates resource type - for summarize action. In a given time range, 'latest' represents the latest policy state(s) and - is the only allowed value. "latest" Required. - :type policy_states_summary_resource: str or - ~azure.mgmt.policyinsights.models.PolicyStatesSummaryResourceType - :param management_group_name: Management group name. Required. - :type management_group_name: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: SummarizeResults or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.SummarizeResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( - "management_groups_namespace", "Microsoft.Management" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.SummarizeResults] = kwargs.pop("cls", None) - - _top = None - _from_property = None - _to = None - _filter = None - if query_options is not None: - _filter = query_options.filter - _from_property = query_options.from_property - _to = query_options.to - _top = query_options.top - - _request = build_summarize_for_management_group_request( - policy_states_summary_resource=policy_states_summary_resource, - management_group_name=management_group_name, - top=_top, - from_property=_from_property, - to=_to, - filter=_filter, - management_groups_namespace=management_groups_namespace, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SummarizeResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_query_results_for_subscription( - self, - policy_states_resource: Union[str, _models.PolicyStatesResource], - subscription_id: str, - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.PolicyState"]: - """Queries policy states for the resources under the subscription. - - :param policy_states_resource: The virtual resource under PolicyStates resource type. In a - given time range, 'latest' represents the latest policy state(s), whereas 'default' represents - all policy state(s). Known values are: "default" and "latest". Required. - :type policy_states_resource: str or ~azure.mgmt.policyinsights.models.PolicyStatesResource - :param subscription_id: Microsoft Azure subscription ID. Required. - :type subscription_id: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either PolicyState or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.PolicyState] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.PolicyStatesQueryResults] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_list_query_results_for_subscription_request( - policy_states_resource=policy_states_resource, - subscription_id=subscription_id, - top=_top, - order_by=_order_by, - select=_select, - from_property=_from_property, - to=_to, - filter=_filter, - apply=_apply, - skip_token=_skip_token, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_next_link_request( - next_link=next_link, - skip_token=_skip_token, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("PolicyStatesQueryResults", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.odata_next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def summarize_for_subscription( - self, - policy_states_summary_resource: Union[str, _models.PolicyStatesSummaryResourceType], - subscription_id: str, - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> _models.SummarizeResults: - """Summarizes policy states for the resources under the subscription. - - :param policy_states_summary_resource: The virtual resource under PolicyStates resource type - for summarize action. In a given time range, 'latest' represents the latest policy state(s) and - is the only allowed value. "latest" Required. - :type policy_states_summary_resource: str or - ~azure.mgmt.policyinsights.models.PolicyStatesSummaryResourceType - :param subscription_id: Microsoft Azure subscription ID. Required. - :type subscription_id: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: SummarizeResults or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.SummarizeResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.SummarizeResults] = kwargs.pop("cls", None) - - _top = None - _from_property = None - _to = None - _filter = None - if query_options is not None: - _filter = query_options.filter - _from_property = query_options.from_property - _to = query_options.to - _top = query_options.top - - _request = build_summarize_for_subscription_request( - policy_states_summary_resource=policy_states_summary_resource, - subscription_id=subscription_id, - top=_top, - from_property=_from_property, - to=_to, - filter=_filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SummarizeResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_query_results_for_resource_group( - self, - policy_states_resource: Union[str, _models.PolicyStatesResource], - subscription_id: str, - resource_group_name: str, - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.PolicyState"]: - """Queries policy states for the resources under the resource group. - - :param policy_states_resource: The virtual resource under PolicyStates resource type. In a - given time range, 'latest' represents the latest policy state(s), whereas 'default' represents - all policy state(s). Known values are: "default" and "latest". Required. - :type policy_states_resource: str or ~azure.mgmt.policyinsights.models.PolicyStatesResource - :param subscription_id: Microsoft Azure subscription ID. Required. - :type subscription_id: str - :param resource_group_name: Resource group name. Required. - :type resource_group_name: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either PolicyState or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.PolicyState] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.PolicyStatesQueryResults] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_list_query_results_for_resource_group_request( - policy_states_resource=policy_states_resource, - subscription_id=subscription_id, - resource_group_name=resource_group_name, - top=_top, - order_by=_order_by, - select=_select, - from_property=_from_property, - to=_to, - filter=_filter, - apply=_apply, - skip_token=_skip_token, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_next_link_request( - next_link=next_link, - skip_token=_skip_token, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("PolicyStatesQueryResults", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.odata_next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def summarize_for_resource_group( - self, - policy_states_summary_resource: Union[str, _models.PolicyStatesSummaryResourceType], - subscription_id: str, - resource_group_name: str, - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> _models.SummarizeResults: - """Summarizes policy states for the resources under the resource group. - - :param policy_states_summary_resource: The virtual resource under PolicyStates resource type - for summarize action. In a given time range, 'latest' represents the latest policy state(s) and - is the only allowed value. "latest" Required. - :type policy_states_summary_resource: str or - ~azure.mgmt.policyinsights.models.PolicyStatesSummaryResourceType - :param subscription_id: Microsoft Azure subscription ID. Required. - :type subscription_id: str - :param resource_group_name: Resource group name. Required. - :type resource_group_name: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: SummarizeResults or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.SummarizeResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.SummarizeResults] = kwargs.pop("cls", None) - - _top = None - _from_property = None - _to = None - _filter = None - if query_options is not None: - _filter = query_options.filter - _from_property = query_options.from_property - _to = query_options.to - _top = query_options.top - - _request = build_summarize_for_resource_group_request( - policy_states_summary_resource=policy_states_summary_resource, - subscription_id=subscription_id, - resource_group_name=resource_group_name, - top=_top, - from_property=_from_property, - to=_to, - filter=_filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SummarizeResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_query_results_for_resource( - self, - policy_states_resource: Union[str, _models.PolicyStatesResource], - resource_id: str, - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.PolicyState"]: - """Queries policy states for the resource. - - :param policy_states_resource: The virtual resource under PolicyStates resource type. In a - given time range, 'latest' represents the latest policy state(s), whereas 'default' represents - all policy state(s). Known values are: "default" and "latest". Required. - :type policy_states_resource: str or ~azure.mgmt.policyinsights.models.PolicyStatesResource - :param resource_id: Resource ID. Required. - :type resource_id: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either PolicyState or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.PolicyState] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.PolicyStatesQueryResults] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _expand = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _expand = query_options.expand - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_list_query_results_for_resource_request( - policy_states_resource=policy_states_resource, - resource_id=resource_id, - top=_top, - order_by=_order_by, - select=_select, - from_property=_from_property, - to=_to, - filter=_filter, - apply=_apply, - expand=_expand, - skip_token=_skip_token, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _expand = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _expand = query_options.expand - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_next_link_request( - next_link=next_link, - skip_token=_skip_token, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("PolicyStatesQueryResults", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.odata_next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def summarize_for_resource( - self, - policy_states_summary_resource: Union[str, _models.PolicyStatesSummaryResourceType], - resource_id: str, - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> _models.SummarizeResults: - """Summarizes policy states for the resource. - - :param policy_states_summary_resource: The virtual resource under PolicyStates resource type - for summarize action. In a given time range, 'latest' represents the latest policy state(s) and - is the only allowed value. "latest" Required. - :type policy_states_summary_resource: str or - ~azure.mgmt.policyinsights.models.PolicyStatesSummaryResourceType - :param resource_id: Resource ID. Required. - :type resource_id: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: SummarizeResults or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.SummarizeResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.SummarizeResults] = kwargs.pop("cls", None) - - _top = None - _from_property = None - _to = None - _filter = None - if query_options is not None: - _filter = query_options.filter - _from_property = query_options.from_property - _to = query_options.to - _top = query_options.top - - _request = build_summarize_for_resource_request( - policy_states_summary_resource=policy_states_summary_resource, - resource_id=resource_id, - top=_top, - from_property=_from_property, - to=_to, - filter=_filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SummarizeResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _trigger_subscription_evaluation_initial( - self, subscription_id: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_trigger_subscription_evaluation_request( - subscription_id=subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_trigger_subscription_evaluation(self, subscription_id: str, **kwargs: Any) -> AsyncLROPoller[None]: - """Triggers a policy evaluation scan for all the resources under the subscription. - - :param subscription_id: Microsoft Azure subscription ID. Required. - :type subscription_id: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._trigger_subscription_evaluation_initial( - subscription_id=subscription_id, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - async def _trigger_resource_group_evaluation_initial( # pylint: disable=name-too-long - self, subscription_id: str, resource_group_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_trigger_resource_group_evaluation_request( - subscription_id=subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_trigger_resource_group_evaluation( - self, subscription_id: str, resource_group_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Triggers a policy evaluation scan for all the resources under the resource group. - - :param subscription_id: Microsoft Azure subscription ID. Required. - :type subscription_id: str - :param resource_group_name: Resource group name. Required. - :type resource_group_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._trigger_resource_group_evaluation_initial( - subscription_id=subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_query_results_for_policy_set_definition( # pylint: disable=name-too-long - self, - policy_states_resource: Union[str, _models.PolicyStatesResource], - subscription_id: str, - policy_set_definition_name: str, - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.PolicyState"]: - """Queries policy states for the subscription level policy set definition. - - :param policy_states_resource: The virtual resource under PolicyStates resource type. In a - given time range, 'latest' represents the latest policy state(s), whereas 'default' represents - all policy state(s). Known values are: "default" and "latest". Required. - :type policy_states_resource: str or ~azure.mgmt.policyinsights.models.PolicyStatesResource - :param subscription_id: Microsoft Azure subscription ID. Required. - :type subscription_id: str - :param policy_set_definition_name: Policy set definition name. Required. - :type policy_set_definition_name: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either PolicyState or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.PolicyState] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( - "authorization_namespace", "Microsoft.Authorization" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.PolicyStatesQueryResults] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_list_query_results_for_policy_set_definition_request( - policy_states_resource=policy_states_resource, - subscription_id=subscription_id, - policy_set_definition_name=policy_set_definition_name, - top=_top, - order_by=_order_by, - select=_select, - from_property=_from_property, - to=_to, - filter=_filter, - apply=_apply, - skip_token=_skip_token, - authorization_namespace=authorization_namespace, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_next_link_request( - next_link=next_link, - skip_token=_skip_token, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("PolicyStatesQueryResults", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.odata_next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def summarize_for_policy_set_definition( - self, - policy_states_summary_resource: Union[str, _models.PolicyStatesSummaryResourceType], - subscription_id: str, - policy_set_definition_name: str, - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> _models.SummarizeResults: - """Summarizes policy states for the subscription level policy set definition. - - :param policy_states_summary_resource: The virtual resource under PolicyStates resource type - for summarize action. In a given time range, 'latest' represents the latest policy state(s) and - is the only allowed value. "latest" Required. - :type policy_states_summary_resource: str or - ~azure.mgmt.policyinsights.models.PolicyStatesSummaryResourceType - :param subscription_id: Microsoft Azure subscription ID. Required. - :type subscription_id: str - :param policy_set_definition_name: Policy set definition name. Required. - :type policy_set_definition_name: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: SummarizeResults or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.SummarizeResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( - "authorization_namespace", "Microsoft.Authorization" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.SummarizeResults] = kwargs.pop("cls", None) - - _top = None - _from_property = None - _to = None - _filter = None - if query_options is not None: - _filter = query_options.filter - _from_property = query_options.from_property - _to = query_options.to - _top = query_options.top - - _request = build_summarize_for_policy_set_definition_request( - policy_states_summary_resource=policy_states_summary_resource, - subscription_id=subscription_id, - policy_set_definition_name=policy_set_definition_name, - top=_top, - from_property=_from_property, - to=_to, - filter=_filter, - authorization_namespace=authorization_namespace, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SummarizeResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_query_results_for_policy_definition( - self, - policy_states_resource: Union[str, _models.PolicyStatesResource], - subscription_id: str, - policy_definition_name: str, - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.PolicyState"]: - """Queries policy states for the subscription level policy definition. - - :param policy_states_resource: The virtual resource under PolicyStates resource type. In a - given time range, 'latest' represents the latest policy state(s), whereas 'default' represents - all policy state(s). Known values are: "default" and "latest". Required. - :type policy_states_resource: str or ~azure.mgmt.policyinsights.models.PolicyStatesResource - :param subscription_id: Microsoft Azure subscription ID. Required. - :type subscription_id: str - :param policy_definition_name: Policy definition name. Required. - :type policy_definition_name: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either PolicyState or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.PolicyState] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( - "authorization_namespace", "Microsoft.Authorization" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.PolicyStatesQueryResults] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_list_query_results_for_policy_definition_request( - policy_states_resource=policy_states_resource, - subscription_id=subscription_id, - policy_definition_name=policy_definition_name, - top=_top, - order_by=_order_by, - select=_select, - from_property=_from_property, - to=_to, - filter=_filter, - apply=_apply, - skip_token=_skip_token, - authorization_namespace=authorization_namespace, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_next_link_request( - next_link=next_link, - skip_token=_skip_token, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("PolicyStatesQueryResults", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.odata_next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def summarize_for_policy_definition( - self, - policy_states_summary_resource: Union[str, _models.PolicyStatesSummaryResourceType], - subscription_id: str, - policy_definition_name: str, - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> _models.SummarizeResults: - """Summarizes policy states for the subscription level policy definition. - - :param policy_states_summary_resource: The virtual resource under PolicyStates resource type - for summarize action. In a given time range, 'latest' represents the latest policy state(s) and - is the only allowed value. "latest" Required. - :type policy_states_summary_resource: str or - ~azure.mgmt.policyinsights.models.PolicyStatesSummaryResourceType - :param subscription_id: Microsoft Azure subscription ID. Required. - :type subscription_id: str - :param policy_definition_name: Policy definition name. Required. - :type policy_definition_name: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: SummarizeResults or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.SummarizeResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( - "authorization_namespace", "Microsoft.Authorization" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.SummarizeResults] = kwargs.pop("cls", None) - - _top = None - _from_property = None - _to = None - _filter = None - if query_options is not None: - _filter = query_options.filter - _from_property = query_options.from_property - _to = query_options.to - _top = query_options.top - - _request = build_summarize_for_policy_definition_request( - policy_states_summary_resource=policy_states_summary_resource, - subscription_id=subscription_id, - policy_definition_name=policy_definition_name, - top=_top, - from_property=_from_property, - to=_to, - filter=_filter, - authorization_namespace=authorization_namespace, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SummarizeResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_query_results_for_subscription_level_policy_assignment( # pylint: disable=name-too-long - self, - policy_states_resource: Union[str, _models.PolicyStatesResource], - subscription_id: str, - policy_assignment_name: str, - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.PolicyState"]: - """Queries policy states for the subscription level policy assignment. - - :param policy_states_resource: The virtual resource under PolicyStates resource type. In a - given time range, 'latest' represents the latest policy state(s), whereas 'default' represents - all policy state(s). Known values are: "default" and "latest". Required. - :type policy_states_resource: str or ~azure.mgmt.policyinsights.models.PolicyStatesResource - :param subscription_id: Microsoft Azure subscription ID. Required. - :type subscription_id: str - :param policy_assignment_name: Policy assignment name. Required. - :type policy_assignment_name: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either PolicyState or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.PolicyState] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( - "authorization_namespace", "Microsoft.Authorization" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.PolicyStatesQueryResults] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_list_query_results_for_subscription_level_policy_assignment_request( - policy_states_resource=policy_states_resource, - subscription_id=subscription_id, - policy_assignment_name=policy_assignment_name, - top=_top, - order_by=_order_by, - select=_select, - from_property=_from_property, - to=_to, - filter=_filter, - apply=_apply, - skip_token=_skip_token, - authorization_namespace=authorization_namespace, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_next_link_request( - next_link=next_link, - skip_token=_skip_token, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("PolicyStatesQueryResults", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.odata_next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def summarize_for_subscription_level_policy_assignment( # pylint: disable=name-too-long - self, - policy_states_summary_resource: Union[str, _models.PolicyStatesSummaryResourceType], - subscription_id: str, - policy_assignment_name: str, - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> _models.SummarizeResults: - """Summarizes policy states for the subscription level policy assignment. - - :param policy_states_summary_resource: The virtual resource under PolicyStates resource type - for summarize action. In a given time range, 'latest' represents the latest policy state(s) and - is the only allowed value. "latest" Required. - :type policy_states_summary_resource: str or - ~azure.mgmt.policyinsights.models.PolicyStatesSummaryResourceType - :param subscription_id: Microsoft Azure subscription ID. Required. - :type subscription_id: str - :param policy_assignment_name: Policy assignment name. Required. - :type policy_assignment_name: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: SummarizeResults or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.SummarizeResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( - "authorization_namespace", "Microsoft.Authorization" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.SummarizeResults] = kwargs.pop("cls", None) - - _top = None - _from_property = None - _to = None - _filter = None - if query_options is not None: - _filter = query_options.filter - _from_property = query_options.from_property - _to = query_options.to - _top = query_options.top - - _request = build_summarize_for_subscription_level_policy_assignment_request( - policy_states_summary_resource=policy_states_summary_resource, - subscription_id=subscription_id, - policy_assignment_name=policy_assignment_name, - top=_top, - from_property=_from_property, - to=_to, - filter=_filter, - authorization_namespace=authorization_namespace, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SummarizeResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_query_results_for_resource_group_level_policy_assignment( # pylint: disable=name-too-long - self, - policy_states_resource: Union[str, _models.PolicyStatesResource], - subscription_id: str, - resource_group_name: str, - policy_assignment_name: str, - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.PolicyState"]: - """Queries policy states for the resource group level policy assignment. - - :param policy_states_resource: The virtual resource under PolicyStates resource type. In a - given time range, 'latest' represents the latest policy state(s), whereas 'default' represents - all policy state(s). Known values are: "default" and "latest". Required. - :type policy_states_resource: str or ~azure.mgmt.policyinsights.models.PolicyStatesResource - :param subscription_id: Microsoft Azure subscription ID. Required. - :type subscription_id: str - :param resource_group_name: Resource group name. Required. - :type resource_group_name: str - :param policy_assignment_name: Policy assignment name. Required. - :type policy_assignment_name: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either PolicyState or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.PolicyState] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( - "authorization_namespace", "Microsoft.Authorization" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.PolicyStatesQueryResults] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_list_query_results_for_resource_group_level_policy_assignment_request( - policy_states_resource=policy_states_resource, - subscription_id=subscription_id, - resource_group_name=resource_group_name, - policy_assignment_name=policy_assignment_name, - top=_top, - order_by=_order_by, - select=_select, - from_property=_from_property, - to=_to, - filter=_filter, - apply=_apply, - skip_token=_skip_token, - authorization_namespace=authorization_namespace, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_next_link_request( - next_link=next_link, - skip_token=_skip_token, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("PolicyStatesQueryResults", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.odata_next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def summarize_for_resource_group_level_policy_assignment( # pylint: disable=name-too-long - self, - policy_states_summary_resource: Union[str, _models.PolicyStatesSummaryResourceType], - subscription_id: str, - resource_group_name: str, - policy_assignment_name: str, - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> _models.SummarizeResults: - """Summarizes policy states for the resource group level policy assignment. - - :param policy_states_summary_resource: The virtual resource under PolicyStates resource type - for summarize action. In a given time range, 'latest' represents the latest policy state(s) and - is the only allowed value. "latest" Required. - :type policy_states_summary_resource: str or - ~azure.mgmt.policyinsights.models.PolicyStatesSummaryResourceType - :param subscription_id: Microsoft Azure subscription ID. Required. - :type subscription_id: str - :param resource_group_name: Resource group name. Required. - :type resource_group_name: str - :param policy_assignment_name: Policy assignment name. Required. - :type policy_assignment_name: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: SummarizeResults or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.SummarizeResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( - "authorization_namespace", "Microsoft.Authorization" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.SummarizeResults] = kwargs.pop("cls", None) - - _top = None - _from_property = None - _to = None - _filter = None - if query_options is not None: - _filter = query_options.filter - _from_property = query_options.from_property - _to = query_options.to - _top = query_options.top - - _request = build_summarize_for_resource_group_level_policy_assignment_request( - policy_states_summary_resource=policy_states_summary_resource, - subscription_id=subscription_id, - resource_group_name=resource_group_name, - policy_assignment_name=policy_assignment_name, - top=_top, - from_property=_from_property, - to=_to, - filter=_filter, - authorization_namespace=authorization_namespace, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SummarizeResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/aio/operations/_policy_tracked_resources_operations.py b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/aio/operations/_policy_tracked_resources_operations.py deleted file mode 100644 index e0a5b6286d78..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/aio/operations/_policy_tracked_resources_operations.py +++ /dev/null @@ -1,412 +0,0 @@ -# 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 collections.abc import MutableMapping -from typing import Any, Callable, Dict, Literal, Optional, TypeVar, Union - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._policy_tracked_resources_operations import ( - build_list_query_results_for_management_group_request, - build_list_query_results_for_resource_group_request, - build_list_query_results_for_resource_request, - build_list_query_results_for_subscription_request, -) -from .._configuration import PolicyInsightsClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class PolicyTrackedResourcesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.policyinsights.aio.PolicyInsightsClient`'s - :attr:`policy_tracked_resources` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: PolicyInsightsClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_query_results_for_management_group( - self, - management_group_name: str, - policy_tracked_resources_resource: Union[str, _models.PolicyTrackedResourcesResourceType], - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.PolicyTrackedResource"]: - """Queries policy tracked resources under the management group. - - :param management_group_name: Management group name. Required. - :type management_group_name: str - :param policy_tracked_resources_resource: The name of the virtual resource under - PolicyTrackedResources resource type; only "default" is allowed. "default" Required. - :type policy_tracked_resources_resource: str or - ~azure.mgmt.policyinsights.models.PolicyTrackedResourcesResourceType - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either PolicyTrackedResource or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.PolicyTrackedResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( - "management_groups_namespace", "Microsoft.Management" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01-preview")) - cls: ClsType[_models.PolicyTrackedResourcesQueryResults] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - _filter = None - if query_options is not None: - _filter = query_options.filter - _top = query_options.top - - _request = build_list_query_results_for_management_group_request( - management_group_name=management_group_name, - policy_tracked_resources_resource=policy_tracked_resources_resource, - top=_top, - filter=_filter, - management_groups_namespace=management_groups_namespace, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("PolicyTrackedResourcesQueryResults", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_query_results_for_subscription( - self, - policy_tracked_resources_resource: Union[str, _models.PolicyTrackedResourcesResourceType], - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.PolicyTrackedResource"]: - """Queries policy tracked resources under the subscription. - - :param policy_tracked_resources_resource: The name of the virtual resource under - PolicyTrackedResources resource type; only "default" is allowed. "default" Required. - :type policy_tracked_resources_resource: str or - ~azure.mgmt.policyinsights.models.PolicyTrackedResourcesResourceType - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either PolicyTrackedResource or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.PolicyTrackedResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01-preview")) - cls: ClsType[_models.PolicyTrackedResourcesQueryResults] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - _filter = None - if query_options is not None: - _filter = query_options.filter - _top = query_options.top - - _request = build_list_query_results_for_subscription_request( - policy_tracked_resources_resource=policy_tracked_resources_resource, - subscription_id=self._config.subscription_id, - top=_top, - filter=_filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("PolicyTrackedResourcesQueryResults", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_query_results_for_resource_group( - self, - resource_group_name: str, - policy_tracked_resources_resource: Union[str, _models.PolicyTrackedResourcesResourceType], - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.PolicyTrackedResource"]: - """Queries policy tracked resources under the resource group. - - :param resource_group_name: Resource group name. Required. - :type resource_group_name: str - :param policy_tracked_resources_resource: The name of the virtual resource under - PolicyTrackedResources resource type; only "default" is allowed. "default" Required. - :type policy_tracked_resources_resource: str or - ~azure.mgmt.policyinsights.models.PolicyTrackedResourcesResourceType - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either PolicyTrackedResource or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.PolicyTrackedResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01-preview")) - cls: ClsType[_models.PolicyTrackedResourcesQueryResults] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - _filter = None - if query_options is not None: - _filter = query_options.filter - _top = query_options.top - - _request = build_list_query_results_for_resource_group_request( - resource_group_name=resource_group_name, - policy_tracked_resources_resource=policy_tracked_resources_resource, - subscription_id=self._config.subscription_id, - top=_top, - filter=_filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("PolicyTrackedResourcesQueryResults", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_query_results_for_resource( - self, - resource_id: str, - policy_tracked_resources_resource: Union[str, _models.PolicyTrackedResourcesResourceType], - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.PolicyTrackedResource"]: - """Queries policy tracked resources under the resource. - - :param resource_id: Resource ID. Required. - :type resource_id: str - :param policy_tracked_resources_resource: The name of the virtual resource under - PolicyTrackedResources resource type; only "default" is allowed. "default" Required. - :type policy_tracked_resources_resource: str or - ~azure.mgmt.policyinsights.models.PolicyTrackedResourcesResourceType - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either PolicyTrackedResource or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.PolicyTrackedResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01-preview")) - cls: ClsType[_models.PolicyTrackedResourcesQueryResults] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - _filter = None - if query_options is not None: - _filter = query_options.filter - _top = query_options.top - - _request = build_list_query_results_for_resource_request( - resource_id=resource_id, - policy_tracked_resources_resource=policy_tracked_resources_resource, - top=_top, - filter=_filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("PolicyTrackedResourcesQueryResults", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/aio/operations/_remediations_operations.py b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/aio/operations/_remediations_operations.py deleted file mode 100644 index 520cd55cda60..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/aio/operations/_remediations_operations.py +++ /dev/null @@ -1,1894 +0,0 @@ -# pylint: disable=too-many-lines -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, Dict, IO, Literal, Optional, TypeVar, Union, overload - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._remediations_operations import ( - build_cancel_at_management_group_request, - build_cancel_at_resource_group_request, - build_cancel_at_resource_request, - build_cancel_at_subscription_request, - build_create_or_update_at_management_group_request, - build_create_or_update_at_resource_group_request, - build_create_or_update_at_resource_request, - build_create_or_update_at_subscription_request, - build_delete_at_management_group_request, - build_delete_at_resource_group_request, - build_delete_at_resource_request, - build_delete_at_subscription_request, - build_get_at_management_group_request, - build_get_at_resource_group_request, - build_get_at_resource_request, - build_get_at_subscription_request, - build_list_deployments_at_management_group_request, - build_list_deployments_at_resource_group_request, - build_list_deployments_at_resource_request, - build_list_deployments_at_subscription_request, - build_list_for_management_group_request, - build_list_for_resource_group_request, - build_list_for_resource_request, - build_list_for_subscription_request, -) -from .._configuration import PolicyInsightsClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class RemediationsOperations: # pylint: disable=too-many-public-methods - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.policyinsights.aio.PolicyInsightsClient`'s - :attr:`remediations` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: PolicyInsightsClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_deployments_at_management_group( - self, - management_group_id: str, - remediation_name: str, - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.RemediationDeployment"]: - """Gets all deployments for a remediation at management group scope. - - :param management_group_id: Management group ID. Required. - :type management_group_id: str - :param remediation_name: The name of the remediation. Required. - :type remediation_name: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either RemediationDeployment or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.RemediationDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( - "management_groups_namespace", "Microsoft.Management" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.RemediationDeploymentsListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - if query_options is not None: - _top = query_options.top - - _request = build_list_deployments_at_management_group_request( - management_group_id=management_group_id, - remediation_name=remediation_name, - top=_top, - management_groups_namespace=management_groups_namespace, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("RemediationDeploymentsListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def cancel_at_management_group( - self, management_group_id: str, remediation_name: str, **kwargs: Any - ) -> _models.Remediation: - """Cancels a remediation at management group scope. - - :param management_group_id: Management group ID. Required. - :type management_group_id: str - :param remediation_name: The name of the remediation. Required. - :type remediation_name: str - :return: Remediation or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.Remediation - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( - "management_groups_namespace", "Microsoft.Management" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.Remediation] = kwargs.pop("cls", None) - - _request = build_cancel_at_management_group_request( - management_group_id=management_group_id, - remediation_name=remediation_name, - management_groups_namespace=management_groups_namespace, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Remediation", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_for_management_group( - self, management_group_id: str, query_options: Optional[_models.QueryOptions] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.Remediation"]: - """Gets all remediations for the management group. - - :param management_group_id: Management group ID. Required. - :type management_group_id: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either Remediation or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.Remediation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( - "management_groups_namespace", "Microsoft.Management" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.RemediationListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - _filter = None - if query_options is not None: - _filter = query_options.filter - _top = query_options.top - - _request = build_list_for_management_group_request( - management_group_id=management_group_id, - top=_top, - filter=_filter, - management_groups_namespace=management_groups_namespace, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("RemediationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @overload - async def create_or_update_at_management_group( - self, - management_group_id: str, - remediation_name: str, - parameters: _models.Remediation, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Remediation: - """Creates or updates a remediation at management group scope. - - :param management_group_id: Management group ID. Required. - :type management_group_id: str - :param remediation_name: The name of the remediation. Required. - :type remediation_name: str - :param parameters: The remediation parameters. Required. - :type parameters: ~azure.mgmt.policyinsights.models.Remediation - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Remediation or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.Remediation - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update_at_management_group( - self, - management_group_id: str, - remediation_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Remediation: - """Creates or updates a remediation at management group scope. - - :param management_group_id: Management group ID. Required. - :type management_group_id: str - :param remediation_name: The name of the remediation. Required. - :type remediation_name: str - :param parameters: The remediation parameters. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: Remediation or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.Remediation - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update_at_management_group( - self, - management_group_id: str, - remediation_name: str, - parameters: Union[_models.Remediation, IO[bytes]], - **kwargs: Any - ) -> _models.Remediation: - """Creates or updates a remediation at management group scope. - - :param management_group_id: Management group ID. Required. - :type management_group_id: str - :param remediation_name: The name of the remediation. Required. - :type remediation_name: str - :param parameters: The remediation parameters. Is either a Remediation type or a IO[bytes] - type. Required. - :type parameters: ~azure.mgmt.policyinsights.models.Remediation or IO[bytes] - :return: Remediation or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.Remediation - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( - "management_groups_namespace", "Microsoft.Management" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Remediation] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "Remediation") - - _request = build_create_or_update_at_management_group_request( - management_group_id=management_group_id, - remediation_name=remediation_name, - management_groups_namespace=management_groups_namespace, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Remediation", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def get_at_management_group( - self, management_group_id: str, remediation_name: str, **kwargs: Any - ) -> _models.Remediation: - """Gets an existing remediation at management group scope. - - :param management_group_id: Management group ID. Required. - :type management_group_id: str - :param remediation_name: The name of the remediation. Required. - :type remediation_name: str - :return: Remediation or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.Remediation - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( - "management_groups_namespace", "Microsoft.Management" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.Remediation] = kwargs.pop("cls", None) - - _request = build_get_at_management_group_request( - management_group_id=management_group_id, - remediation_name=remediation_name, - management_groups_namespace=management_groups_namespace, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Remediation", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete_at_management_group( - self, management_group_id: str, remediation_name: str, **kwargs: Any - ) -> Optional[_models.Remediation]: - """Deletes an existing remediation at management group scope. - - :param management_group_id: Management group ID. Required. - :type management_group_id: str - :param remediation_name: The name of the remediation. Required. - :type remediation_name: str - :return: Remediation or None or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.Remediation or None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( - "management_groups_namespace", "Microsoft.Management" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[Optional[_models.Remediation]] = kwargs.pop("cls", None) - - _request = build_delete_at_management_group_request( - management_group_id=management_group_id, - remediation_name=remediation_name, - management_groups_namespace=management_groups_namespace, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("Remediation", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_deployments_at_subscription( - self, remediation_name: str, query_options: Optional[_models.QueryOptions] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.RemediationDeployment"]: - """Gets all deployments for a remediation at subscription scope. - - :param remediation_name: The name of the remediation. Required. - :type remediation_name: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either RemediationDeployment or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.RemediationDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.RemediationDeploymentsListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - if query_options is not None: - _top = query_options.top - - _request = build_list_deployments_at_subscription_request( - remediation_name=remediation_name, - subscription_id=self._config.subscription_id, - top=_top, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("RemediationDeploymentsListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def cancel_at_subscription(self, remediation_name: str, **kwargs: Any) -> _models.Remediation: - """Cancels a remediation at subscription scope. - - :param remediation_name: The name of the remediation. Required. - :type remediation_name: str - :return: Remediation or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.Remediation - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.Remediation] = kwargs.pop("cls", None) - - _request = build_cancel_at_subscription_request( - remediation_name=remediation_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Remediation", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_for_subscription( - self, query_options: Optional[_models.QueryOptions] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.Remediation"]: - """Gets all remediations for the subscription. - - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either Remediation or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.Remediation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.RemediationListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - _filter = None - if query_options is not None: - _filter = query_options.filter - _top = query_options.top - - _request = build_list_for_subscription_request( - subscription_id=self._config.subscription_id, - top=_top, - filter=_filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("RemediationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @overload - async def create_or_update_at_subscription( - self, - remediation_name: str, - parameters: _models.Remediation, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Remediation: - """Creates or updates a remediation at subscription scope. - - :param remediation_name: The name of the remediation. Required. - :type remediation_name: str - :param parameters: The remediation parameters. Required. - :type parameters: ~azure.mgmt.policyinsights.models.Remediation - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Remediation or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.Remediation - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update_at_subscription( - self, remediation_name: str, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Remediation: - """Creates or updates a remediation at subscription scope. - - :param remediation_name: The name of the remediation. Required. - :type remediation_name: str - :param parameters: The remediation parameters. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: Remediation or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.Remediation - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update_at_subscription( - self, remediation_name: str, parameters: Union[_models.Remediation, IO[bytes]], **kwargs: Any - ) -> _models.Remediation: - """Creates or updates a remediation at subscription scope. - - :param remediation_name: The name of the remediation. Required. - :type remediation_name: str - :param parameters: The remediation parameters. Is either a Remediation type or a IO[bytes] - type. Required. - :type parameters: ~azure.mgmt.policyinsights.models.Remediation or IO[bytes] - :return: Remediation or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.Remediation - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Remediation] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "Remediation") - - _request = build_create_or_update_at_subscription_request( - remediation_name=remediation_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Remediation", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def get_at_subscription(self, remediation_name: str, **kwargs: Any) -> _models.Remediation: - """Gets an existing remediation at subscription scope. - - :param remediation_name: The name of the remediation. Required. - :type remediation_name: str - :return: Remediation or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.Remediation - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.Remediation] = kwargs.pop("cls", None) - - _request = build_get_at_subscription_request( - remediation_name=remediation_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Remediation", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete_at_subscription(self, remediation_name: str, **kwargs: Any) -> Optional[_models.Remediation]: - """Deletes an existing remediation at subscription scope. - - :param remediation_name: The name of the remediation. Required. - :type remediation_name: str - :return: Remediation or None or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.Remediation or None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[Optional[_models.Remediation]] = kwargs.pop("cls", None) - - _request = build_delete_at_subscription_request( - remediation_name=remediation_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("Remediation", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_deployments_at_resource_group( - self, - resource_group_name: str, - remediation_name: str, - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.RemediationDeployment"]: - """Gets all deployments for a remediation at resource group scope. - - :param resource_group_name: Resource group name. Required. - :type resource_group_name: str - :param remediation_name: The name of the remediation. Required. - :type remediation_name: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either RemediationDeployment or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.RemediationDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.RemediationDeploymentsListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - if query_options is not None: - _top = query_options.top - - _request = build_list_deployments_at_resource_group_request( - resource_group_name=resource_group_name, - remediation_name=remediation_name, - subscription_id=self._config.subscription_id, - top=_top, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("RemediationDeploymentsListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def cancel_at_resource_group( - self, resource_group_name: str, remediation_name: str, **kwargs: Any - ) -> _models.Remediation: - """Cancels a remediation at resource group scope. - - :param resource_group_name: Resource group name. Required. - :type resource_group_name: str - :param remediation_name: The name of the remediation. Required. - :type remediation_name: str - :return: Remediation or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.Remediation - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.Remediation] = kwargs.pop("cls", None) - - _request = build_cancel_at_resource_group_request( - resource_group_name=resource_group_name, - remediation_name=remediation_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Remediation", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_for_resource_group( - self, resource_group_name: str, query_options: Optional[_models.QueryOptions] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.Remediation"]: - """Gets all remediations for the subscription. - - :param resource_group_name: Resource group name. Required. - :type resource_group_name: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either Remediation or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.Remediation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.RemediationListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - _filter = None - if query_options is not None: - _filter = query_options.filter - _top = query_options.top - - _request = build_list_for_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - top=_top, - filter=_filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("RemediationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @overload - async def create_or_update_at_resource_group( - self, - resource_group_name: str, - remediation_name: str, - parameters: _models.Remediation, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Remediation: - """Creates or updates a remediation at resource group scope. - - :param resource_group_name: Resource group name. Required. - :type resource_group_name: str - :param remediation_name: The name of the remediation. Required. - :type remediation_name: str - :param parameters: The remediation parameters. Required. - :type parameters: ~azure.mgmt.policyinsights.models.Remediation - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Remediation or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.Remediation - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update_at_resource_group( - self, - resource_group_name: str, - remediation_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Remediation: - """Creates or updates a remediation at resource group scope. - - :param resource_group_name: Resource group name. Required. - :type resource_group_name: str - :param remediation_name: The name of the remediation. Required. - :type remediation_name: str - :param parameters: The remediation parameters. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: Remediation or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.Remediation - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update_at_resource_group( - self, - resource_group_name: str, - remediation_name: str, - parameters: Union[_models.Remediation, IO[bytes]], - **kwargs: Any - ) -> _models.Remediation: - """Creates or updates a remediation at resource group scope. - - :param resource_group_name: Resource group name. Required. - :type resource_group_name: str - :param remediation_name: The name of the remediation. Required. - :type remediation_name: str - :param parameters: The remediation parameters. Is either a Remediation type or a IO[bytes] - type. Required. - :type parameters: ~azure.mgmt.policyinsights.models.Remediation or IO[bytes] - :return: Remediation or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.Remediation - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Remediation] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "Remediation") - - _request = build_create_or_update_at_resource_group_request( - resource_group_name=resource_group_name, - remediation_name=remediation_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Remediation", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def get_at_resource_group( - self, resource_group_name: str, remediation_name: str, **kwargs: Any - ) -> _models.Remediation: - """Gets an existing remediation at resource group scope. - - :param resource_group_name: Resource group name. Required. - :type resource_group_name: str - :param remediation_name: The name of the remediation. Required. - :type remediation_name: str - :return: Remediation or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.Remediation - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.Remediation] = kwargs.pop("cls", None) - - _request = build_get_at_resource_group_request( - resource_group_name=resource_group_name, - remediation_name=remediation_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Remediation", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete_at_resource_group( - self, resource_group_name: str, remediation_name: str, **kwargs: Any - ) -> Optional[_models.Remediation]: - """Deletes an existing remediation at resource group scope. - - :param resource_group_name: Resource group name. Required. - :type resource_group_name: str - :param remediation_name: The name of the remediation. Required. - :type remediation_name: str - :return: Remediation or None or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.Remediation or None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[Optional[_models.Remediation]] = kwargs.pop("cls", None) - - _request = build_delete_at_resource_group_request( - resource_group_name=resource_group_name, - remediation_name=remediation_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("Remediation", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_deployments_at_resource( - self, - resource_id: str, - remediation_name: str, - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.RemediationDeployment"]: - """Gets all deployments for a remediation at resource scope. - - :param resource_id: Resource ID. Required. - :type resource_id: str - :param remediation_name: The name of the remediation. Required. - :type remediation_name: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either RemediationDeployment or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.RemediationDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.RemediationDeploymentsListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - if query_options is not None: - _top = query_options.top - - _request = build_list_deployments_at_resource_request( - resource_id=resource_id, - remediation_name=remediation_name, - top=_top, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("RemediationDeploymentsListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def cancel_at_resource(self, resource_id: str, remediation_name: str, **kwargs: Any) -> _models.Remediation: - """Cancel a remediation at resource scope. - - :param resource_id: Resource ID. Required. - :type resource_id: str - :param remediation_name: The name of the remediation. Required. - :type remediation_name: str - :return: Remediation or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.Remediation - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.Remediation] = kwargs.pop("cls", None) - - _request = build_cancel_at_resource_request( - resource_id=resource_id, - remediation_name=remediation_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Remediation", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_for_resource( - self, resource_id: str, query_options: Optional[_models.QueryOptions] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.Remediation"]: - """Gets all remediations for a resource. - - :param resource_id: Resource ID. Required. - :type resource_id: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either Remediation or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.policyinsights.models.Remediation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.RemediationListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - _filter = None - if query_options is not None: - _filter = query_options.filter - _top = query_options.top - - _request = build_list_for_resource_request( - resource_id=resource_id, - top=_top, - filter=_filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("RemediationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @overload - async def create_or_update_at_resource( - self, - resource_id: str, - remediation_name: str, - parameters: _models.Remediation, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Remediation: - """Creates or updates a remediation at resource scope. - - :param resource_id: Resource ID. Required. - :type resource_id: str - :param remediation_name: The name of the remediation. Required. - :type remediation_name: str - :param parameters: The remediation parameters. Required. - :type parameters: ~azure.mgmt.policyinsights.models.Remediation - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Remediation or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.Remediation - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update_at_resource( - self, - resource_id: str, - remediation_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Remediation: - """Creates or updates a remediation at resource scope. - - :param resource_id: Resource ID. Required. - :type resource_id: str - :param remediation_name: The name of the remediation. Required. - :type remediation_name: str - :param parameters: The remediation parameters. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: Remediation or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.Remediation - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update_at_resource( - self, resource_id: str, remediation_name: str, parameters: Union[_models.Remediation, IO[bytes]], **kwargs: Any - ) -> _models.Remediation: - """Creates or updates a remediation at resource scope. - - :param resource_id: Resource ID. Required. - :type resource_id: str - :param remediation_name: The name of the remediation. Required. - :type remediation_name: str - :param parameters: The remediation parameters. Is either a Remediation type or a IO[bytes] - type. Required. - :type parameters: ~azure.mgmt.policyinsights.models.Remediation or IO[bytes] - :return: Remediation or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.Remediation - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Remediation] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "Remediation") - - _request = build_create_or_update_at_resource_request( - resource_id=resource_id, - remediation_name=remediation_name, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Remediation", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def get_at_resource(self, resource_id: str, remediation_name: str, **kwargs: Any) -> _models.Remediation: - """Gets an existing remediation at resource scope. - - :param resource_id: Resource ID. Required. - :type resource_id: str - :param remediation_name: The name of the remediation. Required. - :type remediation_name: str - :return: Remediation or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.Remediation - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.Remediation] = kwargs.pop("cls", None) - - _request = build_get_at_resource_request( - resource_id=resource_id, - remediation_name=remediation_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Remediation", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete_at_resource( - self, resource_id: str, remediation_name: str, **kwargs: Any - ) -> Optional[_models.Remediation]: - """Deletes an existing remediation at individual resource scope. - - :param resource_id: Resource ID. Required. - :type resource_id: str - :param remediation_name: The name of the remediation. Required. - :type remediation_name: str - :return: Remediation or None or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.Remediation or None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[Optional[_models.Remediation]] = kwargs.pop("cls", None) - - _request = build_delete_at_resource_request( - resource_id=resource_id, - remediation_name=remediation_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("Remediation", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/__init__.py b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/__init__.py index bb01291aaad3..018198456914 100644 --- a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/__init__.py +++ b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/__init__.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- # pylint: disable=wrong-import-position @@ -13,10 +13,10 @@ from ._patch import * # pylint: disable=unused-wildcard-import -from ._models_py3 import ( # type: ignore +from ._models import ( # type: ignore Attestation, AttestationEvidence, - AttestationListResult, + AttestationProperties, CheckManagementGroupRestrictionsRequest, CheckRestrictionEvaluationDetails, CheckRestrictionsRequest, @@ -31,11 +31,7 @@ ComponentPolicyStatesQueryResults, ComponentStateDetails, ErrorDefinition, - ErrorDefinitionAutoGenerated, - ErrorDefinitionAutoGenerated2, ErrorResponse, - ErrorResponseAutoGenerated, - ErrorResponseAutoGenerated2, ExpressionEvaluationDetails, FieldRestriction, FieldRestrictions, @@ -51,26 +47,21 @@ PolicyEvaluationDetails, PolicyEvaluationResult, PolicyEvent, - PolicyEventsQueryResults, PolicyGroupSummary, PolicyMetadata, - PolicyMetadataCollection, PolicyMetadataProperties, PolicyMetadataSlimProperties, PolicyReference, PolicyState, - PolicyStatesQueryResults, PolicyTrackedResource, - PolicyTrackedResourcesQueryResults, + ProxyResource, QueryFailure, QueryFailureError, - QueryOptions, Remediation, RemediationDeployment, RemediationDeploymentSummary, - RemediationDeploymentsListResult, RemediationFilters, - RemediationListResult, + RemediationProperties, RemediationPropertiesFailureThreshold, Resource, SlimPolicyMetadata, @@ -82,7 +73,7 @@ TypedErrorInfo, ) -from ._policy_insights_client_enums import ( # type: ignore +from ._enums import ( # type: ignore ComplianceState, ComponentPolicyStatesResource, CreatedByType, @@ -100,7 +91,7 @@ __all__ = [ "Attestation", "AttestationEvidence", - "AttestationListResult", + "AttestationProperties", "CheckManagementGroupRestrictionsRequest", "CheckRestrictionEvaluationDetails", "CheckRestrictionsRequest", @@ -115,11 +106,7 @@ "ComponentPolicyStatesQueryResults", "ComponentStateDetails", "ErrorDefinition", - "ErrorDefinitionAutoGenerated", - "ErrorDefinitionAutoGenerated2", "ErrorResponse", - "ErrorResponseAutoGenerated", - "ErrorResponseAutoGenerated2", "ExpressionEvaluationDetails", "FieldRestriction", "FieldRestrictions", @@ -135,26 +122,21 @@ "PolicyEvaluationDetails", "PolicyEvaluationResult", "PolicyEvent", - "PolicyEventsQueryResults", "PolicyGroupSummary", "PolicyMetadata", - "PolicyMetadataCollection", "PolicyMetadataProperties", "PolicyMetadataSlimProperties", "PolicyReference", "PolicyState", - "PolicyStatesQueryResults", "PolicyTrackedResource", - "PolicyTrackedResourcesQueryResults", + "ProxyResource", "QueryFailure", "QueryFailureError", - "QueryOptions", "Remediation", "RemediationDeployment", "RemediationDeploymentSummary", - "RemediationDeploymentsListResult", "RemediationFilters", - "RemediationListResult", + "RemediationProperties", "RemediationPropertiesFailureThreshold", "Resource", "SlimPolicyMetadata", diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/_policy_insights_client_enums.py b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/_enums.py similarity index 79% rename from sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/_policy_insights_client_enums.py rename to sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/_enums.py index 2cad8c4247c5..c7477d0d0258 100644 --- a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/_policy_insights_client_enums.py +++ b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/_enums.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -22,18 +22,23 @@ class ComplianceState(str, Enum, metaclass=CaseInsensitiveEnumMeta): class ComponentPolicyStatesResource(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """ComponentPolicyStatesResource.""" + """Type of ComponentPolicyStatesResource.""" LATEST = "latest" + """latest.""" class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of identity that created the resource.""" + """The kind of entity that created the resource.""" USER = "User" + """The entity was created by a user.""" APPLICATION = "Application" + """The entity was created by an application.""" MANAGED_IDENTITY = "ManagedIdentity" + """The entity was created by a managed identity.""" KEY = "Key" + """The entity was created by a key.""" class FieldRestrictionResult(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -50,28 +55,33 @@ class FieldRestrictionResult(str, Enum, metaclass=CaseInsensitiveEnumMeta): class PolicyEventsResourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """PolicyEventsResourceType.""" + """Type of PolicyEventsResourceType.""" DEFAULT = "default" + """default.""" class PolicyStatesResource(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """PolicyStatesResource.""" + """Type of PolicyStatesResource.""" DEFAULT = "default" + """default.""" LATEST = "latest" + """latest.""" class PolicyStatesSummaryResourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """PolicyStatesSummaryResourceType.""" + """Type of PolicyStatesSummaryResourceType.""" LATEST = "latest" + """latest.""" class PolicyTrackedResourcesResourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """PolicyTrackedResourcesResourceType.""" + """Type of PolicyTrackedResourcesResourceType.""" DEFAULT = "default" + """default.""" class ResourceDiscoveryMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/_models.py b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/_models.py new file mode 100644 index 000000000000..c31b11882708 --- /dev/null +++ b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/_models.py @@ -0,0 +1,2998 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=useless-super-delegation + +import datetime +from typing import Any, Mapping, Optional, TYPE_CHECKING, Union, overload + +from .._utils.model_base import Model as _Model, rest_field + +if TYPE_CHECKING: + from .. import models as _models + + +class Resource(_Model): + """Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.policyinsights.models.SystemData + """ + + id: Optional[str] = rest_field(visibility=["read"]) + """Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.""" + name: Optional[str] = rest_field(visibility=["read"]) + """The name of the resource.""" + type: Optional[str] = rest_field(visibility=["read"]) + """The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or + \"Microsoft.Storage/storageAccounts\".""" + system_data: Optional["_models.SystemData"] = rest_field(name="systemData", visibility=["read"]) + """Azure Resource Manager metadata containing createdBy and modifiedBy information.""" + + +class ProxyResource(Resource): + """Proxy Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.policyinsights.models.SystemData + """ + + +class Attestation(ProxyResource): + """An attestation resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.policyinsights.models.SystemData + :ivar properties: Properties for the attestation. Required. + :vartype properties: ~azure.mgmt.policyinsights.models.AttestationProperties + """ + + properties: "_models.AttestationProperties" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Properties for the attestation. Required.""" + + __flattened_items = [ + "policy_assignment_id", + "policy_definition_reference_id", + "compliance_state", + "expires_on", + "owner", + "comments", + "evidence", + "provisioning_state", + "last_compliance_state_change_at", + "assessment_date", + "metadata", + ] + + @overload + def __init__( + self, + *, + properties: "_models.AttestationProperties", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class AttestationEvidence(_Model): + """A piece of evidence supporting the compliance state set in the attestation. + + :ivar description: The description for this piece of evidence. + :vartype description: str + :ivar source_uri: The URI location of the evidence. + :vartype source_uri: str + """ + + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The description for this piece of evidence.""" + source_uri: Optional[str] = rest_field(name="sourceUri", visibility=["read", "create", "update", "delete", "query"]) + """The URI location of the evidence.""" + + @overload + def __init__( + self, + *, + description: Optional[str] = None, + source_uri: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AttestationProperties(_Model): + """The properties of an attestation resource. + + :ivar policy_assignment_id: The resource ID of the policy assignment that the attestation is + setting the state for. Required. + :vartype policy_assignment_id: str + :ivar policy_definition_reference_id: The policy definition reference ID from a policy set + definition that the attestation is setting the state for. If the policy assignment assigns a + policy set definition the attestation can choose a definition within the set definition with + this property or omit this and set the state for the entire set definition. + :vartype policy_definition_reference_id: str + :ivar compliance_state: The compliance state that should be set on the resource. Known values + are: "Compliant", "NonCompliant", and "Unknown". + :vartype compliance_state: str or ~azure.mgmt.policyinsights.models.ComplianceState + :ivar expires_on: The time the compliance state should expire. + :vartype expires_on: ~datetime.datetime + :ivar owner: The person responsible for setting the state of the resource. This value is + typically an Azure Active Directory object ID. + :vartype owner: str + :ivar comments: Comments describing why this attestation was created. + :vartype comments: str + :ivar evidence: The evidence supporting the compliance state set in this attestation. + :vartype evidence: list[~azure.mgmt.policyinsights.models.AttestationEvidence] + :ivar provisioning_state: The status of the attestation. + :vartype provisioning_state: str + :ivar last_compliance_state_change_at: The time the compliance state was last changed in this + attestation. + :vartype last_compliance_state_change_at: ~datetime.datetime + :ivar assessment_date: The time the evidence was assessed. + :vartype assessment_date: ~datetime.datetime + :ivar metadata: Additional metadata for this attestation. + :vartype metadata: any + """ + + policy_assignment_id: str = rest_field( + name="policyAssignmentId", visibility=["read", "create", "update", "delete", "query"] + ) + """The resource ID of the policy assignment that the attestation is setting the state for. + Required.""" + policy_definition_reference_id: Optional[str] = rest_field( + name="policyDefinitionReferenceId", visibility=["read", "create", "update", "delete", "query"] + ) + """The policy definition reference ID from a policy set definition that the attestation is setting + the state for. If the policy assignment assigns a policy set definition the attestation can + choose a definition within the set definition with this property or omit this and set the state + for the entire set definition.""" + compliance_state: Optional[Union[str, "_models.ComplianceState"]] = rest_field( + name="complianceState", visibility=["read", "create", "update", "delete", "query"] + ) + """The compliance state that should be set on the resource. Known values are: \"Compliant\", + \"NonCompliant\", and \"Unknown\".""" + expires_on: Optional[datetime.datetime] = rest_field( + name="expiresOn", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The time the compliance state should expire.""" + owner: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The person responsible for setting the state of the resource. This value is typically an Azure + Active Directory object ID.""" + comments: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Comments describing why this attestation was created.""" + evidence: Optional[list["_models.AttestationEvidence"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The evidence supporting the compliance state set in this attestation.""" + provisioning_state: Optional[str] = rest_field(name="provisioningState", visibility=["read"]) + """The status of the attestation.""" + last_compliance_state_change_at: Optional[datetime.datetime] = rest_field( + name="lastComplianceStateChangeAt", visibility=["read"], format="rfc3339" + ) + """The time the compliance state was last changed in this attestation.""" + assessment_date: Optional[datetime.datetime] = rest_field( + name="assessmentDate", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The time the evidence was assessed.""" + metadata: Optional[Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Additional metadata for this attestation.""" + + @overload + def __init__( + self, + *, + policy_assignment_id: str, + policy_definition_reference_id: Optional[str] = None, + compliance_state: Optional[Union[str, "_models.ComplianceState"]] = None, + expires_on: Optional[datetime.datetime] = None, + owner: Optional[str] = None, + comments: Optional[str] = None, + evidence: Optional[list["_models.AttestationEvidence"]] = None, + assessment_date: Optional[datetime.datetime] = None, + metadata: Optional[Any] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class CheckManagementGroupRestrictionsRequest(_Model): + """The check policy restrictions parameters describing the resource that is being evaluated. + + :ivar resource_details: The information about the resource that will be evaluated. + :vartype resource_details: ~azure.mgmt.policyinsights.models.CheckRestrictionsResourceDetails + :ivar pending_fields: The list of fields and values that should be evaluated for potential + restrictions. + :vartype pending_fields: list[~azure.mgmt.policyinsights.models.PendingField] + """ + + resource_details: Optional["_models.CheckRestrictionsResourceDetails"] = rest_field( + name="resourceDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """The information about the resource that will be evaluated.""" + pending_fields: Optional[list["_models.PendingField"]] = rest_field( + name="pendingFields", visibility=["read", "create", "update", "delete", "query"] + ) + """The list of fields and values that should be evaluated for potential restrictions.""" + + @overload + def __init__( + self, + *, + resource_details: Optional["_models.CheckRestrictionsResourceDetails"] = None, + pending_fields: Optional[list["_models.PendingField"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class CheckRestrictionEvaluationDetails(_Model): + """Policy evaluation details. + + :ivar evaluated_expressions: Details of the evaluated expressions. + :vartype evaluated_expressions: + list[~azure.mgmt.policyinsights.models.ExpressionEvaluationDetails] + :ivar if_not_exists_details: Evaluation details of IfNotExists effect. + :vartype if_not_exists_details: ~azure.mgmt.policyinsights.models.IfNotExistsEvaluationDetails + :ivar reason: The reason for the evaluation result. + :vartype reason: str + """ + + evaluated_expressions: Optional[list["_models.ExpressionEvaluationDetails"]] = rest_field( + name="evaluatedExpressions", visibility=["read", "create", "update", "delete", "query"] + ) + """Details of the evaluated expressions.""" + if_not_exists_details: Optional["_models.IfNotExistsEvaluationDetails"] = rest_field( + name="ifNotExistsDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """Evaluation details of IfNotExists effect.""" + reason: Optional[str] = rest_field(visibility=["read"]) + """The reason for the evaluation result.""" + + @overload + def __init__( + self, + *, + evaluated_expressions: Optional[list["_models.ExpressionEvaluationDetails"]] = None, + if_not_exists_details: Optional["_models.IfNotExistsEvaluationDetails"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class CheckRestrictionsRequest(_Model): + """The check policy restrictions parameters describing the resource that is being evaluated. + + :ivar resource_details: The information about the resource that will be evaluated. Required. + :vartype resource_details: ~azure.mgmt.policyinsights.models.CheckRestrictionsResourceDetails + :ivar pending_fields: The list of fields and values that should be evaluated for potential + restrictions. + :vartype pending_fields: list[~azure.mgmt.policyinsights.models.PendingField] + :ivar include_audit_effect: Whether to include policies with the 'audit' effect in the results. + Defaults to false. + :vartype include_audit_effect: bool + """ + + resource_details: "_models.CheckRestrictionsResourceDetails" = rest_field( + name="resourceDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """The information about the resource that will be evaluated. Required.""" + pending_fields: Optional[list["_models.PendingField"]] = rest_field( + name="pendingFields", visibility=["read", "create", "update", "delete", "query"] + ) + """The list of fields and values that should be evaluated for potential restrictions.""" + include_audit_effect: Optional[bool] = rest_field( + name="includeAuditEffect", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether to include policies with the 'audit' effect in the results. Defaults to false.""" + + @overload + def __init__( + self, + *, + resource_details: "_models.CheckRestrictionsResourceDetails", + pending_fields: Optional[list["_models.PendingField"]] = None, + include_audit_effect: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class CheckRestrictionsResourceDetails(_Model): + """The information about the resource that will be evaluated. + + :ivar resource_content: The resource content. This should include whatever properties are + already known and can be a partial set of all resource properties. Required. + :vartype resource_content: any + :ivar api_version: The api-version of the resource content. + :vartype api_version: str + :ivar scope: The scope where the resource is being created. For example, if the resource is a + child resource this would be the parent resource's resource ID. + :vartype scope: str + """ + + resource_content: Any = rest_field( + name="resourceContent", visibility=["read", "create", "update", "delete", "query"] + ) + """The resource content. This should include whatever properties are already known and can be a + partial set of all resource properties. Required.""" + api_version: Optional[str] = rest_field( + name="apiVersion", visibility=["read", "create", "update", "delete", "query"] + ) + """The api-version of the resource content.""" + scope: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The scope where the resource is being created. For example, if the resource is a child resource + this would be the parent resource's resource ID.""" + + @overload + def __init__( + self, + *, + resource_content: Any, + api_version: Optional[str] = None, + scope: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class CheckRestrictionsResult(_Model): + """The result of a check policy restrictions evaluation on a resource. + + :ivar field_restrictions: The restrictions that will be placed on various fields in the + resource by policy. + :vartype field_restrictions: list[~azure.mgmt.policyinsights.models.FieldRestrictions] + :ivar content_evaluation_result: Evaluation results for the provided partial resource content. + :vartype content_evaluation_result: + ~azure.mgmt.policyinsights.models.CheckRestrictionsResultContentEvaluationResult + """ + + field_restrictions: Optional[list["_models.FieldRestrictions"]] = rest_field( + name="fieldRestrictions", visibility=["read"] + ) + """The restrictions that will be placed on various fields in the resource by policy.""" + content_evaluation_result: Optional["_models.CheckRestrictionsResultContentEvaluationResult"] = rest_field( + name="contentEvaluationResult", visibility=["read"] + ) + """Evaluation results for the provided partial resource content.""" + + +class CheckRestrictionsResultContentEvaluationResult(_Model): # pylint: disable=name-too-long + """Evaluation results for the provided partial resource content. + + :ivar policy_evaluations: Policy evaluation results against the given resource content. This + will indicate if the partial content that was provided will be denied as-is. + :vartype policy_evaluations: list[~azure.mgmt.policyinsights.models.PolicyEvaluationResult] + """ + + policy_evaluations: Optional[list["_models.PolicyEvaluationResult"]] = rest_field( + name="policyEvaluations", visibility=["read", "create", "update", "delete", "query"] + ) + """Policy evaluation results against the given resource content. This will indicate if the partial + content that was provided will be denied as-is.""" + + @overload + def __init__( + self, + *, + policy_evaluations: Optional[list["_models.PolicyEvaluationResult"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ComplianceDetail(_Model): + """The compliance state rollup. + + :ivar compliance_state: The compliance state. + :vartype compliance_state: str + :ivar count: Summarized count value for this compliance state. + :vartype count: int + """ + + compliance_state: Optional[str] = rest_field( + name="complianceState", visibility=["read", "create", "update", "delete", "query"] + ) + """The compliance state.""" + count: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Summarized count value for this compliance state.""" + + @overload + def __init__( + self, + *, + compliance_state: Optional[str] = None, + count: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ComponentEventDetails(_Model): + """Component event details. + + :ivar id: Component Id. + :vartype id: str + :ivar type: Component type. + :vartype type: str + :ivar name: Component name. + :vartype name: str + :ivar timestamp: Timestamp for component policy event record. + :vartype timestamp: ~datetime.datetime + :ivar tenant_id: Tenant ID for the policy event record. + :vartype tenant_id: str + :ivar principal_oid: Principal object ID for the user who initiated the resource component + operation that triggered the policy event. + :vartype principal_oid: str + :ivar policy_definition_action: Policy definition action, i.e. effect. + :vartype policy_definition_action: str + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Component Id.""" + type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Component type.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Component name.""" + timestamp: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """Timestamp for component policy event record.""" + tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read", "create", "update", "delete", "query"]) + """Tenant ID for the policy event record.""" + principal_oid: Optional[str] = rest_field( + name="principalOid", visibility=["read", "create", "update", "delete", "query"] + ) + """Principal object ID for the user who initiated the resource component operation that triggered + the policy event.""" + policy_definition_action: Optional[str] = rest_field( + name="policyDefinitionAction", visibility=["read", "create", "update", "delete", "query"] + ) + """Policy definition action, i.e. effect.""" + + @overload + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + type: Optional[str] = None, + name: Optional[str] = None, + timestamp: Optional[datetime.datetime] = None, + tenant_id: Optional[str] = None, + principal_oid: Optional[str] = None, + policy_definition_action: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ComponentExpressionEvaluationDetails(_Model): + """Evaluation details of policy language expressions. + + :ivar result: Evaluation result. + :vartype result: str + :ivar expression: Expression evaluated. + :vartype expression: str + :ivar expression_kind: The kind of expression that was evaluated. + :vartype expression_kind: str + :ivar path: Property path if the expression is a field or an alias. + :vartype path: str + :ivar expression_value: Value of the expression. + :vartype expression_value: any + :ivar target_value: Target value to be compared with the expression value. + :vartype target_value: any + :ivar operator: Operator to compare the expression value and the target value. + :vartype operator: str + """ + + result: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Evaluation result.""" + expression: Optional[str] = rest_field(visibility=["read"]) + """Expression evaluated.""" + expression_kind: Optional[str] = rest_field(name="expressionKind", visibility=["read"]) + """The kind of expression that was evaluated.""" + path: Optional[str] = rest_field(visibility=["read"]) + """Property path if the expression is a field or an alias.""" + expression_value: Optional[Any] = rest_field(name="expressionValue", visibility=["read"]) + """Value of the expression.""" + target_value: Optional[Any] = rest_field(name="targetValue", visibility=["read"]) + """Target value to be compared with the expression value.""" + operator: Optional[str] = rest_field(visibility=["read"]) + """Operator to compare the expression value and the target value.""" + + @overload + def __init__( + self, + *, + result: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ComponentPolicyEvaluationDetails(_Model): + """Policy evaluation details. + + :ivar evaluated_expressions: Details of the evaluated expressions. + :vartype evaluated_expressions: + list[~azure.mgmt.policyinsights.models.ComponentExpressionEvaluationDetails] + :ivar reason: Additional textual reason for the evaluation outcome. + :vartype reason: str + """ + + evaluated_expressions: Optional[list["_models.ComponentExpressionEvaluationDetails"]] = rest_field( + name="evaluatedExpressions", visibility=["read"] + ) + """Details of the evaluated expressions.""" + reason: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Additional textual reason for the evaluation outcome.""" + + @overload + def __init__( + self, + *, + reason: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ComponentPolicyState(_Model): + """Component Policy State record. + + :ivar odata_id: OData entity ID; always set to null since component policy state records do not + have an entity ID. + :vartype odata_id: str + :ivar odata_context: OData context string; used by OData clients to resolve type information + based on metadata. + :vartype odata_context: str + :ivar timestamp: Timestamp for the component policy state record. + :vartype timestamp: ~datetime.datetime + :ivar component_id: Component Id. + :vartype component_id: str + :ivar component_type: Component type. + :vartype component_type: str + :ivar component_name: Component name. + :vartype component_name: str + :ivar resource_id: Resource ID. + :vartype resource_id: str + :ivar policy_assignment_id: Policy assignment ID. + :vartype policy_assignment_id: str + :ivar policy_definition_id: Policy definition ID. + :vartype policy_definition_id: str + :ivar subscription_id: Subscription ID. + :vartype subscription_id: str + :ivar resource_type: Resource type. + :vartype resource_type: str + :ivar resource_location: Resource location. + :vartype resource_location: str + :ivar resource_group: Resource group name. + :vartype resource_group: str + :ivar policy_assignment_name: Policy assignment name. + :vartype policy_assignment_name: str + :ivar policy_assignment_owner: Policy assignment owner. + :vartype policy_assignment_owner: str + :ivar policy_assignment_parameters: Policy assignment parameters. + :vartype policy_assignment_parameters: str + :ivar policy_assignment_scope: Policy assignment scope. + :vartype policy_assignment_scope: str + :ivar policy_definition_name: Policy definition name. + :vartype policy_definition_name: str + :ivar policy_definition_action: Policy definition action, i.e. effect. + :vartype policy_definition_action: str + :ivar policy_definition_category: Policy definition category. + :vartype policy_definition_category: str + :ivar policy_set_definition_id: Policy set definition ID, if the policy assignment is for a + policy set. + :vartype policy_set_definition_id: str + :ivar policy_set_definition_name: Policy set definition name, if the policy assignment is for a + policy set. + :vartype policy_set_definition_name: str + :ivar policy_set_definition_owner: Policy set definition owner, if the policy assignment is for + a policy set. + :vartype policy_set_definition_owner: str + :ivar policy_set_definition_category: Policy set definition category, if the policy assignment + is for a policy set. + :vartype policy_set_definition_category: str + :ivar policy_set_definition_parameters: Policy set definition parameters, if the policy + assignment is for a policy set. + :vartype policy_set_definition_parameters: str + :ivar policy_definition_reference_id: Reference ID for the policy definition inside the policy + set, if the policy assignment is for a policy set. + :vartype policy_definition_reference_id: str + :ivar compliance_state: Compliance state of the resource. + :vartype compliance_state: str + :ivar policy_evaluation_details: Policy evaluation details. This is only included in the + response if the request contains $expand=PolicyEvaluationDetails. + :vartype policy_evaluation_details: + ~azure.mgmt.policyinsights.models.ComponentPolicyEvaluationDetails + :ivar policy_definition_group_names: Policy definition group names. + :vartype policy_definition_group_names: list[str] + :ivar policy_definition_version: Evaluated policy definition version. + :vartype policy_definition_version: str + :ivar policy_set_definition_version: Evaluated policy set definition version. + :vartype policy_set_definition_version: str + :ivar policy_assignment_version: Evaluated policy assignment version. + :vartype policy_assignment_version: str + """ + + odata_id: Optional[str] = rest_field(name="@odata.id", visibility=["read"]) + """OData entity ID; always set to null since component policy state records do not have an entity + ID.""" + odata_context: Optional[str] = rest_field(name="@odata.context", visibility=["read"]) + """OData context string; used by OData clients to resolve type information based on metadata.""" + timestamp: Optional[datetime.datetime] = rest_field(visibility=["read"], format="rfc3339") + """Timestamp for the component policy state record.""" + component_id: Optional[str] = rest_field(name="componentId", visibility=["read"]) + """Component Id.""" + component_type: Optional[str] = rest_field(name="componentType", visibility=["read"]) + """Component type.""" + component_name: Optional[str] = rest_field(name="componentName", visibility=["read"]) + """Component name.""" + resource_id: Optional[str] = rest_field(name="resourceId", visibility=["read"]) + """Resource ID.""" + policy_assignment_id: Optional[str] = rest_field(name="policyAssignmentId", visibility=["read"]) + """Policy assignment ID.""" + policy_definition_id: Optional[str] = rest_field(name="policyDefinitionId", visibility=["read"]) + """Policy definition ID.""" + subscription_id: Optional[str] = rest_field(name="subscriptionId", visibility=["read"]) + """Subscription ID.""" + resource_type: Optional[str] = rest_field(name="resourceType", visibility=["read"]) + """Resource type.""" + resource_location: Optional[str] = rest_field(name="resourceLocation", visibility=["read"]) + """Resource location.""" + resource_group: Optional[str] = rest_field(name="resourceGroup", visibility=["read"]) + """Resource group name.""" + policy_assignment_name: Optional[str] = rest_field(name="policyAssignmentName", visibility=["read"]) + """Policy assignment name.""" + policy_assignment_owner: Optional[str] = rest_field(name="policyAssignmentOwner", visibility=["read"]) + """Policy assignment owner.""" + policy_assignment_parameters: Optional[str] = rest_field(name="policyAssignmentParameters", visibility=["read"]) + """Policy assignment parameters.""" + policy_assignment_scope: Optional[str] = rest_field(name="policyAssignmentScope", visibility=["read"]) + """Policy assignment scope.""" + policy_definition_name: Optional[str] = rest_field(name="policyDefinitionName", visibility=["read"]) + """Policy definition name.""" + policy_definition_action: Optional[str] = rest_field(name="policyDefinitionAction", visibility=["read"]) + """Policy definition action, i.e. effect.""" + policy_definition_category: Optional[str] = rest_field(name="policyDefinitionCategory", visibility=["read"]) + """Policy definition category.""" + policy_set_definition_id: Optional[str] = rest_field(name="policySetDefinitionId", visibility=["read"]) + """Policy set definition ID, if the policy assignment is for a policy set.""" + policy_set_definition_name: Optional[str] = rest_field(name="policySetDefinitionName", visibility=["read"]) + """Policy set definition name, if the policy assignment is for a policy set.""" + policy_set_definition_owner: Optional[str] = rest_field(name="policySetDefinitionOwner", visibility=["read"]) + """Policy set definition owner, if the policy assignment is for a policy set.""" + policy_set_definition_category: Optional[str] = rest_field(name="policySetDefinitionCategory", visibility=["read"]) + """Policy set definition category, if the policy assignment is for a policy set.""" + policy_set_definition_parameters: Optional[str] = rest_field( + name="policySetDefinitionParameters", visibility=["read"] + ) + """Policy set definition parameters, if the policy assignment is for a policy set.""" + policy_definition_reference_id: Optional[str] = rest_field(name="policyDefinitionReferenceId", visibility=["read"]) + """Reference ID for the policy definition inside the policy set, if the policy assignment is for a + policy set.""" + compliance_state: Optional[str] = rest_field(name="complianceState", visibility=["read"]) + """Compliance state of the resource.""" + policy_evaluation_details: Optional["_models.ComponentPolicyEvaluationDetails"] = rest_field( + name="policyEvaluationDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """Policy evaluation details. This is only included in the response if the request contains + $expand=PolicyEvaluationDetails.""" + policy_definition_group_names: Optional[list[str]] = rest_field( + name="policyDefinitionGroupNames", visibility=["read"] + ) + """Policy definition group names.""" + policy_definition_version: Optional[str] = rest_field(name="policyDefinitionVersion", visibility=["read"]) + """Evaluated policy definition version.""" + policy_set_definition_version: Optional[str] = rest_field(name="policySetDefinitionVersion", visibility=["read"]) + """Evaluated policy set definition version.""" + policy_assignment_version: Optional[str] = rest_field(name="policyAssignmentVersion", visibility=["read"]) + """Evaluated policy assignment version.""" + + @overload + def __init__( # pylint: disable=too-many-locals + self, + *, + policy_evaluation_details: Optional["_models.ComponentPolicyEvaluationDetails"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ComponentPolicyStatesQueryResults(_Model): + """Query results. + + :ivar odata_context: OData context string; used by OData clients to resolve type information + based on metadata. + :vartype odata_context: str + :ivar odata_count: OData entity count; represents the number of policy state records returned. + :vartype odata_count: int + :ivar value: Query results. + :vartype value: list[~azure.mgmt.policyinsights.models.ComponentPolicyState] + """ + + odata_context: Optional[str] = rest_field( + name="@odata.context", visibility=["read", "create", "update", "delete", "query"] + ) + """OData context string; used by OData clients to resolve type information based on metadata.""" + odata_count: Optional[int] = rest_field( + name="@odata.count", visibility=["read", "create", "update", "delete", "query"] + ) + """OData entity count; represents the number of policy state records returned.""" + value: Optional[list["_models.ComponentPolicyState"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Query results.""" + + @overload + def __init__( + self, + *, + odata_context: Optional[str] = None, + odata_count: Optional[int] = None, + value: Optional[list["_models.ComponentPolicyState"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ComponentStateDetails(_Model): + """Component state details. + + :ivar id: Component Id. + :vartype id: str + :ivar type: Component type. + :vartype type: str + :ivar name: Component name. + :vartype name: str + :ivar timestamp: Component compliance evaluation timestamp. + :vartype timestamp: ~datetime.datetime + :ivar compliance_state: Component compliance state. + :vartype compliance_state: str + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Component Id.""" + type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Component type.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Component name.""" + timestamp: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """Component compliance evaluation timestamp.""" + compliance_state: Optional[str] = rest_field( + name="complianceState", visibility=["read", "create", "update", "delete", "query"] + ) + """Component compliance state.""" + + @overload + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + type: Optional[str] = None, + name: Optional[str] = None, + timestamp: Optional[datetime.datetime] = None, + compliance_state: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ErrorDefinition(_Model): + """Error definition. + + :ivar code: Service specific error code which serves as the substatus for the HTTP error code. + :vartype code: str + :ivar message: Description of the error. + :vartype message: str + :ivar target: The target of the error. + :vartype target: str + :ivar details: Internal error details. + :vartype details: list[~azure.mgmt.policyinsights.models.ErrorDefinition] + :ivar additional_info: Additional scenario specific error details. + :vartype additional_info: list[~azure.mgmt.policyinsights.models.TypedErrorInfo] + """ + + code: Optional[str] = rest_field(visibility=["read"]) + """Service specific error code which serves as the substatus for the HTTP error code.""" + message: Optional[str] = rest_field(visibility=["read"]) + """Description of the error.""" + target: Optional[str] = rest_field(visibility=["read"]) + """The target of the error.""" + details: Optional[list["_models.ErrorDefinition"]] = rest_field(visibility=["read"]) + """Internal error details.""" + additional_info: Optional[list["_models.TypedErrorInfo"]] = rest_field(name="additionalInfo", visibility=["read"]) + """Additional scenario specific error details.""" + + +class ErrorResponse(_Model): + """Error response. + + :ivar error: The error details. + :vartype error: ~azure.mgmt.policyinsights.models.ErrorDefinition + """ + + error: Optional["_models.ErrorDefinition"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The error details.""" + + @overload + def __init__( + self, + *, + error: Optional["_models.ErrorDefinition"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ExpressionEvaluationDetails(_Model): + """Evaluation details of policy language expressions. + + :ivar result: Evaluation result. + :vartype result: str + :ivar expression: Expression evaluated. + :vartype expression: str + :ivar expression_kind: The kind of expression that was evaluated. + :vartype expression_kind: str + :ivar path: Property path if the expression is a field or an alias. + :vartype path: str + :ivar expression_value: Value of the expression. + :vartype expression_value: any + :ivar target_value: Target value to be compared with the expression value. + :vartype target_value: any + :ivar operator: Operator to compare the expression value and the target value. + :vartype operator: str + """ + + result: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Evaluation result.""" + expression: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Expression evaluated.""" + expression_kind: Optional[str] = rest_field(name="expressionKind", visibility=["read"]) + """The kind of expression that was evaluated.""" + path: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Property path if the expression is a field or an alias.""" + expression_value: Optional[Any] = rest_field( + name="expressionValue", visibility=["read", "create", "update", "delete", "query"] + ) + """Value of the expression.""" + target_value: Optional[Any] = rest_field( + name="targetValue", visibility=["read", "create", "update", "delete", "query"] + ) + """Target value to be compared with the expression value.""" + operator: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Operator to compare the expression value and the target value.""" + + @overload + def __init__( + self, + *, + result: Optional[str] = None, + expression: Optional[str] = None, + path: Optional[str] = None, + expression_value: Optional[Any] = None, + target_value: Optional[Any] = None, + operator: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class FieldRestriction(_Model): + """The restrictions on a field imposed by a specific policy. + + :ivar result: The type of restriction that is imposed on the field. Known values are: + "Required", "Removed", "Deny", and "Audit". + :vartype result: str or ~azure.mgmt.policyinsights.models.FieldRestrictionResult + :ivar default_value: The value that policy will set for the field if the user does not provide + a value. + :vartype default_value: str + :ivar values_property: The values that policy either requires or denies for the field. + :vartype values_property: list[str] + :ivar policy: The details of the policy that is causing the field restriction. + :vartype policy: ~azure.mgmt.policyinsights.models.PolicyReference + :ivar policy_effect: The effect of the policy that is causing the field restriction. + `http://aka.ms/policyeffects `_. + :vartype policy_effect: str + :ivar reason: The reason for the restriction. + :vartype reason: str + """ + + result: Optional[Union[str, "_models.FieldRestrictionResult"]] = rest_field(visibility=["read"]) + """The type of restriction that is imposed on the field. Known values are: \"Required\", + \"Removed\", \"Deny\", and \"Audit\".""" + default_value: Optional[str] = rest_field(name="defaultValue", visibility=["read"]) + """The value that policy will set for the field if the user does not provide a value.""" + values_property: Optional[list[str]] = rest_field(name="values", visibility=["read"], original_tsp_name="values") + """The values that policy either requires or denies for the field.""" + policy: Optional["_models.PolicyReference"] = rest_field(visibility=["read"]) + """The details of the policy that is causing the field restriction.""" + policy_effect: Optional[str] = rest_field(name="policyEffect", visibility=["read"]) + """The effect of the policy that is causing the field restriction. `http://aka.ms/policyeffects + `_.""" + reason: Optional[str] = rest_field(visibility=["read"]) + """The reason for the restriction.""" + + +class FieldRestrictions(_Model): + """The restrictions that will be placed on a field in the resource by policy. + + :ivar field: The name of the field. This can be a top-level property like 'name' or 'type' or + an Azure Policy field alias. + :vartype field: str + :ivar restrictions: The restrictions placed on that field by policy. + :vartype restrictions: list[~azure.mgmt.policyinsights.models.FieldRestriction] + """ + + field: Optional[str] = rest_field(visibility=["read"]) + """The name of the field. This can be a top-level property like 'name' or 'type' or an Azure + Policy field alias.""" + restrictions: Optional[list["_models.FieldRestriction"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The restrictions placed on that field by policy.""" + + @overload + def __init__( + self, + *, + restrictions: Optional[list["_models.FieldRestriction"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class IfNotExistsEvaluationDetails(_Model): + """Evaluation details of IfNotExists effect. + + :ivar resource_id: ID of the last evaluated resource for IfNotExists effect. + :vartype resource_id: str + :ivar total_resources: Total number of resources to which the existence condition is + applicable. + :vartype total_resources: int + """ + + resource_id: Optional[str] = rest_field( + name="resourceId", visibility=["read", "create", "update", "delete", "query"] + ) + """ID of the last evaluated resource for IfNotExists effect.""" + total_resources: Optional[int] = rest_field( + name="totalResources", visibility=["read", "create", "update", "delete", "query"] + ) + """Total number of resources to which the existence condition is applicable.""" + + @overload + def __init__( + self, + *, + resource_id: Optional[str] = None, + total_resources: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Operation(_Model): + """Operation definition. + + :ivar name: Operation name. + :vartype name: str + :ivar is_data_action: Indicates whether the operation is a data action. + :vartype is_data_action: bool + :ivar display: Display metadata associated with the operation. + :vartype display: ~azure.mgmt.policyinsights.models.OperationDisplay + """ + + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Operation name.""" + is_data_action: Optional[bool] = rest_field( + name="isDataAction", visibility=["read", "create", "update", "delete", "query"] + ) + """Indicates whether the operation is a data action.""" + display: Optional["_models.OperationDisplay"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Display metadata associated with the operation.""" + + @overload + def __init__( + self, + *, + name: Optional[str] = None, + is_data_action: Optional[bool] = None, + display: Optional["_models.OperationDisplay"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class OperationDisplay(_Model): + """Display metadata associated with the operation. + + :ivar provider: Resource provider name. + :vartype provider: str + :ivar resource: Resource name on which the operation is performed. + :vartype resource: str + :ivar operation: Operation name. + :vartype operation: str + :ivar description: Operation description. + :vartype description: str + """ + + provider: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource provider name.""" + resource: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource name on which the operation is performed.""" + operation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Operation name.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Operation description.""" + + @overload + def __init__( + self, + *, + provider: Optional[str] = None, + resource: Optional[str] = None, + operation: Optional[str] = None, + description: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class OperationsListResults(_Model): + """List of available operations. + + :ivar odata_count: OData entity count; represents the number of operations returned. + :vartype odata_count: int + :ivar value: List of available operations. + :vartype value: list[~azure.mgmt.policyinsights.models.Operation] + """ + + odata_count: Optional[int] = rest_field( + name="@odata.count", visibility=["read", "create", "update", "delete", "query"] + ) + """OData entity count; represents the number of operations returned.""" + value: Optional[list["_models.Operation"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """List of available operations.""" + + @overload + def __init__( + self, + *, + odata_count: Optional[int] = None, + value: Optional[list["_models.Operation"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class PendingField(_Model): + """A field that should be evaluated against Azure Policy to determine restrictions. + + :ivar field: The name of the field. This can be a top-level property like 'name' or 'type' or + an Azure Policy field alias. Required. + :vartype field: str + :ivar values_property: The list of potential values for the field that should be evaluated + against Azure Policy. + :vartype values_property: list[str] + """ + + field: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the field. This can be a top-level property like 'name' or 'type' or an Azure + Policy field alias. Required.""" + values_property: Optional[list[str]] = rest_field( + name="values", visibility=["read", "create", "update", "delete", "query"], original_tsp_name="values" + ) + """The list of potential values for the field that should be evaluated against Azure Policy.""" + + @overload + def __init__( + self, + *, + field: str, + values_property: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class PolicyAssignmentSummary(_Model): + """Policy assignment summary. + + :ivar policy_assignment_id: Policy assignment ID. + :vartype policy_assignment_id: str + :ivar policy_set_definition_id: Policy set definition ID, if the policy assignment is for a + policy set. + :vartype policy_set_definition_id: str + :ivar results: Compliance summary for the policy assignment. + :vartype results: ~azure.mgmt.policyinsights.models.SummaryResults + :ivar policy_definitions: Policy definitions summary. + :vartype policy_definitions: list[~azure.mgmt.policyinsights.models.PolicyDefinitionSummary] + :ivar policy_groups: Policy definition group summary. + :vartype policy_groups: list[~azure.mgmt.policyinsights.models.PolicyGroupSummary] + """ + + policy_assignment_id: Optional[str] = rest_field( + name="policyAssignmentId", visibility=["read", "create", "update", "delete", "query"] + ) + """Policy assignment ID.""" + policy_set_definition_id: Optional[str] = rest_field( + name="policySetDefinitionId", visibility=["read", "create", "update", "delete", "query"] + ) + """Policy set definition ID, if the policy assignment is for a policy set.""" + results: Optional["_models.SummaryResults"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Compliance summary for the policy assignment.""" + policy_definitions: Optional[list["_models.PolicyDefinitionSummary"]] = rest_field( + name="policyDefinitions", visibility=["read", "create", "update", "delete", "query"] + ) + """Policy definitions summary.""" + policy_groups: Optional[list["_models.PolicyGroupSummary"]] = rest_field( + name="policyGroups", visibility=["read", "create", "update", "delete", "query"] + ) + """Policy definition group summary.""" + + @overload + def __init__( + self, + *, + policy_assignment_id: Optional[str] = None, + policy_set_definition_id: Optional[str] = None, + results: Optional["_models.SummaryResults"] = None, + policy_definitions: Optional[list["_models.PolicyDefinitionSummary"]] = None, + policy_groups: Optional[list["_models.PolicyGroupSummary"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class PolicyDefinitionSummary(_Model): + """Policy definition summary. + + :ivar policy_definition_id: Policy definition ID. + :vartype policy_definition_id: str + :ivar policy_definition_reference_id: Policy definition reference ID. + :vartype policy_definition_reference_id: str + :ivar policy_definition_group_names: Policy definition group names. + :vartype policy_definition_group_names: list[str] + :ivar effect: Policy effect, i.e. policy definition action. + :vartype effect: str + :ivar results: Compliance summary for the policy definition. + :vartype results: ~azure.mgmt.policyinsights.models.SummaryResults + """ + + policy_definition_id: Optional[str] = rest_field( + name="policyDefinitionId", visibility=["read", "create", "update", "delete", "query"] + ) + """Policy definition ID.""" + policy_definition_reference_id: Optional[str] = rest_field( + name="policyDefinitionReferenceId", visibility=["read", "create", "update", "delete", "query"] + ) + """Policy definition reference ID.""" + policy_definition_group_names: Optional[list[str]] = rest_field( + name="policyDefinitionGroupNames", visibility=["read", "create", "update", "delete", "query"] + ) + """Policy definition group names.""" + effect: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Policy effect, i.e. policy definition action.""" + results: Optional["_models.SummaryResults"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Compliance summary for the policy definition.""" + + @overload + def __init__( + self, + *, + policy_definition_id: Optional[str] = None, + policy_definition_reference_id: Optional[str] = None, + policy_definition_group_names: Optional[list[str]] = None, + effect: Optional[str] = None, + results: Optional["_models.SummaryResults"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class PolicyDetails(_Model): + """The policy details. + + :ivar policy_definition_id: The ID of the policy definition. + :vartype policy_definition_id: str + :ivar policy_assignment_id: The ID of the policy assignment. + :vartype policy_assignment_id: str + :ivar policy_assignment_display_name: The display name of the policy assignment. + :vartype policy_assignment_display_name: str + :ivar policy_assignment_scope: The scope of the policy assignment. + :vartype policy_assignment_scope: str + :ivar policy_set_definition_id: The ID of the policy set definition. + :vartype policy_set_definition_id: str + :ivar policy_definition_reference_id: The policy definition reference ID within the policy set + definition. + :vartype policy_definition_reference_id: str + """ + + policy_definition_id: Optional[str] = rest_field(name="policyDefinitionId", visibility=["read"]) + """The ID of the policy definition.""" + policy_assignment_id: Optional[str] = rest_field(name="policyAssignmentId", visibility=["read"]) + """The ID of the policy assignment.""" + policy_assignment_display_name: Optional[str] = rest_field(name="policyAssignmentDisplayName", visibility=["read"]) + """The display name of the policy assignment.""" + policy_assignment_scope: Optional[str] = rest_field(name="policyAssignmentScope", visibility=["read"]) + """The scope of the policy assignment.""" + policy_set_definition_id: Optional[str] = rest_field(name="policySetDefinitionId", visibility=["read"]) + """The ID of the policy set definition.""" + policy_definition_reference_id: Optional[str] = rest_field(name="policyDefinitionReferenceId", visibility=["read"]) + """The policy definition reference ID within the policy set definition.""" + + +class PolicyEffectDetails(_Model): + """The details of the effect that was applied to the resource. + + :ivar policy_effect: The effect that was applied to the resource. `http://aka.ms/policyeffects + `_. + :vartype policy_effect: str + """ + + policy_effect: Optional[str] = rest_field(name="policyEffect", visibility=["read"]) + """The effect that was applied to the resource. `http://aka.ms/policyeffects + `_.""" + + +class PolicyEvaluationDetails(_Model): + """Policy evaluation details. + + :ivar evaluated_expressions: Details of the evaluated expressions. + :vartype evaluated_expressions: + list[~azure.mgmt.policyinsights.models.ExpressionEvaluationDetails] + :ivar if_not_exists_details: Evaluation details of IfNotExists effect. + :vartype if_not_exists_details: ~azure.mgmt.policyinsights.models.IfNotExistsEvaluationDetails + """ + + evaluated_expressions: Optional[list["_models.ExpressionEvaluationDetails"]] = rest_field( + name="evaluatedExpressions", visibility=["read", "create", "update", "delete", "query"] + ) + """Details of the evaluated expressions.""" + if_not_exists_details: Optional["_models.IfNotExistsEvaluationDetails"] = rest_field( + name="ifNotExistsDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """Evaluation details of IfNotExists effect.""" + + @overload + def __init__( + self, + *, + evaluated_expressions: Optional[list["_models.ExpressionEvaluationDetails"]] = None, + if_not_exists_details: Optional["_models.IfNotExistsEvaluationDetails"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class PolicyEvaluationResult(_Model): + """The result of a non-compliant policy evaluation against the given resource content. + + :ivar policy_info: The details of the policy that was evaluated. + :vartype policy_info: ~azure.mgmt.policyinsights.models.PolicyReference + :ivar evaluation_result: The result of the policy evaluation against the resource. This will + typically be 'NonCompliant' but may contain other values if errors were encountered. + :vartype evaluation_result: str + :ivar evaluation_details: The detailed results of the policy expressions and values that were + evaluated. + :vartype evaluation_details: + ~azure.mgmt.policyinsights.models.CheckRestrictionEvaluationDetails + :ivar effect_details: The details of the effect that was applied to the resource. + :vartype effect_details: ~azure.mgmt.policyinsights.models.PolicyEffectDetails + """ + + policy_info: Optional["_models.PolicyReference"] = rest_field(name="policyInfo", visibility=["read"]) + """The details of the policy that was evaluated.""" + evaluation_result: Optional[str] = rest_field(name="evaluationResult", visibility=["read"]) + """The result of the policy evaluation against the resource. This will typically be 'NonCompliant' + but may contain other values if errors were encountered.""" + evaluation_details: Optional["_models.CheckRestrictionEvaluationDetails"] = rest_field( + name="evaluationDetails", visibility=["read"] + ) + """The detailed results of the policy expressions and values that were evaluated.""" + effect_details: Optional["_models.PolicyEffectDetails"] = rest_field(name="effectDetails", visibility=["read"]) + """The details of the effect that was applied to the resource.""" + + +class PolicyEvent(_Model): + """Policy event record. + + :ivar odata_id: OData entity ID; always set to null since policy event records do not have an + entity ID. + :vartype odata_id: str + :ivar odata_context: OData context string; used by OData clients to resolve type information + based on metadata. + :vartype odata_context: str + :ivar timestamp: Timestamp for the policy event record. + :vartype timestamp: ~datetime.datetime + :ivar resource_id: Resource ID. + :vartype resource_id: str + :ivar policy_assignment_id: Policy assignment ID. + :vartype policy_assignment_id: str + :ivar policy_definition_id: Policy definition ID. + :vartype policy_definition_id: str + :ivar effective_parameters: Effective parameters for the policy assignment. + :vartype effective_parameters: str + :ivar is_compliant: Flag which states whether the resource is compliant against the policy + assignment it was evaluated against. + :vartype is_compliant: bool + :ivar subscription_id: Subscription ID. + :vartype subscription_id: str + :ivar resource_type: Resource type. + :vartype resource_type: str + :ivar resource_location: Resource location. + :vartype resource_location: str + :ivar resource_group: Resource group name. + :vartype resource_group: str + :ivar resource_tags: List of resource tags. + :vartype resource_tags: str + :ivar policy_assignment_name: Policy assignment name. + :vartype policy_assignment_name: str + :ivar policy_assignment_owner: Policy assignment owner. + :vartype policy_assignment_owner: str + :ivar policy_assignment_parameters: Policy assignment parameters. + :vartype policy_assignment_parameters: str + :ivar policy_assignment_scope: Policy assignment scope. + :vartype policy_assignment_scope: str + :ivar policy_definition_name: Policy definition name. + :vartype policy_definition_name: str + :ivar policy_definition_action: Policy definition action, i.e. effect. + :vartype policy_definition_action: str + :ivar policy_definition_category: Policy definition category. + :vartype policy_definition_category: str + :ivar policy_set_definition_id: Policy set definition ID, if the policy assignment is for a + policy set. + :vartype policy_set_definition_id: str + :ivar policy_set_definition_name: Policy set definition name, if the policy assignment is for a + policy set. + :vartype policy_set_definition_name: str + :ivar policy_set_definition_owner: Policy set definition owner, if the policy assignment is for + a policy set. + :vartype policy_set_definition_owner: str + :ivar policy_set_definition_category: Policy set definition category, if the policy assignment + is for a policy set. + :vartype policy_set_definition_category: str + :ivar policy_set_definition_parameters: Policy set definition parameters, if the policy + assignment is for a policy set. + :vartype policy_set_definition_parameters: str + :ivar management_group_ids: Comma separated list of management group IDs, which represent the + hierarchy of the management groups the resource is under. + :vartype management_group_ids: str + :ivar policy_definition_reference_id: Reference ID for the policy definition inside the policy + set, if the policy assignment is for a policy set. + :vartype policy_definition_reference_id: str + :ivar compliance_state: Compliance state of the resource. + :vartype compliance_state: str + :ivar tenant_id: Tenant ID for the policy event record. + :vartype tenant_id: str + :ivar principal_oid: Principal object ID for the user who initiated the resource operation that + triggered the policy event. + :vartype principal_oid: str + :ivar components: Components events records populated only when URL contains $expand=components + clause. + :vartype components: list[~azure.mgmt.policyinsights.models.ComponentEventDetails] + """ + + odata_id: Optional[str] = rest_field(name="@odata.id", visibility=["read", "create", "update", "delete", "query"]) + """OData entity ID; always set to null since policy event records do not have an entity ID.""" + odata_context: Optional[str] = rest_field( + name="@odata.context", visibility=["read", "create", "update", "delete", "query"] + ) + """OData context string; used by OData clients to resolve type information based on metadata.""" + timestamp: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """Timestamp for the policy event record.""" + resource_id: Optional[str] = rest_field( + name="resourceId", visibility=["read", "create", "update", "delete", "query"] + ) + """Resource ID.""" + policy_assignment_id: Optional[str] = rest_field( + name="policyAssignmentId", visibility=["read", "create", "update", "delete", "query"] + ) + """Policy assignment ID.""" + policy_definition_id: Optional[str] = rest_field( + name="policyDefinitionId", visibility=["read", "create", "update", "delete", "query"] + ) + """Policy definition ID.""" + effective_parameters: Optional[str] = rest_field( + name="effectiveParameters", visibility=["read", "create", "update", "delete", "query"] + ) + """Effective parameters for the policy assignment.""" + is_compliant: Optional[bool] = rest_field( + name="isCompliant", visibility=["read", "create", "update", "delete", "query"] + ) + """Flag which states whether the resource is compliant against the policy assignment it was + evaluated against.""" + subscription_id: Optional[str] = rest_field( + name="subscriptionId", visibility=["read", "create", "update", "delete", "query"] + ) + """Subscription ID.""" + resource_type: Optional[str] = rest_field( + name="resourceType", visibility=["read", "create", "update", "delete", "query"] + ) + """Resource type.""" + resource_location: Optional[str] = rest_field( + name="resourceLocation", visibility=["read", "create", "update", "delete", "query"] + ) + """Resource location.""" + resource_group: Optional[str] = rest_field( + name="resourceGroup", visibility=["read", "create", "update", "delete", "query"] + ) + """Resource group name.""" + resource_tags: Optional[str] = rest_field( + name="resourceTags", visibility=["read", "create", "update", "delete", "query"] + ) + """List of resource tags.""" + policy_assignment_name: Optional[str] = rest_field( + name="policyAssignmentName", visibility=["read", "create", "update", "delete", "query"] + ) + """Policy assignment name.""" + policy_assignment_owner: Optional[str] = rest_field( + name="policyAssignmentOwner", visibility=["read", "create", "update", "delete", "query"] + ) + """Policy assignment owner.""" + policy_assignment_parameters: Optional[str] = rest_field( + name="policyAssignmentParameters", visibility=["read", "create", "update", "delete", "query"] + ) + """Policy assignment parameters.""" + policy_assignment_scope: Optional[str] = rest_field( + name="policyAssignmentScope", visibility=["read", "create", "update", "delete", "query"] + ) + """Policy assignment scope.""" + policy_definition_name: Optional[str] = rest_field( + name="policyDefinitionName", visibility=["read", "create", "update", "delete", "query"] + ) + """Policy definition name.""" + policy_definition_action: Optional[str] = rest_field( + name="policyDefinitionAction", visibility=["read", "create", "update", "delete", "query"] + ) + """Policy definition action, i.e. effect.""" + policy_definition_category: Optional[str] = rest_field( + name="policyDefinitionCategory", visibility=["read", "create", "update", "delete", "query"] + ) + """Policy definition category.""" + policy_set_definition_id: Optional[str] = rest_field( + name="policySetDefinitionId", visibility=["read", "create", "update", "delete", "query"] + ) + """Policy set definition ID, if the policy assignment is for a policy set.""" + policy_set_definition_name: Optional[str] = rest_field( + name="policySetDefinitionName", visibility=["read", "create", "update", "delete", "query"] + ) + """Policy set definition name, if the policy assignment is for a policy set.""" + policy_set_definition_owner: Optional[str] = rest_field( + name="policySetDefinitionOwner", visibility=["read", "create", "update", "delete", "query"] + ) + """Policy set definition owner, if the policy assignment is for a policy set.""" + policy_set_definition_category: Optional[str] = rest_field( + name="policySetDefinitionCategory", visibility=["read", "create", "update", "delete", "query"] + ) + """Policy set definition category, if the policy assignment is for a policy set.""" + policy_set_definition_parameters: Optional[str] = rest_field( + name="policySetDefinitionParameters", visibility=["read", "create", "update", "delete", "query"] + ) + """Policy set definition parameters, if the policy assignment is for a policy set.""" + management_group_ids: Optional[str] = rest_field( + name="managementGroupIds", visibility=["read", "create", "update", "delete", "query"] + ) + """Comma separated list of management group IDs, which represent the hierarchy of the management + groups the resource is under.""" + policy_definition_reference_id: Optional[str] = rest_field( + name="policyDefinitionReferenceId", visibility=["read", "create", "update", "delete", "query"] + ) + """Reference ID for the policy definition inside the policy set, if the policy assignment is for a + policy set.""" + compliance_state: Optional[str] = rest_field( + name="complianceState", visibility=["read", "create", "update", "delete", "query"] + ) + """Compliance state of the resource.""" + tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read", "create", "update", "delete", "query"]) + """Tenant ID for the policy event record.""" + principal_oid: Optional[str] = rest_field( + name="principalOid", visibility=["read", "create", "update", "delete", "query"] + ) + """Principal object ID for the user who initiated the resource operation that triggered the policy + event.""" + components: Optional[list["_models.ComponentEventDetails"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Components events records populated only when URL contains $expand=components clause.""" + + @overload + def __init__( # pylint: disable=too-many-locals + self, + *, + odata_id: Optional[str] = None, + odata_context: Optional[str] = None, + timestamp: Optional[datetime.datetime] = None, + resource_id: Optional[str] = None, + policy_assignment_id: Optional[str] = None, + policy_definition_id: Optional[str] = None, + effective_parameters: Optional[str] = None, + is_compliant: Optional[bool] = None, + subscription_id: Optional[str] = None, + resource_type: Optional[str] = None, + resource_location: Optional[str] = None, + resource_group: Optional[str] = None, + resource_tags: Optional[str] = None, + policy_assignment_name: Optional[str] = None, + policy_assignment_owner: Optional[str] = None, + policy_assignment_parameters: Optional[str] = None, + policy_assignment_scope: Optional[str] = None, + policy_definition_name: Optional[str] = None, + policy_definition_action: Optional[str] = None, + policy_definition_category: Optional[str] = None, + policy_set_definition_id: Optional[str] = None, + policy_set_definition_name: Optional[str] = None, + policy_set_definition_owner: Optional[str] = None, + policy_set_definition_category: Optional[str] = None, + policy_set_definition_parameters: Optional[str] = None, + management_group_ids: Optional[str] = None, + policy_definition_reference_id: Optional[str] = None, + compliance_state: Optional[str] = None, + tenant_id: Optional[str] = None, + principal_oid: Optional[str] = None, + components: Optional[list["_models.ComponentEventDetails"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class PolicyGroupSummary(_Model): + """Policy definition group summary. + + :ivar policy_group_name: Policy group name. + :vartype policy_group_name: str + :ivar results: Compliance summary for the policy definition group. + :vartype results: ~azure.mgmt.policyinsights.models.SummaryResults + """ + + policy_group_name: Optional[str] = rest_field( + name="policyGroupName", visibility=["read", "create", "update", "delete", "query"] + ) + """Policy group name.""" + results: Optional["_models.SummaryResults"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Compliance summary for the policy definition group.""" + + @overload + def __init__( + self, + *, + policy_group_name: Optional[str] = None, + results: Optional["_models.SummaryResults"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class PolicyMetadata(ProxyResource): + """Policy metadata resource definition. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.policyinsights.models.SystemData + :ivar properties: Properties of the policy metadata. + :vartype properties: ~azure.mgmt.policyinsights.models.PolicyMetadataProperties + """ + + properties: Optional["_models.PolicyMetadataProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Properties of the policy metadata.""" + + __flattened_items = [ + "metadata_id", + "category", + "title", + "owner", + "additional_content_url", + "metadata", + "description", + "requirements", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.PolicyMetadataProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class PolicyMetadataSlimProperties(_Model): + """The properties of the policy metadata, excluding properties containing large strings. + + :ivar metadata_id: The policy metadata identifier. + :vartype metadata_id: str + :ivar category: The category of the policy metadata. + :vartype category: str + :ivar title: The title of the policy metadata. + :vartype title: str + :ivar owner: The owner of the policy metadata. + :vartype owner: str + :ivar additional_content_url: Url for getting additional content about the resource metadata. + :vartype additional_content_url: str + :ivar metadata: Additional metadata. + :vartype metadata: any + """ + + metadata_id: Optional[str] = rest_field(name="metadataId", visibility=["read"]) + """The policy metadata identifier.""" + category: Optional[str] = rest_field(visibility=["read"]) + """The category of the policy metadata.""" + title: Optional[str] = rest_field(visibility=["read"]) + """The title of the policy metadata.""" + owner: Optional[str] = rest_field(visibility=["read"]) + """The owner of the policy metadata.""" + additional_content_url: Optional[str] = rest_field(name="additionalContentUrl", visibility=["read"]) + """Url for getting additional content about the resource metadata.""" + metadata: Optional[Any] = rest_field(visibility=["read"]) + """Additional metadata.""" + + +class PolicyMetadataProperties(PolicyMetadataSlimProperties): + """The properties of the policy metadata. + + :ivar metadata_id: The policy metadata identifier. + :vartype metadata_id: str + :ivar category: The category of the policy metadata. + :vartype category: str + :ivar title: The title of the policy metadata. + :vartype title: str + :ivar owner: The owner of the policy metadata. + :vartype owner: str + :ivar additional_content_url: Url for getting additional content about the resource metadata. + :vartype additional_content_url: str + :ivar metadata: Additional metadata. + :vartype metadata: any + :ivar description: The description of the policy metadata. + :vartype description: str + :ivar requirements: The requirements of the policy metadata. + :vartype requirements: str + """ + + description: Optional[str] = rest_field(visibility=["read"]) + """The description of the policy metadata.""" + requirements: Optional[str] = rest_field(visibility=["read"]) + """The requirements of the policy metadata.""" + + +class PolicyReference(_Model): + """Resource identifiers for a policy. + + :ivar policy_definition_id: The resource identifier of the policy definition. + :vartype policy_definition_id: str + :ivar policy_set_definition_id: The resource identifier of the policy set definition. + :vartype policy_set_definition_id: str + :ivar policy_definition_reference_id: The reference identifier of a specific policy definition + within a policy set definition. + :vartype policy_definition_reference_id: str + :ivar policy_assignment_id: The resource identifier of the policy assignment. + :vartype policy_assignment_id: str + """ + + policy_definition_id: Optional[str] = rest_field(name="policyDefinitionId", visibility=["read"]) + """The resource identifier of the policy definition.""" + policy_set_definition_id: Optional[str] = rest_field(name="policySetDefinitionId", visibility=["read"]) + """The resource identifier of the policy set definition.""" + policy_definition_reference_id: Optional[str] = rest_field(name="policyDefinitionReferenceId", visibility=["read"]) + """The reference identifier of a specific policy definition within a policy set definition.""" + policy_assignment_id: Optional[str] = rest_field(name="policyAssignmentId", visibility=["read"]) + """The resource identifier of the policy assignment.""" + + +class PolicyState(_Model): + """Policy state record. + + :ivar odata_id: OData entity ID; always set to null since policy state records do not have an + entity ID. + :vartype odata_id: str + :ivar odata_context: OData context string; used by OData clients to resolve type information + based on metadata. + :vartype odata_context: str + :ivar timestamp: Timestamp for the policy state record. + :vartype timestamp: ~datetime.datetime + :ivar resource_id: Resource ID. + :vartype resource_id: str + :ivar policy_assignment_id: Policy assignment ID. + :vartype policy_assignment_id: str + :ivar policy_definition_id: Policy definition ID. + :vartype policy_definition_id: str + :ivar effective_parameters: Effective parameters for the policy assignment. + :vartype effective_parameters: str + :ivar is_compliant: Flag which states whether the resource is compliant against the policy + assignment it was evaluated against. This property is deprecated; please use ComplianceState + instead. + :vartype is_compliant: bool + :ivar subscription_id: Subscription ID. + :vartype subscription_id: str + :ivar resource_type: Resource type. + :vartype resource_type: str + :ivar resource_location: Resource location. + :vartype resource_location: str + :ivar resource_group: Resource group name. + :vartype resource_group: str + :ivar resource_tags: List of resource tags. + :vartype resource_tags: str + :ivar policy_assignment_name: Policy assignment name. + :vartype policy_assignment_name: str + :ivar policy_assignment_owner: Policy assignment owner. + :vartype policy_assignment_owner: str + :ivar policy_assignment_parameters: Policy assignment parameters. + :vartype policy_assignment_parameters: str + :ivar policy_assignment_scope: Policy assignment scope. + :vartype policy_assignment_scope: str + :ivar policy_definition_name: Policy definition name. + :vartype policy_definition_name: str + :ivar policy_definition_action: Policy definition action, i.e. effect. + :vartype policy_definition_action: str + :ivar policy_definition_category: Policy definition category. + :vartype policy_definition_category: str + :ivar policy_set_definition_id: Policy set definition ID, if the policy assignment is for a + policy set. + :vartype policy_set_definition_id: str + :ivar policy_set_definition_name: Policy set definition name, if the policy assignment is for a + policy set. + :vartype policy_set_definition_name: str + :ivar policy_set_definition_owner: Policy set definition owner, if the policy assignment is for + a policy set. + :vartype policy_set_definition_owner: str + :ivar policy_set_definition_category: Policy set definition category, if the policy assignment + is for a policy set. + :vartype policy_set_definition_category: str + :ivar policy_set_definition_parameters: Policy set definition parameters, if the policy + assignment is for a policy set. + :vartype policy_set_definition_parameters: str + :ivar management_group_ids: Comma separated list of management group IDs, which represent the + hierarchy of the management groups the resource is under. + :vartype management_group_ids: str + :ivar policy_definition_reference_id: Reference ID for the policy definition inside the policy + set, if the policy assignment is for a policy set. + :vartype policy_definition_reference_id: str + :ivar compliance_state: Compliance state of the resource. + :vartype compliance_state: str + :ivar policy_evaluation_details: Policy evaluation details. + :vartype policy_evaluation_details: ~azure.mgmt.policyinsights.models.PolicyEvaluationDetails + :ivar policy_definition_group_names: Policy definition group names. + :vartype policy_definition_group_names: list[str] + :ivar components: Components state compliance records populated only when URL contains + $expand=components clause. + :vartype components: list[~azure.mgmt.policyinsights.models.ComponentStateDetails] + :ivar policy_definition_version: Evaluated policy definition version. + :vartype policy_definition_version: str + :ivar policy_set_definition_version: Evaluated policy set definition version. + :vartype policy_set_definition_version: str + :ivar policy_assignment_version: Evaluated policy assignment version. + :vartype policy_assignment_version: str + """ + + odata_id: Optional[str] = rest_field(name="@odata.id", visibility=["read", "create", "update", "delete", "query"]) + """OData entity ID; always set to null since policy state records do not have an entity ID.""" + odata_context: Optional[str] = rest_field( + name="@odata.context", visibility=["read", "create", "update", "delete", "query"] + ) + """OData context string; used by OData clients to resolve type information based on metadata.""" + timestamp: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """Timestamp for the policy state record.""" + resource_id: Optional[str] = rest_field( + name="resourceId", visibility=["read", "create", "update", "delete", "query"] + ) + """Resource ID.""" + policy_assignment_id: Optional[str] = rest_field( + name="policyAssignmentId", visibility=["read", "create", "update", "delete", "query"] + ) + """Policy assignment ID.""" + policy_definition_id: Optional[str] = rest_field( + name="policyDefinitionId", visibility=["read", "create", "update", "delete", "query"] + ) + """Policy definition ID.""" + effective_parameters: Optional[str] = rest_field( + name="effectiveParameters", visibility=["read", "create", "update", "delete", "query"] + ) + """Effective parameters for the policy assignment.""" + is_compliant: Optional[bool] = rest_field( + name="isCompliant", visibility=["read", "create", "update", "delete", "query"] + ) + """Flag which states whether the resource is compliant against the policy assignment it was + evaluated against. This property is deprecated; please use ComplianceState instead.""" + subscription_id: Optional[str] = rest_field( + name="subscriptionId", visibility=["read", "create", "update", "delete", "query"] + ) + """Subscription ID.""" + resource_type: Optional[str] = rest_field( + name="resourceType", visibility=["read", "create", "update", "delete", "query"] + ) + """Resource type.""" + resource_location: Optional[str] = rest_field( + name="resourceLocation", visibility=["read", "create", "update", "delete", "query"] + ) + """Resource location.""" + resource_group: Optional[str] = rest_field( + name="resourceGroup", visibility=["read", "create", "update", "delete", "query"] + ) + """Resource group name.""" + resource_tags: Optional[str] = rest_field( + name="resourceTags", visibility=["read", "create", "update", "delete", "query"] + ) + """List of resource tags.""" + policy_assignment_name: Optional[str] = rest_field( + name="policyAssignmentName", visibility=["read", "create", "update", "delete", "query"] + ) + """Policy assignment name.""" + policy_assignment_owner: Optional[str] = rest_field( + name="policyAssignmentOwner", visibility=["read", "create", "update", "delete", "query"] + ) + """Policy assignment owner.""" + policy_assignment_parameters: Optional[str] = rest_field( + name="policyAssignmentParameters", visibility=["read", "create", "update", "delete", "query"] + ) + """Policy assignment parameters.""" + policy_assignment_scope: Optional[str] = rest_field( + name="policyAssignmentScope", visibility=["read", "create", "update", "delete", "query"] + ) + """Policy assignment scope.""" + policy_definition_name: Optional[str] = rest_field( + name="policyDefinitionName", visibility=["read", "create", "update", "delete", "query"] + ) + """Policy definition name.""" + policy_definition_action: Optional[str] = rest_field( + name="policyDefinitionAction", visibility=["read", "create", "update", "delete", "query"] + ) + """Policy definition action, i.e. effect.""" + policy_definition_category: Optional[str] = rest_field( + name="policyDefinitionCategory", visibility=["read", "create", "update", "delete", "query"] + ) + """Policy definition category.""" + policy_set_definition_id: Optional[str] = rest_field( + name="policySetDefinitionId", visibility=["read", "create", "update", "delete", "query"] + ) + """Policy set definition ID, if the policy assignment is for a policy set.""" + policy_set_definition_name: Optional[str] = rest_field( + name="policySetDefinitionName", visibility=["read", "create", "update", "delete", "query"] + ) + """Policy set definition name, if the policy assignment is for a policy set.""" + policy_set_definition_owner: Optional[str] = rest_field( + name="policySetDefinitionOwner", visibility=["read", "create", "update", "delete", "query"] + ) + """Policy set definition owner, if the policy assignment is for a policy set.""" + policy_set_definition_category: Optional[str] = rest_field( + name="policySetDefinitionCategory", visibility=["read", "create", "update", "delete", "query"] + ) + """Policy set definition category, if the policy assignment is for a policy set.""" + policy_set_definition_parameters: Optional[str] = rest_field( + name="policySetDefinitionParameters", visibility=["read", "create", "update", "delete", "query"] + ) + """Policy set definition parameters, if the policy assignment is for a policy set.""" + management_group_ids: Optional[str] = rest_field( + name="managementGroupIds", visibility=["read", "create", "update", "delete", "query"] + ) + """Comma separated list of management group IDs, which represent the hierarchy of the management + groups the resource is under.""" + policy_definition_reference_id: Optional[str] = rest_field( + name="policyDefinitionReferenceId", visibility=["read", "create", "update", "delete", "query"] + ) + """Reference ID for the policy definition inside the policy set, if the policy assignment is for a + policy set.""" + compliance_state: Optional[str] = rest_field( + name="complianceState", visibility=["read", "create", "update", "delete", "query"] + ) + """Compliance state of the resource.""" + policy_evaluation_details: Optional["_models.PolicyEvaluationDetails"] = rest_field( + name="policyEvaluationDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """Policy evaluation details.""" + policy_definition_group_names: Optional[list[str]] = rest_field( + name="policyDefinitionGroupNames", visibility=["read", "create", "update", "delete", "query"] + ) + """Policy definition group names.""" + components: Optional[list["_models.ComponentStateDetails"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Components state compliance records populated only when URL contains $expand=components clause.""" + policy_definition_version: Optional[str] = rest_field(name="policyDefinitionVersion", visibility=["read"]) + """Evaluated policy definition version.""" + policy_set_definition_version: Optional[str] = rest_field(name="policySetDefinitionVersion", visibility=["read"]) + """Evaluated policy set definition version.""" + policy_assignment_version: Optional[str] = rest_field(name="policyAssignmentVersion", visibility=["read"]) + """Evaluated policy assignment version.""" + + @overload + def __init__( # pylint: disable=too-many-locals + self, + *, + odata_id: Optional[str] = None, + odata_context: Optional[str] = None, + timestamp: Optional[datetime.datetime] = None, + resource_id: Optional[str] = None, + policy_assignment_id: Optional[str] = None, + policy_definition_id: Optional[str] = None, + effective_parameters: Optional[str] = None, + is_compliant: Optional[bool] = None, + subscription_id: Optional[str] = None, + resource_type: Optional[str] = None, + resource_location: Optional[str] = None, + resource_group: Optional[str] = None, + resource_tags: Optional[str] = None, + policy_assignment_name: Optional[str] = None, + policy_assignment_owner: Optional[str] = None, + policy_assignment_parameters: Optional[str] = None, + policy_assignment_scope: Optional[str] = None, + policy_definition_name: Optional[str] = None, + policy_definition_action: Optional[str] = None, + policy_definition_category: Optional[str] = None, + policy_set_definition_id: Optional[str] = None, + policy_set_definition_name: Optional[str] = None, + policy_set_definition_owner: Optional[str] = None, + policy_set_definition_category: Optional[str] = None, + policy_set_definition_parameters: Optional[str] = None, + management_group_ids: Optional[str] = None, + policy_definition_reference_id: Optional[str] = None, + compliance_state: Optional[str] = None, + policy_evaluation_details: Optional["_models.PolicyEvaluationDetails"] = None, + policy_definition_group_names: Optional[list[str]] = None, + components: Optional[list["_models.ComponentStateDetails"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class PolicyTrackedResource(_Model): + """Policy tracked resource record. + + :ivar tracked_resource_id: The ID of the policy tracked resource. + :vartype tracked_resource_id: str + :ivar policy_details: The details of the policy that require the tracked resource. + :vartype policy_details: ~azure.mgmt.policyinsights.models.PolicyDetails + :ivar created_by: The details of the policy triggered deployment that created the tracked + resource. + :vartype created_by: ~azure.mgmt.policyinsights.models.TrackedResourceModificationDetails + :ivar last_modified_by: The details of the policy triggered deployment that modified the + tracked resource. + :vartype last_modified_by: ~azure.mgmt.policyinsights.models.TrackedResourceModificationDetails + :ivar last_update_utc: Timestamp of the last update to the tracked resource. + :vartype last_update_utc: ~datetime.datetime + """ + + tracked_resource_id: Optional[str] = rest_field(name="trackedResourceId", visibility=["read"]) + """The ID of the policy tracked resource.""" + policy_details: Optional["_models.PolicyDetails"] = rest_field(name="policyDetails", visibility=["read"]) + """The details of the policy that require the tracked resource.""" + created_by: Optional["_models.TrackedResourceModificationDetails"] = rest_field( + name="createdBy", visibility=["read"] + ) + """The details of the policy triggered deployment that created the tracked resource.""" + last_modified_by: Optional["_models.TrackedResourceModificationDetails"] = rest_field( + name="lastModifiedBy", visibility=["read"] + ) + """The details of the policy triggered deployment that modified the tracked resource.""" + last_update_utc: Optional[datetime.datetime] = rest_field( + name="lastUpdateUtc", visibility=["read"], format="rfc3339" + ) + """Timestamp of the last update to the tracked resource.""" + + +class QueryFailure(_Model): + """Error response. + + :ivar error: Error definition. + :vartype error: ~azure.mgmt.policyinsights.models.QueryFailureError + """ + + error: Optional["_models.QueryFailureError"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Error definition.""" + + @overload + def __init__( + self, + *, + error: Optional["_models.QueryFailureError"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class QueryFailureError(_Model): + """Error definition. + + :ivar code: Service specific error code which serves as the substatus for the HTTP error code. + :vartype code: str + :ivar message: Description of the error. + :vartype message: str + """ + + code: Optional[str] = rest_field(visibility=["read"]) + """Service specific error code which serves as the substatus for the HTTP error code.""" + message: Optional[str] = rest_field(visibility=["read"]) + """Description of the error.""" + + +class Remediation(ProxyResource): + """The remediation definition. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.policyinsights.models.SystemData + :ivar properties: Properties for the remediation. + :vartype properties: ~azure.mgmt.policyinsights.models.RemediationProperties + """ + + properties: Optional["_models.RemediationProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Properties for the remediation.""" + + __flattened_items = [ + "policy_assignment_id", + "policy_definition_reference_id", + "resource_discovery_mode", + "provisioning_state", + "created_on", + "last_updated_on", + "filters", + "deployment_status", + "status_message", + "correlation_id", + "resource_count", + "parallel_deployments", + "failure_threshold", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.RemediationProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class RemediationDeployment(_Model): + """Details of a single deployment created by the remediation. + + :ivar remediated_resource_id: Resource ID of the resource that is being remediated by the + deployment. + :vartype remediated_resource_id: str + :ivar deployment_id: Resource ID of the template deployment that will remediate the resource. + :vartype deployment_id: str + :ivar status: Status of the remediation deployment. + :vartype status: str + :ivar resource_location: Location of the resource that is being remediated. + :vartype resource_location: str + :ivar error: Error encountered while remediated the resource. + :vartype error: ~azure.mgmt.policyinsights.models.ErrorDefinition + :ivar created_on: The time at which the remediation was created. + :vartype created_on: ~datetime.datetime + :ivar last_updated_on: The time at which the remediation deployment was last updated. + :vartype last_updated_on: ~datetime.datetime + """ + + remediated_resource_id: Optional[str] = rest_field(name="remediatedResourceId", visibility=["read"]) + """Resource ID of the resource that is being remediated by the deployment.""" + deployment_id: Optional[str] = rest_field(name="deploymentId", visibility=["read"]) + """Resource ID of the template deployment that will remediate the resource.""" + status: Optional[str] = rest_field(visibility=["read"]) + """Status of the remediation deployment.""" + resource_location: Optional[str] = rest_field(name="resourceLocation", visibility=["read"]) + """Location of the resource that is being remediated.""" + error: Optional["_models.ErrorDefinition"] = rest_field(visibility=["read"]) + """Error encountered while remediated the resource.""" + created_on: Optional[datetime.datetime] = rest_field(name="createdOn", visibility=["read"], format="rfc3339") + """The time at which the remediation was created.""" + last_updated_on: Optional[datetime.datetime] = rest_field( + name="lastUpdatedOn", visibility=["read"], format="rfc3339" + ) + """The time at which the remediation deployment was last updated.""" + + +class RemediationDeploymentSummary(_Model): + """The deployment status summary for all deployments created by the remediation. + + :ivar total_deployments: The number of deployments required by the remediation. + :vartype total_deployments: int + :ivar successful_deployments: The number of deployments required by the remediation that have + succeeded. + :vartype successful_deployments: int + :ivar failed_deployments: The number of deployments required by the remediation that have + failed. + :vartype failed_deployments: int + """ + + total_deployments: Optional[int] = rest_field(name="totalDeployments", visibility=["read"]) + """The number of deployments required by the remediation.""" + successful_deployments: Optional[int] = rest_field(name="successfulDeployments", visibility=["read"]) + """The number of deployments required by the remediation that have succeeded.""" + failed_deployments: Optional[int] = rest_field(name="failedDeployments", visibility=["read"]) + """The number of deployments required by the remediation that have failed.""" + + +class RemediationFilters(_Model): + """The filters that will be applied to determine which resources to remediate. + + :ivar locations: The resource locations that will be remediated. + :vartype locations: list[str] + :ivar resource_ids: The IDs of the resources that will be remediated. Can specify at most 100 + IDs. This filter cannot be used when ReEvaluateCompliance is set to ReEvaluateCompliance, and + cannot be empty if provided. + :vartype resource_ids: list[str] + """ + + locations: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The resource locations that will be remediated.""" + resource_ids: Optional[list[str]] = rest_field( + name="resourceIds", visibility=["read", "create", "update", "delete", "query"] + ) + """The IDs of the resources that will be remediated. Can specify at most 100 IDs. This filter + cannot be used when ReEvaluateCompliance is set to ReEvaluateCompliance, and cannot be empty if + provided.""" + + @overload + def __init__( + self, + *, + locations: Optional[list[str]] = None, + resource_ids: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class RemediationProperties(_Model): + """The remediation properties. + + :ivar policy_assignment_id: The resource ID of the policy assignment that should be remediated. + :vartype policy_assignment_id: str + :ivar policy_definition_reference_id: The policy definition reference ID of the individual + definition that should be remediated. Required when the policy assignment being remediated + assigns a policy set definition. + :vartype policy_definition_reference_id: str + :ivar resource_discovery_mode: The way resources to remediate are discovered. Defaults to + ExistingNonCompliant if not specified. Known values are: "ExistingNonCompliant" and + "ReEvaluateCompliance". + :vartype resource_discovery_mode: str or + ~azure.mgmt.policyinsights.models.ResourceDiscoveryMode + :ivar provisioning_state: The status of the remediation. This refers to the entire remediation + task, not individual deployments. Allowed values are Evaluating, Canceled, Cancelling, Failed, + Complete, or Succeeded. + :vartype provisioning_state: str + :ivar created_on: The time at which the remediation was created. + :vartype created_on: ~datetime.datetime + :ivar last_updated_on: The time at which the remediation was last updated. + :vartype last_updated_on: ~datetime.datetime + :ivar filters: The filters that will be applied to determine which resources to remediate. + :vartype filters: ~azure.mgmt.policyinsights.models.RemediationFilters + :ivar deployment_status: The deployment status summary for all deployments created by the + remediation. + :vartype deployment_status: ~azure.mgmt.policyinsights.models.RemediationDeploymentSummary + :ivar status_message: The remediation status message. Provides additional details regarding the + state of the remediation. + :vartype status_message: str + :ivar correlation_id: The remediation correlation Id. Can be used to find events related to the + remediation in the activity log. + :vartype correlation_id: str + :ivar resource_count: Determines the max number of resources that can be remediated by the + remediation job. If not provided, the default resource count is used. + :vartype resource_count: int + :ivar parallel_deployments: Determines how many resources to remediate at any given time. Can + be used to increase or reduce the pace of the remediation. If not provided, the default + parallel deployments value is used. + :vartype parallel_deployments: int + :ivar failure_threshold: The remediation failure threshold settings. + :vartype failure_threshold: + ~azure.mgmt.policyinsights.models.RemediationPropertiesFailureThreshold + """ + + policy_assignment_id: Optional[str] = rest_field( + name="policyAssignmentId", visibility=["read", "create", "update", "delete", "query"] + ) + """The resource ID of the policy assignment that should be remediated.""" + policy_definition_reference_id: Optional[str] = rest_field( + name="policyDefinitionReferenceId", visibility=["read", "create", "update", "delete", "query"] + ) + """The policy definition reference ID of the individual definition that should be remediated. + Required when the policy assignment being remediated assigns a policy set definition.""" + resource_discovery_mode: Optional[Union[str, "_models.ResourceDiscoveryMode"]] = rest_field( + name="resourceDiscoveryMode", visibility=["read", "create", "update", "delete", "query"] + ) + """The way resources to remediate are discovered. Defaults to ExistingNonCompliant if not + specified. Known values are: \"ExistingNonCompliant\" and \"ReEvaluateCompliance\".""" + provisioning_state: Optional[str] = rest_field(name="provisioningState", visibility=["read"]) + """The status of the remediation. This refers to the entire remediation task, not individual + deployments. Allowed values are Evaluating, Canceled, Cancelling, Failed, Complete, or + Succeeded.""" + created_on: Optional[datetime.datetime] = rest_field(name="createdOn", visibility=["read"], format="rfc3339") + """The time at which the remediation was created.""" + last_updated_on: Optional[datetime.datetime] = rest_field( + name="lastUpdatedOn", visibility=["read"], format="rfc3339" + ) + """The time at which the remediation was last updated.""" + filters: Optional["_models.RemediationFilters"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The filters that will be applied to determine which resources to remediate.""" + deployment_status: Optional["_models.RemediationDeploymentSummary"] = rest_field( + name="deploymentStatus", visibility=["read"] + ) + """The deployment status summary for all deployments created by the remediation.""" + status_message: Optional[str] = rest_field(name="statusMessage", visibility=["read"]) + """The remediation status message. Provides additional details regarding the state of the + remediation.""" + correlation_id: Optional[str] = rest_field(name="correlationId", visibility=["read"]) + """The remediation correlation Id. Can be used to find events related to the remediation in the + activity log.""" + resource_count: Optional[int] = rest_field( + name="resourceCount", visibility=["read", "create", "update", "delete", "query"] + ) + """Determines the max number of resources that can be remediated by the remediation job. If not + provided, the default resource count is used.""" + parallel_deployments: Optional[int] = rest_field( + name="parallelDeployments", visibility=["read", "create", "update", "delete", "query"] + ) + """Determines how many resources to remediate at any given time. Can be used to increase or reduce + the pace of the remediation. If not provided, the default parallel deployments value is used.""" + failure_threshold: Optional["_models.RemediationPropertiesFailureThreshold"] = rest_field( + name="failureThreshold", visibility=["read", "create", "update", "delete", "query"] + ) + """The remediation failure threshold settings.""" + + @overload + def __init__( + self, + *, + policy_assignment_id: Optional[str] = None, + policy_definition_reference_id: Optional[str] = None, + resource_discovery_mode: Optional[Union[str, "_models.ResourceDiscoveryMode"]] = None, + filters: Optional["_models.RemediationFilters"] = None, + resource_count: Optional[int] = None, + parallel_deployments: Optional[int] = None, + failure_threshold: Optional["_models.RemediationPropertiesFailureThreshold"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class RemediationPropertiesFailureThreshold(_Model): + """The remediation failure threshold settings. + + :ivar percentage: A number between 0.0 to 1.0 representing the percentage failure threshold. + The remediation will fail if the percentage of failed remediation operations (i.e. failed + deployments) exceeds this threshold. + :vartype percentage: float + """ + + percentage: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A number between 0.0 to 1.0 representing the percentage failure threshold. The remediation will + fail if the percentage of failed remediation operations (i.e. failed deployments) exceeds this + threshold.""" + + @overload + def __init__( + self, + *, + percentage: Optional[float] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SlimPolicyMetadata(_Model): + """Slim version of policy metadata resource definition, excluding properties with large strings. + + :ivar properties: Properties of the policy metadata. + :vartype properties: ~azure.mgmt.policyinsights.models.PolicyMetadataSlimProperties + :ivar id: The ID of the policy metadata. + :vartype id: str + :ivar type: The type of the policy metadata. + :vartype type: str + :ivar name: The name of the policy metadata. + :vartype name: str + """ + + properties: Optional["_models.PolicyMetadataSlimProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Properties of the policy metadata.""" + id: Optional[str] = rest_field(visibility=["read"]) + """The ID of the policy metadata.""" + type: Optional[str] = rest_field(visibility=["read"]) + """The type of the policy metadata.""" + name: Optional[str] = rest_field(visibility=["read"]) + """The name of the policy metadata.""" + + __flattened_items = ["metadata_id", "category", "title", "owner", "additional_content_url", "metadata"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.PolicyMetadataSlimProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class SummarizeResults(_Model): + """Summarize action results. + + :ivar odata_context: OData context string; used by OData clients to resolve type information + based on metadata. + :vartype odata_context: str + :ivar odata_count: OData entity count; represents the number of summaries returned; always set + to 1. + :vartype odata_count: int + :ivar value: Summarize action results. + :vartype value: list[~azure.mgmt.policyinsights.models.Summary] + """ + + odata_context: Optional[str] = rest_field( + name="@odata.context", visibility=["read", "create", "update", "delete", "query"] + ) + """OData context string; used by OData clients to resolve type information based on metadata.""" + odata_count: Optional[int] = rest_field( + name="@odata.count", visibility=["read", "create", "update", "delete", "query"] + ) + """OData entity count; represents the number of summaries returned; always set to 1.""" + value: Optional[list["_models.Summary"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Summarize action results.""" + + @overload + def __init__( + self, + *, + odata_context: Optional[str] = None, + odata_count: Optional[int] = None, + value: Optional[list["_models.Summary"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Summary(_Model): + """Summary results. + + :ivar odata_id: OData entity ID; always set to null since summaries do not have an entity ID. + :vartype odata_id: str + :ivar odata_context: OData context string; used by OData clients to resolve type information + based on metadata. + :vartype odata_context: str + :ivar results: Compliance summary for all policy assignments. + :vartype results: ~azure.mgmt.policyinsights.models.SummaryResults + :ivar policy_assignments: Policy assignments summary. + :vartype policy_assignments: list[~azure.mgmt.policyinsights.models.PolicyAssignmentSummary] + """ + + odata_id: Optional[str] = rest_field(name="@odata.id", visibility=["read", "create", "update", "delete", "query"]) + """OData entity ID; always set to null since summaries do not have an entity ID.""" + odata_context: Optional[str] = rest_field( + name="@odata.context", visibility=["read", "create", "update", "delete", "query"] + ) + """OData context string; used by OData clients to resolve type information based on metadata.""" + results: Optional["_models.SummaryResults"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Compliance summary for all policy assignments.""" + policy_assignments: Optional[list["_models.PolicyAssignmentSummary"]] = rest_field( + name="policyAssignments", visibility=["read", "create", "update", "delete", "query"] + ) + """Policy assignments summary.""" + + @overload + def __init__( + self, + *, + odata_id: Optional[str] = None, + odata_context: Optional[str] = None, + results: Optional["_models.SummaryResults"] = None, + policy_assignments: Optional[list["_models.PolicyAssignmentSummary"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SummaryResults(_Model): + """Compliance summary on a particular summary level. + + :ivar query_results_uri: HTTP POST URI for queryResults action on Microsoft.PolicyInsights to + retrieve raw results for the compliance summary. This property will not be available by default + in future API versions, but could be queried explicitly. + :vartype query_results_uri: str + :ivar non_compliant_resources: Number of non-compliant resources. + :vartype non_compliant_resources: int + :ivar non_compliant_policies: Number of non-compliant policies. + :vartype non_compliant_policies: int + :ivar resource_details: The resources summary at this level. + :vartype resource_details: list[~azure.mgmt.policyinsights.models.ComplianceDetail] + :ivar policy_details: The policy artifact summary at this level. For query scope level, it + represents policy assignment summary. For policy assignment level, it represents policy + definitions summary. + :vartype policy_details: list[~azure.mgmt.policyinsights.models.ComplianceDetail] + :ivar policy_group_details: The policy definition group summary at this level. + :vartype policy_group_details: list[~azure.mgmt.policyinsights.models.ComplianceDetail] + """ + + query_results_uri: Optional[str] = rest_field( + name="queryResultsUri", visibility=["read", "create", "update", "delete", "query"] + ) + """HTTP POST URI for queryResults action on Microsoft.PolicyInsights to retrieve raw results for + the compliance summary. This property will not be available by default in future API versions, + but could be queried explicitly.""" + non_compliant_resources: Optional[int] = rest_field( + name="nonCompliantResources", visibility=["read", "create", "update", "delete", "query"] + ) + """Number of non-compliant resources.""" + non_compliant_policies: Optional[int] = rest_field( + name="nonCompliantPolicies", visibility=["read", "create", "update", "delete", "query"] + ) + """Number of non-compliant policies.""" + resource_details: Optional[list["_models.ComplianceDetail"]] = rest_field( + name="resourceDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """The resources summary at this level.""" + policy_details: Optional[list["_models.ComplianceDetail"]] = rest_field( + name="policyDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """The policy artifact summary at this level. For query scope level, it represents policy + assignment summary. For policy assignment level, it represents policy definitions summary.""" + policy_group_details: Optional[list["_models.ComplianceDetail"]] = rest_field( + name="policyGroupDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """The policy definition group summary at this level.""" + + @overload + def __init__( + self, + *, + query_results_uri: Optional[str] = None, + non_compliant_resources: Optional[int] = None, + non_compliant_policies: Optional[int] = None, + resource_details: Optional[list["_models.ComplianceDetail"]] = None, + policy_details: Optional[list["_models.ComplianceDetail"]] = None, + policy_group_details: Optional[list["_models.ComplianceDetail"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SystemData(_Model): + """Metadata pertaining to creation and last modification of the resource. + + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Known values are: + "User", "Application", "ManagedIdentity", and "Key". + :vartype created_by_type: str or ~azure.mgmt.policyinsights.models.CreatedByType + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: ~datetime.datetime + :ivar last_modified_by: The identity that last modified the resource. + :vartype last_modified_by: str + :ivar last_modified_by_type: The type of identity that last modified the resource. Known values + are: "User", "Application", "ManagedIdentity", and "Key". + :vartype last_modified_by_type: str or ~azure.mgmt.policyinsights.models.CreatedByType + :ivar last_modified_at: The timestamp of resource last modification (UTC). + :vartype last_modified_at: ~datetime.datetime + """ + + created_by: Optional[str] = rest_field(name="createdBy", visibility=["read", "create", "update", "delete", "query"]) + """The identity that created the resource.""" + created_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field( + name="createdByType", visibility=["read", "create", "update", "delete", "query"] + ) + """The type of identity that created the resource. Known values are: \"User\", \"Application\", + \"ManagedIdentity\", and \"Key\".""" + created_at: Optional[datetime.datetime] = rest_field( + name="createdAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The timestamp of resource creation (UTC).""" + last_modified_by: Optional[str] = rest_field( + name="lastModifiedBy", visibility=["read", "create", "update", "delete", "query"] + ) + """The identity that last modified the resource.""" + last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field( + name="lastModifiedByType", visibility=["read", "create", "update", "delete", "query"] + ) + """The type of identity that last modified the resource. Known values are: \"User\", + \"Application\", \"ManagedIdentity\", and \"Key\".""" + last_modified_at: Optional[datetime.datetime] = rest_field( + name="lastModifiedAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The timestamp of resource last modification (UTC).""" + + @overload + def __init__( + self, + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TrackedResourceModificationDetails(_Model): + """The details of the policy triggered deployment that created or modified the tracked resource. + + :ivar policy_details: The details of the policy that created or modified the tracked resource. + :vartype policy_details: ~azure.mgmt.policyinsights.models.PolicyDetails + :ivar deployment_id: The ID of the deployment that created or modified the tracked resource. + :vartype deployment_id: str + :ivar deployment_time: Timestamp of the deployment that created or modified the tracked + resource. + :vartype deployment_time: ~datetime.datetime + """ + + policy_details: Optional["_models.PolicyDetails"] = rest_field(name="policyDetails", visibility=["read"]) + """The details of the policy that created or modified the tracked resource.""" + deployment_id: Optional[str] = rest_field(name="deploymentId", visibility=["read"]) + """The ID of the deployment that created or modified the tracked resource.""" + deployment_time: Optional[datetime.datetime] = rest_field( + name="deploymentTime", visibility=["read"], format="rfc3339" + ) + """Timestamp of the deployment that created or modified the tracked resource.""" + + +class TypedErrorInfo(_Model): + """Scenario specific error details. + + :ivar type: The type of included error details. + :vartype type: str + :ivar info: The scenario specific error details. + :vartype info: any + """ + + type: Optional[str] = rest_field(visibility=["read"]) + """The type of included error details.""" + info: Optional[Any] = rest_field(visibility=["read"]) + """The scenario specific error details.""" diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/_models_py3.py b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/_models_py3.py deleted file mode 100644 index def92d910c99..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/_models_py3.py +++ /dev/null @@ -1,3612 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression,too-many-lines -# 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 collections.abc import MutableMapping -import datetime -from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union - -from .._utils import serialization as _serialization - -if TYPE_CHECKING: - from .. import models as _models -JSON = MutableMapping[str, Any] - - -class Resource(_serialization.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.id: Optional[str] = None - self.name: Optional[str] = None - self.type: Optional[str] = None - - -class Attestation(Resource): - """An attestation resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.policyinsights.models.SystemData - :ivar policy_assignment_id: The resource ID of the policy assignment that the attestation is - setting the state for. Required. - :vartype policy_assignment_id: str - :ivar policy_definition_reference_id: The policy definition reference ID from a policy set - definition that the attestation is setting the state for. If the policy assignment assigns a - policy set definition the attestation can choose a definition within the set definition with - this property or omit this and set the state for the entire set definition. - :vartype policy_definition_reference_id: str - :ivar compliance_state: The compliance state that should be set on the resource. Known values - are: "Compliant", "NonCompliant", and "Unknown". - :vartype compliance_state: str or ~azure.mgmt.policyinsights.models.ComplianceState - :ivar expires_on: The time the compliance state should expire. - :vartype expires_on: ~datetime.datetime - :ivar owner: The person responsible for setting the state of the resource. This value is - typically an Azure Active Directory object ID. - :vartype owner: str - :ivar comments: Comments describing why this attestation was created. - :vartype comments: str - :ivar evidence: The evidence supporting the compliance state set in this attestation. - :vartype evidence: list[~azure.mgmt.policyinsights.models.AttestationEvidence] - :ivar provisioning_state: The status of the attestation. - :vartype provisioning_state: str - :ivar last_compliance_state_change_at: The time the compliance state was last changed in this - attestation. - :vartype last_compliance_state_change_at: ~datetime.datetime - :ivar assessment_date: The time the evidence was assessed. - :vartype assessment_date: ~datetime.datetime - :ivar metadata: Additional metadata for this attestation. - :vartype metadata: JSON - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "policy_assignment_id": {"required": True}, - "provisioning_state": {"readonly": True}, - "last_compliance_state_change_at": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "policy_assignment_id": {"key": "properties.policyAssignmentId", "type": "str"}, - "policy_definition_reference_id": {"key": "properties.policyDefinitionReferenceId", "type": "str"}, - "compliance_state": {"key": "properties.complianceState", "type": "str"}, - "expires_on": {"key": "properties.expiresOn", "type": "iso-8601"}, - "owner": {"key": "properties.owner", "type": "str"}, - "comments": {"key": "properties.comments", "type": "str"}, - "evidence": {"key": "properties.evidence", "type": "[AttestationEvidence]"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "last_compliance_state_change_at": {"key": "properties.lastComplianceStateChangeAt", "type": "iso-8601"}, - "assessment_date": {"key": "properties.assessmentDate", "type": "iso-8601"}, - "metadata": {"key": "properties.metadata", "type": "object"}, - } - - def __init__( - self, - *, - policy_assignment_id: str, - policy_definition_reference_id: Optional[str] = None, - compliance_state: Optional[Union[str, "_models.ComplianceState"]] = None, - expires_on: Optional[datetime.datetime] = None, - owner: Optional[str] = None, - comments: Optional[str] = None, - evidence: Optional[List["_models.AttestationEvidence"]] = None, - assessment_date: Optional[datetime.datetime] = None, - metadata: Optional[JSON] = None, - **kwargs: Any - ) -> None: - """ - :keyword policy_assignment_id: The resource ID of the policy assignment that the attestation is - setting the state for. Required. - :paramtype policy_assignment_id: str - :keyword policy_definition_reference_id: The policy definition reference ID from a policy set - definition that the attestation is setting the state for. If the policy assignment assigns a - policy set definition the attestation can choose a definition within the set definition with - this property or omit this and set the state for the entire set definition. - :paramtype policy_definition_reference_id: str - :keyword compliance_state: The compliance state that should be set on the resource. Known - values are: "Compliant", "NonCompliant", and "Unknown". - :paramtype compliance_state: str or ~azure.mgmt.policyinsights.models.ComplianceState - :keyword expires_on: The time the compliance state should expire. - :paramtype expires_on: ~datetime.datetime - :keyword owner: The person responsible for setting the state of the resource. This value is - typically an Azure Active Directory object ID. - :paramtype owner: str - :keyword comments: Comments describing why this attestation was created. - :paramtype comments: str - :keyword evidence: The evidence supporting the compliance state set in this attestation. - :paramtype evidence: list[~azure.mgmt.policyinsights.models.AttestationEvidence] - :keyword assessment_date: The time the evidence was assessed. - :paramtype assessment_date: ~datetime.datetime - :keyword metadata: Additional metadata for this attestation. - :paramtype metadata: JSON - """ - super().__init__(**kwargs) - self.system_data: Optional["_models.SystemData"] = None - self.policy_assignment_id = policy_assignment_id - self.policy_definition_reference_id = policy_definition_reference_id - self.compliance_state = compliance_state - self.expires_on = expires_on - self.owner = owner - self.comments = comments - self.evidence = evidence - self.provisioning_state: Optional[str] = None - self.last_compliance_state_change_at: Optional[datetime.datetime] = None - self.assessment_date = assessment_date - self.metadata = metadata - - -class AttestationEvidence(_serialization.Model): - """A piece of evidence supporting the compliance state set in the attestation. - - :ivar description: The description for this piece of evidence. - :vartype description: str - :ivar source_uri: The URI location of the evidence. - :vartype source_uri: str - """ - - _attribute_map = { - "description": {"key": "description", "type": "str"}, - "source_uri": {"key": "sourceUri", "type": "str"}, - } - - def __init__(self, *, description: Optional[str] = None, source_uri: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword description: The description for this piece of evidence. - :paramtype description: str - :keyword source_uri: The URI location of the evidence. - :paramtype source_uri: str - """ - super().__init__(**kwargs) - self.description = description - self.source_uri = source_uri - - -class AttestationListResult(_serialization.Model): - """List of attestations. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of attestation definitions. - :vartype value: list[~azure.mgmt.policyinsights.models.Attestation] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[Attestation]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[List["_models.Attestation"]] = None - self.next_link: Optional[str] = None - - -class CheckManagementGroupRestrictionsRequest(_serialization.Model): - """The check policy restrictions parameters describing the resource that is being evaluated. - - :ivar resource_details: The information about the resource that will be evaluated. - :vartype resource_details: ~azure.mgmt.policyinsights.models.CheckRestrictionsResourceDetails - :ivar pending_fields: The list of fields and values that should be evaluated for potential - restrictions. - :vartype pending_fields: list[~azure.mgmt.policyinsights.models.PendingField] - """ - - _attribute_map = { - "resource_details": {"key": "resourceDetails", "type": "CheckRestrictionsResourceDetails"}, - "pending_fields": {"key": "pendingFields", "type": "[PendingField]"}, - } - - def __init__( - self, - *, - resource_details: Optional["_models.CheckRestrictionsResourceDetails"] = None, - pending_fields: Optional[List["_models.PendingField"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword resource_details: The information about the resource that will be evaluated. - :paramtype resource_details: ~azure.mgmt.policyinsights.models.CheckRestrictionsResourceDetails - :keyword pending_fields: The list of fields and values that should be evaluated for potential - restrictions. - :paramtype pending_fields: list[~azure.mgmt.policyinsights.models.PendingField] - """ - super().__init__(**kwargs) - self.resource_details = resource_details - self.pending_fields = pending_fields - - -class CheckRestrictionEvaluationDetails(_serialization.Model): - """Policy evaluation details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar evaluated_expressions: Details of the evaluated expressions. - :vartype evaluated_expressions: - list[~azure.mgmt.policyinsights.models.ExpressionEvaluationDetails] - :ivar if_not_exists_details: Evaluation details of IfNotExists effect. - :vartype if_not_exists_details: ~azure.mgmt.policyinsights.models.IfNotExistsEvaluationDetails - :ivar reason: The reason for the evaluation result. - :vartype reason: str - """ - - _validation = { - "reason": {"readonly": True}, - } - - _attribute_map = { - "evaluated_expressions": {"key": "evaluatedExpressions", "type": "[ExpressionEvaluationDetails]"}, - "if_not_exists_details": {"key": "ifNotExistsDetails", "type": "IfNotExistsEvaluationDetails"}, - "reason": {"key": "reason", "type": "str"}, - } - - def __init__( - self, - *, - evaluated_expressions: Optional[List["_models.ExpressionEvaluationDetails"]] = None, - if_not_exists_details: Optional["_models.IfNotExistsEvaluationDetails"] = None, - **kwargs: Any - ) -> None: - """ - :keyword evaluated_expressions: Details of the evaluated expressions. - :paramtype evaluated_expressions: - list[~azure.mgmt.policyinsights.models.ExpressionEvaluationDetails] - :keyword if_not_exists_details: Evaluation details of IfNotExists effect. - :paramtype if_not_exists_details: - ~azure.mgmt.policyinsights.models.IfNotExistsEvaluationDetails - """ - super().__init__(**kwargs) - self.evaluated_expressions = evaluated_expressions - self.if_not_exists_details = if_not_exists_details - self.reason: Optional[str] = None - - -class CheckRestrictionsRequest(_serialization.Model): - """The check policy restrictions parameters describing the resource that is being evaluated. - - All required parameters must be populated in order to send to server. - - :ivar resource_details: The information about the resource that will be evaluated. Required. - :vartype resource_details: ~azure.mgmt.policyinsights.models.CheckRestrictionsResourceDetails - :ivar pending_fields: The list of fields and values that should be evaluated for potential - restrictions. - :vartype pending_fields: list[~azure.mgmt.policyinsights.models.PendingField] - :ivar include_audit_effect: Whether to include policies with the 'audit' effect in the results. - Defaults to false. - :vartype include_audit_effect: bool - """ - - _validation = { - "resource_details": {"required": True}, - } - - _attribute_map = { - "resource_details": {"key": "resourceDetails", "type": "CheckRestrictionsResourceDetails"}, - "pending_fields": {"key": "pendingFields", "type": "[PendingField]"}, - "include_audit_effect": {"key": "includeAuditEffect", "type": "bool"}, - } - - def __init__( - self, - *, - resource_details: "_models.CheckRestrictionsResourceDetails", - pending_fields: Optional[List["_models.PendingField"]] = None, - include_audit_effect: bool = False, - **kwargs: Any - ) -> None: - """ - :keyword resource_details: The information about the resource that will be evaluated. Required. - :paramtype resource_details: ~azure.mgmt.policyinsights.models.CheckRestrictionsResourceDetails - :keyword pending_fields: The list of fields and values that should be evaluated for potential - restrictions. - :paramtype pending_fields: list[~azure.mgmt.policyinsights.models.PendingField] - :keyword include_audit_effect: Whether to include policies with the 'audit' effect in the - results. Defaults to false. - :paramtype include_audit_effect: bool - """ - super().__init__(**kwargs) - self.resource_details = resource_details - self.pending_fields = pending_fields - self.include_audit_effect = include_audit_effect - - -class CheckRestrictionsResourceDetails(_serialization.Model): - """The information about the resource that will be evaluated. - - All required parameters must be populated in order to send to server. - - :ivar resource_content: The resource content. This should include whatever properties are - already known and can be a partial set of all resource properties. Required. - :vartype resource_content: JSON - :ivar api_version: The api-version of the resource content. - :vartype api_version: str - :ivar scope: The scope where the resource is being created. For example, if the resource is a - child resource this would be the parent resource's resource ID. - :vartype scope: str - """ - - _validation = { - "resource_content": {"required": True}, - } - - _attribute_map = { - "resource_content": {"key": "resourceContent", "type": "object"}, - "api_version": {"key": "apiVersion", "type": "str"}, - "scope": {"key": "scope", "type": "str"}, - } - - def __init__( - self, *, resource_content: JSON, api_version: Optional[str] = None, scope: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword resource_content: The resource content. This should include whatever properties are - already known and can be a partial set of all resource properties. Required. - :paramtype resource_content: JSON - :keyword api_version: The api-version of the resource content. - :paramtype api_version: str - :keyword scope: The scope where the resource is being created. For example, if the resource is - a child resource this would be the parent resource's resource ID. - :paramtype scope: str - """ - super().__init__(**kwargs) - self.resource_content = resource_content - self.api_version = api_version - self.scope = scope - - -class CheckRestrictionsResult(_serialization.Model): - """The result of a check policy restrictions evaluation on a resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar field_restrictions: The restrictions that will be placed on various fields in the - resource by policy. - :vartype field_restrictions: list[~azure.mgmt.policyinsights.models.FieldRestrictions] - :ivar content_evaluation_result: Evaluation results for the provided partial resource content. - :vartype content_evaluation_result: - ~azure.mgmt.policyinsights.models.CheckRestrictionsResultContentEvaluationResult - """ - - _validation = { - "field_restrictions": {"readonly": True}, - "content_evaluation_result": {"readonly": True}, - } - - _attribute_map = { - "field_restrictions": {"key": "fieldRestrictions", "type": "[FieldRestrictions]"}, - "content_evaluation_result": { - "key": "contentEvaluationResult", - "type": "CheckRestrictionsResultContentEvaluationResult", - }, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.field_restrictions: Optional[List["_models.FieldRestrictions"]] = None - self.content_evaluation_result: Optional["_models.CheckRestrictionsResultContentEvaluationResult"] = None - - -class CheckRestrictionsResultContentEvaluationResult(_serialization.Model): # pylint: disable=name-too-long - """Evaluation results for the provided partial resource content. - - :ivar policy_evaluations: Policy evaluation results against the given resource content. This - will indicate if the partial content that was provided will be denied as-is. - :vartype policy_evaluations: list[~azure.mgmt.policyinsights.models.PolicyEvaluationResult] - """ - - _attribute_map = { - "policy_evaluations": {"key": "policyEvaluations", "type": "[PolicyEvaluationResult]"}, - } - - def __init__( - self, *, policy_evaluations: Optional[List["_models.PolicyEvaluationResult"]] = None, **kwargs: Any - ) -> None: - """ - :keyword policy_evaluations: Policy evaluation results against the given resource content. This - will indicate if the partial content that was provided will be denied as-is. - :paramtype policy_evaluations: list[~azure.mgmt.policyinsights.models.PolicyEvaluationResult] - """ - super().__init__(**kwargs) - self.policy_evaluations = policy_evaluations - - -class ComplianceDetail(_serialization.Model): - """The compliance state rollup. - - :ivar compliance_state: The compliance state. - :vartype compliance_state: str - :ivar count: Summarized count value for this compliance state. - :vartype count: int - """ - - _attribute_map = { - "compliance_state": {"key": "complianceState", "type": "str"}, - "count": {"key": "count", "type": "int"}, - } - - def __init__(self, *, compliance_state: Optional[str] = None, count: Optional[int] = None, **kwargs: Any) -> None: - """ - :keyword compliance_state: The compliance state. - :paramtype compliance_state: str - :keyword count: Summarized count value for this compliance state. - :paramtype count: int - """ - super().__init__(**kwargs) - self.compliance_state = compliance_state - self.count = count - - -class ComponentEventDetails(_serialization.Model): - """Component event details. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar id: Component Id. - :vartype id: str - :ivar type: Component type. - :vartype type: str - :ivar name: Component name. - :vartype name: str - :ivar timestamp: Timestamp for component policy event record. - :vartype timestamp: ~datetime.datetime - :ivar tenant_id: Tenant ID for the policy event record. - :vartype tenant_id: str - :ivar principal_oid: Principal object ID for the user who initiated the resource component - operation that triggered the policy event. - :vartype principal_oid: str - :ivar policy_definition_action: Policy definition action, i.e. effect. - :vartype policy_definition_action: str - """ - - _attribute_map = { - "additional_properties": {"key": "", "type": "{object}"}, - "id": {"key": "id", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "timestamp": {"key": "timestamp", "type": "iso-8601"}, - "tenant_id": {"key": "tenantId", "type": "str"}, - "principal_oid": {"key": "principalOid", "type": "str"}, - "policy_definition_action": {"key": "policyDefinitionAction", "type": "str"}, - } - - def __init__( - self, - *, - additional_properties: Optional[Dict[str, Any]] = None, - id: Optional[str] = None, # pylint: disable=redefined-builtin - type: Optional[str] = None, - name: Optional[str] = None, - timestamp: Optional[datetime.datetime] = None, - tenant_id: Optional[str] = None, - principal_oid: Optional[str] = None, - policy_definition_action: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword id: Component Id. - :paramtype id: str - :keyword type: Component type. - :paramtype type: str - :keyword name: Component name. - :paramtype name: str - :keyword timestamp: Timestamp for component policy event record. - :paramtype timestamp: ~datetime.datetime - :keyword tenant_id: Tenant ID for the policy event record. - :paramtype tenant_id: str - :keyword principal_oid: Principal object ID for the user who initiated the resource component - operation that triggered the policy event. - :paramtype principal_oid: str - :keyword policy_definition_action: Policy definition action, i.e. effect. - :paramtype policy_definition_action: str - """ - super().__init__(**kwargs) - self.additional_properties = additional_properties - self.id = id - self.type = type - self.name = name - self.timestamp = timestamp - self.tenant_id = tenant_id - self.principal_oid = principal_oid - self.policy_definition_action = policy_definition_action - - -class ComponentExpressionEvaluationDetails(_serialization.Model): - """Evaluation details of policy language expressions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar result: Evaluation result. - :vartype result: str - :ivar expression: Expression evaluated. - :vartype expression: str - :ivar expression_kind: The kind of expression that was evaluated. - :vartype expression_kind: str - :ivar path: Property path if the expression is a field or an alias. - :vartype path: str - :ivar expression_value: Value of the expression. - :vartype expression_value: JSON - :ivar target_value: Target value to be compared with the expression value. - :vartype target_value: JSON - :ivar operator: Operator to compare the expression value and the target value. - :vartype operator: str - """ - - _validation = { - "expression": {"readonly": True}, - "expression_kind": {"readonly": True}, - "path": {"readonly": True}, - "expression_value": {"readonly": True}, - "target_value": {"readonly": True}, - "operator": {"readonly": True}, - } - - _attribute_map = { - "result": {"key": "result", "type": "str"}, - "expression": {"key": "expression", "type": "str"}, - "expression_kind": {"key": "expressionKind", "type": "str"}, - "path": {"key": "path", "type": "str"}, - "expression_value": {"key": "expressionValue", "type": "object"}, - "target_value": {"key": "targetValue", "type": "object"}, - "operator": {"key": "operator", "type": "str"}, - } - - def __init__(self, *, result: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword result: Evaluation result. - :paramtype result: str - """ - super().__init__(**kwargs) - self.result = result - self.expression: Optional[str] = None - self.expression_kind: Optional[str] = None - self.path: Optional[str] = None - self.expression_value: Optional[JSON] = None - self.target_value: Optional[JSON] = None - self.operator: Optional[str] = None - - -class ComponentPolicyEvaluationDetails(_serialization.Model): - """Policy evaluation details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar evaluated_expressions: Details of the evaluated expressions. - :vartype evaluated_expressions: - list[~azure.mgmt.policyinsights.models.ComponentExpressionEvaluationDetails] - :ivar reason: Additional textual reason for the evaluation outcome. - :vartype reason: str - """ - - _validation = { - "evaluated_expressions": {"readonly": True}, - } - - _attribute_map = { - "evaluated_expressions": {"key": "evaluatedExpressions", "type": "[ComponentExpressionEvaluationDetails]"}, - "reason": {"key": "reason", "type": "str"}, - } - - def __init__(self, *, reason: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword reason: Additional textual reason for the evaluation outcome. - :paramtype reason: str - """ - super().__init__(**kwargs) - self.evaluated_expressions: Optional[List["_models.ComponentExpressionEvaluationDetails"]] = None - self.reason = reason - - -class ComponentPolicyState(_serialization.Model): - """Component Policy State record. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar odata_id: OData entity ID; always set to null since component policy state records do not - have an entity ID. - :vartype odata_id: str - :ivar odata_context: OData context string; used by OData clients to resolve type information - based on metadata. - :vartype odata_context: str - :ivar timestamp: Timestamp for the component policy state record. - :vartype timestamp: ~datetime.datetime - :ivar component_id: Component Id. - :vartype component_id: str - :ivar component_type: Component type. - :vartype component_type: str - :ivar component_name: Component name. - :vartype component_name: str - :ivar resource_id: Resource ID. - :vartype resource_id: str - :ivar policy_assignment_id: Policy assignment ID. - :vartype policy_assignment_id: str - :ivar policy_definition_id: Policy definition ID. - :vartype policy_definition_id: str - :ivar subscription_id: Subscription ID. - :vartype subscription_id: str - :ivar resource_type: Resource type. - :vartype resource_type: str - :ivar resource_location: Resource location. - :vartype resource_location: str - :ivar resource_group: Resource group name. - :vartype resource_group: str - :ivar policy_assignment_name: Policy assignment name. - :vartype policy_assignment_name: str - :ivar policy_assignment_owner: Policy assignment owner. - :vartype policy_assignment_owner: str - :ivar policy_assignment_parameters: Policy assignment parameters. - :vartype policy_assignment_parameters: str - :ivar policy_assignment_scope: Policy assignment scope. - :vartype policy_assignment_scope: str - :ivar policy_definition_name: Policy definition name. - :vartype policy_definition_name: str - :ivar policy_definition_action: Policy definition action, i.e. effect. - :vartype policy_definition_action: str - :ivar policy_definition_category: Policy definition category. - :vartype policy_definition_category: str - :ivar policy_set_definition_id: Policy set definition ID, if the policy assignment is for a - policy set. - :vartype policy_set_definition_id: str - :ivar policy_set_definition_name: Policy set definition name, if the policy assignment is for a - policy set. - :vartype policy_set_definition_name: str - :ivar policy_set_definition_owner: Policy set definition owner, if the policy assignment is for - a policy set. - :vartype policy_set_definition_owner: str - :ivar policy_set_definition_category: Policy set definition category, if the policy assignment - is for a policy set. - :vartype policy_set_definition_category: str - :ivar policy_set_definition_parameters: Policy set definition parameters, if the policy - assignment is for a policy set. - :vartype policy_set_definition_parameters: str - :ivar policy_definition_reference_id: Reference ID for the policy definition inside the policy - set, if the policy assignment is for a policy set. - :vartype policy_definition_reference_id: str - :ivar compliance_state: Compliance state of the resource. - :vartype compliance_state: str - :ivar policy_evaluation_details: Policy evaluation details. This is only included in the - response if the request contains $expand=PolicyEvaluationDetails. - :vartype policy_evaluation_details: - ~azure.mgmt.policyinsights.models.ComponentPolicyEvaluationDetails - :ivar policy_definition_group_names: Policy definition group names. - :vartype policy_definition_group_names: list[str] - :ivar policy_definition_version: Evaluated policy definition version. - :vartype policy_definition_version: str - :ivar policy_set_definition_version: Evaluated policy set definition version. - :vartype policy_set_definition_version: str - :ivar policy_assignment_version: Evaluated policy assignment version. - :vartype policy_assignment_version: str - """ - - _validation = { - "odata_id": {"readonly": True}, - "odata_context": {"readonly": True}, - "timestamp": {"readonly": True}, - "component_id": {"readonly": True}, - "component_type": {"readonly": True}, - "component_name": {"readonly": True}, - "resource_id": {"readonly": True}, - "policy_assignment_id": {"readonly": True}, - "policy_definition_id": {"readonly": True}, - "subscription_id": {"readonly": True}, - "resource_type": {"readonly": True}, - "resource_location": {"readonly": True}, - "resource_group": {"readonly": True}, - "policy_assignment_name": {"readonly": True}, - "policy_assignment_owner": {"readonly": True}, - "policy_assignment_parameters": {"readonly": True}, - "policy_assignment_scope": {"readonly": True}, - "policy_definition_name": {"readonly": True}, - "policy_definition_action": {"readonly": True}, - "policy_definition_category": {"readonly": True}, - "policy_set_definition_id": {"readonly": True}, - "policy_set_definition_name": {"readonly": True}, - "policy_set_definition_owner": {"readonly": True}, - "policy_set_definition_category": {"readonly": True}, - "policy_set_definition_parameters": {"readonly": True}, - "policy_definition_reference_id": {"readonly": True}, - "compliance_state": {"readonly": True}, - "policy_definition_group_names": {"readonly": True}, - "policy_definition_version": {"readonly": True}, - "policy_set_definition_version": {"readonly": True}, - "policy_assignment_version": {"readonly": True}, - } - - _attribute_map = { - "additional_properties": {"key": "", "type": "{object}"}, - "odata_id": {"key": "@odata\\.id", "type": "str"}, - "odata_context": {"key": "@odata\\.context", "type": "str"}, - "timestamp": {"key": "timestamp", "type": "iso-8601"}, - "component_id": {"key": "componentId", "type": "str"}, - "component_type": {"key": "componentType", "type": "str"}, - "component_name": {"key": "componentName", "type": "str"}, - "resource_id": {"key": "resourceId", "type": "str"}, - "policy_assignment_id": {"key": "policyAssignmentId", "type": "str"}, - "policy_definition_id": {"key": "policyDefinitionId", "type": "str"}, - "subscription_id": {"key": "subscriptionId", "type": "str"}, - "resource_type": {"key": "resourceType", "type": "str"}, - "resource_location": {"key": "resourceLocation", "type": "str"}, - "resource_group": {"key": "resourceGroup", "type": "str"}, - "policy_assignment_name": {"key": "policyAssignmentName", "type": "str"}, - "policy_assignment_owner": {"key": "policyAssignmentOwner", "type": "str"}, - "policy_assignment_parameters": {"key": "policyAssignmentParameters", "type": "str"}, - "policy_assignment_scope": {"key": "policyAssignmentScope", "type": "str"}, - "policy_definition_name": {"key": "policyDefinitionName", "type": "str"}, - "policy_definition_action": {"key": "policyDefinitionAction", "type": "str"}, - "policy_definition_category": {"key": "policyDefinitionCategory", "type": "str"}, - "policy_set_definition_id": {"key": "policySetDefinitionId", "type": "str"}, - "policy_set_definition_name": {"key": "policySetDefinitionName", "type": "str"}, - "policy_set_definition_owner": {"key": "policySetDefinitionOwner", "type": "str"}, - "policy_set_definition_category": {"key": "policySetDefinitionCategory", "type": "str"}, - "policy_set_definition_parameters": {"key": "policySetDefinitionParameters", "type": "str"}, - "policy_definition_reference_id": {"key": "policyDefinitionReferenceId", "type": "str"}, - "compliance_state": {"key": "complianceState", "type": "str"}, - "policy_evaluation_details": {"key": "policyEvaluationDetails", "type": "ComponentPolicyEvaluationDetails"}, - "policy_definition_group_names": {"key": "policyDefinitionGroupNames", "type": "[str]"}, - "policy_definition_version": {"key": "policyDefinitionVersion", "type": "str"}, - "policy_set_definition_version": {"key": "policySetDefinitionVersion", "type": "str"}, - "policy_assignment_version": {"key": "policyAssignmentVersion", "type": "str"}, - } - - def __init__( # pylint: disable=too-many-locals - self, - *, - additional_properties: Optional[Dict[str, Any]] = None, - policy_evaluation_details: Optional["_models.ComponentPolicyEvaluationDetails"] = None, - **kwargs: Any - ) -> None: - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword policy_evaluation_details: Policy evaluation details. This is only included in the - response if the request contains $expand=PolicyEvaluationDetails. - :paramtype policy_evaluation_details: - ~azure.mgmt.policyinsights.models.ComponentPolicyEvaluationDetails - """ - super().__init__(**kwargs) - self.additional_properties = additional_properties - self.odata_id: Optional[str] = None - self.odata_context: Optional[str] = None - self.timestamp: Optional[datetime.datetime] = None - self.component_id: Optional[str] = None - self.component_type: Optional[str] = None - self.component_name: Optional[str] = None - self.resource_id: Optional[str] = None - self.policy_assignment_id: Optional[str] = None - self.policy_definition_id: Optional[str] = None - self.subscription_id: Optional[str] = None - self.resource_type: Optional[str] = None - self.resource_location: Optional[str] = None - self.resource_group: Optional[str] = None - self.policy_assignment_name: Optional[str] = None - self.policy_assignment_owner: Optional[str] = None - self.policy_assignment_parameters: Optional[str] = None - self.policy_assignment_scope: Optional[str] = None - self.policy_definition_name: Optional[str] = None - self.policy_definition_action: Optional[str] = None - self.policy_definition_category: Optional[str] = None - self.policy_set_definition_id: Optional[str] = None - self.policy_set_definition_name: Optional[str] = None - self.policy_set_definition_owner: Optional[str] = None - self.policy_set_definition_category: Optional[str] = None - self.policy_set_definition_parameters: Optional[str] = None - self.policy_definition_reference_id: Optional[str] = None - self.compliance_state: Optional[str] = None - self.policy_evaluation_details = policy_evaluation_details - self.policy_definition_group_names: Optional[List[str]] = None - self.policy_definition_version: Optional[str] = None - self.policy_set_definition_version: Optional[str] = None - self.policy_assignment_version: Optional[str] = None - - -class ComponentPolicyStatesQueryResults(_serialization.Model): - """Query results. - - :ivar odata_context: OData context string; used by OData clients to resolve type information - based on metadata. - :vartype odata_context: str - :ivar odata_count: OData entity count; represents the number of policy state records returned. - :vartype odata_count: int - :ivar value: Query results. - :vartype value: list[~azure.mgmt.policyinsights.models.ComponentPolicyState] - """ - - _validation = { - "odata_count": {"minimum": 0}, - } - - _attribute_map = { - "odata_context": {"key": "@odata\\.context", "type": "str"}, - "odata_count": {"key": "@odata\\.count", "type": "int"}, - "value": {"key": "value", "type": "[ComponentPolicyState]"}, - } - - def __init__( - self, - *, - odata_context: Optional[str] = None, - odata_count: Optional[int] = None, - value: Optional[List["_models.ComponentPolicyState"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword odata_context: OData context string; used by OData clients to resolve type information - based on metadata. - :paramtype odata_context: str - :keyword odata_count: OData entity count; represents the number of policy state records - returned. - :paramtype odata_count: int - :keyword value: Query results. - :paramtype value: list[~azure.mgmt.policyinsights.models.ComponentPolicyState] - """ - super().__init__(**kwargs) - self.odata_context = odata_context - self.odata_count = odata_count - self.value = value - - -class ComponentStateDetails(_serialization.Model): - """Component state details. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar id: Component Id. - :vartype id: str - :ivar type: Component type. - :vartype type: str - :ivar name: Component name. - :vartype name: str - :ivar timestamp: Component compliance evaluation timestamp. - :vartype timestamp: ~datetime.datetime - :ivar compliance_state: Component compliance state. - :vartype compliance_state: str - """ - - _attribute_map = { - "additional_properties": {"key": "", "type": "{object}"}, - "id": {"key": "id", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "timestamp": {"key": "timestamp", "type": "iso-8601"}, - "compliance_state": {"key": "complianceState", "type": "str"}, - } - - def __init__( - self, - *, - additional_properties: Optional[Dict[str, Any]] = None, - id: Optional[str] = None, # pylint: disable=redefined-builtin - type: Optional[str] = None, - name: Optional[str] = None, - timestamp: Optional[datetime.datetime] = None, - compliance_state: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword id: Component Id. - :paramtype id: str - :keyword type: Component type. - :paramtype type: str - :keyword name: Component name. - :paramtype name: str - :keyword timestamp: Component compliance evaluation timestamp. - :paramtype timestamp: ~datetime.datetime - :keyword compliance_state: Component compliance state. - :paramtype compliance_state: str - """ - super().__init__(**kwargs) - self.additional_properties = additional_properties - self.id = id - self.type = type - self.name = name - self.timestamp = timestamp - self.compliance_state = compliance_state - - -class ErrorDefinition(_serialization.Model): - """Error definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: Service specific error code which serves as the substatus for the HTTP error code. - :vartype code: str - :ivar message: Description of the error. - :vartype message: str - :ivar target: The target of the error. - :vartype target: str - :ivar details: Internal error details. - :vartype details: list[~azure.mgmt.policyinsights.models.ErrorDefinition] - :ivar additional_info: Additional scenario specific error details. - :vartype additional_info: list[~azure.mgmt.policyinsights.models.TypedErrorInfo] - """ - - _validation = { - "code": {"readonly": True}, - "message": {"readonly": True}, - "target": {"readonly": True}, - "details": {"readonly": True}, - "additional_info": {"readonly": True}, - } - - _attribute_map = { - "code": {"key": "code", "type": "str"}, - "message": {"key": "message", "type": "str"}, - "target": {"key": "target", "type": "str"}, - "details": {"key": "details", "type": "[ErrorDefinition]"}, - "additional_info": {"key": "additionalInfo", "type": "[TypedErrorInfo]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.code: Optional[str] = None - self.message: Optional[str] = None - self.target: Optional[str] = None - self.details: Optional[List["_models.ErrorDefinition"]] = None - self.additional_info: Optional[List["_models.TypedErrorInfo"]] = None - - -class ErrorDefinitionAutoGenerated(_serialization.Model): - """Error definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: Service specific error code which serves as the substatus for the HTTP error code. - :vartype code: str - :ivar message: Description of the error. - :vartype message: str - :ivar target: The target of the error. - :vartype target: str - :ivar details: Internal error details. - :vartype details: list[~azure.mgmt.policyinsights.models.ErrorDefinitionAutoGenerated] - :ivar additional_info: Additional scenario specific error details. - :vartype additional_info: list[~azure.mgmt.policyinsights.models.TypedErrorInfo] - """ - - _validation = { - "code": {"readonly": True}, - "message": {"readonly": True}, - "target": {"readonly": True}, - "details": {"readonly": True}, - "additional_info": {"readonly": True}, - } - - _attribute_map = { - "code": {"key": "code", "type": "str"}, - "message": {"key": "message", "type": "str"}, - "target": {"key": "target", "type": "str"}, - "details": {"key": "details", "type": "[ErrorDefinitionAutoGenerated]"}, - "additional_info": {"key": "additionalInfo", "type": "[TypedErrorInfo]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.code: Optional[str] = None - self.message: Optional[str] = None - self.target: Optional[str] = None - self.details: Optional[List["_models.ErrorDefinitionAutoGenerated"]] = None - self.additional_info: Optional[List["_models.TypedErrorInfo"]] = None - - -class ErrorDefinitionAutoGenerated2(_serialization.Model): - """Error definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: Service specific error code which serves as the substatus for the HTTP error code. - :vartype code: str - :ivar message: Description of the error. - :vartype message: str - :ivar target: The target of the error. - :vartype target: str - :ivar details: Internal error details. - :vartype details: list[~azure.mgmt.policyinsights.models.ErrorDefinitionAutoGenerated2] - :ivar additional_info: Additional scenario specific error details. - :vartype additional_info: list[~azure.mgmt.policyinsights.models.TypedErrorInfo] - """ - - _validation = { - "code": {"readonly": True}, - "message": {"readonly": True}, - "target": {"readonly": True}, - "details": {"readonly": True}, - "additional_info": {"readonly": True}, - } - - _attribute_map = { - "code": {"key": "code", "type": "str"}, - "message": {"key": "message", "type": "str"}, - "target": {"key": "target", "type": "str"}, - "details": {"key": "details", "type": "[ErrorDefinitionAutoGenerated2]"}, - "additional_info": {"key": "additionalInfo", "type": "[TypedErrorInfo]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.code: Optional[str] = None - self.message: Optional[str] = None - self.target: Optional[str] = None - self.details: Optional[List["_models.ErrorDefinitionAutoGenerated2"]] = None - self.additional_info: Optional[List["_models.TypedErrorInfo"]] = None - - -class ErrorResponse(_serialization.Model): - """Error response. - - :ivar error: The error details. - :vartype error: ~azure.mgmt.policyinsights.models.ErrorDefinition - """ - - _attribute_map = { - "error": {"key": "error", "type": "ErrorDefinition"}, - } - - def __init__(self, *, error: Optional["_models.ErrorDefinition"] = None, **kwargs: Any) -> None: - """ - :keyword error: The error details. - :paramtype error: ~azure.mgmt.policyinsights.models.ErrorDefinition - """ - super().__init__(**kwargs) - self.error = error - - -class ErrorResponseAutoGenerated(_serialization.Model): - """Error response. - - :ivar error: The error details. - :vartype error: ~azure.mgmt.policyinsights.models.ErrorDefinitionAutoGenerated - """ - - _attribute_map = { - "error": {"key": "error", "type": "ErrorDefinitionAutoGenerated"}, - } - - def __init__(self, *, error: Optional["_models.ErrorDefinitionAutoGenerated"] = None, **kwargs: Any) -> None: - """ - :keyword error: The error details. - :paramtype error: ~azure.mgmt.policyinsights.models.ErrorDefinitionAutoGenerated - """ - super().__init__(**kwargs) - self.error = error - - -class ErrorResponseAutoGenerated2(_serialization.Model): - """Error response. - - :ivar error: The error details. - :vartype error: ~azure.mgmt.policyinsights.models.ErrorDefinitionAutoGenerated2 - """ - - _attribute_map = { - "error": {"key": "error", "type": "ErrorDefinitionAutoGenerated2"}, - } - - def __init__(self, *, error: Optional["_models.ErrorDefinitionAutoGenerated2"] = None, **kwargs: Any) -> None: - """ - :keyword error: The error details. - :paramtype error: ~azure.mgmt.policyinsights.models.ErrorDefinitionAutoGenerated2 - """ - super().__init__(**kwargs) - self.error = error - - -class ExpressionEvaluationDetails(_serialization.Model): - """Evaluation details of policy language expressions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar result: Evaluation result. - :vartype result: str - :ivar expression: Expression evaluated. - :vartype expression: str - :ivar expression_kind: The kind of expression that was evaluated. - :vartype expression_kind: str - :ivar path: Property path if the expression is a field or an alias. - :vartype path: str - :ivar expression_value: Value of the expression. - :vartype expression_value: JSON - :ivar target_value: Target value to be compared with the expression value. - :vartype target_value: JSON - :ivar operator: Operator to compare the expression value and the target value. - :vartype operator: str - """ - - _validation = { - "expression_kind": {"readonly": True}, - } - - _attribute_map = { - "result": {"key": "result", "type": "str"}, - "expression": {"key": "expression", "type": "str"}, - "expression_kind": {"key": "expressionKind", "type": "str"}, - "path": {"key": "path", "type": "str"}, - "expression_value": {"key": "expressionValue", "type": "object"}, - "target_value": {"key": "targetValue", "type": "object"}, - "operator": {"key": "operator", "type": "str"}, - } - - def __init__( - self, - *, - result: Optional[str] = None, - expression: Optional[str] = None, - path: Optional[str] = None, - expression_value: Optional[JSON] = None, - target_value: Optional[JSON] = None, - operator: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword result: Evaluation result. - :paramtype result: str - :keyword expression: Expression evaluated. - :paramtype expression: str - :keyword path: Property path if the expression is a field or an alias. - :paramtype path: str - :keyword expression_value: Value of the expression. - :paramtype expression_value: JSON - :keyword target_value: Target value to be compared with the expression value. - :paramtype target_value: JSON - :keyword operator: Operator to compare the expression value and the target value. - :paramtype operator: str - """ - super().__init__(**kwargs) - self.result = result - self.expression = expression - self.expression_kind: Optional[str] = None - self.path = path - self.expression_value = expression_value - self.target_value = target_value - self.operator = operator - - -class FieldRestriction(_serialization.Model): - """The restrictions on a field imposed by a specific policy. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar result: The type of restriction that is imposed on the field. Known values are: - "Required", "Removed", "Deny", and "Audit". - :vartype result: str or ~azure.mgmt.policyinsights.models.FieldRestrictionResult - :ivar default_value: The value that policy will set for the field if the user does not provide - a value. - :vartype default_value: str - :ivar values: The values that policy either requires or denies for the field. - :vartype values: list[str] - :ivar policy: The details of the policy that is causing the field restriction. - :vartype policy: ~azure.mgmt.policyinsights.models.PolicyReference - :ivar policy_effect: The effect of the policy that is causing the field restriction. - http://aka.ms/policyeffects. - :vartype policy_effect: str - :ivar reason: The reason for the restriction. - :vartype reason: str - """ - - _validation = { - "result": {"readonly": True}, - "default_value": {"readonly": True}, - "values": {"readonly": True}, - "policy": {"readonly": True}, - "policy_effect": {"readonly": True}, - "reason": {"readonly": True}, - } - - _attribute_map = { - "result": {"key": "result", "type": "str"}, - "default_value": {"key": "defaultValue", "type": "str"}, - "values": {"key": "values", "type": "[str]"}, - "policy": {"key": "policy", "type": "PolicyReference"}, - "policy_effect": {"key": "policyEffect", "type": "str"}, - "reason": {"key": "reason", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.result: Optional[Union[str, "_models.FieldRestrictionResult"]] = None - self.default_value: Optional[str] = None - self.values: Optional[List[str]] = None - self.policy: Optional["_models.PolicyReference"] = None - self.policy_effect: Optional[str] = None - self.reason: Optional[str] = None - - -class FieldRestrictions(_serialization.Model): - """The restrictions that will be placed on a field in the resource by policy. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar field: The name of the field. This can be a top-level property like 'name' or 'type' or - an Azure Policy field alias. - :vartype field: str - :ivar restrictions: The restrictions placed on that field by policy. - :vartype restrictions: list[~azure.mgmt.policyinsights.models.FieldRestriction] - """ - - _validation = { - "field": {"readonly": True}, - } - - _attribute_map = { - "field": {"key": "field", "type": "str"}, - "restrictions": {"key": "restrictions", "type": "[FieldRestriction]"}, - } - - def __init__(self, *, restrictions: Optional[List["_models.FieldRestriction"]] = None, **kwargs: Any) -> None: - """ - :keyword restrictions: The restrictions placed on that field by policy. - :paramtype restrictions: list[~azure.mgmt.policyinsights.models.FieldRestriction] - """ - super().__init__(**kwargs) - self.field: Optional[str] = None - self.restrictions = restrictions - - -class IfNotExistsEvaluationDetails(_serialization.Model): - """Evaluation details of IfNotExists effect. - - :ivar resource_id: ID of the last evaluated resource for IfNotExists effect. - :vartype resource_id: str - :ivar total_resources: Total number of resources to which the existence condition is - applicable. - :vartype total_resources: int - """ - - _attribute_map = { - "resource_id": {"key": "resourceId", "type": "str"}, - "total_resources": {"key": "totalResources", "type": "int"}, - } - - def __init__( - self, *, resource_id: Optional[str] = None, total_resources: Optional[int] = None, **kwargs: Any - ) -> None: - """ - :keyword resource_id: ID of the last evaluated resource for IfNotExists effect. - :paramtype resource_id: str - :keyword total_resources: Total number of resources to which the existence condition is - applicable. - :paramtype total_resources: int - """ - super().__init__(**kwargs) - self.resource_id = resource_id - self.total_resources = total_resources - - -class Operation(_serialization.Model): - """Operation definition. - - :ivar name: Operation name. - :vartype name: str - :ivar is_data_action: Indicates whether the operation is a data action. - :vartype is_data_action: bool - :ivar display: Display metadata associated with the operation. - :vartype display: ~azure.mgmt.policyinsights.models.OperationDisplay - """ - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "is_data_action": {"key": "isDataAction", "type": "bool"}, - "display": {"key": "display", "type": "OperationDisplay"}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - is_data_action: Optional[bool] = None, - display: Optional["_models.OperationDisplay"] = None, - **kwargs: Any - ) -> None: - """ - :keyword name: Operation name. - :paramtype name: str - :keyword is_data_action: Indicates whether the operation is a data action. - :paramtype is_data_action: bool - :keyword display: Display metadata associated with the operation. - :paramtype display: ~azure.mgmt.policyinsights.models.OperationDisplay - """ - super().__init__(**kwargs) - self.name = name - self.is_data_action = is_data_action - self.display = display - - -class OperationDisplay(_serialization.Model): - """Display metadata associated with the operation. - - :ivar provider: Resource provider name. - :vartype provider: str - :ivar resource: Resource name on which the operation is performed. - :vartype resource: str - :ivar operation: Operation name. - :vartype operation: str - :ivar description: Operation description. - :vartype description: str - """ - - _attribute_map = { - "provider": {"key": "provider", "type": "str"}, - "resource": {"key": "resource", "type": "str"}, - "operation": {"key": "operation", "type": "str"}, - "description": {"key": "description", "type": "str"}, - } - - def __init__( - self, - *, - provider: Optional[str] = None, - resource: Optional[str] = None, - operation: Optional[str] = None, - description: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword provider: Resource provider name. - :paramtype provider: str - :keyword resource: Resource name on which the operation is performed. - :paramtype resource: str - :keyword operation: Operation name. - :paramtype operation: str - :keyword description: Operation description. - :paramtype description: str - """ - super().__init__(**kwargs) - self.provider = provider - self.resource = resource - self.operation = operation - self.description = description - - -class OperationsListResults(_serialization.Model): - """List of available operations. - - :ivar odata_count: OData entity count; represents the number of operations returned. - :vartype odata_count: int - :ivar value: List of available operations. - :vartype value: list[~azure.mgmt.policyinsights.models.Operation] - """ - - _validation = { - "odata_count": {"minimum": 1}, - } - - _attribute_map = { - "odata_count": {"key": "@odata\\.count", "type": "int"}, - "value": {"key": "value", "type": "[Operation]"}, - } - - def __init__( - self, *, odata_count: Optional[int] = None, value: Optional[List["_models.Operation"]] = None, **kwargs: Any - ) -> None: - """ - :keyword odata_count: OData entity count; represents the number of operations returned. - :paramtype odata_count: int - :keyword value: List of available operations. - :paramtype value: list[~azure.mgmt.policyinsights.models.Operation] - """ - super().__init__(**kwargs) - self.odata_count = odata_count - self.value = value - - -class PendingField(_serialization.Model): - """A field that should be evaluated against Azure Policy to determine restrictions. - - All required parameters must be populated in order to send to server. - - :ivar field: The name of the field. This can be a top-level property like 'name' or 'type' or - an Azure Policy field alias. Required. - :vartype field: str - :ivar values: The list of potential values for the field that should be evaluated against Azure - Policy. - :vartype values: list[str] - """ - - _validation = { - "field": {"required": True}, - } - - _attribute_map = { - "field": {"key": "field", "type": "str"}, - "values": {"key": "values", "type": "[str]"}, - } - - def __init__(self, *, field: str, values: Optional[List[str]] = None, **kwargs: Any) -> None: - """ - :keyword field: The name of the field. This can be a top-level property like 'name' or 'type' - or an Azure Policy field alias. Required. - :paramtype field: str - :keyword values: The list of potential values for the field that should be evaluated against - Azure Policy. - :paramtype values: list[str] - """ - super().__init__(**kwargs) - self.field = field - self.values = values - - -class PolicyAssignmentSummary(_serialization.Model): - """Policy assignment summary. - - :ivar policy_assignment_id: Policy assignment ID. - :vartype policy_assignment_id: str - :ivar policy_set_definition_id: Policy set definition ID, if the policy assignment is for a - policy set. - :vartype policy_set_definition_id: str - :ivar results: Compliance summary for the policy assignment. - :vartype results: ~azure.mgmt.policyinsights.models.SummaryResults - :ivar policy_definitions: Policy definitions summary. - :vartype policy_definitions: list[~azure.mgmt.policyinsights.models.PolicyDefinitionSummary] - :ivar policy_groups: Policy definition group summary. - :vartype policy_groups: list[~azure.mgmt.policyinsights.models.PolicyGroupSummary] - """ - - _attribute_map = { - "policy_assignment_id": {"key": "policyAssignmentId", "type": "str"}, - "policy_set_definition_id": {"key": "policySetDefinitionId", "type": "str"}, - "results": {"key": "results", "type": "SummaryResults"}, - "policy_definitions": {"key": "policyDefinitions", "type": "[PolicyDefinitionSummary]"}, - "policy_groups": {"key": "policyGroups", "type": "[PolicyGroupSummary]"}, - } - - def __init__( - self, - *, - policy_assignment_id: Optional[str] = None, - policy_set_definition_id: Optional[str] = None, - results: Optional["_models.SummaryResults"] = None, - policy_definitions: Optional[List["_models.PolicyDefinitionSummary"]] = None, - policy_groups: Optional[List["_models.PolicyGroupSummary"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword policy_assignment_id: Policy assignment ID. - :paramtype policy_assignment_id: str - :keyword policy_set_definition_id: Policy set definition ID, if the policy assignment is for a - policy set. - :paramtype policy_set_definition_id: str - :keyword results: Compliance summary for the policy assignment. - :paramtype results: ~azure.mgmt.policyinsights.models.SummaryResults - :keyword policy_definitions: Policy definitions summary. - :paramtype policy_definitions: list[~azure.mgmt.policyinsights.models.PolicyDefinitionSummary] - :keyword policy_groups: Policy definition group summary. - :paramtype policy_groups: list[~azure.mgmt.policyinsights.models.PolicyGroupSummary] - """ - super().__init__(**kwargs) - self.policy_assignment_id = policy_assignment_id - self.policy_set_definition_id = policy_set_definition_id - self.results = results - self.policy_definitions = policy_definitions - self.policy_groups = policy_groups - - -class PolicyDefinitionSummary(_serialization.Model): - """Policy definition summary. - - :ivar policy_definition_id: Policy definition ID. - :vartype policy_definition_id: str - :ivar policy_definition_reference_id: Policy definition reference ID. - :vartype policy_definition_reference_id: str - :ivar policy_definition_group_names: Policy definition group names. - :vartype policy_definition_group_names: list[str] - :ivar effect: Policy effect, i.e. policy definition action. - :vartype effect: str - :ivar results: Compliance summary for the policy definition. - :vartype results: ~azure.mgmt.policyinsights.models.SummaryResults - """ - - _attribute_map = { - "policy_definition_id": {"key": "policyDefinitionId", "type": "str"}, - "policy_definition_reference_id": {"key": "policyDefinitionReferenceId", "type": "str"}, - "policy_definition_group_names": {"key": "policyDefinitionGroupNames", "type": "[str]"}, - "effect": {"key": "effect", "type": "str"}, - "results": {"key": "results", "type": "SummaryResults"}, - } - - def __init__( - self, - *, - policy_definition_id: Optional[str] = None, - policy_definition_reference_id: Optional[str] = None, - policy_definition_group_names: Optional[List[str]] = None, - effect: Optional[str] = None, - results: Optional["_models.SummaryResults"] = None, - **kwargs: Any - ) -> None: - """ - :keyword policy_definition_id: Policy definition ID. - :paramtype policy_definition_id: str - :keyword policy_definition_reference_id: Policy definition reference ID. - :paramtype policy_definition_reference_id: str - :keyword policy_definition_group_names: Policy definition group names. - :paramtype policy_definition_group_names: list[str] - :keyword effect: Policy effect, i.e. policy definition action. - :paramtype effect: str - :keyword results: Compliance summary for the policy definition. - :paramtype results: ~azure.mgmt.policyinsights.models.SummaryResults - """ - super().__init__(**kwargs) - self.policy_definition_id = policy_definition_id - self.policy_definition_reference_id = policy_definition_reference_id - self.policy_definition_group_names = policy_definition_group_names - self.effect = effect - self.results = results - - -class PolicyDetails(_serialization.Model): - """The policy details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar policy_definition_id: The ID of the policy definition. - :vartype policy_definition_id: str - :ivar policy_assignment_id: The ID of the policy assignment. - :vartype policy_assignment_id: str - :ivar policy_assignment_display_name: The display name of the policy assignment. - :vartype policy_assignment_display_name: str - :ivar policy_assignment_scope: The scope of the policy assignment. - :vartype policy_assignment_scope: str - :ivar policy_set_definition_id: The ID of the policy set definition. - :vartype policy_set_definition_id: str - :ivar policy_definition_reference_id: The policy definition reference ID within the policy set - definition. - :vartype policy_definition_reference_id: str - """ - - _validation = { - "policy_definition_id": {"readonly": True}, - "policy_assignment_id": {"readonly": True}, - "policy_assignment_display_name": {"readonly": True}, - "policy_assignment_scope": {"readonly": True}, - "policy_set_definition_id": {"readonly": True}, - "policy_definition_reference_id": {"readonly": True}, - } - - _attribute_map = { - "policy_definition_id": {"key": "policyDefinitionId", "type": "str"}, - "policy_assignment_id": {"key": "policyAssignmentId", "type": "str"}, - "policy_assignment_display_name": {"key": "policyAssignmentDisplayName", "type": "str"}, - "policy_assignment_scope": {"key": "policyAssignmentScope", "type": "str"}, - "policy_set_definition_id": {"key": "policySetDefinitionId", "type": "str"}, - "policy_definition_reference_id": {"key": "policyDefinitionReferenceId", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.policy_definition_id: Optional[str] = None - self.policy_assignment_id: Optional[str] = None - self.policy_assignment_display_name: Optional[str] = None - self.policy_assignment_scope: Optional[str] = None - self.policy_set_definition_id: Optional[str] = None - self.policy_definition_reference_id: Optional[str] = None - - -class PolicyEffectDetails(_serialization.Model): - """The details of the effect that was applied to the resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar policy_effect: The effect that was applied to the resource. http://aka.ms/policyeffects. - :vartype policy_effect: str - """ - - _validation = { - "policy_effect": {"readonly": True}, - } - - _attribute_map = { - "policy_effect": {"key": "policyEffect", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.policy_effect: Optional[str] = None - - -class PolicyEvaluationDetails(_serialization.Model): - """Policy evaluation details. - - :ivar evaluated_expressions: Details of the evaluated expressions. - :vartype evaluated_expressions: - list[~azure.mgmt.policyinsights.models.ExpressionEvaluationDetails] - :ivar if_not_exists_details: Evaluation details of IfNotExists effect. - :vartype if_not_exists_details: ~azure.mgmt.policyinsights.models.IfNotExistsEvaluationDetails - """ - - _attribute_map = { - "evaluated_expressions": {"key": "evaluatedExpressions", "type": "[ExpressionEvaluationDetails]"}, - "if_not_exists_details": {"key": "ifNotExistsDetails", "type": "IfNotExistsEvaluationDetails"}, - } - - def __init__( - self, - *, - evaluated_expressions: Optional[List["_models.ExpressionEvaluationDetails"]] = None, - if_not_exists_details: Optional["_models.IfNotExistsEvaluationDetails"] = None, - **kwargs: Any - ) -> None: - """ - :keyword evaluated_expressions: Details of the evaluated expressions. - :paramtype evaluated_expressions: - list[~azure.mgmt.policyinsights.models.ExpressionEvaluationDetails] - :keyword if_not_exists_details: Evaluation details of IfNotExists effect. - :paramtype if_not_exists_details: - ~azure.mgmt.policyinsights.models.IfNotExistsEvaluationDetails - """ - super().__init__(**kwargs) - self.evaluated_expressions = evaluated_expressions - self.if_not_exists_details = if_not_exists_details - - -class PolicyEvaluationResult(_serialization.Model): - """The result of a non-compliant policy evaluation against the given resource content. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar policy_info: The details of the policy that was evaluated. - :vartype policy_info: ~azure.mgmt.policyinsights.models.PolicyReference - :ivar evaluation_result: The result of the policy evaluation against the resource. This will - typically be 'NonCompliant' but may contain other values if errors were encountered. - :vartype evaluation_result: str - :ivar evaluation_details: The detailed results of the policy expressions and values that were - evaluated. - :vartype evaluation_details: - ~azure.mgmt.policyinsights.models.CheckRestrictionEvaluationDetails - :ivar effect_details: The details of the effect that was applied to the resource. - :vartype effect_details: ~azure.mgmt.policyinsights.models.PolicyEffectDetails - """ - - _validation = { - "policy_info": {"readonly": True}, - "evaluation_result": {"readonly": True}, - "evaluation_details": {"readonly": True}, - "effect_details": {"readonly": True}, - } - - _attribute_map = { - "policy_info": {"key": "policyInfo", "type": "PolicyReference"}, - "evaluation_result": {"key": "evaluationResult", "type": "str"}, - "evaluation_details": {"key": "evaluationDetails", "type": "CheckRestrictionEvaluationDetails"}, - "effect_details": {"key": "effectDetails", "type": "PolicyEffectDetails"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.policy_info: Optional["_models.PolicyReference"] = None - self.evaluation_result: Optional[str] = None - self.evaluation_details: Optional["_models.CheckRestrictionEvaluationDetails"] = None - self.effect_details: Optional["_models.PolicyEffectDetails"] = None - - -class PolicyEvent(_serialization.Model): - """Policy event record. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar odata_id: OData entity ID; always set to null since policy event records do not have an - entity ID. - :vartype odata_id: str - :ivar odata_context: OData context string; used by OData clients to resolve type information - based on metadata. - :vartype odata_context: str - :ivar timestamp: Timestamp for the policy event record. - :vartype timestamp: ~datetime.datetime - :ivar resource_id: Resource ID. - :vartype resource_id: str - :ivar policy_assignment_id: Policy assignment ID. - :vartype policy_assignment_id: str - :ivar policy_definition_id: Policy definition ID. - :vartype policy_definition_id: str - :ivar effective_parameters: Effective parameters for the policy assignment. - :vartype effective_parameters: str - :ivar is_compliant: Flag which states whether the resource is compliant against the policy - assignment it was evaluated against. - :vartype is_compliant: bool - :ivar subscription_id: Subscription ID. - :vartype subscription_id: str - :ivar resource_type: Resource type. - :vartype resource_type: str - :ivar resource_location: Resource location. - :vartype resource_location: str - :ivar resource_group: Resource group name. - :vartype resource_group: str - :ivar resource_tags: List of resource tags. - :vartype resource_tags: str - :ivar policy_assignment_name: Policy assignment name. - :vartype policy_assignment_name: str - :ivar policy_assignment_owner: Policy assignment owner. - :vartype policy_assignment_owner: str - :ivar policy_assignment_parameters: Policy assignment parameters. - :vartype policy_assignment_parameters: str - :ivar policy_assignment_scope: Policy assignment scope. - :vartype policy_assignment_scope: str - :ivar policy_definition_name: Policy definition name. - :vartype policy_definition_name: str - :ivar policy_definition_action: Policy definition action, i.e. effect. - :vartype policy_definition_action: str - :ivar policy_definition_category: Policy definition category. - :vartype policy_definition_category: str - :ivar policy_set_definition_id: Policy set definition ID, if the policy assignment is for a - policy set. - :vartype policy_set_definition_id: str - :ivar policy_set_definition_name: Policy set definition name, if the policy assignment is for a - policy set. - :vartype policy_set_definition_name: str - :ivar policy_set_definition_owner: Policy set definition owner, if the policy assignment is for - a policy set. - :vartype policy_set_definition_owner: str - :ivar policy_set_definition_category: Policy set definition category, if the policy assignment - is for a policy set. - :vartype policy_set_definition_category: str - :ivar policy_set_definition_parameters: Policy set definition parameters, if the policy - assignment is for a policy set. - :vartype policy_set_definition_parameters: str - :ivar management_group_ids: Comma separated list of management group IDs, which represent the - hierarchy of the management groups the resource is under. - :vartype management_group_ids: str - :ivar policy_definition_reference_id: Reference ID for the policy definition inside the policy - set, if the policy assignment is for a policy set. - :vartype policy_definition_reference_id: str - :ivar compliance_state: Compliance state of the resource. - :vartype compliance_state: str - :ivar tenant_id: Tenant ID for the policy event record. - :vartype tenant_id: str - :ivar principal_oid: Principal object ID for the user who initiated the resource operation that - triggered the policy event. - :vartype principal_oid: str - :ivar components: Components events records populated only when URL contains $expand=components - clause. - :vartype components: list[~azure.mgmt.policyinsights.models.ComponentEventDetails] - """ - - _attribute_map = { - "additional_properties": {"key": "", "type": "{object}"}, - "odata_id": {"key": "@odata\\.id", "type": "str"}, - "odata_context": {"key": "@odata\\.context", "type": "str"}, - "timestamp": {"key": "timestamp", "type": "iso-8601"}, - "resource_id": {"key": "resourceId", "type": "str"}, - "policy_assignment_id": {"key": "policyAssignmentId", "type": "str"}, - "policy_definition_id": {"key": "policyDefinitionId", "type": "str"}, - "effective_parameters": {"key": "effectiveParameters", "type": "str"}, - "is_compliant": {"key": "isCompliant", "type": "bool"}, - "subscription_id": {"key": "subscriptionId", "type": "str"}, - "resource_type": {"key": "resourceType", "type": "str"}, - "resource_location": {"key": "resourceLocation", "type": "str"}, - "resource_group": {"key": "resourceGroup", "type": "str"}, - "resource_tags": {"key": "resourceTags", "type": "str"}, - "policy_assignment_name": {"key": "policyAssignmentName", "type": "str"}, - "policy_assignment_owner": {"key": "policyAssignmentOwner", "type": "str"}, - "policy_assignment_parameters": {"key": "policyAssignmentParameters", "type": "str"}, - "policy_assignment_scope": {"key": "policyAssignmentScope", "type": "str"}, - "policy_definition_name": {"key": "policyDefinitionName", "type": "str"}, - "policy_definition_action": {"key": "policyDefinitionAction", "type": "str"}, - "policy_definition_category": {"key": "policyDefinitionCategory", "type": "str"}, - "policy_set_definition_id": {"key": "policySetDefinitionId", "type": "str"}, - "policy_set_definition_name": {"key": "policySetDefinitionName", "type": "str"}, - "policy_set_definition_owner": {"key": "policySetDefinitionOwner", "type": "str"}, - "policy_set_definition_category": {"key": "policySetDefinitionCategory", "type": "str"}, - "policy_set_definition_parameters": {"key": "policySetDefinitionParameters", "type": "str"}, - "management_group_ids": {"key": "managementGroupIds", "type": "str"}, - "policy_definition_reference_id": {"key": "policyDefinitionReferenceId", "type": "str"}, - "compliance_state": {"key": "complianceState", "type": "str"}, - "tenant_id": {"key": "tenantId", "type": "str"}, - "principal_oid": {"key": "principalOid", "type": "str"}, - "components": {"key": "components", "type": "[ComponentEventDetails]"}, - } - - def __init__( # pylint: disable=too-many-locals - self, - *, - additional_properties: Optional[Dict[str, Any]] = None, - odata_id: Optional[str] = None, - odata_context: Optional[str] = None, - timestamp: Optional[datetime.datetime] = None, - resource_id: Optional[str] = None, - policy_assignment_id: Optional[str] = None, - policy_definition_id: Optional[str] = None, - effective_parameters: Optional[str] = None, - is_compliant: Optional[bool] = None, - subscription_id: Optional[str] = None, - resource_type: Optional[str] = None, - resource_location: Optional[str] = None, - resource_group: Optional[str] = None, - resource_tags: Optional[str] = None, - policy_assignment_name: Optional[str] = None, - policy_assignment_owner: Optional[str] = None, - policy_assignment_parameters: Optional[str] = None, - policy_assignment_scope: Optional[str] = None, - policy_definition_name: Optional[str] = None, - policy_definition_action: Optional[str] = None, - policy_definition_category: Optional[str] = None, - policy_set_definition_id: Optional[str] = None, - policy_set_definition_name: Optional[str] = None, - policy_set_definition_owner: Optional[str] = None, - policy_set_definition_category: Optional[str] = None, - policy_set_definition_parameters: Optional[str] = None, - management_group_ids: Optional[str] = None, - policy_definition_reference_id: Optional[str] = None, - compliance_state: Optional[str] = None, - tenant_id: Optional[str] = None, - principal_oid: Optional[str] = None, - components: Optional[List["_models.ComponentEventDetails"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword odata_id: OData entity ID; always set to null since policy event records do not have - an entity ID. - :paramtype odata_id: str - :keyword odata_context: OData context string; used by OData clients to resolve type information - based on metadata. - :paramtype odata_context: str - :keyword timestamp: Timestamp for the policy event record. - :paramtype timestamp: ~datetime.datetime - :keyword resource_id: Resource ID. - :paramtype resource_id: str - :keyword policy_assignment_id: Policy assignment ID. - :paramtype policy_assignment_id: str - :keyword policy_definition_id: Policy definition ID. - :paramtype policy_definition_id: str - :keyword effective_parameters: Effective parameters for the policy assignment. - :paramtype effective_parameters: str - :keyword is_compliant: Flag which states whether the resource is compliant against the policy - assignment it was evaluated against. - :paramtype is_compliant: bool - :keyword subscription_id: Subscription ID. - :paramtype subscription_id: str - :keyword resource_type: Resource type. - :paramtype resource_type: str - :keyword resource_location: Resource location. - :paramtype resource_location: str - :keyword resource_group: Resource group name. - :paramtype resource_group: str - :keyword resource_tags: List of resource tags. - :paramtype resource_tags: str - :keyword policy_assignment_name: Policy assignment name. - :paramtype policy_assignment_name: str - :keyword policy_assignment_owner: Policy assignment owner. - :paramtype policy_assignment_owner: str - :keyword policy_assignment_parameters: Policy assignment parameters. - :paramtype policy_assignment_parameters: str - :keyword policy_assignment_scope: Policy assignment scope. - :paramtype policy_assignment_scope: str - :keyword policy_definition_name: Policy definition name. - :paramtype policy_definition_name: str - :keyword policy_definition_action: Policy definition action, i.e. effect. - :paramtype policy_definition_action: str - :keyword policy_definition_category: Policy definition category. - :paramtype policy_definition_category: str - :keyword policy_set_definition_id: Policy set definition ID, if the policy assignment is for a - policy set. - :paramtype policy_set_definition_id: str - :keyword policy_set_definition_name: Policy set definition name, if the policy assignment is - for a policy set. - :paramtype policy_set_definition_name: str - :keyword policy_set_definition_owner: Policy set definition owner, if the policy assignment is - for a policy set. - :paramtype policy_set_definition_owner: str - :keyword policy_set_definition_category: Policy set definition category, if the policy - assignment is for a policy set. - :paramtype policy_set_definition_category: str - :keyword policy_set_definition_parameters: Policy set definition parameters, if the policy - assignment is for a policy set. - :paramtype policy_set_definition_parameters: str - :keyword management_group_ids: Comma separated list of management group IDs, which represent - the hierarchy of the management groups the resource is under. - :paramtype management_group_ids: str - :keyword policy_definition_reference_id: Reference ID for the policy definition inside the - policy set, if the policy assignment is for a policy set. - :paramtype policy_definition_reference_id: str - :keyword compliance_state: Compliance state of the resource. - :paramtype compliance_state: str - :keyword tenant_id: Tenant ID for the policy event record. - :paramtype tenant_id: str - :keyword principal_oid: Principal object ID for the user who initiated the resource operation - that triggered the policy event. - :paramtype principal_oid: str - :keyword components: Components events records populated only when URL contains - $expand=components clause. - :paramtype components: list[~azure.mgmt.policyinsights.models.ComponentEventDetails] - """ - super().__init__(**kwargs) - self.additional_properties = additional_properties - self.odata_id = odata_id - self.odata_context = odata_context - self.timestamp = timestamp - self.resource_id = resource_id - self.policy_assignment_id = policy_assignment_id - self.policy_definition_id = policy_definition_id - self.effective_parameters = effective_parameters - self.is_compliant = is_compliant - self.subscription_id = subscription_id - self.resource_type = resource_type - self.resource_location = resource_location - self.resource_group = resource_group - self.resource_tags = resource_tags - self.policy_assignment_name = policy_assignment_name - self.policy_assignment_owner = policy_assignment_owner - self.policy_assignment_parameters = policy_assignment_parameters - self.policy_assignment_scope = policy_assignment_scope - self.policy_definition_name = policy_definition_name - self.policy_definition_action = policy_definition_action - self.policy_definition_category = policy_definition_category - self.policy_set_definition_id = policy_set_definition_id - self.policy_set_definition_name = policy_set_definition_name - self.policy_set_definition_owner = policy_set_definition_owner - self.policy_set_definition_category = policy_set_definition_category - self.policy_set_definition_parameters = policy_set_definition_parameters - self.management_group_ids = management_group_ids - self.policy_definition_reference_id = policy_definition_reference_id - self.compliance_state = compliance_state - self.tenant_id = tenant_id - self.principal_oid = principal_oid - self.components = components - - -class PolicyEventsQueryResults(_serialization.Model): - """Query results. - - :ivar odata_context: OData context string; used by OData clients to resolve type information - based on metadata. - :vartype odata_context: str - :ivar odata_count: OData entity count; represents the number of policy event records returned. - :vartype odata_count: int - :ivar odata_next_link: Odata next link; URL to get the next set of results. - :vartype odata_next_link: str - :ivar value: Query results. - :vartype value: list[~azure.mgmt.policyinsights.models.PolicyEvent] - """ - - _validation = { - "odata_count": {"minimum": 0}, - } - - _attribute_map = { - "odata_context": {"key": "@odata\\.context", "type": "str"}, - "odata_count": {"key": "@odata\\.count", "type": "int"}, - "odata_next_link": {"key": "@odata\\.nextLink", "type": "str"}, - "value": {"key": "value", "type": "[PolicyEvent]"}, - } - - def __init__( - self, - *, - odata_context: Optional[str] = None, - odata_count: Optional[int] = None, - odata_next_link: Optional[str] = None, - value: Optional[List["_models.PolicyEvent"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword odata_context: OData context string; used by OData clients to resolve type information - based on metadata. - :paramtype odata_context: str - :keyword odata_count: OData entity count; represents the number of policy event records - returned. - :paramtype odata_count: int - :keyword odata_next_link: Odata next link; URL to get the next set of results. - :paramtype odata_next_link: str - :keyword value: Query results. - :paramtype value: list[~azure.mgmt.policyinsights.models.PolicyEvent] - """ - super().__init__(**kwargs) - self.odata_context = odata_context - self.odata_count = odata_count - self.odata_next_link = odata_next_link - self.value = value - - -class PolicyGroupSummary(_serialization.Model): - """Policy definition group summary. - - :ivar policy_group_name: Policy group name. - :vartype policy_group_name: str - :ivar results: Compliance summary for the policy definition group. - :vartype results: ~azure.mgmt.policyinsights.models.SummaryResults - """ - - _attribute_map = { - "policy_group_name": {"key": "policyGroupName", "type": "str"}, - "results": {"key": "results", "type": "SummaryResults"}, - } - - def __init__( - self, - *, - policy_group_name: Optional[str] = None, - results: Optional["_models.SummaryResults"] = None, - **kwargs: Any - ) -> None: - """ - :keyword policy_group_name: Policy group name. - :paramtype policy_group_name: str - :keyword results: Compliance summary for the policy definition group. - :paramtype results: ~azure.mgmt.policyinsights.models.SummaryResults - """ - super().__init__(**kwargs) - self.policy_group_name = policy_group_name - self.results = results - - -class PolicyMetadata(_serialization.Model): - """Policy metadata resource definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The ID of the policy metadata. - :vartype id: str - :ivar type: The type of the policy metadata. - :vartype type: str - :ivar name: The name of the policy metadata. - :vartype name: str - :ivar metadata_id: The policy metadata identifier. - :vartype metadata_id: str - :ivar category: The category of the policy metadata. - :vartype category: str - :ivar title: The title of the policy metadata. - :vartype title: str - :ivar owner: The owner of the policy metadata. - :vartype owner: str - :ivar additional_content_url: Url for getting additional content about the resource metadata. - :vartype additional_content_url: str - :ivar metadata: Additional metadata. - :vartype metadata: JSON - :ivar description: The description of the policy metadata. - :vartype description: str - :ivar requirements: The requirements of the policy metadata. - :vartype requirements: str - """ - - _validation = { - "id": {"readonly": True}, - "type": {"readonly": True}, - "name": {"readonly": True}, - "metadata_id": {"readonly": True}, - "category": {"readonly": True}, - "title": {"readonly": True}, - "owner": {"readonly": True}, - "additional_content_url": {"readonly": True}, - "metadata": {"readonly": True}, - "description": {"readonly": True}, - "requirements": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "metadata_id": {"key": "properties.metadataId", "type": "str"}, - "category": {"key": "properties.category", "type": "str"}, - "title": {"key": "properties.title", "type": "str"}, - "owner": {"key": "properties.owner", "type": "str"}, - "additional_content_url": {"key": "properties.additionalContentUrl", "type": "str"}, - "metadata": {"key": "properties.metadata", "type": "object"}, - "description": {"key": "properties.description", "type": "str"}, - "requirements": {"key": "properties.requirements", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.id: Optional[str] = None - self.type: Optional[str] = None - self.name: Optional[str] = None - self.metadata_id: Optional[str] = None - self.category: Optional[str] = None - self.title: Optional[str] = None - self.owner: Optional[str] = None - self.additional_content_url: Optional[str] = None - self.metadata: Optional[JSON] = None - self.description: Optional[str] = None - self.requirements: Optional[str] = None - - -class PolicyMetadataCollection(_serialization.Model): - """Collection of policy metadata resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of policy metadata definitions. - :vartype value: list[~azure.mgmt.policyinsights.models.SlimPolicyMetadata] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[SlimPolicyMetadata]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[List["_models.SlimPolicyMetadata"]] = None - self.next_link: Optional[str] = None - - -class PolicyMetadataSlimProperties(_serialization.Model): - """The properties of the policy metadata, excluding properties containing large strings. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar metadata_id: The policy metadata identifier. - :vartype metadata_id: str - :ivar category: The category of the policy metadata. - :vartype category: str - :ivar title: The title of the policy metadata. - :vartype title: str - :ivar owner: The owner of the policy metadata. - :vartype owner: str - :ivar additional_content_url: Url for getting additional content about the resource metadata. - :vartype additional_content_url: str - :ivar metadata: Additional metadata. - :vartype metadata: JSON - """ - - _validation = { - "metadata_id": {"readonly": True}, - "category": {"readonly": True}, - "title": {"readonly": True}, - "owner": {"readonly": True}, - "additional_content_url": {"readonly": True}, - "metadata": {"readonly": True}, - } - - _attribute_map = { - "metadata_id": {"key": "metadataId", "type": "str"}, - "category": {"key": "category", "type": "str"}, - "title": {"key": "title", "type": "str"}, - "owner": {"key": "owner", "type": "str"}, - "additional_content_url": {"key": "additionalContentUrl", "type": "str"}, - "metadata": {"key": "metadata", "type": "object"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.metadata_id: Optional[str] = None - self.category: Optional[str] = None - self.title: Optional[str] = None - self.owner: Optional[str] = None - self.additional_content_url: Optional[str] = None - self.metadata: Optional[JSON] = None - - -class PolicyMetadataProperties(PolicyMetadataSlimProperties): - """The properties of the policy metadata. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar metadata_id: The policy metadata identifier. - :vartype metadata_id: str - :ivar category: The category of the policy metadata. - :vartype category: str - :ivar title: The title of the policy metadata. - :vartype title: str - :ivar owner: The owner of the policy metadata. - :vartype owner: str - :ivar additional_content_url: Url for getting additional content about the resource metadata. - :vartype additional_content_url: str - :ivar metadata: Additional metadata. - :vartype metadata: JSON - :ivar description: The description of the policy metadata. - :vartype description: str - :ivar requirements: The requirements of the policy metadata. - :vartype requirements: str - """ - - _validation = { - "metadata_id": {"readonly": True}, - "category": {"readonly": True}, - "title": {"readonly": True}, - "owner": {"readonly": True}, - "additional_content_url": {"readonly": True}, - "metadata": {"readonly": True}, - "description": {"readonly": True}, - "requirements": {"readonly": True}, - } - - _attribute_map = { - "metadata_id": {"key": "metadataId", "type": "str"}, - "category": {"key": "category", "type": "str"}, - "title": {"key": "title", "type": "str"}, - "owner": {"key": "owner", "type": "str"}, - "additional_content_url": {"key": "additionalContentUrl", "type": "str"}, - "metadata": {"key": "metadata", "type": "object"}, - "description": {"key": "description", "type": "str"}, - "requirements": {"key": "requirements", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.description: Optional[str] = None - self.requirements: Optional[str] = None - - -class PolicyReference(_serialization.Model): - """Resource identifiers for a policy. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar policy_definition_id: The resource identifier of the policy definition. - :vartype policy_definition_id: str - :ivar policy_set_definition_id: The resource identifier of the policy set definition. - :vartype policy_set_definition_id: str - :ivar policy_definition_reference_id: The reference identifier of a specific policy definition - within a policy set definition. - :vartype policy_definition_reference_id: str - :ivar policy_assignment_id: The resource identifier of the policy assignment. - :vartype policy_assignment_id: str - """ - - _validation = { - "policy_definition_id": {"readonly": True}, - "policy_set_definition_id": {"readonly": True}, - "policy_definition_reference_id": {"readonly": True}, - "policy_assignment_id": {"readonly": True}, - } - - _attribute_map = { - "policy_definition_id": {"key": "policyDefinitionId", "type": "str"}, - "policy_set_definition_id": {"key": "policySetDefinitionId", "type": "str"}, - "policy_definition_reference_id": {"key": "policyDefinitionReferenceId", "type": "str"}, - "policy_assignment_id": {"key": "policyAssignmentId", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.policy_definition_id: Optional[str] = None - self.policy_set_definition_id: Optional[str] = None - self.policy_definition_reference_id: Optional[str] = None - self.policy_assignment_id: Optional[str] = None - - -class PolicyState(_serialization.Model): - """Policy state record. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar odata_id: OData entity ID; always set to null since policy state records do not have an - entity ID. - :vartype odata_id: str - :ivar odata_context: OData context string; used by OData clients to resolve type information - based on metadata. - :vartype odata_context: str - :ivar timestamp: Timestamp for the policy state record. - :vartype timestamp: ~datetime.datetime - :ivar resource_id: Resource ID. - :vartype resource_id: str - :ivar policy_assignment_id: Policy assignment ID. - :vartype policy_assignment_id: str - :ivar policy_definition_id: Policy definition ID. - :vartype policy_definition_id: str - :ivar effective_parameters: Effective parameters for the policy assignment. - :vartype effective_parameters: str - :ivar is_compliant: Flag which states whether the resource is compliant against the policy - assignment it was evaluated against. This property is deprecated; please use ComplianceState - instead. - :vartype is_compliant: bool - :ivar subscription_id: Subscription ID. - :vartype subscription_id: str - :ivar resource_type: Resource type. - :vartype resource_type: str - :ivar resource_location: Resource location. - :vartype resource_location: str - :ivar resource_group: Resource group name. - :vartype resource_group: str - :ivar resource_tags: List of resource tags. - :vartype resource_tags: str - :ivar policy_assignment_name: Policy assignment name. - :vartype policy_assignment_name: str - :ivar policy_assignment_owner: Policy assignment owner. - :vartype policy_assignment_owner: str - :ivar policy_assignment_parameters: Policy assignment parameters. - :vartype policy_assignment_parameters: str - :ivar policy_assignment_scope: Policy assignment scope. - :vartype policy_assignment_scope: str - :ivar policy_definition_name: Policy definition name. - :vartype policy_definition_name: str - :ivar policy_definition_action: Policy definition action, i.e. effect. - :vartype policy_definition_action: str - :ivar policy_definition_category: Policy definition category. - :vartype policy_definition_category: str - :ivar policy_set_definition_id: Policy set definition ID, if the policy assignment is for a - policy set. - :vartype policy_set_definition_id: str - :ivar policy_set_definition_name: Policy set definition name, if the policy assignment is for a - policy set. - :vartype policy_set_definition_name: str - :ivar policy_set_definition_owner: Policy set definition owner, if the policy assignment is for - a policy set. - :vartype policy_set_definition_owner: str - :ivar policy_set_definition_category: Policy set definition category, if the policy assignment - is for a policy set. - :vartype policy_set_definition_category: str - :ivar policy_set_definition_parameters: Policy set definition parameters, if the policy - assignment is for a policy set. - :vartype policy_set_definition_parameters: str - :ivar management_group_ids: Comma separated list of management group IDs, which represent the - hierarchy of the management groups the resource is under. - :vartype management_group_ids: str - :ivar policy_definition_reference_id: Reference ID for the policy definition inside the policy - set, if the policy assignment is for a policy set. - :vartype policy_definition_reference_id: str - :ivar compliance_state: Compliance state of the resource. - :vartype compliance_state: str - :ivar policy_evaluation_details: Policy evaluation details. - :vartype policy_evaluation_details: ~azure.mgmt.policyinsights.models.PolicyEvaluationDetails - :ivar policy_definition_group_names: Policy definition group names. - :vartype policy_definition_group_names: list[str] - :ivar components: Components state compliance records populated only when URL contains - $expand=components clause. - :vartype components: list[~azure.mgmt.policyinsights.models.ComponentStateDetails] - :ivar policy_definition_version: Evaluated policy definition version. - :vartype policy_definition_version: str - :ivar policy_set_definition_version: Evaluated policy set definition version. - :vartype policy_set_definition_version: str - :ivar policy_assignment_version: Evaluated policy assignment version. - :vartype policy_assignment_version: str - """ - - _validation = { - "policy_definition_version": {"readonly": True}, - "policy_set_definition_version": {"readonly": True}, - "policy_assignment_version": {"readonly": True}, - } - - _attribute_map = { - "additional_properties": {"key": "", "type": "{object}"}, - "odata_id": {"key": "@odata\\.id", "type": "str"}, - "odata_context": {"key": "@odata\\.context", "type": "str"}, - "timestamp": {"key": "timestamp", "type": "iso-8601"}, - "resource_id": {"key": "resourceId", "type": "str"}, - "policy_assignment_id": {"key": "policyAssignmentId", "type": "str"}, - "policy_definition_id": {"key": "policyDefinitionId", "type": "str"}, - "effective_parameters": {"key": "effectiveParameters", "type": "str"}, - "is_compliant": {"key": "isCompliant", "type": "bool"}, - "subscription_id": {"key": "subscriptionId", "type": "str"}, - "resource_type": {"key": "resourceType", "type": "str"}, - "resource_location": {"key": "resourceLocation", "type": "str"}, - "resource_group": {"key": "resourceGroup", "type": "str"}, - "resource_tags": {"key": "resourceTags", "type": "str"}, - "policy_assignment_name": {"key": "policyAssignmentName", "type": "str"}, - "policy_assignment_owner": {"key": "policyAssignmentOwner", "type": "str"}, - "policy_assignment_parameters": {"key": "policyAssignmentParameters", "type": "str"}, - "policy_assignment_scope": {"key": "policyAssignmentScope", "type": "str"}, - "policy_definition_name": {"key": "policyDefinitionName", "type": "str"}, - "policy_definition_action": {"key": "policyDefinitionAction", "type": "str"}, - "policy_definition_category": {"key": "policyDefinitionCategory", "type": "str"}, - "policy_set_definition_id": {"key": "policySetDefinitionId", "type": "str"}, - "policy_set_definition_name": {"key": "policySetDefinitionName", "type": "str"}, - "policy_set_definition_owner": {"key": "policySetDefinitionOwner", "type": "str"}, - "policy_set_definition_category": {"key": "policySetDefinitionCategory", "type": "str"}, - "policy_set_definition_parameters": {"key": "policySetDefinitionParameters", "type": "str"}, - "management_group_ids": {"key": "managementGroupIds", "type": "str"}, - "policy_definition_reference_id": {"key": "policyDefinitionReferenceId", "type": "str"}, - "compliance_state": {"key": "complianceState", "type": "str"}, - "policy_evaluation_details": {"key": "policyEvaluationDetails", "type": "PolicyEvaluationDetails"}, - "policy_definition_group_names": {"key": "policyDefinitionGroupNames", "type": "[str]"}, - "components": {"key": "components", "type": "[ComponentStateDetails]"}, - "policy_definition_version": {"key": "policyDefinitionVersion", "type": "str"}, - "policy_set_definition_version": {"key": "policySetDefinitionVersion", "type": "str"}, - "policy_assignment_version": {"key": "policyAssignmentVersion", "type": "str"}, - } - - def __init__( # pylint: disable=too-many-locals - self, - *, - additional_properties: Optional[Dict[str, Any]] = None, - odata_id: Optional[str] = None, - odata_context: Optional[str] = None, - timestamp: Optional[datetime.datetime] = None, - resource_id: Optional[str] = None, - policy_assignment_id: Optional[str] = None, - policy_definition_id: Optional[str] = None, - effective_parameters: Optional[str] = None, - is_compliant: Optional[bool] = None, - subscription_id: Optional[str] = None, - resource_type: Optional[str] = None, - resource_location: Optional[str] = None, - resource_group: Optional[str] = None, - resource_tags: Optional[str] = None, - policy_assignment_name: Optional[str] = None, - policy_assignment_owner: Optional[str] = None, - policy_assignment_parameters: Optional[str] = None, - policy_assignment_scope: Optional[str] = None, - policy_definition_name: Optional[str] = None, - policy_definition_action: Optional[str] = None, - policy_definition_category: Optional[str] = None, - policy_set_definition_id: Optional[str] = None, - policy_set_definition_name: Optional[str] = None, - policy_set_definition_owner: Optional[str] = None, - policy_set_definition_category: Optional[str] = None, - policy_set_definition_parameters: Optional[str] = None, - management_group_ids: Optional[str] = None, - policy_definition_reference_id: Optional[str] = None, - compliance_state: Optional[str] = None, - policy_evaluation_details: Optional["_models.PolicyEvaluationDetails"] = None, - policy_definition_group_names: Optional[List[str]] = None, - components: Optional[List["_models.ComponentStateDetails"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword odata_id: OData entity ID; always set to null since policy state records do not have - an entity ID. - :paramtype odata_id: str - :keyword odata_context: OData context string; used by OData clients to resolve type information - based on metadata. - :paramtype odata_context: str - :keyword timestamp: Timestamp for the policy state record. - :paramtype timestamp: ~datetime.datetime - :keyword resource_id: Resource ID. - :paramtype resource_id: str - :keyword policy_assignment_id: Policy assignment ID. - :paramtype policy_assignment_id: str - :keyword policy_definition_id: Policy definition ID. - :paramtype policy_definition_id: str - :keyword effective_parameters: Effective parameters for the policy assignment. - :paramtype effective_parameters: str - :keyword is_compliant: Flag which states whether the resource is compliant against the policy - assignment it was evaluated against. This property is deprecated; please use ComplianceState - instead. - :paramtype is_compliant: bool - :keyword subscription_id: Subscription ID. - :paramtype subscription_id: str - :keyword resource_type: Resource type. - :paramtype resource_type: str - :keyword resource_location: Resource location. - :paramtype resource_location: str - :keyword resource_group: Resource group name. - :paramtype resource_group: str - :keyword resource_tags: List of resource tags. - :paramtype resource_tags: str - :keyword policy_assignment_name: Policy assignment name. - :paramtype policy_assignment_name: str - :keyword policy_assignment_owner: Policy assignment owner. - :paramtype policy_assignment_owner: str - :keyword policy_assignment_parameters: Policy assignment parameters. - :paramtype policy_assignment_parameters: str - :keyword policy_assignment_scope: Policy assignment scope. - :paramtype policy_assignment_scope: str - :keyword policy_definition_name: Policy definition name. - :paramtype policy_definition_name: str - :keyword policy_definition_action: Policy definition action, i.e. effect. - :paramtype policy_definition_action: str - :keyword policy_definition_category: Policy definition category. - :paramtype policy_definition_category: str - :keyword policy_set_definition_id: Policy set definition ID, if the policy assignment is for a - policy set. - :paramtype policy_set_definition_id: str - :keyword policy_set_definition_name: Policy set definition name, if the policy assignment is - for a policy set. - :paramtype policy_set_definition_name: str - :keyword policy_set_definition_owner: Policy set definition owner, if the policy assignment is - for a policy set. - :paramtype policy_set_definition_owner: str - :keyword policy_set_definition_category: Policy set definition category, if the policy - assignment is for a policy set. - :paramtype policy_set_definition_category: str - :keyword policy_set_definition_parameters: Policy set definition parameters, if the policy - assignment is for a policy set. - :paramtype policy_set_definition_parameters: str - :keyword management_group_ids: Comma separated list of management group IDs, which represent - the hierarchy of the management groups the resource is under. - :paramtype management_group_ids: str - :keyword policy_definition_reference_id: Reference ID for the policy definition inside the - policy set, if the policy assignment is for a policy set. - :paramtype policy_definition_reference_id: str - :keyword compliance_state: Compliance state of the resource. - :paramtype compliance_state: str - :keyword policy_evaluation_details: Policy evaluation details. - :paramtype policy_evaluation_details: ~azure.mgmt.policyinsights.models.PolicyEvaluationDetails - :keyword policy_definition_group_names: Policy definition group names. - :paramtype policy_definition_group_names: list[str] - :keyword components: Components state compliance records populated only when URL contains - $expand=components clause. - :paramtype components: list[~azure.mgmt.policyinsights.models.ComponentStateDetails] - """ - super().__init__(**kwargs) - self.additional_properties = additional_properties - self.odata_id = odata_id - self.odata_context = odata_context - self.timestamp = timestamp - self.resource_id = resource_id - self.policy_assignment_id = policy_assignment_id - self.policy_definition_id = policy_definition_id - self.effective_parameters = effective_parameters - self.is_compliant = is_compliant - self.subscription_id = subscription_id - self.resource_type = resource_type - self.resource_location = resource_location - self.resource_group = resource_group - self.resource_tags = resource_tags - self.policy_assignment_name = policy_assignment_name - self.policy_assignment_owner = policy_assignment_owner - self.policy_assignment_parameters = policy_assignment_parameters - self.policy_assignment_scope = policy_assignment_scope - self.policy_definition_name = policy_definition_name - self.policy_definition_action = policy_definition_action - self.policy_definition_category = policy_definition_category - self.policy_set_definition_id = policy_set_definition_id - self.policy_set_definition_name = policy_set_definition_name - self.policy_set_definition_owner = policy_set_definition_owner - self.policy_set_definition_category = policy_set_definition_category - self.policy_set_definition_parameters = policy_set_definition_parameters - self.management_group_ids = management_group_ids - self.policy_definition_reference_id = policy_definition_reference_id - self.compliance_state = compliance_state - self.policy_evaluation_details = policy_evaluation_details - self.policy_definition_group_names = policy_definition_group_names - self.components = components - self.policy_definition_version: Optional[str] = None - self.policy_set_definition_version: Optional[str] = None - self.policy_assignment_version: Optional[str] = None - - -class PolicyStatesQueryResults(_serialization.Model): - """Query results. - - :ivar odata_context: OData context string; used by OData clients to resolve type information - based on metadata. - :vartype odata_context: str - :ivar odata_count: OData entity count; represents the number of policy state records returned. - :vartype odata_count: int - :ivar odata_next_link: Odata next link; URL to get the next set of results. - :vartype odata_next_link: str - :ivar value: Query results. - :vartype value: list[~azure.mgmt.policyinsights.models.PolicyState] - """ - - _validation = { - "odata_count": {"minimum": 0}, - } - - _attribute_map = { - "odata_context": {"key": "@odata\\.context", "type": "str"}, - "odata_count": {"key": "@odata\\.count", "type": "int"}, - "odata_next_link": {"key": "@odata\\.nextLink", "type": "str"}, - "value": {"key": "value", "type": "[PolicyState]"}, - } - - def __init__( - self, - *, - odata_context: Optional[str] = None, - odata_count: Optional[int] = None, - odata_next_link: Optional[str] = None, - value: Optional[List["_models.PolicyState"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword odata_context: OData context string; used by OData clients to resolve type information - based on metadata. - :paramtype odata_context: str - :keyword odata_count: OData entity count; represents the number of policy state records - returned. - :paramtype odata_count: int - :keyword odata_next_link: Odata next link; URL to get the next set of results. - :paramtype odata_next_link: str - :keyword value: Query results. - :paramtype value: list[~azure.mgmt.policyinsights.models.PolicyState] - """ - super().__init__(**kwargs) - self.odata_context = odata_context - self.odata_count = odata_count - self.odata_next_link = odata_next_link - self.value = value - - -class PolicyTrackedResource(_serialization.Model): - """Policy tracked resource record. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar tracked_resource_id: The ID of the policy tracked resource. - :vartype tracked_resource_id: str - :ivar policy_details: The details of the policy that require the tracked resource. - :vartype policy_details: ~azure.mgmt.policyinsights.models.PolicyDetails - :ivar created_by: The details of the policy triggered deployment that created the tracked - resource. - :vartype created_by: ~azure.mgmt.policyinsights.models.TrackedResourceModificationDetails - :ivar last_modified_by: The details of the policy triggered deployment that modified the - tracked resource. - :vartype last_modified_by: ~azure.mgmt.policyinsights.models.TrackedResourceModificationDetails - :ivar last_update_utc: Timestamp of the last update to the tracked resource. - :vartype last_update_utc: ~datetime.datetime - """ - - _validation = { - "tracked_resource_id": {"readonly": True}, - "policy_details": {"readonly": True}, - "created_by": {"readonly": True}, - "last_modified_by": {"readonly": True}, - "last_update_utc": {"readonly": True}, - } - - _attribute_map = { - "tracked_resource_id": {"key": "trackedResourceId", "type": "str"}, - "policy_details": {"key": "policyDetails", "type": "PolicyDetails"}, - "created_by": {"key": "createdBy", "type": "TrackedResourceModificationDetails"}, - "last_modified_by": {"key": "lastModifiedBy", "type": "TrackedResourceModificationDetails"}, - "last_update_utc": {"key": "lastUpdateUtc", "type": "iso-8601"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.tracked_resource_id: Optional[str] = None - self.policy_details: Optional["_models.PolicyDetails"] = None - self.created_by: Optional["_models.TrackedResourceModificationDetails"] = None - self.last_modified_by: Optional["_models.TrackedResourceModificationDetails"] = None - self.last_update_utc: Optional[datetime.datetime] = None - - -class PolicyTrackedResourcesQueryResults(_serialization.Model): - """Query results. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Query results. - :vartype value: list[~azure.mgmt.policyinsights.models.PolicyTrackedResource] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[PolicyTrackedResource]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[List["_models.PolicyTrackedResource"]] = None - self.next_link: Optional[str] = None - - -class QueryFailure(_serialization.Model): - """Error response. - - :ivar error: Error definition. - :vartype error: ~azure.mgmt.policyinsights.models.QueryFailureError - """ - - _attribute_map = { - "error": {"key": "error", "type": "QueryFailureError"}, - } - - def __init__(self, *, error: Optional["_models.QueryFailureError"] = None, **kwargs: Any) -> None: - """ - :keyword error: Error definition. - :paramtype error: ~azure.mgmt.policyinsights.models.QueryFailureError - """ - super().__init__(**kwargs) - self.error = error - - -class QueryFailureError(_serialization.Model): - """Error definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: Service specific error code which serves as the substatus for the HTTP error code. - :vartype code: str - :ivar message: Description of the error. - :vartype message: str - """ - - _validation = { - "code": {"readonly": True}, - "message": {"readonly": True}, - } - - _attribute_map = { - "code": {"key": "code", "type": "str"}, - "message": {"key": "message", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.code: Optional[str] = None - self.message: Optional[str] = None - - -class QueryOptions(_serialization.Model): - """Parameter group. - - :ivar top: Maximum number of records to return. - :vartype top: int - :ivar filter: OData filter expression. - :vartype filter: str - :ivar order_by: Ordering expression using OData notation. One or more comma-separated column - names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, - ResourceId asc". - :vartype order_by: str - :ivar select: Select expression using OData notation. Limits the columns on each record to just - those requested, e.g. "$select=PolicyAssignmentId, ResourceId". - :vartype select: str - :ivar from_property: ISO 8601 formatted timestamp specifying the start time of the interval to - query. When not specified, the service uses ($to - 1-day). - :vartype from_property: ~datetime.datetime - :ivar to: ISO 8601 formatted timestamp specifying the end time of the interval to query. When - not specified, the service uses request time. - :vartype to: ~datetime.datetime - :ivar apply: OData apply expression for aggregations. - :vartype apply: str - :ivar skip_token: Skiptoken is only provided if a previous response returned a partial result - as a part of nextLink element. - :vartype skip_token: str - :ivar expand: The $expand query parameter. For example, to expand components use - $expand=components. - :vartype expand: str - """ - - _validation = { - "top": {"minimum": 0}, - } - - _attribute_map = { - "top": {"key": "Top", "type": "int"}, - "filter": {"key": "Filter", "type": "str"}, - "order_by": {"key": "OrderBy", "type": "str"}, - "select": {"key": "Select", "type": "str"}, - "from_property": {"key": "FromProperty", "type": "iso-8601"}, - "to": {"key": "To", "type": "iso-8601"}, - "apply": {"key": "Apply", "type": "str"}, - "skip_token": {"key": "SkipToken", "type": "str"}, - "expand": {"key": "Expand", "type": "str"}, - } - - def __init__( - self, - *, - top: Optional[int] = None, - filter: Optional[str] = None, # pylint: disable=redefined-builtin - order_by: Optional[str] = None, - select: Optional[str] = None, - from_property: Optional[datetime.datetime] = None, - to: Optional[datetime.datetime] = None, - apply: Optional[str] = None, - skip_token: Optional[str] = None, - expand: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword top: Maximum number of records to return. - :paramtype top: int - :keyword filter: OData filter expression. - :paramtype filter: str - :keyword order_by: Ordering expression using OData notation. One or more comma-separated column - names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, - ResourceId asc". - :paramtype order_by: str - :keyword select: Select expression using OData notation. Limits the columns on each record to - just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". - :paramtype select: str - :keyword from_property: ISO 8601 formatted timestamp specifying the start time of the interval - to query. When not specified, the service uses ($to - 1-day). - :paramtype from_property: ~datetime.datetime - :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. - When not specified, the service uses request time. - :paramtype to: ~datetime.datetime - :keyword apply: OData apply expression for aggregations. - :paramtype apply: str - :keyword skip_token: Skiptoken is only provided if a previous response returned a partial - result as a part of nextLink element. - :paramtype skip_token: str - :keyword expand: The $expand query parameter. For example, to expand components use - $expand=components. - :paramtype expand: str - """ - super().__init__(**kwargs) - self.top = top - self.filter = filter - self.order_by = order_by - self.select = select - self.from_property = from_property - self.to = to - self.apply = apply - self.skip_token = skip_token - self.expand = expand - - -class Remediation(_serialization.Model): - """The remediation definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The ID of the remediation. - :vartype id: str - :ivar type: The type of the remediation. - :vartype type: str - :ivar name: The name of the remediation. - :vartype name: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.policyinsights.models.SystemData - :ivar policy_assignment_id: The resource ID of the policy assignment that should be remediated. - :vartype policy_assignment_id: str - :ivar policy_definition_reference_id: The policy definition reference ID of the individual - definition that should be remediated. Required when the policy assignment being remediated - assigns a policy set definition. - :vartype policy_definition_reference_id: str - :ivar resource_discovery_mode: The way resources to remediate are discovered. Defaults to - ExistingNonCompliant if not specified. Known values are: "ExistingNonCompliant" and - "ReEvaluateCompliance". - :vartype resource_discovery_mode: str or - ~azure.mgmt.policyinsights.models.ResourceDiscoveryMode - :ivar provisioning_state: The status of the remediation. This refers to the entire remediation - task, not individual deployments. Allowed values are Evaluating, Canceled, Cancelling, Failed, - Complete, or Succeeded. - :vartype provisioning_state: str - :ivar created_on: The time at which the remediation was created. - :vartype created_on: ~datetime.datetime - :ivar last_updated_on: The time at which the remediation was last updated. - :vartype last_updated_on: ~datetime.datetime - :ivar filters: The filters that will be applied to determine which resources to remediate. - :vartype filters: ~azure.mgmt.policyinsights.models.RemediationFilters - :ivar deployment_status: The deployment status summary for all deployments created by the - remediation. - :vartype deployment_status: ~azure.mgmt.policyinsights.models.RemediationDeploymentSummary - :ivar status_message: The remediation status message. Provides additional details regarding the - state of the remediation. - :vartype status_message: str - :ivar correlation_id: The remediation correlation Id. Can be used to find events related to the - remediation in the activity log. - :vartype correlation_id: str - :ivar resource_count: Determines the max number of resources that can be remediated by the - remediation job. If not provided, the default resource count is used. - :vartype resource_count: int - :ivar parallel_deployments: Determines how many resources to remediate at any given time. Can - be used to increase or reduce the pace of the remediation. If not provided, the default - parallel deployments value is used. - :vartype parallel_deployments: int - :ivar failure_threshold: The remediation failure threshold settings. - :vartype failure_threshold: - ~azure.mgmt.policyinsights.models.RemediationPropertiesFailureThreshold - """ - - _validation = { - "id": {"readonly": True}, - "type": {"readonly": True}, - "name": {"readonly": True}, - "system_data": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "created_on": {"readonly": True}, - "last_updated_on": {"readonly": True}, - "deployment_status": {"readonly": True}, - "status_message": {"readonly": True}, - "correlation_id": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "policy_assignment_id": {"key": "properties.policyAssignmentId", "type": "str"}, - "policy_definition_reference_id": {"key": "properties.policyDefinitionReferenceId", "type": "str"}, - "resource_discovery_mode": {"key": "properties.resourceDiscoveryMode", "type": "str"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "created_on": {"key": "properties.createdOn", "type": "iso-8601"}, - "last_updated_on": {"key": "properties.lastUpdatedOn", "type": "iso-8601"}, - "filters": {"key": "properties.filters", "type": "RemediationFilters"}, - "deployment_status": {"key": "properties.deploymentStatus", "type": "RemediationDeploymentSummary"}, - "status_message": {"key": "properties.statusMessage", "type": "str"}, - "correlation_id": {"key": "properties.correlationId", "type": "str"}, - "resource_count": {"key": "properties.resourceCount", "type": "int"}, - "parallel_deployments": {"key": "properties.parallelDeployments", "type": "int"}, - "failure_threshold": {"key": "properties.failureThreshold", "type": "RemediationPropertiesFailureThreshold"}, - } - - def __init__( - self, - *, - policy_assignment_id: Optional[str] = None, - policy_definition_reference_id: Optional[str] = None, - resource_discovery_mode: Optional[Union[str, "_models.ResourceDiscoveryMode"]] = None, - filters: Optional["_models.RemediationFilters"] = None, - resource_count: Optional[int] = None, - parallel_deployments: Optional[int] = None, - failure_threshold: Optional["_models.RemediationPropertiesFailureThreshold"] = None, - **kwargs: Any - ) -> None: - """ - :keyword policy_assignment_id: The resource ID of the policy assignment that should be - remediated. - :paramtype policy_assignment_id: str - :keyword policy_definition_reference_id: The policy definition reference ID of the individual - definition that should be remediated. Required when the policy assignment being remediated - assigns a policy set definition. - :paramtype policy_definition_reference_id: str - :keyword resource_discovery_mode: The way resources to remediate are discovered. Defaults to - ExistingNonCompliant if not specified. Known values are: "ExistingNonCompliant" and - "ReEvaluateCompliance". - :paramtype resource_discovery_mode: str or - ~azure.mgmt.policyinsights.models.ResourceDiscoveryMode - :keyword filters: The filters that will be applied to determine which resources to remediate. - :paramtype filters: ~azure.mgmt.policyinsights.models.RemediationFilters - :keyword resource_count: Determines the max number of resources that can be remediated by the - remediation job. If not provided, the default resource count is used. - :paramtype resource_count: int - :keyword parallel_deployments: Determines how many resources to remediate at any given time. - Can be used to increase or reduce the pace of the remediation. If not provided, the default - parallel deployments value is used. - :paramtype parallel_deployments: int - :keyword failure_threshold: The remediation failure threshold settings. - :paramtype failure_threshold: - ~azure.mgmt.policyinsights.models.RemediationPropertiesFailureThreshold - """ - super().__init__(**kwargs) - self.id: Optional[str] = None - self.type: Optional[str] = None - self.name: Optional[str] = None - self.system_data: Optional["_models.SystemData"] = None - self.policy_assignment_id = policy_assignment_id - self.policy_definition_reference_id = policy_definition_reference_id - self.resource_discovery_mode = resource_discovery_mode - self.provisioning_state: Optional[str] = None - self.created_on: Optional[datetime.datetime] = None - self.last_updated_on: Optional[datetime.datetime] = None - self.filters = filters - self.deployment_status: Optional["_models.RemediationDeploymentSummary"] = None - self.status_message: Optional[str] = None - self.correlation_id: Optional[str] = None - self.resource_count = resource_count - self.parallel_deployments = parallel_deployments - self.failure_threshold = failure_threshold - - -class RemediationDeployment(_serialization.Model): - """Details of a single deployment created by the remediation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar remediated_resource_id: Resource ID of the resource that is being remediated by the - deployment. - :vartype remediated_resource_id: str - :ivar deployment_id: Resource ID of the template deployment that will remediate the resource. - :vartype deployment_id: str - :ivar status: Status of the remediation deployment. - :vartype status: str - :ivar resource_location: Location of the resource that is being remediated. - :vartype resource_location: str - :ivar error: Error encountered while remediated the resource. - :vartype error: ~azure.mgmt.policyinsights.models.ErrorDefinition - :ivar created_on: The time at which the remediation was created. - :vartype created_on: ~datetime.datetime - :ivar last_updated_on: The time at which the remediation deployment was last updated. - :vartype last_updated_on: ~datetime.datetime - """ - - _validation = { - "remediated_resource_id": {"readonly": True}, - "deployment_id": {"readonly": True}, - "status": {"readonly": True}, - "resource_location": {"readonly": True}, - "error": {"readonly": True}, - "created_on": {"readonly": True}, - "last_updated_on": {"readonly": True}, - } - - _attribute_map = { - "remediated_resource_id": {"key": "remediatedResourceId", "type": "str"}, - "deployment_id": {"key": "deploymentId", "type": "str"}, - "status": {"key": "status", "type": "str"}, - "resource_location": {"key": "resourceLocation", "type": "str"}, - "error": {"key": "error", "type": "ErrorDefinition"}, - "created_on": {"key": "createdOn", "type": "iso-8601"}, - "last_updated_on": {"key": "lastUpdatedOn", "type": "iso-8601"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.remediated_resource_id: Optional[str] = None - self.deployment_id: Optional[str] = None - self.status: Optional[str] = None - self.resource_location: Optional[str] = None - self.error: Optional["_models.ErrorDefinition"] = None - self.created_on: Optional[datetime.datetime] = None - self.last_updated_on: Optional[datetime.datetime] = None - - -class RemediationDeploymentsListResult(_serialization.Model): - """List of deployments for a remediation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of deployments for the remediation. - :vartype value: list[~azure.mgmt.policyinsights.models.RemediationDeployment] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[RemediationDeployment]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[List["_models.RemediationDeployment"]] = None - self.next_link: Optional[str] = None - - -class RemediationDeploymentSummary(_serialization.Model): - """The deployment status summary for all deployments created by the remediation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar total_deployments: The number of deployments required by the remediation. - :vartype total_deployments: int - :ivar successful_deployments: The number of deployments required by the remediation that have - succeeded. - :vartype successful_deployments: int - :ivar failed_deployments: The number of deployments required by the remediation that have - failed. - :vartype failed_deployments: int - """ - - _validation = { - "total_deployments": {"readonly": True}, - "successful_deployments": {"readonly": True}, - "failed_deployments": {"readonly": True}, - } - - _attribute_map = { - "total_deployments": {"key": "totalDeployments", "type": "int"}, - "successful_deployments": {"key": "successfulDeployments", "type": "int"}, - "failed_deployments": {"key": "failedDeployments", "type": "int"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.total_deployments: Optional[int] = None - self.successful_deployments: Optional[int] = None - self.failed_deployments: Optional[int] = None - - -class RemediationFilters(_serialization.Model): - """The filters that will be applied to determine which resources to remediate. - - :ivar locations: The resource locations that will be remediated. - :vartype locations: list[str] - :ivar resource_ids: The IDs of the resources that will be remediated. Can specify at most 100 - IDs. This filter cannot be used when ReEvaluateCompliance is set to ReEvaluateCompliance, and - cannot be empty if provided. - :vartype resource_ids: list[str] - """ - - _attribute_map = { - "locations": {"key": "locations", "type": "[str]"}, - "resource_ids": {"key": "resourceIds", "type": "[str]"}, - } - - def __init__( - self, *, locations: Optional[List[str]] = None, resource_ids: Optional[List[str]] = None, **kwargs: Any - ) -> None: - """ - :keyword locations: The resource locations that will be remediated. - :paramtype locations: list[str] - :keyword resource_ids: The IDs of the resources that will be remediated. Can specify at most - 100 IDs. This filter cannot be used when ReEvaluateCompliance is set to ReEvaluateCompliance, - and cannot be empty if provided. - :paramtype resource_ids: list[str] - """ - super().__init__(**kwargs) - self.locations = locations - self.resource_ids = resource_ids - - -class RemediationListResult(_serialization.Model): - """List of remediations. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of remediation definitions. - :vartype value: list[~azure.mgmt.policyinsights.models.Remediation] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[Remediation]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[List["_models.Remediation"]] = None - self.next_link: Optional[str] = None - - -class RemediationPropertiesFailureThreshold(_serialization.Model): - """The remediation failure threshold settings. - - :ivar percentage: A number between 0.0 to 1.0 representing the percentage failure threshold. - The remediation will fail if the percentage of failed remediation operations (i.e. failed - deployments) exceeds this threshold. - :vartype percentage: float - """ - - _attribute_map = { - "percentage": {"key": "percentage", "type": "float"}, - } - - def __init__(self, *, percentage: Optional[float] = None, **kwargs: Any) -> None: - """ - :keyword percentage: A number between 0.0 to 1.0 representing the percentage failure threshold. - The remediation will fail if the percentage of failed remediation operations (i.e. failed - deployments) exceeds this threshold. - :paramtype percentage: float - """ - super().__init__(**kwargs) - self.percentage = percentage - - -class SlimPolicyMetadata(_serialization.Model): - """Slim version of policy metadata resource definition, excluding properties with large strings. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The ID of the policy metadata. - :vartype id: str - :ivar type: The type of the policy metadata. - :vartype type: str - :ivar name: The name of the policy metadata. - :vartype name: str - :ivar metadata_id: The policy metadata identifier. - :vartype metadata_id: str - :ivar category: The category of the policy metadata. - :vartype category: str - :ivar title: The title of the policy metadata. - :vartype title: str - :ivar owner: The owner of the policy metadata. - :vartype owner: str - :ivar additional_content_url: Url for getting additional content about the resource metadata. - :vartype additional_content_url: str - :ivar metadata: Additional metadata. - :vartype metadata: JSON - """ - - _validation = { - "id": {"readonly": True}, - "type": {"readonly": True}, - "name": {"readonly": True}, - "metadata_id": {"readonly": True}, - "category": {"readonly": True}, - "title": {"readonly": True}, - "owner": {"readonly": True}, - "additional_content_url": {"readonly": True}, - "metadata": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "metadata_id": {"key": "properties.metadataId", "type": "str"}, - "category": {"key": "properties.category", "type": "str"}, - "title": {"key": "properties.title", "type": "str"}, - "owner": {"key": "properties.owner", "type": "str"}, - "additional_content_url": {"key": "properties.additionalContentUrl", "type": "str"}, - "metadata": {"key": "properties.metadata", "type": "object"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.id: Optional[str] = None - self.type: Optional[str] = None - self.name: Optional[str] = None - self.metadata_id: Optional[str] = None - self.category: Optional[str] = None - self.title: Optional[str] = None - self.owner: Optional[str] = None - self.additional_content_url: Optional[str] = None - self.metadata: Optional[JSON] = None - - -class SummarizeResults(_serialization.Model): - """Summarize action results. - - :ivar odata_context: OData context string; used by OData clients to resolve type information - based on metadata. - :vartype odata_context: str - :ivar odata_count: OData entity count; represents the number of summaries returned; always set - to 1. - :vartype odata_count: int - :ivar value: Summarize action results. - :vartype value: list[~azure.mgmt.policyinsights.models.Summary] - """ - - _validation = { - "odata_count": {"maximum": 1, "minimum": 1}, - } - - _attribute_map = { - "odata_context": {"key": "@odata\\.context", "type": "str"}, - "odata_count": {"key": "@odata\\.count", "type": "int"}, - "value": {"key": "value", "type": "[Summary]"}, - } - - def __init__( - self, - *, - odata_context: Optional[str] = None, - odata_count: Optional[int] = None, - value: Optional[List["_models.Summary"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword odata_context: OData context string; used by OData clients to resolve type information - based on metadata. - :paramtype odata_context: str - :keyword odata_count: OData entity count; represents the number of summaries returned; always - set to 1. - :paramtype odata_count: int - :keyword value: Summarize action results. - :paramtype value: list[~azure.mgmt.policyinsights.models.Summary] - """ - super().__init__(**kwargs) - self.odata_context = odata_context - self.odata_count = odata_count - self.value = value - - -class Summary(_serialization.Model): - """Summary results. - - :ivar odata_id: OData entity ID; always set to null since summaries do not have an entity ID. - :vartype odata_id: str - :ivar odata_context: OData context string; used by OData clients to resolve type information - based on metadata. - :vartype odata_context: str - :ivar results: Compliance summary for all policy assignments. - :vartype results: ~azure.mgmt.policyinsights.models.SummaryResults - :ivar policy_assignments: Policy assignments summary. - :vartype policy_assignments: list[~azure.mgmt.policyinsights.models.PolicyAssignmentSummary] - """ - - _attribute_map = { - "odata_id": {"key": "@odata\\.id", "type": "str"}, - "odata_context": {"key": "@odata\\.context", "type": "str"}, - "results": {"key": "results", "type": "SummaryResults"}, - "policy_assignments": {"key": "policyAssignments", "type": "[PolicyAssignmentSummary]"}, - } - - def __init__( - self, - *, - odata_id: Optional[str] = None, - odata_context: Optional[str] = None, - results: Optional["_models.SummaryResults"] = None, - policy_assignments: Optional[List["_models.PolicyAssignmentSummary"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword odata_id: OData entity ID; always set to null since summaries do not have an entity - ID. - :paramtype odata_id: str - :keyword odata_context: OData context string; used by OData clients to resolve type information - based on metadata. - :paramtype odata_context: str - :keyword results: Compliance summary for all policy assignments. - :paramtype results: ~azure.mgmt.policyinsights.models.SummaryResults - :keyword policy_assignments: Policy assignments summary. - :paramtype policy_assignments: list[~azure.mgmt.policyinsights.models.PolicyAssignmentSummary] - """ - super().__init__(**kwargs) - self.odata_id = odata_id - self.odata_context = odata_context - self.results = results - self.policy_assignments = policy_assignments - - -class SummaryResults(_serialization.Model): - """Compliance summary on a particular summary level. - - :ivar query_results_uri: HTTP POST URI for queryResults action on Microsoft.PolicyInsights to - retrieve raw results for the compliance summary. This property will not be available by default - in future API versions, but could be queried explicitly. - :vartype query_results_uri: str - :ivar non_compliant_resources: Number of non-compliant resources. - :vartype non_compliant_resources: int - :ivar non_compliant_policies: Number of non-compliant policies. - :vartype non_compliant_policies: int - :ivar resource_details: The resources summary at this level. - :vartype resource_details: list[~azure.mgmt.policyinsights.models.ComplianceDetail] - :ivar policy_details: The policy artifact summary at this level. For query scope level, it - represents policy assignment summary. For policy assignment level, it represents policy - definitions summary. - :vartype policy_details: list[~azure.mgmt.policyinsights.models.ComplianceDetail] - :ivar policy_group_details: The policy definition group summary at this level. - :vartype policy_group_details: list[~azure.mgmt.policyinsights.models.ComplianceDetail] - """ - - _validation = { - "non_compliant_resources": {"minimum": 0}, - "non_compliant_policies": {"minimum": 0}, - } - - _attribute_map = { - "query_results_uri": {"key": "queryResultsUri", "type": "str"}, - "non_compliant_resources": {"key": "nonCompliantResources", "type": "int"}, - "non_compliant_policies": {"key": "nonCompliantPolicies", "type": "int"}, - "resource_details": {"key": "resourceDetails", "type": "[ComplianceDetail]"}, - "policy_details": {"key": "policyDetails", "type": "[ComplianceDetail]"}, - "policy_group_details": {"key": "policyGroupDetails", "type": "[ComplianceDetail]"}, - } - - def __init__( - self, - *, - query_results_uri: Optional[str] = None, - non_compliant_resources: Optional[int] = None, - non_compliant_policies: Optional[int] = None, - resource_details: Optional[List["_models.ComplianceDetail"]] = None, - policy_details: Optional[List["_models.ComplianceDetail"]] = None, - policy_group_details: Optional[List["_models.ComplianceDetail"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword query_results_uri: HTTP POST URI for queryResults action on Microsoft.PolicyInsights - to retrieve raw results for the compliance summary. This property will not be available by - default in future API versions, but could be queried explicitly. - :paramtype query_results_uri: str - :keyword non_compliant_resources: Number of non-compliant resources. - :paramtype non_compliant_resources: int - :keyword non_compliant_policies: Number of non-compliant policies. - :paramtype non_compliant_policies: int - :keyword resource_details: The resources summary at this level. - :paramtype resource_details: list[~azure.mgmt.policyinsights.models.ComplianceDetail] - :keyword policy_details: The policy artifact summary at this level. For query scope level, it - represents policy assignment summary. For policy assignment level, it represents policy - definitions summary. - :paramtype policy_details: list[~azure.mgmt.policyinsights.models.ComplianceDetail] - :keyword policy_group_details: The policy definition group summary at this level. - :paramtype policy_group_details: list[~azure.mgmt.policyinsights.models.ComplianceDetail] - """ - super().__init__(**kwargs) - self.query_results_uri = query_results_uri - self.non_compliant_resources = non_compliant_resources - self.non_compliant_policies = non_compliant_policies - self.resource_details = resource_details - self.policy_details = policy_details - self.policy_group_details = policy_group_details - - -class SystemData(_serialization.Model): - """Metadata pertaining to creation and last modification of the resource. - - :ivar created_by: The identity that created the resource. - :vartype created_by: str - :ivar created_by_type: The type of identity that created the resource. Known values are: - "User", "Application", "ManagedIdentity", and "Key". - :vartype created_by_type: str or ~azure.mgmt.policyinsights.models.CreatedByType - :ivar created_at: The timestamp of resource creation (UTC). - :vartype created_at: ~datetime.datetime - :ivar last_modified_by: The identity that last modified the resource. - :vartype last_modified_by: str - :ivar last_modified_by_type: The type of identity that last modified the resource. Known values - are: "User", "Application", "ManagedIdentity", and "Key". - :vartype last_modified_by_type: str or ~azure.mgmt.policyinsights.models.CreatedByType - :ivar last_modified_at: The timestamp of resource last modification (UTC). - :vartype last_modified_at: ~datetime.datetime - """ - - _attribute_map = { - "created_by": {"key": "createdBy", "type": "str"}, - "created_by_type": {"key": "createdByType", "type": "str"}, - "created_at": {"key": "createdAt", "type": "iso-8601"}, - "last_modified_by": {"key": "lastModifiedBy", "type": "str"}, - "last_modified_by_type": {"key": "lastModifiedByType", "type": "str"}, - "last_modified_at": {"key": "lastModifiedAt", "type": "iso-8601"}, - } - - def __init__( - self, - *, - created_by: Optional[str] = None, - created_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, - created_at: Optional[datetime.datetime] = None, - last_modified_by: Optional[str] = None, - last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, - last_modified_at: Optional[datetime.datetime] = None, - **kwargs: Any - ) -> None: - """ - :keyword created_by: The identity that created the resource. - :paramtype created_by: str - :keyword created_by_type: The type of identity that created the resource. Known values are: - "User", "Application", "ManagedIdentity", and "Key". - :paramtype created_by_type: str or ~azure.mgmt.policyinsights.models.CreatedByType - :keyword created_at: The timestamp of resource creation (UTC). - :paramtype created_at: ~datetime.datetime - :keyword last_modified_by: The identity that last modified the resource. - :paramtype last_modified_by: str - :keyword last_modified_by_type: The type of identity that last modified the resource. Known - values are: "User", "Application", "ManagedIdentity", and "Key". - :paramtype last_modified_by_type: str or ~azure.mgmt.policyinsights.models.CreatedByType - :keyword last_modified_at: The timestamp of resource last modification (UTC). - :paramtype last_modified_at: ~datetime.datetime - """ - super().__init__(**kwargs) - self.created_by = created_by - self.created_by_type = created_by_type - self.created_at = created_at - self.last_modified_by = last_modified_by - self.last_modified_by_type = last_modified_by_type - self.last_modified_at = last_modified_at - - -class TrackedResourceModificationDetails(_serialization.Model): - """The details of the policy triggered deployment that created or modified the tracked resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar policy_details: The details of the policy that created or modified the tracked resource. - :vartype policy_details: ~azure.mgmt.policyinsights.models.PolicyDetails - :ivar deployment_id: The ID of the deployment that created or modified the tracked resource. - :vartype deployment_id: str - :ivar deployment_time: Timestamp of the deployment that created or modified the tracked - resource. - :vartype deployment_time: ~datetime.datetime - """ - - _validation = { - "policy_details": {"readonly": True}, - "deployment_id": {"readonly": True}, - "deployment_time": {"readonly": True}, - } - - _attribute_map = { - "policy_details": {"key": "policyDetails", "type": "PolicyDetails"}, - "deployment_id": {"key": "deploymentId", "type": "str"}, - "deployment_time": {"key": "deploymentTime", "type": "iso-8601"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.policy_details: Optional["_models.PolicyDetails"] = None - self.deployment_id: Optional[str] = None - self.deployment_time: Optional[datetime.datetime] = None - - -class TypedErrorInfo(_serialization.Model): - """Scenario specific error details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar type: The type of included error details. - :vartype type: str - :ivar info: The scenario specific error details. - :vartype info: any - """ - - _validation = { - "type": {"readonly": True}, - "info": {"readonly": True}, - } - - _attribute_map = { - "type": {"key": "type", "type": "str"}, - "info": {"key": "info", "type": "object"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.type: Optional[str] = None - self.info: Optional[Any] = None diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/_patch.py b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/_patch.py index f7dd32510333..87676c65a8f0 100644 --- a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/_patch.py +++ b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/_patch.py @@ -1,14 +1,15 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# 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. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/operations/__init__.py b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/operations/__init__.py index 4ff80dcf0f86..0da3fdcef222 100644 --- a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/operations/__init__.py +++ b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/operations/__init__.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- # pylint: disable=wrong-import-position @@ -12,30 +12,30 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import -from ._policy_tracked_resources_operations import PolicyTrackedResourcesOperations # type: ignore -from ._remediations_operations import RemediationsOperations # type: ignore -from ._policy_events_operations import PolicyEventsOperations # type: ignore -from ._policy_states_operations import PolicyStatesOperations # type: ignore -from ._policy_metadata_operations import PolicyMetadataOperations # type: ignore -from ._policy_restrictions_operations import PolicyRestrictionsOperations # type: ignore -from ._component_policy_states_operations import ComponentPolicyStatesOperations # type: ignore from ._operations import Operations # type: ignore -from ._attestations_operations import AttestationsOperations # type: ignore +from ._operations import RemediationsOperations # type: ignore +from ._operations import AttestationsOperations # type: ignore +from ._operations import PolicyMetadataOperations # type: ignore +from ._operations import PolicyEventsOperations # type: ignore +from ._operations import PolicyStatesOperations # type: ignore +from ._operations import PolicyRestrictionsOperations # type: ignore +from ._operations import ComponentPolicyStatesOperations # type: ignore +from ._operations import PolicyTrackedResourcesOperations # type: ignore from ._patch import __all__ as _patch_all from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ - "PolicyTrackedResourcesOperations", + "Operations", "RemediationsOperations", + "AttestationsOperations", + "PolicyMetadataOperations", "PolicyEventsOperations", "PolicyStatesOperations", - "PolicyMetadataOperations", "PolicyRestrictionsOperations", "ComponentPolicyStatesOperations", - "Operations", - "AttestationsOperations", + "PolicyTrackedResourcesOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/operations/_attestations_operations.py b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/operations/_attestations_operations.py deleted file mode 100644 index a26e5b329cae..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/operations/_attestations_operations.py +++ /dev/null @@ -1,1525 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression,too-many-lines -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, Dict, IO, Iterator, Optional, TypeVar, Union, cast, overload - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import PolicyInsightsClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_for_subscription_request( - subscription_id: str, *, top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/attestations") - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int", minimum=0) - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_at_subscription_request( # pylint: disable=name-too-long - attestation_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/attestations/{attestationName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "attestationName": _SERIALIZER.url("attestation_name", attestation_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_at_subscription_request(attestation_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/attestations/{attestationName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "attestationName": _SERIALIZER.url("attestation_name", attestation_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_at_subscription_request(attestation_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/attestations/{attestationName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "attestationName": _SERIALIZER.url("attestation_name", attestation_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_for_resource_group_request( - resource_group_name: str, - subscription_id: str, - *, - top: Optional[int] = None, - filter: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/attestations", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int", minimum=0) - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_at_resource_group_request( # pylint: disable=name-too-long - resource_group_name: str, attestation_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/attestations/{attestationName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "attestationName": _SERIALIZER.url("attestation_name", attestation_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_at_resource_group_request( - resource_group_name: str, attestation_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/attestations/{attestationName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "attestationName": _SERIALIZER.url("attestation_name", attestation_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_at_resource_group_request( - resource_group_name: str, attestation_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/attestations/{attestationName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "attestationName": _SERIALIZER.url("attestation_name", attestation_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_for_resource_request( - resource_id: str, *, top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/{resourceId}/providers/Microsoft.PolicyInsights/attestations") - path_format_arguments = { - "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int", minimum=0) - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_at_resource_request( # pylint: disable=name-too-long - resource_id: str, attestation_name: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/{resourceId}/providers/Microsoft.PolicyInsights/attestations/{attestationName}") - path_format_arguments = { - "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), - "attestationName": _SERIALIZER.url("attestation_name", attestation_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_at_resource_request(resource_id: str, attestation_name: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/{resourceId}/providers/Microsoft.PolicyInsights/attestations/{attestationName}") - path_format_arguments = { - "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), - "attestationName": _SERIALIZER.url("attestation_name", attestation_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_at_resource_request(resource_id: str, attestation_name: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/{resourceId}/providers/Microsoft.PolicyInsights/attestations/{attestationName}") - path_format_arguments = { - "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), - "attestationName": _SERIALIZER.url("attestation_name", attestation_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class AttestationsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.policyinsights.PolicyInsightsClient`'s - :attr:`attestations` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: PolicyInsightsClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_for_subscription( - self, query_options: Optional[_models.QueryOptions] = None, **kwargs: Any - ) -> ItemPaged["_models.Attestation"]: - """Gets all attestations for the subscription. - - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either Attestation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.Attestation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.AttestationListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - _filter = None - if query_options is not None: - _filter = query_options.filter - _top = query_options.top - - _request = build_list_for_subscription_request( - subscription_id=self._config.subscription_id, - top=_top, - filter=_filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("AttestationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated2, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - def _create_or_update_at_subscription_initial( # pylint: disable=name-too-long - self, attestation_name: str, parameters: Union[_models.Attestation, IO[bytes]], **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "Attestation") - - _request = build_create_or_update_at_subscription_request( - attestation_name=attestation_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated2, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update_at_subscription( - self, - attestation_name: str, - parameters: _models.Attestation, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Attestation]: - """Creates or updates an attestation at subscription scope. - - :param attestation_name: The name of the attestation. Required. - :type attestation_name: str - :param parameters: The attestation parameters. Required. - :type parameters: ~azure.mgmt.policyinsights.models.Attestation - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either Attestation or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.policyinsights.models.Attestation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update_at_subscription( - self, attestation_name: str, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.Attestation]: - """Creates or updates an attestation at subscription scope. - - :param attestation_name: The name of the attestation. Required. - :type attestation_name: str - :param parameters: The attestation parameters. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either Attestation or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.policyinsights.models.Attestation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update_at_subscription( - self, attestation_name: str, parameters: Union[_models.Attestation, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.Attestation]: - """Creates or updates an attestation at subscription scope. - - :param attestation_name: The name of the attestation. Required. - :type attestation_name: str - :param parameters: The attestation parameters. Is either a Attestation type or a IO[bytes] - type. Required. - :type parameters: ~azure.mgmt.policyinsights.models.Attestation or IO[bytes] - :return: An instance of LROPoller that returns either Attestation or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.policyinsights.models.Attestation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Attestation] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_at_subscription_initial( - attestation_name=attestation_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Attestation", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.Attestation].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Attestation]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace - def get_at_subscription(self, attestation_name: str, **kwargs: Any) -> _models.Attestation: - """Gets an existing attestation at subscription scope. - - :param attestation_name: The name of the attestation. Required. - :type attestation_name: str - :return: Attestation or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.Attestation - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.Attestation] = kwargs.pop("cls", None) - - _request = build_get_at_subscription_request( - attestation_name=attestation_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated2, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Attestation", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete_at_subscription( # pylint: disable=inconsistent-return-statements - self, attestation_name: str, **kwargs: Any - ) -> None: - """Deletes an existing attestation at subscription scope. - - :param attestation_name: The name of the attestation. Required. - :type attestation_name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_at_subscription_request( - attestation_name=attestation_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated2, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list_for_resource_group( - self, resource_group_name: str, query_options: Optional[_models.QueryOptions] = None, **kwargs: Any - ) -> ItemPaged["_models.Attestation"]: - """Gets all attestations for the resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either Attestation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.Attestation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.AttestationListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - _filter = None - if query_options is not None: - _filter = query_options.filter - _top = query_options.top - - _request = build_list_for_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - top=_top, - filter=_filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("AttestationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated2, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - def _create_or_update_at_resource_group_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - attestation_name: str, - parameters: Union[_models.Attestation, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "Attestation") - - _request = build_create_or_update_at_resource_group_request( - resource_group_name=resource_group_name, - attestation_name=attestation_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated2, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update_at_resource_group( - self, - resource_group_name: str, - attestation_name: str, - parameters: _models.Attestation, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Attestation]: - """Creates or updates an attestation at resource group scope. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param attestation_name: The name of the attestation. Required. - :type attestation_name: str - :param parameters: The attestation parameters. Required. - :type parameters: ~azure.mgmt.policyinsights.models.Attestation - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either Attestation or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.policyinsights.models.Attestation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update_at_resource_group( - self, - resource_group_name: str, - attestation_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Attestation]: - """Creates or updates an attestation at resource group scope. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param attestation_name: The name of the attestation. Required. - :type attestation_name: str - :param parameters: The attestation parameters. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either Attestation or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.policyinsights.models.Attestation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update_at_resource_group( - self, - resource_group_name: str, - attestation_name: str, - parameters: Union[_models.Attestation, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.Attestation]: - """Creates or updates an attestation at resource group scope. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param attestation_name: The name of the attestation. Required. - :type attestation_name: str - :param parameters: The attestation parameters. Is either a Attestation type or a IO[bytes] - type. Required. - :type parameters: ~azure.mgmt.policyinsights.models.Attestation or IO[bytes] - :return: An instance of LROPoller that returns either Attestation or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.policyinsights.models.Attestation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Attestation] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_at_resource_group_initial( - resource_group_name=resource_group_name, - attestation_name=attestation_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Attestation", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.Attestation].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Attestation]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace - def get_at_resource_group( - self, resource_group_name: str, attestation_name: str, **kwargs: Any - ) -> _models.Attestation: - """Gets an existing attestation at resource group scope. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param attestation_name: The name of the attestation. Required. - :type attestation_name: str - :return: Attestation or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.Attestation - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.Attestation] = kwargs.pop("cls", None) - - _request = build_get_at_resource_group_request( - resource_group_name=resource_group_name, - attestation_name=attestation_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated2, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Attestation", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete_at_resource_group( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, attestation_name: str, **kwargs: Any - ) -> None: - """Deletes an existing attestation at resource group scope. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param attestation_name: The name of the attestation. Required. - :type attestation_name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_at_resource_group_request( - resource_group_name=resource_group_name, - attestation_name=attestation_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated2, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list_for_resource( - self, resource_id: str, query_options: Optional[_models.QueryOptions] = None, **kwargs: Any - ) -> ItemPaged["_models.Attestation"]: - """Gets all attestations for a resource. - - :param resource_id: Resource ID. Required. - :type resource_id: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either Attestation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.Attestation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.AttestationListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - _filter = None - if query_options is not None: - _filter = query_options.filter - _top = query_options.top - - _request = build_list_for_resource_request( - resource_id=resource_id, - top=_top, - filter=_filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("AttestationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated2, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - def _create_or_update_at_resource_initial( - self, resource_id: str, attestation_name: str, parameters: Union[_models.Attestation, IO[bytes]], **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "Attestation") - - _request = build_create_or_update_at_resource_request( - resource_id=resource_id, - attestation_name=attestation_name, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated2, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update_at_resource( - self, - resource_id: str, - attestation_name: str, - parameters: _models.Attestation, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Attestation]: - """Creates or updates an attestation at resource scope. - - :param resource_id: Resource ID. Required. - :type resource_id: str - :param attestation_name: The name of the attestation. Required. - :type attestation_name: str - :param parameters: The attestation parameters. Required. - :type parameters: ~azure.mgmt.policyinsights.models.Attestation - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either Attestation or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.policyinsights.models.Attestation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update_at_resource( - self, - resource_id: str, - attestation_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Attestation]: - """Creates or updates an attestation at resource scope. - - :param resource_id: Resource ID. Required. - :type resource_id: str - :param attestation_name: The name of the attestation. Required. - :type attestation_name: str - :param parameters: The attestation parameters. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either Attestation or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.policyinsights.models.Attestation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update_at_resource( - self, resource_id: str, attestation_name: str, parameters: Union[_models.Attestation, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.Attestation]: - """Creates or updates an attestation at resource scope. - - :param resource_id: Resource ID. Required. - :type resource_id: str - :param attestation_name: The name of the attestation. Required. - :type attestation_name: str - :param parameters: The attestation parameters. Is either a Attestation type or a IO[bytes] - type. Required. - :type parameters: ~azure.mgmt.policyinsights.models.Attestation or IO[bytes] - :return: An instance of LROPoller that returns either Attestation or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.policyinsights.models.Attestation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Attestation] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_at_resource_initial( - resource_id=resource_id, - attestation_name=attestation_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Attestation", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.Attestation].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Attestation]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace - def get_at_resource(self, resource_id: str, attestation_name: str, **kwargs: Any) -> _models.Attestation: - """Gets an existing attestation at resource scope. - - :param resource_id: Resource ID. Required. - :type resource_id: str - :param attestation_name: The name of the attestation. Required. - :type attestation_name: str - :return: Attestation or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.Attestation - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.Attestation] = kwargs.pop("cls", None) - - _request = build_get_at_resource_request( - resource_id=resource_id, - attestation_name=attestation_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated2, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Attestation", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete_at_resource( # pylint: disable=inconsistent-return-statements - self, resource_id: str, attestation_name: str, **kwargs: Any - ) -> None: - """Deletes an existing attestation at individual resource scope. - - :param resource_id: Resource ID. Required. - :type resource_id: str - :param attestation_name: The name of the attestation. Required. - :type attestation_name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_at_resource_request( - resource_id=resource_id, - attestation_name=attestation_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated2, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/operations/_component_policy_states_operations.py b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/operations/_component_policy_states_operations.py deleted file mode 100644 index 0e106ad9e179..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/operations/_component_policy_states_operations.py +++ /dev/null @@ -1,1044 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression,too-many-lines -# 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 collections.abc import MutableMapping -import datetime -from typing import Any, Callable, Dict, Literal, Optional, TypeVar, Union - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import PolicyInsightsClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_query_results_for_subscription_request( # pylint: disable=name-too-long - subscription_id: str, - component_policy_states_resource: Union[str, _models.ComponentPolicyStatesResource], - *, - top: Optional[int] = None, - order_by: Optional[str] = None, - select: Optional[str] = None, - from_parameter: Optional[datetime.datetime] = None, - to: Optional[datetime.datetime] = None, - filter: Optional[str] = None, - apply: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/componentPolicyStates/{componentPolicyStatesResource}/queryResults", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "componentPolicyStatesResource": _SERIALIZER.url( - "component_policy_states_resource", component_policy_states_resource, "str" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int", minimum=0) - if order_by is not None: - _params["$orderby"] = _SERIALIZER.query("order_by", order_by, "str") - if select is not None: - _params["$select"] = _SERIALIZER.query("select", select, "str") - if from_parameter is not None: - _params["$from"] = _SERIALIZER.query("from_parameter", from_parameter, "iso-8601") - if to is not None: - _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - if apply is not None: - _params["$apply"] = _SERIALIZER.query("apply", apply, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_query_results_for_resource_group_request( # pylint: disable=name-too-long - subscription_id: str, - resource_group_name: str, - component_policy_states_resource: Union[str, _models.ComponentPolicyStatesResource], - *, - top: Optional[int] = None, - order_by: Optional[str] = None, - select: Optional[str] = None, - from_parameter: Optional[datetime.datetime] = None, - to: Optional[datetime.datetime] = None, - filter: Optional[str] = None, - apply: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/componentPolicyStates/{componentPolicyStatesResource}/queryResults", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "componentPolicyStatesResource": _SERIALIZER.url( - "component_policy_states_resource", component_policy_states_resource, "str" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int", minimum=0) - if order_by is not None: - _params["$orderby"] = _SERIALIZER.query("order_by", order_by, "str") - if select is not None: - _params["$select"] = _SERIALIZER.query("select", select, "str") - if from_parameter is not None: - _params["$from"] = _SERIALIZER.query("from_parameter", from_parameter, "iso-8601") - if to is not None: - _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - if apply is not None: - _params["$apply"] = _SERIALIZER.query("apply", apply, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_query_results_for_resource_request( # pylint: disable=name-too-long - resource_id: str, - component_policy_states_resource: Union[str, _models.ComponentPolicyStatesResource], - *, - top: Optional[int] = None, - order_by: Optional[str] = None, - select: Optional[str] = None, - from_parameter: Optional[datetime.datetime] = None, - to: Optional[datetime.datetime] = None, - filter: Optional[str] = None, - apply: Optional[str] = None, - expand: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/{resourceId}/providers/Microsoft.PolicyInsights/componentPolicyStates/{componentPolicyStatesResource}/queryResults", - ) - path_format_arguments = { - "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), - "componentPolicyStatesResource": _SERIALIZER.url( - "component_policy_states_resource", component_policy_states_resource, "str" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int", minimum=0) - if order_by is not None: - _params["$orderby"] = _SERIALIZER.query("order_by", order_by, "str") - if select is not None: - _params["$select"] = _SERIALIZER.query("select", select, "str") - if from_parameter is not None: - _params["$from"] = _SERIALIZER.query("from_parameter", from_parameter, "iso-8601") - if to is not None: - _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - if apply is not None: - _params["$apply"] = _SERIALIZER.query("apply", apply, "str") - if expand is not None: - _params["$expand"] = _SERIALIZER.query("expand", expand, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_query_results_for_policy_definition_request( # pylint: disable=name-too-long - subscription_id: str, - policy_definition_name: str, - component_policy_states_resource: Union[str, _models.ComponentPolicyStatesResource], - *, - top: Optional[int] = None, - order_by: Optional[str] = None, - select: Optional[str] = None, - from_parameter: Optional[datetime.datetime] = None, - to: Optional[datetime.datetime] = None, - filter: Optional[str] = None, - apply: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( - "authorization_namespace", "Microsoft.Authorization" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyDefinitions/{policyDefinitionName}/providers/Microsoft.PolicyInsights/componentPolicyStates/{componentPolicyStatesResource}/queryResults", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "authorizationNamespace": _SERIALIZER.url("authorization_namespace", authorization_namespace, "str"), - "policyDefinitionName": _SERIALIZER.url( - "policy_definition_name", - policy_definition_name, - "str", - max_length=64, - min_length=1, - pattern=r"^[^<>%&:\\?/#]*$", - ), - "componentPolicyStatesResource": _SERIALIZER.url( - "component_policy_states_resource", component_policy_states_resource, "str" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int", minimum=0) - if order_by is not None: - _params["$orderby"] = _SERIALIZER.query("order_by", order_by, "str") - if select is not None: - _params["$select"] = _SERIALIZER.query("select", select, "str") - if from_parameter is not None: - _params["$from"] = _SERIALIZER.query("from_parameter", from_parameter, "iso-8601") - if to is not None: - _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - if apply is not None: - _params["$apply"] = _SERIALIZER.query("apply", apply, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_query_results_for_subscription_level_policy_assignment_request( # pylint: disable=name-too-long - subscription_id: str, - policy_assignment_name: str, - component_policy_states_resource: Union[str, _models.ComponentPolicyStatesResource], - *, - top: Optional[int] = None, - order_by: Optional[str] = None, - select: Optional[str] = None, - from_parameter: Optional[datetime.datetime] = None, - to: Optional[datetime.datetime] = None, - filter: Optional[str] = None, - apply: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( - "authorization_namespace", "Microsoft.Authorization" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/componentPolicyStates/{componentPolicyStatesResource}/queryResults", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "authorizationNamespace": _SERIALIZER.url("authorization_namespace", authorization_namespace, "str"), - "policyAssignmentName": _SERIALIZER.url( - "policy_assignment_name", - policy_assignment_name, - "str", - max_length=64, - min_length=1, - pattern=r"^[^<>%&:\\?/#]*$", - ), - "componentPolicyStatesResource": _SERIALIZER.url( - "component_policy_states_resource", component_policy_states_resource, "str" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int", minimum=0) - if order_by is not None: - _params["$orderby"] = _SERIALIZER.query("order_by", order_by, "str") - if select is not None: - _params["$select"] = _SERIALIZER.query("select", select, "str") - if from_parameter is not None: - _params["$from"] = _SERIALIZER.query("from_parameter", from_parameter, "iso-8601") - if to is not None: - _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - if apply is not None: - _params["$apply"] = _SERIALIZER.query("apply", apply, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_query_results_for_resource_group_level_policy_assignment_request( # pylint: disable=name-too-long - subscription_id: str, - resource_group_name: str, - policy_assignment_name: str, - component_policy_states_resource: Union[str, _models.ComponentPolicyStatesResource], - *, - top: Optional[int] = None, - order_by: Optional[str] = None, - select: Optional[str] = None, - from_parameter: Optional[datetime.datetime] = None, - to: Optional[datetime.datetime] = None, - filter: Optional[str] = None, - apply: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( - "authorization_namespace", "Microsoft.Authorization" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/componentPolicyStates/{componentPolicyStatesResource}/queryResults", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "authorizationNamespace": _SERIALIZER.url("authorization_namespace", authorization_namespace, "str"), - "policyAssignmentName": _SERIALIZER.url( - "policy_assignment_name", - policy_assignment_name, - "str", - max_length=64, - min_length=1, - pattern=r"^[^<>%&:\\?/#]*$", - ), - "componentPolicyStatesResource": _SERIALIZER.url( - "component_policy_states_resource", component_policy_states_resource, "str" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int", minimum=0) - if order_by is not None: - _params["$orderby"] = _SERIALIZER.query("order_by", order_by, "str") - if select is not None: - _params["$select"] = _SERIALIZER.query("select", select, "str") - if from_parameter is not None: - _params["$from"] = _SERIALIZER.query("from_parameter", from_parameter, "iso-8601") - if to is not None: - _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - if apply is not None: - _params["$apply"] = _SERIALIZER.query("apply", apply, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -class ComponentPolicyStatesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.policyinsights.PolicyInsightsClient`'s - :attr:`component_policy_states` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: PolicyInsightsClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_query_results_for_subscription( - self, - subscription_id: str, - component_policy_states_resource: Union[str, _models.ComponentPolicyStatesResource], - top: Optional[int] = None, - order_by: Optional[str] = None, - select: Optional[str] = None, - from_parameter: Optional[datetime.datetime] = None, - to: Optional[datetime.datetime] = None, - filter: Optional[str] = None, - apply: Optional[str] = None, - **kwargs: Any - ) -> _models.ComponentPolicyStatesQueryResults: - """Queries component policy states under subscription scope. - - :param subscription_id: Microsoft Azure subscription ID. Required. - :type subscription_id: str - :param component_policy_states_resource: The virtual resource under ComponentPolicyStates - resource type. In a given time range, 'latest' represents the latest component policy state(s). - "latest" Required. - :type component_policy_states_resource: str or - ~azure.mgmt.policyinsights.models.ComponentPolicyStatesResource - :param top: Maximum number of records to return. Default value is None. - :type top: int - :param order_by: Ordering expression using OData notation. One or more comma-separated column - names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, - ResourceId asc". Default value is None. - :type order_by: str - :param select: Select expression using OData notation. Limits the columns on each record to - just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Default value is None. - :type select: str - :param from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval - to query. When not specified, the service uses ($to - 1-day). Default value is None. - :type from_parameter: ~datetime.datetime - :param to: ISO 8601 formatted timestamp specifying the end time of the interval to query. When - not specified, the service uses request time. Default value is None. - :type to: ~datetime.datetime - :param filter: OData filter expression. Default value is None. - :type filter: str - :param apply: OData apply expression for aggregations. Default value is None. - :type apply: str - :return: ComponentPolicyStatesQueryResults or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.ComponentPolicyStatesQueryResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.ComponentPolicyStatesQueryResults] = kwargs.pop("cls", None) - - _request = build_list_query_results_for_subscription_request( - subscription_id=subscription_id, - component_policy_states_resource=component_policy_states_resource, - top=top, - order_by=order_by, - select=select, - from_parameter=from_parameter, - to=to, - filter=filter, - apply=apply, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ComponentPolicyStatesQueryResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_query_results_for_resource_group( - self, - subscription_id: str, - resource_group_name: str, - component_policy_states_resource: Union[str, _models.ComponentPolicyStatesResource], - top: Optional[int] = None, - order_by: Optional[str] = None, - select: Optional[str] = None, - from_parameter: Optional[datetime.datetime] = None, - to: Optional[datetime.datetime] = None, - filter: Optional[str] = None, - apply: Optional[str] = None, - **kwargs: Any - ) -> _models.ComponentPolicyStatesQueryResults: - """Queries component policy states under resource group scope. - - :param subscription_id: Microsoft Azure subscription ID. Required. - :type subscription_id: str - :param resource_group_name: Resource group name. Required. - :type resource_group_name: str - :param component_policy_states_resource: The virtual resource under ComponentPolicyStates - resource type. In a given time range, 'latest' represents the latest component policy state(s). - "latest" Required. - :type component_policy_states_resource: str or - ~azure.mgmt.policyinsights.models.ComponentPolicyStatesResource - :param top: Maximum number of records to return. Default value is None. - :type top: int - :param order_by: Ordering expression using OData notation. One or more comma-separated column - names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, - ResourceId asc". Default value is None. - :type order_by: str - :param select: Select expression using OData notation. Limits the columns on each record to - just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Default value is None. - :type select: str - :param from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval - to query. When not specified, the service uses ($to - 1-day). Default value is None. - :type from_parameter: ~datetime.datetime - :param to: ISO 8601 formatted timestamp specifying the end time of the interval to query. When - not specified, the service uses request time. Default value is None. - :type to: ~datetime.datetime - :param filter: OData filter expression. Default value is None. - :type filter: str - :param apply: OData apply expression for aggregations. Default value is None. - :type apply: str - :return: ComponentPolicyStatesQueryResults or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.ComponentPolicyStatesQueryResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.ComponentPolicyStatesQueryResults] = kwargs.pop("cls", None) - - _request = build_list_query_results_for_resource_group_request( - subscription_id=subscription_id, - resource_group_name=resource_group_name, - component_policy_states_resource=component_policy_states_resource, - top=top, - order_by=order_by, - select=select, - from_parameter=from_parameter, - to=to, - filter=filter, - apply=apply, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ComponentPolicyStatesQueryResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_query_results_for_resource( - self, - resource_id: str, - component_policy_states_resource: Union[str, _models.ComponentPolicyStatesResource], - top: Optional[int] = None, - order_by: Optional[str] = None, - select: Optional[str] = None, - from_parameter: Optional[datetime.datetime] = None, - to: Optional[datetime.datetime] = None, - filter: Optional[str] = None, - apply: Optional[str] = None, - expand: Optional[str] = None, - **kwargs: Any - ) -> _models.ComponentPolicyStatesQueryResults: - """Queries component policy states for the resource. - - :param resource_id: Resource ID. Required. - :type resource_id: str - :param component_policy_states_resource: The virtual resource under ComponentPolicyStates - resource type. In a given time range, 'latest' represents the latest component policy state(s). - "latest" Required. - :type component_policy_states_resource: str or - ~azure.mgmt.policyinsights.models.ComponentPolicyStatesResource - :param top: Maximum number of records to return. Default value is None. - :type top: int - :param order_by: Ordering expression using OData notation. One or more comma-separated column - names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, - ResourceId asc". Default value is None. - :type order_by: str - :param select: Select expression using OData notation. Limits the columns on each record to - just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Default value is None. - :type select: str - :param from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval - to query. When not specified, the service uses ($to - 1-day). Default value is None. - :type from_parameter: ~datetime.datetime - :param to: ISO 8601 formatted timestamp specifying the end time of the interval to query. When - not specified, the service uses request time. Default value is None. - :type to: ~datetime.datetime - :param filter: OData filter expression. Default value is None. - :type filter: str - :param apply: OData apply expression for aggregations. Default value is None. - :type apply: str - :param expand: The $expand query parameter. Default value is None. - :type expand: str - :return: ComponentPolicyStatesQueryResults or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.ComponentPolicyStatesQueryResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.ComponentPolicyStatesQueryResults] = kwargs.pop("cls", None) - - _request = build_list_query_results_for_resource_request( - resource_id=resource_id, - component_policy_states_resource=component_policy_states_resource, - top=top, - order_by=order_by, - select=select, - from_parameter=from_parameter, - to=to, - filter=filter, - apply=apply, - expand=expand, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ComponentPolicyStatesQueryResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_query_results_for_policy_definition( - self, - subscription_id: str, - policy_definition_name: str, - component_policy_states_resource: Union[str, _models.ComponentPolicyStatesResource], - top: Optional[int] = None, - order_by: Optional[str] = None, - select: Optional[str] = None, - from_parameter: Optional[datetime.datetime] = None, - to: Optional[datetime.datetime] = None, - filter: Optional[str] = None, - apply: Optional[str] = None, - **kwargs: Any - ) -> _models.ComponentPolicyStatesQueryResults: - """Queries component policy states for the subscription level policy definition. - - :param subscription_id: Microsoft Azure subscription ID. Required. - :type subscription_id: str - :param policy_definition_name: Policy definition name. Required. - :type policy_definition_name: str - :param component_policy_states_resource: The virtual resource under ComponentPolicyStates - resource type. In a given time range, 'latest' represents the latest component policy state(s). - "latest" Required. - :type component_policy_states_resource: str or - ~azure.mgmt.policyinsights.models.ComponentPolicyStatesResource - :param top: Maximum number of records to return. Default value is None. - :type top: int - :param order_by: Ordering expression using OData notation. One or more comma-separated column - names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, - ResourceId asc". Default value is None. - :type order_by: str - :param select: Select expression using OData notation. Limits the columns on each record to - just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Default value is None. - :type select: str - :param from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval - to query. When not specified, the service uses ($to - 1-day). Default value is None. - :type from_parameter: ~datetime.datetime - :param to: ISO 8601 formatted timestamp specifying the end time of the interval to query. When - not specified, the service uses request time. Default value is None. - :type to: ~datetime.datetime - :param filter: OData filter expression. Default value is None. - :type filter: str - :param apply: OData apply expression for aggregations. Default value is None. - :type apply: str - :return: ComponentPolicyStatesQueryResults or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.ComponentPolicyStatesQueryResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( - "authorization_namespace", "Microsoft.Authorization" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.ComponentPolicyStatesQueryResults] = kwargs.pop("cls", None) - - _request = build_list_query_results_for_policy_definition_request( - subscription_id=subscription_id, - policy_definition_name=policy_definition_name, - component_policy_states_resource=component_policy_states_resource, - top=top, - order_by=order_by, - select=select, - from_parameter=from_parameter, - to=to, - filter=filter, - apply=apply, - authorization_namespace=authorization_namespace, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ComponentPolicyStatesQueryResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_query_results_for_subscription_level_policy_assignment( # pylint: disable=name-too-long - self, - subscription_id: str, - policy_assignment_name: str, - component_policy_states_resource: Union[str, _models.ComponentPolicyStatesResource], - top: Optional[int] = None, - order_by: Optional[str] = None, - select: Optional[str] = None, - from_parameter: Optional[datetime.datetime] = None, - to: Optional[datetime.datetime] = None, - filter: Optional[str] = None, - apply: Optional[str] = None, - **kwargs: Any - ) -> _models.ComponentPolicyStatesQueryResults: - """Queries component policy states for the subscription level policy assignment. - - :param subscription_id: Microsoft Azure subscription ID. Required. - :type subscription_id: str - :param policy_assignment_name: Policy assignment name. Required. - :type policy_assignment_name: str - :param component_policy_states_resource: The virtual resource under ComponentPolicyStates - resource type. In a given time range, 'latest' represents the latest component policy state(s). - "latest" Required. - :type component_policy_states_resource: str or - ~azure.mgmt.policyinsights.models.ComponentPolicyStatesResource - :param top: Maximum number of records to return. Default value is None. - :type top: int - :param order_by: Ordering expression using OData notation. One or more comma-separated column - names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, - ResourceId asc". Default value is None. - :type order_by: str - :param select: Select expression using OData notation. Limits the columns on each record to - just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Default value is None. - :type select: str - :param from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval - to query. When not specified, the service uses ($to - 1-day). Default value is None. - :type from_parameter: ~datetime.datetime - :param to: ISO 8601 formatted timestamp specifying the end time of the interval to query. When - not specified, the service uses request time. Default value is None. - :type to: ~datetime.datetime - :param filter: OData filter expression. Default value is None. - :type filter: str - :param apply: OData apply expression for aggregations. Default value is None. - :type apply: str - :return: ComponentPolicyStatesQueryResults or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.ComponentPolicyStatesQueryResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( - "authorization_namespace", "Microsoft.Authorization" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.ComponentPolicyStatesQueryResults] = kwargs.pop("cls", None) - - _request = build_list_query_results_for_subscription_level_policy_assignment_request( - subscription_id=subscription_id, - policy_assignment_name=policy_assignment_name, - component_policy_states_resource=component_policy_states_resource, - top=top, - order_by=order_by, - select=select, - from_parameter=from_parameter, - to=to, - filter=filter, - apply=apply, - authorization_namespace=authorization_namespace, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ComponentPolicyStatesQueryResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_query_results_for_resource_group_level_policy_assignment( # pylint: disable=name-too-long - self, - subscription_id: str, - resource_group_name: str, - policy_assignment_name: str, - component_policy_states_resource: Union[str, _models.ComponentPolicyStatesResource], - top: Optional[int] = None, - order_by: Optional[str] = None, - select: Optional[str] = None, - from_parameter: Optional[datetime.datetime] = None, - to: Optional[datetime.datetime] = None, - filter: Optional[str] = None, - apply: Optional[str] = None, - **kwargs: Any - ) -> _models.ComponentPolicyStatesQueryResults: - """Queries component policy states for the resource group level policy assignment. - - :param subscription_id: Microsoft Azure subscription ID. Required. - :type subscription_id: str - :param resource_group_name: Resource group name. Required. - :type resource_group_name: str - :param policy_assignment_name: Policy assignment name. Required. - :type policy_assignment_name: str - :param component_policy_states_resource: The virtual resource under ComponentPolicyStates - resource type. In a given time range, 'latest' represents the latest component policy state(s). - "latest" Required. - :type component_policy_states_resource: str or - ~azure.mgmt.policyinsights.models.ComponentPolicyStatesResource - :param top: Maximum number of records to return. Default value is None. - :type top: int - :param order_by: Ordering expression using OData notation. One or more comma-separated column - names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, - ResourceId asc". Default value is None. - :type order_by: str - :param select: Select expression using OData notation. Limits the columns on each record to - just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Default value is None. - :type select: str - :param from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval - to query. When not specified, the service uses ($to - 1-day). Default value is None. - :type from_parameter: ~datetime.datetime - :param to: ISO 8601 formatted timestamp specifying the end time of the interval to query. When - not specified, the service uses request time. Default value is None. - :type to: ~datetime.datetime - :param filter: OData filter expression. Default value is None. - :type filter: str - :param apply: OData apply expression for aggregations. Default value is None. - :type apply: str - :return: ComponentPolicyStatesQueryResults or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.ComponentPolicyStatesQueryResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( - "authorization_namespace", "Microsoft.Authorization" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.ComponentPolicyStatesQueryResults] = kwargs.pop("cls", None) - - _request = build_list_query_results_for_resource_group_level_policy_assignment_request( - subscription_id=subscription_id, - resource_group_name=resource_group_name, - policy_assignment_name=policy_assignment_name, - component_policy_states_resource=component_policy_states_resource, - top=top, - order_by=order_by, - select=select, - from_parameter=from_parameter, - to=to, - filter=filter, - apply=apply, - authorization_namespace=authorization_namespace, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ComponentPolicyStatesQueryResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/operations/_operations.py b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/operations/_operations.py index 46d6aa3f01f5..b73707bdd698 100644 --- a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/operations/_operations.py +++ b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/operations/_operations.py @@ -1,12 +1,16 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from collections.abc import MutableMapping -from typing import Any, Callable, Dict, Optional, TypeVar +import datetime +from io import IOBase +import json +from typing import Any, Callable, IO, Iterator, Literal, Optional, TypeVar, Union, cast, overload from azure.core import PipelineClient from azure.core.exceptions import ( @@ -15,26 +19,34 @@ ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, map_error, ) +from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod from azure.core.rest import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models from .._configuration import PolicyInsightsClientConfiguration +from .._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize from .._utils.serialization import Deserializer, Serializer T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] +JSON = MutableMapping[str, Any] +List = list _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False -def build_list_request(**kwargs: Any) -> HttpRequest: +def build_operations_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -42,7 +54,7 @@ def build_list_request(**kwargs: Any) -> HttpRequest: accept = _headers.pop("Accept", "application/json") # Construct URL - _url = kwargs.pop("template_url", "/providers/Microsoft.PolicyInsights/operations") + _url = "/providers/Microsoft.PolicyInsights/operations" # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -53,31 +65,10960 @@ def build_list_request(**kwargs: Any) -> HttpRequest: return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) +def build_remediations_get_at_management_group_request( # pylint: disable=name-too-long + management_group_id: str, remediation_name: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( + "management_groups_namespace", "Microsoft.Management" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/providers/{managementGroupsNamespace}/managementGroups/{managementGroupId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}" + path_format_arguments = { + "managementGroupsNamespace": _SERIALIZER.url("management_groups_namespace", management_groups_namespace, "str"), + "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), + "remediationName": _SERIALIZER.url("remediation_name", remediation_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_remediations_create_or_update_at_management_group_request( # pylint: disable=name-too-long + management_group_id: str, remediation_name: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( + "management_groups_namespace", "Microsoft.Management" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/providers/{managementGroupsNamespace}/managementGroups/{managementGroupId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}" + path_format_arguments = { + "managementGroupsNamespace": _SERIALIZER.url("management_groups_namespace", management_groups_namespace, "str"), + "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), + "remediationName": _SERIALIZER.url("remediation_name", remediation_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_remediations_delete_at_management_group_request( # pylint: disable=name-too-long + management_group_id: str, remediation_name: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( + "management_groups_namespace", "Microsoft.Management" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/providers/{managementGroupsNamespace}/managementGroups/{managementGroupId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}" + path_format_arguments = { + "managementGroupsNamespace": _SERIALIZER.url("management_groups_namespace", management_groups_namespace, "str"), + "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), + "remediationName": _SERIALIZER.url("remediation_name", remediation_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_remediations_list_for_management_group_request( # pylint: disable=name-too-long + management_group_id: str, *, top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( + "management_groups_namespace", "Microsoft.Management" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/providers/{managementGroupsNamespace}/managementGroups/{managementGroupId}/providers/Microsoft.PolicyInsights/remediations" + path_format_arguments = { + "managementGroupsNamespace": _SERIALIZER.url("management_groups_namespace", management_groups_namespace, "str"), + "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_remediations_get_at_subscription_request( # pylint: disable=name-too-long + remediation_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "remediationName": _SERIALIZER.url("remediation_name", remediation_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_remediations_create_or_update_at_subscription_request( # pylint: disable=name-too-long + remediation_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "remediationName": _SERIALIZER.url("remediation_name", remediation_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_remediations_delete_at_subscription_request( # pylint: disable=name-too-long + remediation_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "remediationName": _SERIALIZER.url("remediation_name", remediation_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_remediations_list_for_subscription_request( # pylint: disable=name-too-long + subscription_id: str, *, top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/remediations" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_remediations_list_deployments_at_subscription_request( # pylint: disable=name-too-long + remediation_name: str, subscription_id: str, *, top: Optional[int] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/listDeployments" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "remediationName": _SERIALIZER.url("remediation_name", remediation_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_remediations_cancel_at_subscription_request( # pylint: disable=name-too-long + remediation_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/cancel" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "remediationName": _SERIALIZER.url("remediation_name", remediation_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_remediations_get_at_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, remediation_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/remediations/{remediationName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "remediationName": _SERIALIZER.url("remediation_name", remediation_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_remediations_create_or_update_at_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, remediation_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/remediations/{remediationName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "remediationName": _SERIALIZER.url("remediation_name", remediation_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_remediations_delete_at_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, remediation_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/remediations/{remediationName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "remediationName": _SERIALIZER.url("remediation_name", remediation_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_remediations_list_for_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, + subscription_id: str, + *, + top: Optional[int] = None, + filter: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/remediations" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_remediations_list_deployments_at_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, remediation_name: str, subscription_id: str, *, top: Optional[int] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/listDeployments" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "remediationName": _SERIALIZER.url("remediation_name", remediation_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_remediations_cancel_at_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, remediation_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/cancel" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "remediationName": _SERIALIZER.url("remediation_name", remediation_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_remediations_get_at_resource_request( # pylint: disable=name-too-long + resource_id: str, remediation_name: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/{resourceId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}" + path_format_arguments = { + "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), + "remediationName": _SERIALIZER.url("remediation_name", remediation_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_remediations_create_or_update_at_resource_request( # pylint: disable=name-too-long + resource_id: str, remediation_name: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/{resourceId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}" + path_format_arguments = { + "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), + "remediationName": _SERIALIZER.url("remediation_name", remediation_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_remediations_delete_at_resource_request( # pylint: disable=name-too-long + resource_id: str, remediation_name: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/{resourceId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}" + path_format_arguments = { + "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), + "remediationName": _SERIALIZER.url("remediation_name", remediation_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_remediations_list_for_resource_request( # pylint: disable=name-too-long + resource_id: str, *, top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/{resourceId}/providers/Microsoft.PolicyInsights/remediations" + path_format_arguments = { + "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_remediations_list_deployments_at_resource_request( # pylint: disable=name-too-long + resource_id: str, remediation_name: str, *, top: Optional[int] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/{resourceId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/listDeployments" + path_format_arguments = { + "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), + "remediationName": _SERIALIZER.url("remediation_name", remediation_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_remediations_cancel_at_resource_request( # pylint: disable=name-too-long + resource_id: str, remediation_name: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/{resourceId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/cancel" + path_format_arguments = { + "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), + "remediationName": _SERIALIZER.url("remediation_name", remediation_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_remediations_list_deployments_at_management_group_request( # pylint: disable=name-too-long + management_group_id: str, remediation_name: str, *, top: Optional[int] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( + "management_groups_namespace", "Microsoft.Management" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/providers/{managementGroupsNamespace}/managementGroups/{managementGroupId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/listDeployments" + path_format_arguments = { + "managementGroupsNamespace": _SERIALIZER.url("management_groups_namespace", management_groups_namespace, "str"), + "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), + "remediationName": _SERIALIZER.url("remediation_name", remediation_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_remediations_cancel_at_management_group_request( # pylint: disable=name-too-long + management_group_id: str, remediation_name: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( + "management_groups_namespace", "Microsoft.Management" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/providers/{managementGroupsNamespace}/managementGroups/{managementGroupId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/cancel" + path_format_arguments = { + "managementGroupsNamespace": _SERIALIZER.url("management_groups_namespace", management_groups_namespace, "str"), + "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), + "remediationName": _SERIALIZER.url("remediation_name", remediation_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_attestations_get_at_subscription_request( # pylint: disable=name-too-long + attestation_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/attestations/{attestationName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "attestationName": _SERIALIZER.url("attestation_name", attestation_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_attestations_create_or_update_at_subscription_request( # pylint: disable=name-too-long + attestation_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/attestations/{attestationName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "attestationName": _SERIALIZER.url("attestation_name", attestation_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_attestations_delete_at_subscription_request( # pylint: disable=name-too-long + attestation_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/attestations/{attestationName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "attestationName": _SERIALIZER.url("attestation_name", attestation_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_attestations_list_for_subscription_request( # pylint: disable=name-too-long + subscription_id: str, *, top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/attestations" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_attestations_get_at_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, attestation_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/attestations/{attestationName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "attestationName": _SERIALIZER.url("attestation_name", attestation_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_attestations_create_or_update_at_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, attestation_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/attestations/{attestationName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "attestationName": _SERIALIZER.url("attestation_name", attestation_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_attestations_delete_at_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, attestation_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/attestations/{attestationName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "attestationName": _SERIALIZER.url("attestation_name", attestation_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_attestations_list_for_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, + subscription_id: str, + *, + top: Optional[int] = None, + filter: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/attestations" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_attestations_get_at_resource_request( # pylint: disable=name-too-long + resource_id: str, attestation_name: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/{resourceId}/providers/Microsoft.PolicyInsights/attestations/{attestationName}" + path_format_arguments = { + "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), + "attestationName": _SERIALIZER.url("attestation_name", attestation_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_attestations_create_or_update_at_resource_request( # pylint: disable=name-too-long + resource_id: str, attestation_name: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/{resourceId}/providers/Microsoft.PolicyInsights/attestations/{attestationName}" + path_format_arguments = { + "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), + "attestationName": _SERIALIZER.url("attestation_name", attestation_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_attestations_delete_at_resource_request( # pylint: disable=name-too-long + resource_id: str, attestation_name: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + # Construct URL + _url = "/{resourceId}/providers/Microsoft.PolicyInsights/attestations/{attestationName}" + path_format_arguments = { + "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), + "attestationName": _SERIALIZER.url("attestation_name", attestation_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_attestations_list_for_resource_request( # pylint: disable=name-too-long + resource_id: str, *, top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/{resourceId}/providers/Microsoft.PolicyInsights/attestations" + path_format_arguments = { + "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_policy_metadata_get_resource_request( # pylint: disable=name-too-long + resource_name: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/providers/Microsoft.PolicyInsights/policyMetadata/{resourceName}" + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str", skip_quote=True), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_policy_metadata_list_request(*, top: Optional[int] = None, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/providers/Microsoft.PolicyInsights/policyMetadata" + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_policy_events_list_query_results_for_management_group_request( # pylint: disable=name-too-long + policy_events_resource: Union[str, _models.PolicyEventsResourceType], + management_group_name: str, + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( + "management_groups_namespace", "Microsoft.Management" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/providers/{managementGroupsNamespace}/managementGroups/{managementGroupName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults" + path_format_arguments = { + "policyEventsResource": _SERIALIZER.url("policy_events_resource", policy_events_resource, "str"), + "managementGroupsNamespace": _SERIALIZER.url("management_groups_namespace", management_groups_namespace, "str"), + "managementGroupName": _SERIALIZER.url("management_group_name", management_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + if order_by is not None: + _params["$orderby"] = _SERIALIZER.query("order_by", order_by, "str") + if select is not None: + _params["$select"] = _SERIALIZER.query("select", select, "str") + if from_parameter is not None: + _params["$from"] = _SERIALIZER.query("from_parameter", from_parameter, "iso-8601") + if to is not None: + _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + if apply is not None: + _params["$apply"] = _SERIALIZER.query("apply", apply, "str") + if skip_token is not None: + _params["$skiptoken"] = _SERIALIZER.query("skip_token", skip_token, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_policy_events_list_query_results_for_subscription_request( # pylint: disable=name-too-long + policy_events_resource: Union[str, _models.PolicyEventsResourceType], + subscription_id: str, + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "policyEventsResource": _SERIALIZER.url("policy_events_resource", policy_events_resource, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + if order_by is not None: + _params["$orderby"] = _SERIALIZER.query("order_by", order_by, "str") + if select is not None: + _params["$select"] = _SERIALIZER.query("select", select, "str") + if from_parameter is not None: + _params["$from"] = _SERIALIZER.query("from_parameter", from_parameter, "iso-8601") + if to is not None: + _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + if apply is not None: + _params["$apply"] = _SERIALIZER.query("apply", apply, "str") + if skip_token is not None: + _params["$skiptoken"] = _SERIALIZER.query("skip_token", skip_token, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_policy_events_list_query_results_for_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, + policy_events_resource: Union[str, _models.PolicyEventsResourceType], + subscription_id: str, + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "policyEventsResource": _SERIALIZER.url("policy_events_resource", policy_events_resource, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + if order_by is not None: + _params["$orderby"] = _SERIALIZER.query("order_by", order_by, "str") + if select is not None: + _params["$select"] = _SERIALIZER.query("select", select, "str") + if from_parameter is not None: + _params["$from"] = _SERIALIZER.query("from_parameter", from_parameter, "iso-8601") + if to is not None: + _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + if apply is not None: + _params["$apply"] = _SERIALIZER.query("apply", apply, "str") + if skip_token is not None: + _params["$skiptoken"] = _SERIALIZER.query("skip_token", skip_token, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_policy_events_list_query_results_for_resource_request( # pylint: disable=name-too-long + policy_events_resource: Union[str, _models.PolicyEventsResourceType], + resource_id: str, + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + expand: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/{resourceId}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults" + path_format_arguments = { + "policyEventsResource": _SERIALIZER.url("policy_events_resource", policy_events_resource, "str"), + "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + if order_by is not None: + _params["$orderby"] = _SERIALIZER.query("order_by", order_by, "str") + if select is not None: + _params["$select"] = _SERIALIZER.query("select", select, "str") + if from_parameter is not None: + _params["$from"] = _SERIALIZER.query("from_parameter", from_parameter, "iso-8601") + if to is not None: + _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + if apply is not None: + _params["$apply"] = _SERIALIZER.query("apply", apply, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + if skip_token is not None: + _params["$skiptoken"] = _SERIALIZER.query("skip_token", skip_token, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_policy_events_list_query_results_for_policy_set_definition_request( # pylint: disable=name-too-long + policy_events_resource: Union[str, _models.PolicyEventsResourceType], + policy_set_definition_name: str, + subscription_id: str, + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( + "authorization_namespace", "Microsoft.Authorization" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policySetDefinitions/{policySetDefinitionName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "policyEventsResource": _SERIALIZER.url("policy_events_resource", policy_events_resource, "str"), + "authorizationNamespace": _SERIALIZER.url("authorization_namespace", authorization_namespace, "str"), + "policySetDefinitionName": _SERIALIZER.url("policy_set_definition_name", policy_set_definition_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + if order_by is not None: + _params["$orderby"] = _SERIALIZER.query("order_by", order_by, "str") + if select is not None: + _params["$select"] = _SERIALIZER.query("select", select, "str") + if from_parameter is not None: + _params["$from"] = _SERIALIZER.query("from_parameter", from_parameter, "iso-8601") + if to is not None: + _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + if apply is not None: + _params["$apply"] = _SERIALIZER.query("apply", apply, "str") + if skip_token is not None: + _params["$skiptoken"] = _SERIALIZER.query("skip_token", skip_token, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_policy_events_list_query_results_for_policy_definition_request( # pylint: disable=name-too-long + policy_events_resource: Union[str, _models.PolicyEventsResourceType], + policy_definition_name: str, + subscription_id: str, + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( + "authorization_namespace", "Microsoft.Authorization" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyDefinitions/{policyDefinitionName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "policyEventsResource": _SERIALIZER.url("policy_events_resource", policy_events_resource, "str"), + "authorizationNamespace": _SERIALIZER.url("authorization_namespace", authorization_namespace, "str"), + "policyDefinitionName": _SERIALIZER.url("policy_definition_name", policy_definition_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + if order_by is not None: + _params["$orderby"] = _SERIALIZER.query("order_by", order_by, "str") + if select is not None: + _params["$select"] = _SERIALIZER.query("select", select, "str") + if from_parameter is not None: + _params["$from"] = _SERIALIZER.query("from_parameter", from_parameter, "iso-8601") + if to is not None: + _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + if apply is not None: + _params["$apply"] = _SERIALIZER.query("apply", apply, "str") + if skip_token is not None: + _params["$skiptoken"] = _SERIALIZER.query("skip_token", skip_token, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_policy_events_list_query_results_for_subscription_level_policy_assignment_request( # pylint: disable=name-too-long + policy_events_resource: Union[str, _models.PolicyEventsResourceType], + policy_assignment_name: str, + subscription_id: str, + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( + "authorization_namespace", "Microsoft.Authorization" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "policyEventsResource": _SERIALIZER.url("policy_events_resource", policy_events_resource, "str"), + "authorizationNamespace": _SERIALIZER.url("authorization_namespace", authorization_namespace, "str"), + "policyAssignmentName": _SERIALIZER.url("policy_assignment_name", policy_assignment_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + if order_by is not None: + _params["$orderby"] = _SERIALIZER.query("order_by", order_by, "str") + if select is not None: + _params["$select"] = _SERIALIZER.query("select", select, "str") + if from_parameter is not None: + _params["$from"] = _SERIALIZER.query("from_parameter", from_parameter, "iso-8601") + if to is not None: + _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + if apply is not None: + _params["$apply"] = _SERIALIZER.query("apply", apply, "str") + if skip_token is not None: + _params["$skiptoken"] = _SERIALIZER.query("skip_token", skip_token, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_policy_events_list_query_results_for_resource_group_level_policy_assignment_request( # pylint: disable=name-too-long + resource_group_name: str, + policy_events_resource: Union[str, _models.PolicyEventsResourceType], + policy_assignment_name: str, + subscription_id: str, + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( + "authorization_namespace", "Microsoft.Authorization" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "policyEventsResource": _SERIALIZER.url("policy_events_resource", policy_events_resource, "str"), + "authorizationNamespace": _SERIALIZER.url("authorization_namespace", authorization_namespace, "str"), + "policyAssignmentName": _SERIALIZER.url("policy_assignment_name", policy_assignment_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + if order_by is not None: + _params["$orderby"] = _SERIALIZER.query("order_by", order_by, "str") + if select is not None: + _params["$select"] = _SERIALIZER.query("select", select, "str") + if from_parameter is not None: + _params["$from"] = _SERIALIZER.query("from_parameter", from_parameter, "iso-8601") + if to is not None: + _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + if apply is not None: + _params["$apply"] = _SERIALIZER.query("apply", apply, "str") + if skip_token is not None: + _params["$skiptoken"] = _SERIALIZER.query("skip_token", skip_token, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_policy_states_list_query_results_for_management_group_request( # pylint: disable=name-too-long + policy_states_resource: Union[str, _models.PolicyStatesResource], + management_group_name: str, + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( + "management_groups_namespace", "Microsoft.Management" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/providers/{managementGroupsNamespace}/managementGroups/{managementGroupName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults" + path_format_arguments = { + "policyStatesResource": _SERIALIZER.url("policy_states_resource", policy_states_resource, "str"), + "managementGroupsNamespace": _SERIALIZER.url("management_groups_namespace", management_groups_namespace, "str"), + "managementGroupName": _SERIALIZER.url("management_group_name", management_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + if order_by is not None: + _params["$orderby"] = _SERIALIZER.query("order_by", order_by, "str") + if select is not None: + _params["$select"] = _SERIALIZER.query("select", select, "str") + if from_parameter is not None: + _params["$from"] = _SERIALIZER.query("from_parameter", from_parameter, "iso-8601") + if to is not None: + _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + if apply is not None: + _params["$apply"] = _SERIALIZER.query("apply", apply, "str") + if skip_token is not None: + _params["$skiptoken"] = _SERIALIZER.query("skip_token", skip_token, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_policy_states_summarize_for_management_group_request( # pylint: disable=name-too-long + policy_states_summary_resource: Union[str, _models.PolicyStatesSummaryResourceType], + management_group_name: str, + *, + top: Optional[int] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( + "management_groups_namespace", "Microsoft.Management" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/providers/{managementGroupsNamespace}/managementGroups/{managementGroupName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize" + path_format_arguments = { + "policyStatesSummaryResource": _SERIALIZER.url( + "policy_states_summary_resource", policy_states_summary_resource, "str" + ), + "managementGroupsNamespace": _SERIALIZER.url("management_groups_namespace", management_groups_namespace, "str"), + "managementGroupName": _SERIALIZER.url("management_group_name", management_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + if from_parameter is not None: + _params["$from"] = _SERIALIZER.query("from_parameter", from_parameter, "iso-8601") + if to is not None: + _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_policy_states_list_query_results_for_subscription_request( # pylint: disable=name-too-long + policy_states_resource: Union[str, _models.PolicyStatesResource], + subscription_id: str, + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "policyStatesResource": _SERIALIZER.url("policy_states_resource", policy_states_resource, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + if order_by is not None: + _params["$orderby"] = _SERIALIZER.query("order_by", order_by, "str") + if select is not None: + _params["$select"] = _SERIALIZER.query("select", select, "str") + if from_parameter is not None: + _params["$from"] = _SERIALIZER.query("from_parameter", from_parameter, "iso-8601") + if to is not None: + _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + if apply is not None: + _params["$apply"] = _SERIALIZER.query("apply", apply, "str") + if skip_token is not None: + _params["$skiptoken"] = _SERIALIZER.query("skip_token", skip_token, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_policy_states_summarize_for_subscription_request( # pylint: disable=name-too-long + policy_states_summary_resource: Union[str, _models.PolicyStatesSummaryResourceType], + subscription_id: str, + *, + top: Optional[int] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "policyStatesSummaryResource": _SERIALIZER.url( + "policy_states_summary_resource", policy_states_summary_resource, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + if from_parameter is not None: + _params["$from"] = _SERIALIZER.query("from_parameter", from_parameter, "iso-8601") + if to is not None: + _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_policy_states_list_query_results_for_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, + policy_states_resource: Union[str, _models.PolicyStatesResource], + subscription_id: str, + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "policyStatesResource": _SERIALIZER.url("policy_states_resource", policy_states_resource, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + if order_by is not None: + _params["$orderby"] = _SERIALIZER.query("order_by", order_by, "str") + if select is not None: + _params["$select"] = _SERIALIZER.query("select", select, "str") + if from_parameter is not None: + _params["$from"] = _SERIALIZER.query("from_parameter", from_parameter, "iso-8601") + if to is not None: + _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + if apply is not None: + _params["$apply"] = _SERIALIZER.query("apply", apply, "str") + if skip_token is not None: + _params["$skiptoken"] = _SERIALIZER.query("skip_token", skip_token, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_policy_states_summarize_for_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, + policy_states_summary_resource: Union[str, _models.PolicyStatesSummaryResourceType], + subscription_id: str, + *, + top: Optional[int] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "policyStatesSummaryResource": _SERIALIZER.url( + "policy_states_summary_resource", policy_states_summary_resource, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + if from_parameter is not None: + _params["$from"] = _SERIALIZER.query("from_parameter", from_parameter, "iso-8601") + if to is not None: + _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_policy_states_list_query_results_for_resource_request( # pylint: disable=name-too-long + policy_states_resource: Union[str, _models.PolicyStatesResource], + resource_id: str, + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + expand: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/{resourceId}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults" + path_format_arguments = { + "policyStatesResource": _SERIALIZER.url("policy_states_resource", policy_states_resource, "str"), + "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + if order_by is not None: + _params["$orderby"] = _SERIALIZER.query("order_by", order_by, "str") + if select is not None: + _params["$select"] = _SERIALIZER.query("select", select, "str") + if from_parameter is not None: + _params["$from"] = _SERIALIZER.query("from_parameter", from_parameter, "iso-8601") + if to is not None: + _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + if apply is not None: + _params["$apply"] = _SERIALIZER.query("apply", apply, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + if skip_token is not None: + _params["$skiptoken"] = _SERIALIZER.query("skip_token", skip_token, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_policy_states_summarize_for_resource_request( # pylint: disable=name-too-long + policy_states_summary_resource: Union[str, _models.PolicyStatesSummaryResourceType], + resource_id: str, + *, + top: Optional[int] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/{resourceId}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize" + path_format_arguments = { + "policyStatesSummaryResource": _SERIALIZER.url( + "policy_states_summary_resource", policy_states_summary_resource, "str" + ), + "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + if from_parameter is not None: + _params["$from"] = _SERIALIZER.query("from_parameter", from_parameter, "iso-8601") + if to is not None: + _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_policy_states_trigger_subscription_evaluation_request( # pylint: disable=name-too-long + subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyStates/latest/triggerEvaluation" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + + +def build_policy_states_trigger_resource_group_evaluation_request( # pylint: disable=name-too-long + resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyStates/latest/triggerEvaluation" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + + +def build_policy_states_list_query_results_for_policy_set_definition_request( # pylint: disable=name-too-long + policy_states_resource: Union[str, _models.PolicyStatesResource], + policy_set_definition_name: str, + subscription_id: str, + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( + "authorization_namespace", "Microsoft.Authorization" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policySetDefinitions/{policySetDefinitionName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "policyStatesResource": _SERIALIZER.url("policy_states_resource", policy_states_resource, "str"), + "authorizationNamespace": _SERIALIZER.url("authorization_namespace", authorization_namespace, "str"), + "policySetDefinitionName": _SERIALIZER.url("policy_set_definition_name", policy_set_definition_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + if order_by is not None: + _params["$orderby"] = _SERIALIZER.query("order_by", order_by, "str") + if select is not None: + _params["$select"] = _SERIALIZER.query("select", select, "str") + if from_parameter is not None: + _params["$from"] = _SERIALIZER.query("from_parameter", from_parameter, "iso-8601") + if to is not None: + _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + if apply is not None: + _params["$apply"] = _SERIALIZER.query("apply", apply, "str") + if skip_token is not None: + _params["$skiptoken"] = _SERIALIZER.query("skip_token", skip_token, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_policy_states_summarize_for_policy_set_definition_request( # pylint: disable=name-too-long + policy_states_summary_resource: Union[str, _models.PolicyStatesSummaryResourceType], + policy_set_definition_name: str, + subscription_id: str, + *, + top: Optional[int] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( + "authorization_namespace", "Microsoft.Authorization" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policySetDefinitions/{policySetDefinitionName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "policyStatesSummaryResource": _SERIALIZER.url( + "policy_states_summary_resource", policy_states_summary_resource, "str" + ), + "authorizationNamespace": _SERIALIZER.url("authorization_namespace", authorization_namespace, "str"), + "policySetDefinitionName": _SERIALIZER.url("policy_set_definition_name", policy_set_definition_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + if from_parameter is not None: + _params["$from"] = _SERIALIZER.query("from_parameter", from_parameter, "iso-8601") + if to is not None: + _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_policy_states_list_query_results_for_policy_definition_request( # pylint: disable=name-too-long + policy_states_resource: Union[str, _models.PolicyStatesResource], + policy_definition_name: str, + subscription_id: str, + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( + "authorization_namespace", "Microsoft.Authorization" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyDefinitions/{policyDefinitionName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "policyStatesResource": _SERIALIZER.url("policy_states_resource", policy_states_resource, "str"), + "authorizationNamespace": _SERIALIZER.url("authorization_namespace", authorization_namespace, "str"), + "policyDefinitionName": _SERIALIZER.url("policy_definition_name", policy_definition_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + if order_by is not None: + _params["$orderby"] = _SERIALIZER.query("order_by", order_by, "str") + if select is not None: + _params["$select"] = _SERIALIZER.query("select", select, "str") + if from_parameter is not None: + _params["$from"] = _SERIALIZER.query("from_parameter", from_parameter, "iso-8601") + if to is not None: + _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + if apply is not None: + _params["$apply"] = _SERIALIZER.query("apply", apply, "str") + if skip_token is not None: + _params["$skiptoken"] = _SERIALIZER.query("skip_token", skip_token, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_policy_states_summarize_for_policy_definition_request( # pylint: disable=name-too-long + policy_states_summary_resource: Union[str, _models.PolicyStatesSummaryResourceType], + policy_definition_name: str, + subscription_id: str, + *, + top: Optional[int] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( + "authorization_namespace", "Microsoft.Authorization" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyDefinitions/{policyDefinitionName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "policyStatesSummaryResource": _SERIALIZER.url( + "policy_states_summary_resource", policy_states_summary_resource, "str" + ), + "authorizationNamespace": _SERIALIZER.url("authorization_namespace", authorization_namespace, "str"), + "policyDefinitionName": _SERIALIZER.url("policy_definition_name", policy_definition_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + if from_parameter is not None: + _params["$from"] = _SERIALIZER.query("from_parameter", from_parameter, "iso-8601") + if to is not None: + _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_policy_states_list_query_results_for_subscription_level_policy_assignment_request( # pylint: disable=name-too-long + policy_states_resource: Union[str, _models.PolicyStatesResource], + policy_assignment_name: str, + subscription_id: str, + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( + "authorization_namespace", "Microsoft.Authorization" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "policyStatesResource": _SERIALIZER.url("policy_states_resource", policy_states_resource, "str"), + "authorizationNamespace": _SERIALIZER.url("authorization_namespace", authorization_namespace, "str"), + "policyAssignmentName": _SERIALIZER.url("policy_assignment_name", policy_assignment_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + if order_by is not None: + _params["$orderby"] = _SERIALIZER.query("order_by", order_by, "str") + if select is not None: + _params["$select"] = _SERIALIZER.query("select", select, "str") + if from_parameter is not None: + _params["$from"] = _SERIALIZER.query("from_parameter", from_parameter, "iso-8601") + if to is not None: + _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + if apply is not None: + _params["$apply"] = _SERIALIZER.query("apply", apply, "str") + if skip_token is not None: + _params["$skiptoken"] = _SERIALIZER.query("skip_token", skip_token, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_policy_states_summarize_for_subscription_level_policy_assignment_request( # pylint: disable=name-too-long + policy_states_summary_resource: Union[str, _models.PolicyStatesSummaryResourceType], + policy_assignment_name: str, + subscription_id: str, + *, + top: Optional[int] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( + "authorization_namespace", "Microsoft.Authorization" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "policyStatesSummaryResource": _SERIALIZER.url( + "policy_states_summary_resource", policy_states_summary_resource, "str" + ), + "authorizationNamespace": _SERIALIZER.url("authorization_namespace", authorization_namespace, "str"), + "policyAssignmentName": _SERIALIZER.url("policy_assignment_name", policy_assignment_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + if from_parameter is not None: + _params["$from"] = _SERIALIZER.query("from_parameter", from_parameter, "iso-8601") + if to is not None: + _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_policy_states_list_query_results_for_resource_group_level_policy_assignment_request( # pylint: disable=name-too-long + resource_group_name: str, + policy_states_resource: Union[str, _models.PolicyStatesResource], + policy_assignment_name: str, + subscription_id: str, + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( + "authorization_namespace", "Microsoft.Authorization" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "policyStatesResource": _SERIALIZER.url("policy_states_resource", policy_states_resource, "str"), + "authorizationNamespace": _SERIALIZER.url("authorization_namespace", authorization_namespace, "str"), + "policyAssignmentName": _SERIALIZER.url("policy_assignment_name", policy_assignment_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + if order_by is not None: + _params["$orderby"] = _SERIALIZER.query("order_by", order_by, "str") + if select is not None: + _params["$select"] = _SERIALIZER.query("select", select, "str") + if from_parameter is not None: + _params["$from"] = _SERIALIZER.query("from_parameter", from_parameter, "iso-8601") + if to is not None: + _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + if apply is not None: + _params["$apply"] = _SERIALIZER.query("apply", apply, "str") + if skip_token is not None: + _params["$skiptoken"] = _SERIALIZER.query("skip_token", skip_token, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_policy_states_summarize_for_resource_group_level_policy_assignment_request( # pylint: disable=name-too-long + resource_group_name: str, + policy_states_summary_resource: Union[str, _models.PolicyStatesSummaryResourceType], + policy_assignment_name: str, + subscription_id: str, + *, + top: Optional[int] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( + "authorization_namespace", "Microsoft.Authorization" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "policyStatesSummaryResource": _SERIALIZER.url( + "policy_states_summary_resource", policy_states_summary_resource, "str" + ), + "authorizationNamespace": _SERIALIZER.url("authorization_namespace", authorization_namespace, "str"), + "policyAssignmentName": _SERIALIZER.url("policy_assignment_name", policy_assignment_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + if from_parameter is not None: + _params["$from"] = _SERIALIZER.query("from_parameter", from_parameter, "iso-8601") + if to is not None: + _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_policy_restrictions_check_at_subscription_scope_request( # pylint: disable=name-too-long + subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/checkPolicyRestrictions" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_policy_restrictions_check_at_resource_group_scope_request( # pylint: disable=name-too-long + resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/checkPolicyRestrictions" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_policy_restrictions_check_at_management_group_scope_request( # pylint: disable=name-too-long + management_group_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( + "management_groups_namespace", "Microsoft.Management" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/providers/{managementGroupsNamespace}/managementGroups/{managementGroupId}/providers/Microsoft.PolicyInsights/checkPolicyRestrictions" + path_format_arguments = { + "managementGroupsNamespace": _SERIALIZER.url("management_groups_namespace", management_groups_namespace, "str"), + "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_component_policy_states_list_query_results_for_subscription_request( # pylint: disable=name-too-long + component_policy_states_resource: Union[str, _models.ComponentPolicyStatesResource], + subscription_id: str, + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/componentPolicyStates/{componentPolicyStatesResource}/queryResults" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "componentPolicyStatesResource": _SERIALIZER.url( + "component_policy_states_resource", component_policy_states_resource, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + if order_by is not None: + _params["$orderby"] = _SERIALIZER.query("order_by", order_by, "str") + if select is not None: + _params["$select"] = _SERIALIZER.query("select", select, "str") + if from_parameter is not None: + _params["$from"] = _SERIALIZER.query("from_parameter", from_parameter, "iso-8601") + if to is not None: + _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + if apply is not None: + _params["$apply"] = _SERIALIZER.query("apply", apply, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_component_policy_states_list_query_results_for_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, + component_policy_states_resource: Union[str, _models.ComponentPolicyStatesResource], + subscription_id: str, + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/componentPolicyStates/{componentPolicyStatesResource}/queryResults" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "componentPolicyStatesResource": _SERIALIZER.url( + "component_policy_states_resource", component_policy_states_resource, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + if order_by is not None: + _params["$orderby"] = _SERIALIZER.query("order_by", order_by, "str") + if select is not None: + _params["$select"] = _SERIALIZER.query("select", select, "str") + if from_parameter is not None: + _params["$from"] = _SERIALIZER.query("from_parameter", from_parameter, "iso-8601") + if to is not None: + _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + if apply is not None: + _params["$apply"] = _SERIALIZER.query("apply", apply, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_component_policy_states_list_query_results_for_resource_request( # pylint: disable=name-too-long + resource_id: str, + component_policy_states_resource: Union[str, _models.ComponentPolicyStatesResource], + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + expand: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/{resourceId}/providers/Microsoft.PolicyInsights/componentPolicyStates/{componentPolicyStatesResource}/queryResults" + path_format_arguments = { + "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), + "componentPolicyStatesResource": _SERIALIZER.url( + "component_policy_states_resource", component_policy_states_resource, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + if order_by is not None: + _params["$orderby"] = _SERIALIZER.query("order_by", order_by, "str") + if select is not None: + _params["$select"] = _SERIALIZER.query("select", select, "str") + if from_parameter is not None: + _params["$from"] = _SERIALIZER.query("from_parameter", from_parameter, "iso-8601") + if to is not None: + _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + if apply is not None: + _params["$apply"] = _SERIALIZER.query("apply", apply, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_component_policy_states_list_query_results_for_policy_definition_request( # pylint: disable=name-too-long + policy_definition_name: str, + component_policy_states_resource: Union[str, _models.ComponentPolicyStatesResource], + subscription_id: str, + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( + "authorization_namespace", "Microsoft.Authorization" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyDefinitions/{policyDefinitionName}/providers/Microsoft.PolicyInsights/componentPolicyStates/{componentPolicyStatesResource}/queryResults" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "authorizationNamespace": _SERIALIZER.url("authorization_namespace", authorization_namespace, "str"), + "policyDefinitionName": _SERIALIZER.url("policy_definition_name", policy_definition_name, "str"), + "componentPolicyStatesResource": _SERIALIZER.url( + "component_policy_states_resource", component_policy_states_resource, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + if order_by is not None: + _params["$orderby"] = _SERIALIZER.query("order_by", order_by, "str") + if select is not None: + _params["$select"] = _SERIALIZER.query("select", select, "str") + if from_parameter is not None: + _params["$from"] = _SERIALIZER.query("from_parameter", from_parameter, "iso-8601") + if to is not None: + _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + if apply is not None: + _params["$apply"] = _SERIALIZER.query("apply", apply, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_component_policy_states_list_query_results_for_subscription_level_policy_assignment_request( # pylint: disable=name-too-long + policy_assignment_name: str, + component_policy_states_resource: Union[str, _models.ComponentPolicyStatesResource], + subscription_id: str, + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( + "authorization_namespace", "Microsoft.Authorization" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/componentPolicyStates/{componentPolicyStatesResource}/queryResults" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "authorizationNamespace": _SERIALIZER.url("authorization_namespace", authorization_namespace, "str"), + "policyAssignmentName": _SERIALIZER.url("policy_assignment_name", policy_assignment_name, "str"), + "componentPolicyStatesResource": _SERIALIZER.url( + "component_policy_states_resource", component_policy_states_resource, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + if order_by is not None: + _params["$orderby"] = _SERIALIZER.query("order_by", order_by, "str") + if select is not None: + _params["$select"] = _SERIALIZER.query("select", select, "str") + if from_parameter is not None: + _params["$from"] = _SERIALIZER.query("from_parameter", from_parameter, "iso-8601") + if to is not None: + _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + if apply is not None: + _params["$apply"] = _SERIALIZER.query("apply", apply, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_component_policy_states_list_query_results_for_resource_group_level_policy_assignment_request( # pylint: disable=name-too-long + resource_group_name: str, + policy_assignment_name: str, + component_policy_states_resource: Union[str, _models.ComponentPolicyStatesResource], + subscription_id: str, + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( + "authorization_namespace", "Microsoft.Authorization" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/componentPolicyStates/{componentPolicyStatesResource}/queryResults" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "authorizationNamespace": _SERIALIZER.url("authorization_namespace", authorization_namespace, "str"), + "policyAssignmentName": _SERIALIZER.url("policy_assignment_name", policy_assignment_name, "str"), + "componentPolicyStatesResource": _SERIALIZER.url( + "component_policy_states_resource", component_policy_states_resource, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + if order_by is not None: + _params["$orderby"] = _SERIALIZER.query("order_by", order_by, "str") + if select is not None: + _params["$select"] = _SERIALIZER.query("select", select, "str") + if from_parameter is not None: + _params["$from"] = _SERIALIZER.query("from_parameter", from_parameter, "iso-8601") + if to is not None: + _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + if apply is not None: + _params["$apply"] = _SERIALIZER.query("apply", apply, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_policy_tracked_resources_list_query_results_for_management_group_request( # pylint: disable=name-too-long + management_group_name: str, + policy_tracked_resources_resource: Union[str, _models.PolicyTrackedResourcesResourceType], + *, + top: Optional[int] = None, + filter: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( + "management_groups_namespace", "Microsoft.Management" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/providers/{managementGroupsNamespace}/managementGroups/{managementGroupName}/providers/Microsoft.PolicyInsights/policyTrackedResources/{policyTrackedResourcesResource}/queryResults" + path_format_arguments = { + "managementGroupsNamespace": _SERIALIZER.url("management_groups_namespace", management_groups_namespace, "str"), + "managementGroupName": _SERIALIZER.url("management_group_name", management_group_name, "str"), + "policyTrackedResourcesResource": _SERIALIZER.url( + "policy_tracked_resources_resource", policy_tracked_resources_resource, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_policy_tracked_resources_list_query_results_for_subscription_request( # pylint: disable=name-too-long + policy_tracked_resources_resource: Union[str, _models.PolicyTrackedResourcesResourceType], + subscription_id: str, + *, + top: Optional[int] = None, + filter: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyTrackedResources/{policyTrackedResourcesResource}/queryResults" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "policyTrackedResourcesResource": _SERIALIZER.url( + "policy_tracked_resources_resource", policy_tracked_resources_resource, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_policy_tracked_resources_list_query_results_for_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, + policy_tracked_resources_resource: Union[str, _models.PolicyTrackedResourcesResourceType], + subscription_id: str, + *, + top: Optional[int] = None, + filter: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyTrackedResources/{policyTrackedResourcesResource}/queryResults" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "policyTrackedResourcesResource": _SERIALIZER.url( + "policy_tracked_resources_resource", policy_tracked_resources_resource, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_policy_tracked_resources_list_query_results_for_resource_request( # pylint: disable=name-too-long + resource_id: str, + policy_tracked_resources_resource: Union[str, _models.PolicyTrackedResourcesResourceType], + *, + top: Optional[int] = None, + filter: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/{resourceId}/providers/Microsoft.PolicyInsights/policyTrackedResources/{policyTrackedResourcesResource}/queryResults" + path_format_arguments = { + "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), + "policyTrackedResourcesResource": _SERIALIZER.url( + "policy_tracked_resources_resource", policy_tracked_resources_resource, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + class Operations: """ .. warning:: **DO NOT** instantiate this class directly. - Instead, you should access the following operations through - :class:`~azure.mgmt.policyinsights.PolicyInsightsClient`'s - :attr:`operations` attribute. - """ + Instead, you should access the following operations through + :class:`~azure.mgmt.policyinsights.PolicyInsightsClient`'s + :attr:`operations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: PolicyInsightsClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list(self, **kwargs: Any) -> _models.OperationsListResults: + """Lists available operations. + + :return: OperationsListResults. The OperationsListResults is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.OperationsListResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[_models.OperationsListResults] = kwargs.pop("cls", None) + + _request = build_operations_list_request( + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.OperationsListResults, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class RemediationsOperations: # pylint: disable=too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.policyinsights.PolicyInsightsClient`'s + :attr:`remediations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: PolicyInsightsClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get_at_management_group( + self, management_group_id: str, remediation_name: str, **kwargs: Any + ) -> _models.Remediation: + """Gets an existing remediation at management group scope. + + :param management_group_id: Management group ID. Required. + :type management_group_id: str + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :return: Remediation. The Remediation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Remediation + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( + "management_groups_namespace", "Microsoft.Management" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[_models.Remediation] = kwargs.pop("cls", None) + + _request = build_remediations_get_at_management_group_request( + management_group_id=management_group_id, + remediation_name=remediation_name, + management_groups_namespace=management_groups_namespace, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Remediation, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update_at_management_group( + self, + management_group_id: str, + remediation_name: str, + parameters: _models.Remediation, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Remediation: + """Creates or updates a remediation at management group scope. + + :param management_group_id: Management group ID. Required. + :type management_group_id: str + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :param parameters: The remediation parameters. Required. + :type parameters: ~azure.mgmt.policyinsights.models.Remediation + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Remediation. The Remediation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Remediation + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update_at_management_group( + self, + management_group_id: str, + remediation_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Remediation: + """Creates or updates a remediation at management group scope. + + :param management_group_id: Management group ID. Required. + :type management_group_id: str + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :param parameters: The remediation parameters. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Remediation. The Remediation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Remediation + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update_at_management_group( + self, + management_group_id: str, + remediation_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Remediation: + """Creates or updates a remediation at management group scope. + + :param management_group_id: Management group ID. Required. + :type management_group_id: str + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :param parameters: The remediation parameters. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Remediation. The Remediation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Remediation + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update_at_management_group( + self, + management_group_id: str, + remediation_name: str, + parameters: Union[_models.Remediation, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.Remediation: + """Creates or updates a remediation at management group scope. + + :param management_group_id: Management group ID. Required. + :type management_group_id: str + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :param parameters: The remediation parameters. Is one of the following types: Remediation, + JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.policyinsights.models.Remediation or JSON or IO[bytes] + :return: Remediation. The Remediation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Remediation + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( + "management_groups_namespace", "Microsoft.Management" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Remediation] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_remediations_create_or_update_at_management_group_request( + management_group_id=management_group_id, + remediation_name=remediation_name, + management_groups_namespace=management_groups_namespace, + api_version=api_version, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Remediation, response.json()) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete_at_management_group( + self, management_group_id: str, remediation_name: str, **kwargs: Any + ) -> Optional[_models.Remediation]: + """Deletes an existing remediation at management group scope. + + :param management_group_id: Management group ID. Required. + :type management_group_id: str + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :return: Remediation or None. The Remediation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Remediation or None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( + "management_groups_namespace", "Microsoft.Management" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[Optional[_models.Remediation]] = kwargs.pop("cls", None) + + _request = build_remediations_delete_at_management_group_request( + management_group_id=management_group_id, + remediation_name=remediation_name, + management_groups_namespace=management_groups_namespace, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Remediation, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_for_management_group( + self, management_group_id: str, *, top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any + ) -> ItemPaged["_models.Remediation"]: + """Gets all remediations for the management group. + + :param management_group_id: Management group ID. Required. + :type management_group_id: str + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :return: An iterator like instance of Remediation + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.Remediation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( + "management_groups_namespace", "Microsoft.Management" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[List[_models.Remediation]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_remediations_list_for_management_group_request( + management_group_id=management_group_id, + top=top, + filter=filter, + management_groups_namespace=management_groups_namespace, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Remediation], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get_at_subscription(self, remediation_name: str, **kwargs: Any) -> _models.Remediation: + """Gets an existing remediation at subscription scope. + + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :return: Remediation. The Remediation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Remediation + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[_models.Remediation] = kwargs.pop("cls", None) + + _request = build_remediations_get_at_subscription_request( + remediation_name=remediation_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Remediation, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update_at_subscription( + self, + remediation_name: str, + parameters: _models.Remediation, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Remediation: + """Creates or updates a remediation at subscription scope. + + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :param parameters: The remediation parameters. Required. + :type parameters: ~azure.mgmt.policyinsights.models.Remediation + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Remediation. The Remediation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Remediation + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update_at_subscription( + self, remediation_name: str, parameters: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Remediation: + """Creates or updates a remediation at subscription scope. + + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :param parameters: The remediation parameters. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Remediation. The Remediation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Remediation + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update_at_subscription( + self, remediation_name: str, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Remediation: + """Creates or updates a remediation at subscription scope. + + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :param parameters: The remediation parameters. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Remediation. The Remediation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Remediation + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update_at_subscription( + self, remediation_name: str, parameters: Union[_models.Remediation, JSON, IO[bytes]], **kwargs: Any + ) -> _models.Remediation: + """Creates or updates a remediation at subscription scope. + + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :param parameters: The remediation parameters. Is one of the following types: Remediation, + JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.policyinsights.models.Remediation or JSON or IO[bytes] + :return: Remediation. The Remediation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Remediation + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Remediation] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_remediations_create_or_update_at_subscription_request( + remediation_name=remediation_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Remediation, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete_at_subscription(self, remediation_name: str, **kwargs: Any) -> Optional[_models.Remediation]: + """Deletes an existing remediation at subscription scope. + + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :return: Remediation or None. The Remediation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Remediation or None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[Optional[_models.Remediation]] = kwargs.pop("cls", None) + + _request = build_remediations_delete_at_subscription_request( + remediation_name=remediation_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Remediation, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_for_subscription( + self, *, top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any + ) -> ItemPaged["_models.Remediation"]: + """Gets all remediations for the subscription. + + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :return: An iterator like instance of Remediation + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.Remediation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[List[_models.Remediation]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_remediations_list_for_subscription_request( + subscription_id=self._config.subscription_id, + top=top, + filter=filter, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Remediation], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_deployments_at_subscription( + self, remediation_name: str, *, top: Optional[int] = None, **kwargs: Any + ) -> ItemPaged["_models.RemediationDeployment"]: + """Gets all deployments for a remediation at subscription scope. + + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :return: An iterator like instance of RemediationDeployment + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.RemediationDeployment] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[List[_models.RemediationDeployment]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_remediations_list_deployments_at_subscription_request( + remediation_name=remediation_name, + subscription_id=self._config.subscription_id, + top=top, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.RemediationDeployment], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def cancel_at_subscription(self, remediation_name: str, **kwargs: Any) -> _models.Remediation: + """Cancels a remediation at subscription scope. + + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :return: Remediation. The Remediation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Remediation + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[_models.Remediation] = kwargs.pop("cls", None) + + _request = build_remediations_cancel_at_subscription_request( + remediation_name=remediation_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Remediation, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_at_resource_group( + self, resource_group_name: str, remediation_name: str, **kwargs: Any + ) -> _models.Remediation: + """Gets an existing remediation at resource group scope. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :return: Remediation. The Remediation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Remediation + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[_models.Remediation] = kwargs.pop("cls", None) + + _request = build_remediations_get_at_resource_group_request( + resource_group_name=resource_group_name, + remediation_name=remediation_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Remediation, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update_at_resource_group( + self, + resource_group_name: str, + remediation_name: str, + parameters: _models.Remediation, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Remediation: + """Creates or updates a remediation at resource group scope. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :param parameters: The remediation parameters. Required. + :type parameters: ~azure.mgmt.policyinsights.models.Remediation + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Remediation. The Remediation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Remediation + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update_at_resource_group( + self, + resource_group_name: str, + remediation_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Remediation: + """Creates or updates a remediation at resource group scope. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :param parameters: The remediation parameters. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Remediation. The Remediation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Remediation + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update_at_resource_group( + self, + resource_group_name: str, + remediation_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Remediation: + """Creates or updates a remediation at resource group scope. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :param parameters: The remediation parameters. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Remediation. The Remediation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Remediation + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update_at_resource_group( + self, + resource_group_name: str, + remediation_name: str, + parameters: Union[_models.Remediation, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.Remediation: + """Creates or updates a remediation at resource group scope. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :param parameters: The remediation parameters. Is one of the following types: Remediation, + JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.policyinsights.models.Remediation or JSON or IO[bytes] + :return: Remediation. The Remediation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Remediation + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Remediation] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_remediations_create_or_update_at_resource_group_request( + resource_group_name=resource_group_name, + remediation_name=remediation_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Remediation, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete_at_resource_group( + self, resource_group_name: str, remediation_name: str, **kwargs: Any + ) -> Optional[_models.Remediation]: + """Deletes an existing remediation at resource group scope. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :return: Remediation or None. The Remediation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Remediation or None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[Optional[_models.Remediation]] = kwargs.pop("cls", None) + + _request = build_remediations_delete_at_resource_group_request( + resource_group_name=resource_group_name, + remediation_name=remediation_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Remediation, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_for_resource_group( + self, resource_group_name: str, *, top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any + ) -> ItemPaged["_models.Remediation"]: + """Gets all remediations for the subscription. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :return: An iterator like instance of Remediation + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.Remediation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[List[_models.Remediation]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_remediations_list_for_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + top=top, + filter=filter, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Remediation], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_deployments_at_resource_group( + self, resource_group_name: str, remediation_name: str, *, top: Optional[int] = None, **kwargs: Any + ) -> ItemPaged["_models.RemediationDeployment"]: + """Gets all deployments for a remediation at resource group scope. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :return: An iterator like instance of RemediationDeployment + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.RemediationDeployment] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[List[_models.RemediationDeployment]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_remediations_list_deployments_at_resource_group_request( + resource_group_name=resource_group_name, + remediation_name=remediation_name, + subscription_id=self._config.subscription_id, + top=top, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.RemediationDeployment], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def cancel_at_resource_group( + self, resource_group_name: str, remediation_name: str, **kwargs: Any + ) -> _models.Remediation: + """Cancels a remediation at resource group scope. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :return: Remediation. The Remediation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Remediation + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[_models.Remediation] = kwargs.pop("cls", None) + + _request = build_remediations_cancel_at_resource_group_request( + resource_group_name=resource_group_name, + remediation_name=remediation_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Remediation, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_at_resource(self, resource_id: str, remediation_name: str, **kwargs: Any) -> _models.Remediation: + """Gets an existing remediation at resource scope. + + :param resource_id: Resource ID. Required. + :type resource_id: str + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :return: Remediation. The Remediation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Remediation + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[_models.Remediation] = kwargs.pop("cls", None) + + _request = build_remediations_get_at_resource_request( + resource_id=resource_id, + remediation_name=remediation_name, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Remediation, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update_at_resource( + self, + resource_id: str, + remediation_name: str, + parameters: _models.Remediation, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Remediation: + """Creates or updates a remediation at resource scope. + + :param resource_id: Resource ID. Required. + :type resource_id: str + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :param parameters: The remediation parameters. Required. + :type parameters: ~azure.mgmt.policyinsights.models.Remediation + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Remediation. The Remediation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Remediation + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update_at_resource( + self, + resource_id: str, + remediation_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Remediation: + """Creates or updates a remediation at resource scope. + + :param resource_id: Resource ID. Required. + :type resource_id: str + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :param parameters: The remediation parameters. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Remediation. The Remediation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Remediation + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update_at_resource( + self, + resource_id: str, + remediation_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Remediation: + """Creates or updates a remediation at resource scope. + + :param resource_id: Resource ID. Required. + :type resource_id: str + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :param parameters: The remediation parameters. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Remediation. The Remediation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Remediation + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update_at_resource( + self, + resource_id: str, + remediation_name: str, + parameters: Union[_models.Remediation, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.Remediation: + """Creates or updates a remediation at resource scope. + + :param resource_id: Resource ID. Required. + :type resource_id: str + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :param parameters: The remediation parameters. Is one of the following types: Remediation, + JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.policyinsights.models.Remediation or JSON or IO[bytes] + :return: Remediation. The Remediation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Remediation + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Remediation] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_remediations_create_or_update_at_resource_request( + resource_id=resource_id, + remediation_name=remediation_name, + api_version=api_version, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Remediation, response.json()) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete_at_resource( + self, resource_id: str, remediation_name: str, **kwargs: Any + ) -> Optional[_models.Remediation]: + """Deletes an existing remediation at individual resource scope. + + :param resource_id: Resource ID. Required. + :type resource_id: str + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :return: Remediation or None. The Remediation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Remediation or None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[Optional[_models.Remediation]] = kwargs.pop("cls", None) + + _request = build_remediations_delete_at_resource_request( + resource_id=resource_id, + remediation_name=remediation_name, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Remediation, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_for_resource( + self, resource_id: str, *, top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any + ) -> ItemPaged["_models.Remediation"]: + """Gets all remediations for a resource. + + :param resource_id: Resource ID. Required. + :type resource_id: str + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :return: An iterator like instance of Remediation + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.Remediation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[List[_models.Remediation]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_remediations_list_for_resource_request( + resource_id=resource_id, + top=top, + filter=filter, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Remediation], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_deployments_at_resource( + self, resource_id: str, remediation_name: str, *, top: Optional[int] = None, **kwargs: Any + ) -> ItemPaged["_models.RemediationDeployment"]: + """Gets all deployments for a remediation at resource scope. + + :param resource_id: Resource ID. Required. + :type resource_id: str + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :return: An iterator like instance of RemediationDeployment + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.RemediationDeployment] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[List[_models.RemediationDeployment]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_remediations_list_deployments_at_resource_request( + resource_id=resource_id, + remediation_name=remediation_name, + top=top, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.RemediationDeployment], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def cancel_at_resource(self, resource_id: str, remediation_name: str, **kwargs: Any) -> _models.Remediation: + """Cancel a remediation at resource scope. + + :param resource_id: Resource ID. Required. + :type resource_id: str + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :return: Remediation. The Remediation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Remediation + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[_models.Remediation] = kwargs.pop("cls", None) + + _request = build_remediations_cancel_at_resource_request( + resource_id=resource_id, + remediation_name=remediation_name, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Remediation, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_deployments_at_management_group( + self, management_group_id: str, remediation_name: str, *, top: Optional[int] = None, **kwargs: Any + ) -> ItemPaged["_models.RemediationDeployment"]: + """Gets all deployments for a remediation at management group scope. + + :param management_group_id: Management group ID. Required. + :type management_group_id: str + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :return: An iterator like instance of RemediationDeployment + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.RemediationDeployment] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( + "management_groups_namespace", "Microsoft.Management" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[List[_models.RemediationDeployment]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_remediations_list_deployments_at_management_group_request( + management_group_id=management_group_id, + remediation_name=remediation_name, + top=top, + management_groups_namespace=management_groups_namespace, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.RemediationDeployment], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def cancel_at_management_group( + self, management_group_id: str, remediation_name: str, **kwargs: Any + ) -> _models.Remediation: + """Cancels a remediation at management group scope. + + :param management_group_id: Management group ID. Required. + :type management_group_id: str + :param remediation_name: The name of the remediation. Required. + :type remediation_name: str + :return: Remediation. The Remediation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Remediation + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( + "management_groups_namespace", "Microsoft.Management" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[_models.Remediation] = kwargs.pop("cls", None) + + _request = build_remediations_cancel_at_management_group_request( + management_group_id=management_group_id, + remediation_name=remediation_name, + management_groups_namespace=management_groups_namespace, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Remediation, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class AttestationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.policyinsights.PolicyInsightsClient`'s + :attr:`attestations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: PolicyInsightsClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get_at_subscription(self, attestation_name: str, **kwargs: Any) -> _models.Attestation: + """Gets an existing attestation at subscription scope. + + :param attestation_name: The name of the attestation. Required. + :type attestation_name: str + :return: Attestation. The Attestation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Attestation + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[_models.Attestation] = kwargs.pop("cls", None) + + _request = build_attestations_get_at_subscription_request( + attestation_name=attestation_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Attestation, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_at_subscription_initial( # pylint: disable=name-too-long + self, attestation_name: str, parameters: Union[_models.Attestation, JSON, IO[bytes]], **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_attestations_create_or_update_at_subscription_request( + attestation_name=attestation_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update_at_subscription( + self, + attestation_name: str, + parameters: _models.Attestation, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Attestation]: + """Creates or updates an attestation at subscription scope. + + :param attestation_name: The name of the attestation. Required. + :type attestation_name: str + :param parameters: The attestation parameters. Required. + :type parameters: ~azure.mgmt.policyinsights.models.Attestation + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Attestation. The Attestation is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.policyinsights.models.Attestation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update_at_subscription( + self, attestation_name: str, parameters: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> LROPoller[_models.Attestation]: + """Creates or updates an attestation at subscription scope. + + :param attestation_name: The name of the attestation. Required. + :type attestation_name: str + :param parameters: The attestation parameters. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Attestation. The Attestation is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.policyinsights.models.Attestation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update_at_subscription( + self, attestation_name: str, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> LROPoller[_models.Attestation]: + """Creates or updates an attestation at subscription scope. + + :param attestation_name: The name of the attestation. Required. + :type attestation_name: str + :param parameters: The attestation parameters. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Attestation. The Attestation is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.policyinsights.models.Attestation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update_at_subscription( + self, attestation_name: str, parameters: Union[_models.Attestation, JSON, IO[bytes]], **kwargs: Any + ) -> LROPoller[_models.Attestation]: + """Creates or updates an attestation at subscription scope. + + :param attestation_name: The name of the attestation. Required. + :type attestation_name: str + :param parameters: The attestation parameters. Is one of the following types: Attestation, + JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.policyinsights.models.Attestation or JSON or IO[bytes] + :return: An instance of LROPoller that returns Attestation. The Attestation is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.policyinsights.models.Attestation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Attestation] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_at_subscription_initial( + attestation_name=attestation_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Attestation, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Attestation].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Attestation]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def delete_at_subscription( # pylint: disable=inconsistent-return-statements + self, attestation_name: str, **kwargs: Any + ) -> None: + """Deletes an existing attestation at subscription scope. + + :param attestation_name: The name of the attestation. Required. + :type attestation_name: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_attestations_delete_at_subscription_request( + attestation_name=attestation_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_for_subscription( + self, *, top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any + ) -> ItemPaged["_models.Attestation"]: + """Gets all attestations for the subscription. + + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :return: An iterator like instance of Attestation + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.Attestation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[List[_models.Attestation]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_attestations_list_for_subscription_request( + subscription_id=self._config.subscription_id, + top=top, + filter=filter, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Attestation], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get_at_resource_group( + self, resource_group_name: str, attestation_name: str, **kwargs: Any + ) -> _models.Attestation: + """Gets an existing attestation at resource group scope. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param attestation_name: The name of the attestation. Required. + :type attestation_name: str + :return: Attestation. The Attestation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Attestation + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[_models.Attestation] = kwargs.pop("cls", None) + + _request = build_attestations_get_at_resource_group_request( + resource_group_name=resource_group_name, + attestation_name=attestation_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Attestation, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_at_resource_group_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + attestation_name: str, + parameters: Union[_models.Attestation, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_attestations_create_or_update_at_resource_group_request( + resource_group_name=resource_group_name, + attestation_name=attestation_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update_at_resource_group( + self, + resource_group_name: str, + attestation_name: str, + parameters: _models.Attestation, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Attestation]: + """Creates or updates an attestation at resource group scope. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param attestation_name: The name of the attestation. Required. + :type attestation_name: str + :param parameters: The attestation parameters. Required. + :type parameters: ~azure.mgmt.policyinsights.models.Attestation + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Attestation. The Attestation is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.policyinsights.models.Attestation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update_at_resource_group( + self, + resource_group_name: str, + attestation_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Attestation]: + """Creates or updates an attestation at resource group scope. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param attestation_name: The name of the attestation. Required. + :type attestation_name: str + :param parameters: The attestation parameters. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Attestation. The Attestation is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.policyinsights.models.Attestation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update_at_resource_group( + self, + resource_group_name: str, + attestation_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Attestation]: + """Creates or updates an attestation at resource group scope. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param attestation_name: The name of the attestation. Required. + :type attestation_name: str + :param parameters: The attestation parameters. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Attestation. The Attestation is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.policyinsights.models.Attestation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update_at_resource_group( + self, + resource_group_name: str, + attestation_name: str, + parameters: Union[_models.Attestation, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.Attestation]: + """Creates or updates an attestation at resource group scope. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param attestation_name: The name of the attestation. Required. + :type attestation_name: str + :param parameters: The attestation parameters. Is one of the following types: Attestation, + JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.policyinsights.models.Attestation or JSON or IO[bytes] + :return: An instance of LROPoller that returns Attestation. The Attestation is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.policyinsights.models.Attestation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Attestation] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_at_resource_group_initial( + resource_group_name=resource_group_name, + attestation_name=attestation_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Attestation, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Attestation].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Attestation]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def delete_at_resource_group( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, attestation_name: str, **kwargs: Any + ) -> None: + """Deletes an existing attestation at resource group scope. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param attestation_name: The name of the attestation. Required. + :type attestation_name: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_attestations_delete_at_resource_group_request( + resource_group_name=resource_group_name, + attestation_name=attestation_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_for_resource_group( + self, resource_group_name: str, *, top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any + ) -> ItemPaged["_models.Attestation"]: + """Gets all attestations for the resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :return: An iterator like instance of Attestation + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.Attestation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[List[_models.Attestation]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_attestations_list_for_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + top=top, + filter=filter, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Attestation], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get_at_resource(self, resource_id: str, attestation_name: str, **kwargs: Any) -> _models.Attestation: + """Gets an existing attestation at resource scope. + + :param resource_id: Resource ID. Required. + :type resource_id: str + :param attestation_name: The name of the attestation. Required. + :type attestation_name: str + :return: Attestation. The Attestation is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.Attestation + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[_models.Attestation] = kwargs.pop("cls", None) + + _request = build_attestations_get_at_resource_request( + resource_id=resource_id, + attestation_name=attestation_name, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Attestation, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_at_resource_initial( + self, + resource_id: str, + attestation_name: str, + parameters: Union[_models.Attestation, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_attestations_create_or_update_at_resource_request( + resource_id=resource_id, + attestation_name=attestation_name, + api_version=api_version, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update_at_resource( + self, + resource_id: str, + attestation_name: str, + parameters: _models.Attestation, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Attestation]: + """Creates or updates an attestation at resource scope. + + :param resource_id: Resource ID. Required. + :type resource_id: str + :param attestation_name: The name of the attestation. Required. + :type attestation_name: str + :param parameters: The attestation parameters. Required. + :type parameters: ~azure.mgmt.policyinsights.models.Attestation + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Attestation. The Attestation is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.policyinsights.models.Attestation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update_at_resource( + self, + resource_id: str, + attestation_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Attestation]: + """Creates or updates an attestation at resource scope. + + :param resource_id: Resource ID. Required. + :type resource_id: str + :param attestation_name: The name of the attestation. Required. + :type attestation_name: str + :param parameters: The attestation parameters. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Attestation. The Attestation is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.policyinsights.models.Attestation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update_at_resource( + self, + resource_id: str, + attestation_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Attestation]: + """Creates or updates an attestation at resource scope. + + :param resource_id: Resource ID. Required. + :type resource_id: str + :param attestation_name: The name of the attestation. Required. + :type attestation_name: str + :param parameters: The attestation parameters. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Attestation. The Attestation is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.policyinsights.models.Attestation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update_at_resource( + self, + resource_id: str, + attestation_name: str, + parameters: Union[_models.Attestation, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.Attestation]: + """Creates or updates an attestation at resource scope. + + :param resource_id: Resource ID. Required. + :type resource_id: str + :param attestation_name: The name of the attestation. Required. + :type attestation_name: str + :param parameters: The attestation parameters. Is one of the following types: Attestation, + JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.policyinsights.models.Attestation or JSON or IO[bytes] + :return: An instance of LROPoller that returns Attestation. The Attestation is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.policyinsights.models.Attestation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Attestation] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_at_resource_initial( + resource_id=resource_id, + attestation_name=attestation_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Attestation, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Attestation].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Attestation]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def delete_at_resource( # pylint: disable=inconsistent-return-statements + self, resource_id: str, attestation_name: str, **kwargs: Any + ) -> None: + """Deletes an existing attestation at individual resource scope. + + :param resource_id: Resource ID. Required. + :type resource_id: str + :param attestation_name: The name of the attestation. Required. + :type attestation_name: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_attestations_delete_at_resource_request( + resource_id=resource_id, + attestation_name=attestation_name, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_for_resource( + self, resource_id: str, *, top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any + ) -> ItemPaged["_models.Attestation"]: + """Gets all attestations for a resource. + + :param resource_id: Resource ID. Required. + :type resource_id: str + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :return: An iterator like instance of Attestation + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.Attestation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[List[_models.Attestation]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_attestations_list_for_resource_request( + resource_id=resource_id, + top=top, + filter=filter, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Attestation], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class PolicyMetadataOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.policyinsights.PolicyInsightsClient`'s + :attr:`policy_metadata` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: PolicyInsightsClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get_resource(self, resource_name: str, **kwargs: Any) -> _models.PolicyMetadata: + """Get policy metadata resource. + + :param resource_name: The name of the policy metadata resource. Required. + :type resource_name: str + :return: PolicyMetadata. The PolicyMetadata is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.PolicyMetadata + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[_models.PolicyMetadata] = kwargs.pop("cls", None) + + _request = build_policy_metadata_get_resource_request( + resource_name=resource_name, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.PolicyMetadata, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list(self, *, top: Optional[int] = None, **kwargs: Any) -> ItemPaged["_models.SlimPolicyMetadata"]: + """Get a list of the policy metadata resources. + + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :return: An iterator like instance of SlimPolicyMetadata + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.SlimPolicyMetadata] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[List[_models.SlimPolicyMetadata]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_policy_metadata_list_request( + top=top, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SlimPolicyMetadata], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class PolicyEventsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.policyinsights.PolicyInsightsClient`'s + :attr:`policy_events` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: PolicyInsightsClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_query_results_for_management_group( # pylint: disable=too-many-locals + self, + policy_events_resource: Union[str, _models.PolicyEventsResourceType], + management_group_name: str, + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.PolicyEvent"]: + """Queries policy events for the resources under the management group. + + :param policy_events_resource: The name of the virtual resource under PolicyEvents resource + type; only "default" is allowed. "default" Required. + :type policy_events_resource: str or ~azure.mgmt.policyinsights.models.PolicyEventsResourceType + :param management_group_name: Management group name. Required. + :type management_group_name: str + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword order_by: Ordering expression using OData notation. One or more comma-separated column + names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, + ResourceId asc". Default value is None. + :paramtype order_by: str + :keyword select: Select expression using OData notation. Limits the columns on each record to + just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Default value is None. + :paramtype select: str + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :keyword apply: OData apply expression for aggregations. Default value is None. + :paramtype apply: str + :keyword skip_token: Skiptoken is only provided if a previous response returned a partial + result as a part of nextLink element. Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of PolicyEvent + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.PolicyEvent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( + "management_groups_namespace", "Microsoft.Management" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[List[_models.PolicyEvent]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_policy_events_list_query_results_for_management_group_request( + policy_events_resource=policy_events_resource, + management_group_name=management_group_name, + top=top, + order_by=order_by, + select=select, + from_parameter=from_parameter, + to=to, + filter=filter, + apply=apply, + skip_token=skip_token, + management_groups_namespace=management_groups_namespace, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.PolicyEvent], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("@odata.nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_query_results_for_subscription( + self, + policy_events_resource: Union[str, _models.PolicyEventsResourceType], + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.PolicyEvent"]: + """Queries policy events for the resources under the subscription. + + :param policy_events_resource: The name of the virtual resource under PolicyEvents resource + type; only "default" is allowed. "default" Required. + :type policy_events_resource: str or ~azure.mgmt.policyinsights.models.PolicyEventsResourceType + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword order_by: Ordering expression using OData notation. One or more comma-separated column + names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, + ResourceId asc". Default value is None. + :paramtype order_by: str + :keyword select: Select expression using OData notation. Limits the columns on each record to + just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Default value is None. + :paramtype select: str + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :keyword apply: OData apply expression for aggregations. Default value is None. + :paramtype apply: str + :keyword skip_token: Skiptoken is only provided if a previous response returned a partial + result as a part of nextLink element. Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of PolicyEvent + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.PolicyEvent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[List[_models.PolicyEvent]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_policy_events_list_query_results_for_subscription_request( + policy_events_resource=policy_events_resource, + subscription_id=self._config.subscription_id, + top=top, + order_by=order_by, + select=select, + from_parameter=from_parameter, + to=to, + filter=filter, + apply=apply, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.PolicyEvent], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("@odata.nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_query_results_for_resource_group( + self, + resource_group_name: str, + policy_events_resource: Union[str, _models.PolicyEventsResourceType], + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.PolicyEvent"]: + """Queries policy events for the resources under the resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param policy_events_resource: The name of the virtual resource under PolicyEvents resource + type; only "default" is allowed. "default" Required. + :type policy_events_resource: str or ~azure.mgmt.policyinsights.models.PolicyEventsResourceType + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword order_by: Ordering expression using OData notation. One or more comma-separated column + names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, + ResourceId asc". Default value is None. + :paramtype order_by: str + :keyword select: Select expression using OData notation. Limits the columns on each record to + just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Default value is None. + :paramtype select: str + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :keyword apply: OData apply expression for aggregations. Default value is None. + :paramtype apply: str + :keyword skip_token: Skiptoken is only provided if a previous response returned a partial + result as a part of nextLink element. Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of PolicyEvent + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.PolicyEvent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[List[_models.PolicyEvent]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_policy_events_list_query_results_for_resource_group_request( + resource_group_name=resource_group_name, + policy_events_resource=policy_events_resource, + subscription_id=self._config.subscription_id, + top=top, + order_by=order_by, + select=select, + from_parameter=from_parameter, + to=to, + filter=filter, + apply=apply, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.PolicyEvent], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("@odata.nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_query_results_for_resource( # pylint: disable=too-many-locals + self, + policy_events_resource: Union[str, _models.PolicyEventsResourceType], + resource_id: str, + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + expand: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.PolicyEvent"]: + """Queries policy events for the resource. + + :param policy_events_resource: The name of the virtual resource under PolicyEvents resource + type; only "default" is allowed. "default" Required. + :type policy_events_resource: str or ~azure.mgmt.policyinsights.models.PolicyEventsResourceType + :param resource_id: Resource ID. Required. + :type resource_id: str + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword order_by: Ordering expression using OData notation. One or more comma-separated column + names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, + ResourceId asc". Default value is None. + :paramtype order_by: str + :keyword select: Select expression using OData notation. Limits the columns on each record to + just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Default value is None. + :paramtype select: str + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :keyword apply: OData apply expression for aggregations. Default value is None. + :paramtype apply: str + :keyword expand: The $expand query parameter. For example, to expand components use + $expand=components. Default value is None. + :paramtype expand: str + :keyword skip_token: Skiptoken is only provided if a previous response returned a partial + result as a part of nextLink element. Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of PolicyEvent + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.PolicyEvent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[List[_models.PolicyEvent]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_policy_events_list_query_results_for_resource_request( + policy_events_resource=policy_events_resource, + resource_id=resource_id, + top=top, + order_by=order_by, + select=select, + from_parameter=from_parameter, + to=to, + filter=filter, + apply=apply, + expand=expand, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.PolicyEvent], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("@odata.nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_query_results_for_policy_set_definition( # pylint: disable=name-too-long,too-many-locals + self, + policy_events_resource: Union[str, _models.PolicyEventsResourceType], + policy_set_definition_name: str, + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.PolicyEvent"]: + """Queries policy events for the subscription level policy set definition. + + :param policy_events_resource: The name of the virtual resource under PolicyEvents resource + type; only "default" is allowed. "default" Required. + :type policy_events_resource: str or ~azure.mgmt.policyinsights.models.PolicyEventsResourceType + :param policy_set_definition_name: Policy set definition name. Required. + :type policy_set_definition_name: str + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword order_by: Ordering expression using OData notation. One or more comma-separated column + names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, + ResourceId asc". Default value is None. + :paramtype order_by: str + :keyword select: Select expression using OData notation. Limits the columns on each record to + just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Default value is None. + :paramtype select: str + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :keyword apply: OData apply expression for aggregations. Default value is None. + :paramtype apply: str + :keyword skip_token: Skiptoken is only provided if a previous response returned a partial + result as a part of nextLink element. Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of PolicyEvent + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.PolicyEvent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( + "authorization_namespace", "Microsoft.Authorization" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[List[_models.PolicyEvent]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_policy_events_list_query_results_for_policy_set_definition_request( + policy_events_resource=policy_events_resource, + policy_set_definition_name=policy_set_definition_name, + subscription_id=self._config.subscription_id, + top=top, + order_by=order_by, + select=select, + from_parameter=from_parameter, + to=to, + filter=filter, + apply=apply, + skip_token=skip_token, + authorization_namespace=authorization_namespace, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.PolicyEvent], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("@odata.nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_query_results_for_policy_definition( # pylint: disable=too-many-locals + self, + policy_events_resource: Union[str, _models.PolicyEventsResourceType], + policy_definition_name: str, + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.PolicyEvent"]: + """Queries policy events for the subscription level policy definition. + + :param policy_events_resource: The name of the virtual resource under PolicyEvents resource + type; only "default" is allowed. "default" Required. + :type policy_events_resource: str or ~azure.mgmt.policyinsights.models.PolicyEventsResourceType + :param policy_definition_name: Policy definition name. Required. + :type policy_definition_name: str + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword order_by: Ordering expression using OData notation. One or more comma-separated column + names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, + ResourceId asc". Default value is None. + :paramtype order_by: str + :keyword select: Select expression using OData notation. Limits the columns on each record to + just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Default value is None. + :paramtype select: str + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :keyword apply: OData apply expression for aggregations. Default value is None. + :paramtype apply: str + :keyword skip_token: Skiptoken is only provided if a previous response returned a partial + result as a part of nextLink element. Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of PolicyEvent + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.PolicyEvent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( + "authorization_namespace", "Microsoft.Authorization" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[List[_models.PolicyEvent]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_policy_events_list_query_results_for_policy_definition_request( + policy_events_resource=policy_events_resource, + policy_definition_name=policy_definition_name, + subscription_id=self._config.subscription_id, + top=top, + order_by=order_by, + select=select, + from_parameter=from_parameter, + to=to, + filter=filter, + apply=apply, + skip_token=skip_token, + authorization_namespace=authorization_namespace, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.PolicyEvent], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("@odata.nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_query_results_for_subscription_level_policy_assignment( # pylint: disable=name-too-long,too-many-locals + self, + policy_events_resource: Union[str, _models.PolicyEventsResourceType], + policy_assignment_name: str, + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.PolicyEvent"]: + """Queries policy events for the subscription level policy assignment. + + :param policy_events_resource: The name of the virtual resource under PolicyEvents resource + type; only "default" is allowed. "default" Required. + :type policy_events_resource: str or ~azure.mgmt.policyinsights.models.PolicyEventsResourceType + :param policy_assignment_name: Policy assignment name. Required. + :type policy_assignment_name: str + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword order_by: Ordering expression using OData notation. One or more comma-separated column + names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, + ResourceId asc". Default value is None. + :paramtype order_by: str + :keyword select: Select expression using OData notation. Limits the columns on each record to + just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Default value is None. + :paramtype select: str + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :keyword apply: OData apply expression for aggregations. Default value is None. + :paramtype apply: str + :keyword skip_token: Skiptoken is only provided if a previous response returned a partial + result as a part of nextLink element. Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of PolicyEvent + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.PolicyEvent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( + "authorization_namespace", "Microsoft.Authorization" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[List[_models.PolicyEvent]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_policy_events_list_query_results_for_subscription_level_policy_assignment_request( + policy_events_resource=policy_events_resource, + policy_assignment_name=policy_assignment_name, + subscription_id=self._config.subscription_id, + top=top, + order_by=order_by, + select=select, + from_parameter=from_parameter, + to=to, + filter=filter, + apply=apply, + skip_token=skip_token, + authorization_namespace=authorization_namespace, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.PolicyEvent], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("@odata.nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_query_results_for_resource_group_level_policy_assignment( # pylint: disable=name-too-long,too-many-locals + self, + resource_group_name: str, + policy_events_resource: Union[str, _models.PolicyEventsResourceType], + policy_assignment_name: str, + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.PolicyEvent"]: + """Queries policy events for the resource group level policy assignment. + + :param resource_group_name: Resource group name. Required. + :type resource_group_name: str + :param policy_events_resource: The name of the virtual resource under PolicyEvents resource + type; only "default" is allowed. "default" Required. + :type policy_events_resource: str or ~azure.mgmt.policyinsights.models.PolicyEventsResourceType + :param policy_assignment_name: Policy assignment name. Required. + :type policy_assignment_name: str + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword order_by: Ordering expression using OData notation. One or more comma-separated column + names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, + ResourceId asc". Default value is None. + :paramtype order_by: str + :keyword select: Select expression using OData notation. Limits the columns on each record to + just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Default value is None. + :paramtype select: str + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :keyword apply: OData apply expression for aggregations. Default value is None. + :paramtype apply: str + :keyword skip_token: Skiptoken is only provided if a previous response returned a partial + result as a part of nextLink element. Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of PolicyEvent + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.PolicyEvent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( + "authorization_namespace", "Microsoft.Authorization" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[List[_models.PolicyEvent]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_policy_events_list_query_results_for_resource_group_level_policy_assignment_request( + resource_group_name=resource_group_name, + policy_events_resource=policy_events_resource, + policy_assignment_name=policy_assignment_name, + subscription_id=self._config.subscription_id, + top=top, + order_by=order_by, + select=select, + from_parameter=from_parameter, + to=to, + filter=filter, + apply=apply, + skip_token=skip_token, + authorization_namespace=authorization_namespace, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.PolicyEvent], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("@odata.nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class PolicyStatesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.policyinsights.PolicyInsightsClient`'s + :attr:`policy_states` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: PolicyInsightsClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_query_results_for_management_group( # pylint: disable=too-many-locals + self, + policy_states_resource: Union[str, _models.PolicyStatesResource], + management_group_name: str, + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.PolicyState"]: + """Queries policy states for the resources under the management group. + + :param policy_states_resource: The virtual resource under PolicyStates resource type. In a + given time range, 'latest' represents the latest policy state(s), whereas 'default' represents + all policy state(s). Known values are: "default" and "latest". Required. + :type policy_states_resource: str or ~azure.mgmt.policyinsights.models.PolicyStatesResource + :param management_group_name: Management group name. Required. + :type management_group_name: str + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword order_by: Ordering expression using OData notation. One or more comma-separated column + names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, + ResourceId asc". Default value is None. + :paramtype order_by: str + :keyword select: Select expression using OData notation. Limits the columns on each record to + just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Default value is None. + :paramtype select: str + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :keyword apply: OData apply expression for aggregations. Default value is None. + :paramtype apply: str + :keyword skip_token: Skiptoken is only provided if a previous response returned a partial + result as a part of nextLink element. Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of PolicyState + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.PolicyState] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( + "management_groups_namespace", "Microsoft.Management" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[List[_models.PolicyState]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_policy_states_list_query_results_for_management_group_request( + policy_states_resource=policy_states_resource, + management_group_name=management_group_name, + top=top, + order_by=order_by, + select=select, + from_parameter=from_parameter, + to=to, + filter=filter, + apply=apply, + skip_token=skip_token, + management_groups_namespace=management_groups_namespace, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.PolicyState], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("@odata.nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def summarize_for_management_group( + self, + policy_states_summary_resource: Union[str, _models.PolicyStatesSummaryResourceType], + management_group_name: str, + *, + top: Optional[int] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> _models.SummarizeResults: + """Summarizes policy states for the resources under the management group. + + :param policy_states_summary_resource: The virtual resource under PolicyStates resource type + for summarize action. In a given time range, 'latest' represents the latest policy state(s) and + is the only allowed value. "latest" Required. + :type policy_states_summary_resource: str or + ~azure.mgmt.policyinsights.models.PolicyStatesSummaryResourceType + :param management_group_name: Management group name. Required. + :type management_group_name: str + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :return: SummarizeResults. The SummarizeResults is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.SummarizeResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( + "management_groups_namespace", "Microsoft.Management" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[_models.SummarizeResults] = kwargs.pop("cls", None) + + _request = build_policy_states_summarize_for_management_group_request( + policy_states_summary_resource=policy_states_summary_resource, + management_group_name=management_group_name, + top=top, + from_parameter=from_parameter, + to=to, + filter=filter, + management_groups_namespace=management_groups_namespace, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SummarizeResults, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_query_results_for_subscription( + self, + policy_states_resource: Union[str, _models.PolicyStatesResource], + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.PolicyState"]: + """Queries policy states for the resources under the subscription. + + :param policy_states_resource: The virtual resource under PolicyStates resource type. In a + given time range, 'latest' represents the latest policy state(s), whereas 'default' represents + all policy state(s). Known values are: "default" and "latest". Required. + :type policy_states_resource: str or ~azure.mgmt.policyinsights.models.PolicyStatesResource + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword order_by: Ordering expression using OData notation. One or more comma-separated column + names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, + ResourceId asc". Default value is None. + :paramtype order_by: str + :keyword select: Select expression using OData notation. Limits the columns on each record to + just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Default value is None. + :paramtype select: str + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :keyword apply: OData apply expression for aggregations. Default value is None. + :paramtype apply: str + :keyword skip_token: Skiptoken is only provided if a previous response returned a partial + result as a part of nextLink element. Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of PolicyState + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.PolicyState] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[List[_models.PolicyState]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_policy_states_list_query_results_for_subscription_request( + policy_states_resource=policy_states_resource, + subscription_id=self._config.subscription_id, + top=top, + order_by=order_by, + select=select, + from_parameter=from_parameter, + to=to, + filter=filter, + apply=apply, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.PolicyState], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("@odata.nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def summarize_for_subscription( + self, + policy_states_summary_resource: Union[str, _models.PolicyStatesSummaryResourceType], + *, + top: Optional[int] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> _models.SummarizeResults: + """Summarizes policy states for the resources under the subscription. + + :param policy_states_summary_resource: The virtual resource under PolicyStates resource type + for summarize action. In a given time range, 'latest' represents the latest policy state(s) and + is the only allowed value. "latest" Required. + :type policy_states_summary_resource: str or + ~azure.mgmt.policyinsights.models.PolicyStatesSummaryResourceType + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :return: SummarizeResults. The SummarizeResults is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.SummarizeResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[_models.SummarizeResults] = kwargs.pop("cls", None) + + _request = build_policy_states_summarize_for_subscription_request( + policy_states_summary_resource=policy_states_summary_resource, + subscription_id=self._config.subscription_id, + top=top, + from_parameter=from_parameter, + to=to, + filter=filter, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SummarizeResults, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_query_results_for_resource_group( + self, + resource_group_name: str, + policy_states_resource: Union[str, _models.PolicyStatesResource], + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.PolicyState"]: + """Queries policy states for the resources under the resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param policy_states_resource: The virtual resource under PolicyStates resource type. In a + given time range, 'latest' represents the latest policy state(s), whereas 'default' represents + all policy state(s). Known values are: "default" and "latest". Required. + :type policy_states_resource: str or ~azure.mgmt.policyinsights.models.PolicyStatesResource + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword order_by: Ordering expression using OData notation. One or more comma-separated column + names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, + ResourceId asc". Default value is None. + :paramtype order_by: str + :keyword select: Select expression using OData notation. Limits the columns on each record to + just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Default value is None. + :paramtype select: str + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :keyword apply: OData apply expression for aggregations. Default value is None. + :paramtype apply: str + :keyword skip_token: Skiptoken is only provided if a previous response returned a partial + result as a part of nextLink element. Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of PolicyState + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.PolicyState] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[List[_models.PolicyState]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_policy_states_list_query_results_for_resource_group_request( + resource_group_name=resource_group_name, + policy_states_resource=policy_states_resource, + subscription_id=self._config.subscription_id, + top=top, + order_by=order_by, + select=select, + from_parameter=from_parameter, + to=to, + filter=filter, + apply=apply, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.PolicyState], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("@odata.nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def summarize_for_resource_group( + self, + resource_group_name: str, + policy_states_summary_resource: Union[str, _models.PolicyStatesSummaryResourceType], + *, + top: Optional[int] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> _models.SummarizeResults: + """Summarizes policy states for the resources under the resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param policy_states_summary_resource: The virtual resource under PolicyStates resource type + for summarize action. In a given time range, 'latest' represents the latest policy state(s) and + is the only allowed value. "latest" Required. + :type policy_states_summary_resource: str or + ~azure.mgmt.policyinsights.models.PolicyStatesSummaryResourceType + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :return: SummarizeResults. The SummarizeResults is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.SummarizeResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[_models.SummarizeResults] = kwargs.pop("cls", None) + + _request = build_policy_states_summarize_for_resource_group_request( + resource_group_name=resource_group_name, + policy_states_summary_resource=policy_states_summary_resource, + subscription_id=self._config.subscription_id, + top=top, + from_parameter=from_parameter, + to=to, + filter=filter, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SummarizeResults, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_query_results_for_resource( # pylint: disable=too-many-locals + self, + policy_states_resource: Union[str, _models.PolicyStatesResource], + resource_id: str, + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + expand: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.PolicyState"]: + """Queries policy states for the resource. + + :param policy_states_resource: The virtual resource under PolicyStates resource type. In a + given time range, 'latest' represents the latest policy state(s), whereas 'default' represents + all policy state(s). Known values are: "default" and "latest". Required. + :type policy_states_resource: str or ~azure.mgmt.policyinsights.models.PolicyStatesResource + :param resource_id: Resource ID. Required. + :type resource_id: str + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword order_by: Ordering expression using OData notation. One or more comma-separated column + names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, + ResourceId asc". Default value is None. + :paramtype order_by: str + :keyword select: Select expression using OData notation. Limits the columns on each record to + just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Default value is None. + :paramtype select: str + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :keyword apply: OData apply expression for aggregations. Default value is None. + :paramtype apply: str + :keyword expand: The $expand query parameter. For example, to expand components use + $expand=components. Default value is None. + :paramtype expand: str + :keyword skip_token: Skiptoken is only provided if a previous response returned a partial + result as a part of nextLink element. Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of PolicyState + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.PolicyState] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[List[_models.PolicyState]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_policy_states_list_query_results_for_resource_request( + policy_states_resource=policy_states_resource, + resource_id=resource_id, + top=top, + order_by=order_by, + select=select, + from_parameter=from_parameter, + to=to, + filter=filter, + apply=apply, + expand=expand, + skip_token=skip_token, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.PolicyState], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("@odata.nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def summarize_for_resource( + self, + policy_states_summary_resource: Union[str, _models.PolicyStatesSummaryResourceType], + resource_id: str, + *, + top: Optional[int] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> _models.SummarizeResults: + """Summarizes policy states for the resource. + + :param policy_states_summary_resource: The virtual resource under PolicyStates resource type + for summarize action. In a given time range, 'latest' represents the latest policy state(s) and + is the only allowed value. "latest" Required. + :type policy_states_summary_resource: str or + ~azure.mgmt.policyinsights.models.PolicyStatesSummaryResourceType + :param resource_id: Resource ID. Required. + :type resource_id: str + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :return: SummarizeResults. The SummarizeResults is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.SummarizeResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[_models.SummarizeResults] = kwargs.pop("cls", None) + + _request = build_policy_states_summarize_for_resource_request( + policy_states_summary_resource=policy_states_summary_resource, + resource_id=resource_id, + top=top, + from_parameter=from_parameter, + to=to, + filter=filter, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SummarizeResults, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _trigger_subscription_evaluation_initial(self, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_policy_states_trigger_subscription_evaluation_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_trigger_subscription_evaluation(self, **kwargs: Any) -> LROPoller[None]: + """Triggers a policy evaluation scan for all the resources under the subscription. + + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._trigger_subscription_evaluation_initial( + api_version=api_version, cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _trigger_resource_group_evaluation_initial( # pylint: disable=name-too-long + self, resource_group_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_policy_states_trigger_resource_group_evaluation_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_trigger_resource_group_evaluation(self, resource_group_name: str, **kwargs: Any) -> LROPoller[None]: + """Triggers a policy evaluation scan for all the resources under the resource group. + + :param resource_group_name: Resource group name. Required. + :type resource_group_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._trigger_resource_group_evaluation_initial( + resource_group_name=resource_group_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_query_results_for_policy_set_definition( # pylint: disable=name-too-long,too-many-locals + self, + policy_states_resource: Union[str, _models.PolicyStatesResource], + policy_set_definition_name: str, + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.PolicyState"]: + """Queries policy states for the subscription level policy set definition. + + :param policy_states_resource: The virtual resource under PolicyStates resource type. In a + given time range, 'latest' represents the latest policy state(s), whereas 'default' represents + all policy state(s). Known values are: "default" and "latest". Required. + :type policy_states_resource: str or ~azure.mgmt.policyinsights.models.PolicyStatesResource + :param policy_set_definition_name: Policy set definition name. Required. + :type policy_set_definition_name: str + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword order_by: Ordering expression using OData notation. One or more comma-separated column + names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, + ResourceId asc". Default value is None. + :paramtype order_by: str + :keyword select: Select expression using OData notation. Limits the columns on each record to + just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Default value is None. + :paramtype select: str + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :keyword apply: OData apply expression for aggregations. Default value is None. + :paramtype apply: str + :keyword skip_token: Skiptoken is only provided if a previous response returned a partial + result as a part of nextLink element. Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of PolicyState + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.PolicyState] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( + "authorization_namespace", "Microsoft.Authorization" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[List[_models.PolicyState]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_policy_states_list_query_results_for_policy_set_definition_request( + policy_states_resource=policy_states_resource, + policy_set_definition_name=policy_set_definition_name, + subscription_id=self._config.subscription_id, + top=top, + order_by=order_by, + select=select, + from_parameter=from_parameter, + to=to, + filter=filter, + apply=apply, + skip_token=skip_token, + authorization_namespace=authorization_namespace, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.PolicyState], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("@odata.nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def summarize_for_policy_set_definition( + self, + policy_states_summary_resource: Union[str, _models.PolicyStatesSummaryResourceType], + policy_set_definition_name: str, + *, + top: Optional[int] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> _models.SummarizeResults: + """Summarizes policy states for the subscription level policy set definition. + + :param policy_states_summary_resource: The virtual resource under PolicyStates resource type + for summarize action. In a given time range, 'latest' represents the latest policy state(s) and + is the only allowed value. "latest" Required. + :type policy_states_summary_resource: str or + ~azure.mgmt.policyinsights.models.PolicyStatesSummaryResourceType + :param policy_set_definition_name: Policy set definition name. Required. + :type policy_set_definition_name: str + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :return: SummarizeResults. The SummarizeResults is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.SummarizeResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( + "authorization_namespace", "Microsoft.Authorization" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[_models.SummarizeResults] = kwargs.pop("cls", None) + + _request = build_policy_states_summarize_for_policy_set_definition_request( + policy_states_summary_resource=policy_states_summary_resource, + policy_set_definition_name=policy_set_definition_name, + subscription_id=self._config.subscription_id, + top=top, + from_parameter=from_parameter, + to=to, + filter=filter, + authorization_namespace=authorization_namespace, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SummarizeResults, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_query_results_for_policy_definition( # pylint: disable=too-many-locals + self, + policy_states_resource: Union[str, _models.PolicyStatesResource], + policy_definition_name: str, + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.PolicyState"]: + """Queries policy states for the subscription level policy definition. + + :param policy_states_resource: The virtual resource under PolicyStates resource type. In a + given time range, 'latest' represents the latest policy state(s), whereas 'default' represents + all policy state(s). Known values are: "default" and "latest". Required. + :type policy_states_resource: str or ~azure.mgmt.policyinsights.models.PolicyStatesResource + :param policy_definition_name: Policy definition name. Required. + :type policy_definition_name: str + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword order_by: Ordering expression using OData notation. One or more comma-separated column + names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, + ResourceId asc". Default value is None. + :paramtype order_by: str + :keyword select: Select expression using OData notation. Limits the columns on each record to + just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Default value is None. + :paramtype select: str + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :keyword apply: OData apply expression for aggregations. Default value is None. + :paramtype apply: str + :keyword skip_token: Skiptoken is only provided if a previous response returned a partial + result as a part of nextLink element. Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of PolicyState + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.PolicyState] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( + "authorization_namespace", "Microsoft.Authorization" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[List[_models.PolicyState]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_policy_states_list_query_results_for_policy_definition_request( + policy_states_resource=policy_states_resource, + policy_definition_name=policy_definition_name, + subscription_id=self._config.subscription_id, + top=top, + order_by=order_by, + select=select, + from_parameter=from_parameter, + to=to, + filter=filter, + apply=apply, + skip_token=skip_token, + authorization_namespace=authorization_namespace, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.PolicyState], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("@odata.nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def summarize_for_policy_definition( + self, + policy_states_summary_resource: Union[str, _models.PolicyStatesSummaryResourceType], + policy_definition_name: str, + *, + top: Optional[int] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> _models.SummarizeResults: + """Summarizes policy states for the subscription level policy definition. + + :param policy_states_summary_resource: The virtual resource under PolicyStates resource type + for summarize action. In a given time range, 'latest' represents the latest policy state(s) and + is the only allowed value. "latest" Required. + :type policy_states_summary_resource: str or + ~azure.mgmt.policyinsights.models.PolicyStatesSummaryResourceType + :param policy_definition_name: Policy definition name. Required. + :type policy_definition_name: str + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :return: SummarizeResults. The SummarizeResults is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.SummarizeResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( + "authorization_namespace", "Microsoft.Authorization" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[_models.SummarizeResults] = kwargs.pop("cls", None) + + _request = build_policy_states_summarize_for_policy_definition_request( + policy_states_summary_resource=policy_states_summary_resource, + policy_definition_name=policy_definition_name, + subscription_id=self._config.subscription_id, + top=top, + from_parameter=from_parameter, + to=to, + filter=filter, + authorization_namespace=authorization_namespace, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SummarizeResults, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_query_results_for_subscription_level_policy_assignment( # pylint: disable=name-too-long,too-many-locals + self, + policy_states_resource: Union[str, _models.PolicyStatesResource], + policy_assignment_name: str, + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.PolicyState"]: + """Queries policy states for the subscription level policy assignment. + + :param policy_states_resource: The virtual resource under PolicyStates resource type. In a + given time range, 'latest' represents the latest policy state(s), whereas 'default' represents + all policy state(s). Known values are: "default" and "latest". Required. + :type policy_states_resource: str or ~azure.mgmt.policyinsights.models.PolicyStatesResource + :param policy_assignment_name: Policy assignment name. Required. + :type policy_assignment_name: str + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword order_by: Ordering expression using OData notation. One or more comma-separated column + names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, + ResourceId asc". Default value is None. + :paramtype order_by: str + :keyword select: Select expression using OData notation. Limits the columns on each record to + just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Default value is None. + :paramtype select: str + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :keyword apply: OData apply expression for aggregations. Default value is None. + :paramtype apply: str + :keyword skip_token: Skiptoken is only provided if a previous response returned a partial + result as a part of nextLink element. Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of PolicyState + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.PolicyState] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( + "authorization_namespace", "Microsoft.Authorization" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[List[_models.PolicyState]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_policy_states_list_query_results_for_subscription_level_policy_assignment_request( + policy_states_resource=policy_states_resource, + policy_assignment_name=policy_assignment_name, + subscription_id=self._config.subscription_id, + top=top, + order_by=order_by, + select=select, + from_parameter=from_parameter, + to=to, + filter=filter, + apply=apply, + skip_token=skip_token, + authorization_namespace=authorization_namespace, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.PolicyState], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("@odata.nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def summarize_for_subscription_level_policy_assignment( # pylint: disable=name-too-long + self, + policy_states_summary_resource: Union[str, _models.PolicyStatesSummaryResourceType], + policy_assignment_name: str, + *, + top: Optional[int] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> _models.SummarizeResults: + """Summarizes policy states for the subscription level policy assignment. + + :param policy_states_summary_resource: The virtual resource under PolicyStates resource type + for summarize action. In a given time range, 'latest' represents the latest policy state(s) and + is the only allowed value. "latest" Required. + :type policy_states_summary_resource: str or + ~azure.mgmt.policyinsights.models.PolicyStatesSummaryResourceType + :param policy_assignment_name: Policy assignment name. Required. + :type policy_assignment_name: str + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :return: SummarizeResults. The SummarizeResults is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.SummarizeResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( + "authorization_namespace", "Microsoft.Authorization" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[_models.SummarizeResults] = kwargs.pop("cls", None) + + _request = build_policy_states_summarize_for_subscription_level_policy_assignment_request( + policy_states_summary_resource=policy_states_summary_resource, + policy_assignment_name=policy_assignment_name, + subscription_id=self._config.subscription_id, + top=top, + from_parameter=from_parameter, + to=to, + filter=filter, + authorization_namespace=authorization_namespace, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SummarizeResults, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_query_results_for_resource_group_level_policy_assignment( # pylint: disable=name-too-long,too-many-locals + self, + resource_group_name: str, + policy_states_resource: Union[str, _models.PolicyStatesResource], + policy_assignment_name: str, + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.PolicyState"]: + """Queries policy states for the resource group level policy assignment. + + :param resource_group_name: Resource group name. Required. + :type resource_group_name: str + :param policy_states_resource: The virtual resource under PolicyStates resource type. In a + given time range, 'latest' represents the latest policy state(s), whereas 'default' represents + all policy state(s). Known values are: "default" and "latest". Required. + :type policy_states_resource: str or ~azure.mgmt.policyinsights.models.PolicyStatesResource + :param policy_assignment_name: Policy assignment name. Required. + :type policy_assignment_name: str + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword order_by: Ordering expression using OData notation. One or more comma-separated column + names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, + ResourceId asc". Default value is None. + :paramtype order_by: str + :keyword select: Select expression using OData notation. Limits the columns on each record to + just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Default value is None. + :paramtype select: str + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :keyword apply: OData apply expression for aggregations. Default value is None. + :paramtype apply: str + :keyword skip_token: Skiptoken is only provided if a previous response returned a partial + result as a part of nextLink element. Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of PolicyState + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.PolicyState] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( + "authorization_namespace", "Microsoft.Authorization" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[List[_models.PolicyState]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_policy_states_list_query_results_for_resource_group_level_policy_assignment_request( + resource_group_name=resource_group_name, + policy_states_resource=policy_states_resource, + policy_assignment_name=policy_assignment_name, + subscription_id=self._config.subscription_id, + top=top, + order_by=order_by, + select=select, + from_parameter=from_parameter, + to=to, + filter=filter, + apply=apply, + skip_token=skip_token, + authorization_namespace=authorization_namespace, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.PolicyState], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("@odata.nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def summarize_for_resource_group_level_policy_assignment( # pylint: disable=name-too-long + self, + resource_group_name: str, + policy_states_summary_resource: Union[str, _models.PolicyStatesSummaryResourceType], + policy_assignment_name: str, + *, + top: Optional[int] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> _models.SummarizeResults: + """Summarizes policy states for the resource group level policy assignment. + + :param resource_group_name: Resource group name. Required. + :type resource_group_name: str + :param policy_states_summary_resource: The virtual resource under PolicyStates resource type + for summarize action. In a given time range, 'latest' represents the latest policy state(s) and + is the only allowed value. "latest" Required. + :type policy_states_summary_resource: str or + ~azure.mgmt.policyinsights.models.PolicyStatesSummaryResourceType + :param policy_assignment_name: Policy assignment name. Required. + :type policy_assignment_name: str + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :return: SummarizeResults. The SummarizeResults is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.SummarizeResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( + "authorization_namespace", "Microsoft.Authorization" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[_models.SummarizeResults] = kwargs.pop("cls", None) + + _request = build_policy_states_summarize_for_resource_group_level_policy_assignment_request( + resource_group_name=resource_group_name, + policy_states_summary_resource=policy_states_summary_resource, + policy_assignment_name=policy_assignment_name, + subscription_id=self._config.subscription_id, + top=top, + from_parameter=from_parameter, + to=to, + filter=filter, + authorization_namespace=authorization_namespace, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SummarizeResults, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class PolicyRestrictionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.policyinsights.PolicyInsightsClient`'s + :attr:`policy_restrictions` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: PolicyInsightsClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + def check_at_subscription_scope( + self, parameters: _models.CheckRestrictionsRequest, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.CheckRestrictionsResult: + """Checks what restrictions Azure Policy will place on a resource within a subscription. + + :param parameters: The request body. Required. + :type parameters: ~azure.mgmt.policyinsights.models.CheckRestrictionsRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: CheckRestrictionsResult. The CheckRestrictionsResult is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.CheckRestrictionsResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def check_at_subscription_scope( + self, parameters: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.CheckRestrictionsResult: + """Checks what restrictions Azure Policy will place on a resource within a subscription. + + :param parameters: The request body. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: CheckRestrictionsResult. The CheckRestrictionsResult is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.CheckRestrictionsResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def check_at_subscription_scope( + self, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.CheckRestrictionsResult: + """Checks what restrictions Azure Policy will place on a resource within a subscription. + + :param parameters: The request body. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: CheckRestrictionsResult. The CheckRestrictionsResult is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.CheckRestrictionsResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def check_at_subscription_scope( + self, parameters: Union[_models.CheckRestrictionsRequest, JSON, IO[bytes]], **kwargs: Any + ) -> _models.CheckRestrictionsResult: + """Checks what restrictions Azure Policy will place on a resource within a subscription. + + :param parameters: The request body. Is one of the following types: CheckRestrictionsRequest, + JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.policyinsights.models.CheckRestrictionsRequest or JSON or + IO[bytes] + :return: CheckRestrictionsResult. The CheckRestrictionsResult is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.CheckRestrictionsResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CheckRestrictionsResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_policy_restrictions_check_at_subscription_scope_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.CheckRestrictionsResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def check_at_resource_group_scope( + self, + resource_group_name: str, + parameters: _models.CheckRestrictionsRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.CheckRestrictionsResult: + """Checks what restrictions Azure Policy will place on a resource within a resource group. Use + this when the resource group the resource will be created in is already known. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param parameters: The request body. Required. + :type parameters: ~azure.mgmt.policyinsights.models.CheckRestrictionsRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: CheckRestrictionsResult. The CheckRestrictionsResult is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.CheckRestrictionsResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def check_at_resource_group_scope( + self, resource_group_name: str, parameters: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.CheckRestrictionsResult: + """Checks what restrictions Azure Policy will place on a resource within a resource group. Use + this when the resource group the resource will be created in is already known. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param parameters: The request body. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: CheckRestrictionsResult. The CheckRestrictionsResult is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.CheckRestrictionsResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def check_at_resource_group_scope( + self, resource_group_name: str, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.CheckRestrictionsResult: + """Checks what restrictions Azure Policy will place on a resource within a resource group. Use + this when the resource group the resource will be created in is already known. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param parameters: The request body. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: CheckRestrictionsResult. The CheckRestrictionsResult is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.CheckRestrictionsResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def check_at_resource_group_scope( + self, + resource_group_name: str, + parameters: Union[_models.CheckRestrictionsRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.CheckRestrictionsResult: + """Checks what restrictions Azure Policy will place on a resource within a resource group. Use + this when the resource group the resource will be created in is already known. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param parameters: The request body. Is one of the following types: CheckRestrictionsRequest, + JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.policyinsights.models.CheckRestrictionsRequest or JSON or + IO[bytes] + :return: CheckRestrictionsResult. The CheckRestrictionsResult is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.CheckRestrictionsResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CheckRestrictionsResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_policy_restrictions_check_at_resource_group_scope_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.CheckRestrictionsResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def check_at_management_group_scope( + self, + management_group_id: str, + parameters: _models.CheckManagementGroupRestrictionsRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.CheckRestrictionsResult: + """Checks what restrictions Azure Policy will place on resources within a management group. + + :param management_group_id: Management group ID. Required. + :type management_group_id: str + :param parameters: The check policy restrictions parameters. Required. + :type parameters: ~azure.mgmt.policyinsights.models.CheckManagementGroupRestrictionsRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: CheckRestrictionsResult. The CheckRestrictionsResult is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.CheckRestrictionsResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def check_at_management_group_scope( + self, management_group_id: str, parameters: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.CheckRestrictionsResult: + """Checks what restrictions Azure Policy will place on resources within a management group. + + :param management_group_id: Management group ID. Required. + :type management_group_id: str + :param parameters: The check policy restrictions parameters. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: CheckRestrictionsResult. The CheckRestrictionsResult is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.CheckRestrictionsResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def check_at_management_group_scope( + self, management_group_id: str, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.CheckRestrictionsResult: + """Checks what restrictions Azure Policy will place on resources within a management group. + + :param management_group_id: Management group ID. Required. + :type management_group_id: str + :param parameters: The check policy restrictions parameters. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: CheckRestrictionsResult. The CheckRestrictionsResult is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.CheckRestrictionsResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def check_at_management_group_scope( + self, + management_group_id: str, + parameters: Union[_models.CheckManagementGroupRestrictionsRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.CheckRestrictionsResult: + """Checks what restrictions Azure Policy will place on resources within a management group. + + :param management_group_id: Management group ID. Required. + :type management_group_id: str + :param parameters: The check policy restrictions parameters. Is one of the following types: + CheckManagementGroupRestrictionsRequest, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.policyinsights.models.CheckManagementGroupRestrictionsRequest or + JSON or IO[bytes] + :return: CheckRestrictionsResult. The CheckRestrictionsResult is compatible with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.CheckRestrictionsResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( + "management_groups_namespace", "Microsoft.Management" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CheckRestrictionsResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_policy_restrictions_check_at_management_group_scope_request( + management_group_id=management_group_id, + management_groups_namespace=management_groups_namespace, + api_version=api_version, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.CheckRestrictionsResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class ComponentPolicyStatesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.policyinsights.PolicyInsightsClient`'s + :attr:`component_policy_states` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: PolicyInsightsClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_query_results_for_subscription( + self, + component_policy_states_resource: Union[str, _models.ComponentPolicyStatesResource], + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + **kwargs: Any + ) -> _models.ComponentPolicyStatesQueryResults: + """Queries component policy states under subscription scope. + + :param component_policy_states_resource: The virtual resource under ComponentPolicyStates + resource type. In a given time range, 'latest' represents the latest component policy state(s). + "latest" Required. + :type component_policy_states_resource: str or + ~azure.mgmt.policyinsights.models.ComponentPolicyStatesResource + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword order_by: Ordering expression using OData notation. One or more comma-separated column + names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, + ResourceId asc". Default value is None. + :paramtype order_by: str + :keyword select: Select expression using OData notation. Limits the columns on each record to + just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Default value is None. + :paramtype select: str + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :keyword apply: OData apply expression for aggregations. Default value is None. + :paramtype apply: str + :return: ComponentPolicyStatesQueryResults. The ComponentPolicyStatesQueryResults is compatible + with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.ComponentPolicyStatesQueryResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[_models.ComponentPolicyStatesQueryResults] = kwargs.pop("cls", None) + + _request = build_component_policy_states_list_query_results_for_subscription_request( + component_policy_states_resource=component_policy_states_resource, + subscription_id=self._config.subscription_id, + top=top, + order_by=order_by, + select=select, + from_parameter=from_parameter, + to=to, + filter=filter, + apply=apply, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ComponentPolicyStatesQueryResults, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_query_results_for_resource_group( + self, + resource_group_name: str, + component_policy_states_resource: Union[str, _models.ComponentPolicyStatesResource], + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + **kwargs: Any + ) -> _models.ComponentPolicyStatesQueryResults: + """Queries component policy states under resource group scope. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param component_policy_states_resource: The virtual resource under ComponentPolicyStates + resource type. In a given time range, 'latest' represents the latest component policy state(s). + "latest" Required. + :type component_policy_states_resource: str or + ~azure.mgmt.policyinsights.models.ComponentPolicyStatesResource + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword order_by: Ordering expression using OData notation. One or more comma-separated column + names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, + ResourceId asc". Default value is None. + :paramtype order_by: str + :keyword select: Select expression using OData notation. Limits the columns on each record to + just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Default value is None. + :paramtype select: str + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :keyword apply: OData apply expression for aggregations. Default value is None. + :paramtype apply: str + :return: ComponentPolicyStatesQueryResults. The ComponentPolicyStatesQueryResults is compatible + with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.ComponentPolicyStatesQueryResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[_models.ComponentPolicyStatesQueryResults] = kwargs.pop("cls", None) + + _request = build_component_policy_states_list_query_results_for_resource_group_request( + resource_group_name=resource_group_name, + component_policy_states_resource=component_policy_states_resource, + subscription_id=self._config.subscription_id, + top=top, + order_by=order_by, + select=select, + from_parameter=from_parameter, + to=to, + filter=filter, + apply=apply, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ComponentPolicyStatesQueryResults, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore - models = _models + @distributed_trace + def list_query_results_for_resource( + self, + resource_id: str, + component_policy_states_resource: Union[str, _models.ComponentPolicyStatesResource], + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + expand: Optional[str] = None, + **kwargs: Any + ) -> _models.ComponentPolicyStatesQueryResults: + """Queries component policy states for the resource. - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: PolicyInsightsClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + :param resource_id: Resource ID. Required. + :type resource_id: str + :param component_policy_states_resource: The virtual resource under ComponentPolicyStates + resource type. In a given time range, 'latest' represents the latest component policy state(s). + "latest" Required. + :type component_policy_states_resource: str or + ~azure.mgmt.policyinsights.models.ComponentPolicyStatesResource + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword order_by: Ordering expression using OData notation. One or more comma-separated column + names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, + ResourceId asc". Default value is None. + :paramtype order_by: str + :keyword select: Select expression using OData notation. Limits the columns on each record to + just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Default value is None. + :paramtype select: str + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :keyword apply: OData apply expression for aggregations. Default value is None. + :paramtype apply: str + :keyword expand: The $expand query parameter. Default value is None. + :paramtype expand: str + :return: ComponentPolicyStatesQueryResults. The ComponentPolicyStatesQueryResults is compatible + with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.ComponentPolicyStatesQueryResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[_models.ComponentPolicyStatesQueryResults] = kwargs.pop("cls", None) + + _request = build_component_policy_states_list_query_results_for_resource_request( + resource_id=resource_id, + component_policy_states_resource=component_policy_states_resource, + top=top, + order_by=order_by, + select=select, + from_parameter=from_parameter, + to=to, + filter=filter, + apply=apply, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ComponentPolicyStatesQueryResults, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore @distributed_trace - def list(self, **kwargs: Any) -> _models.OperationsListResults: - """Lists available operations. + def list_query_results_for_policy_definition( + self, + policy_definition_name: str, + component_policy_states_resource: Union[str, _models.ComponentPolicyStatesResource], + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + **kwargs: Any + ) -> _models.ComponentPolicyStatesQueryResults: + """Queries component policy states for the subscription level policy definition. - :return: OperationsListResults or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.OperationsListResults + :param policy_definition_name: Policy definition name. Required. + :type policy_definition_name: str + :param component_policy_states_resource: The virtual resource under ComponentPolicyStates + resource type. In a given time range, 'latest' represents the latest component policy state(s). + "latest" Required. + :type component_policy_states_resource: str or + ~azure.mgmt.policyinsights.models.ComponentPolicyStatesResource + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword order_by: Ordering expression using OData notation. One or more comma-separated column + names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, + ResourceId asc". Default value is None. + :paramtype order_by: str + :keyword select: Select expression using OData notation. Limits the columns on each record to + just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Default value is None. + :paramtype select: str + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :keyword apply: OData apply expression for aggregations. Default value is None. + :paramtype apply: str + :return: ComponentPolicyStatesQueryResults. The ComponentPolicyStatesQueryResults is compatible + with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.ComponentPolicyStatesQueryResults :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -91,17 +11032,273 @@ def list(self, **kwargs: Any) -> _models.OperationsListResults: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( + "authorization_namespace", "Microsoft.Authorization" + ) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.OperationsListResults] = kwargs.pop("cls", None) + cls: ClsType[_models.ComponentPolicyStatesQueryResults] = kwargs.pop("cls", None) - _request = build_list_request( + _request = build_component_policy_states_list_query_results_for_policy_definition_request( + policy_definition_name=policy_definition_name, + component_policy_states_resource=component_policy_states_resource, + subscription_id=self._config.subscription_id, + top=top, + order_by=order_by, + select=select, + from_parameter=from_parameter, + to=to, + filter=filter, + apply=apply, + authorization_namespace=authorization_namespace, api_version=api_version, headers=_headers, params=_params, ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ComponentPolicyStatesQueryResults, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_query_results_for_subscription_level_policy_assignment( # pylint: disable=name-too-long + self, + policy_assignment_name: str, + component_policy_states_resource: Union[str, _models.ComponentPolicyStatesResource], + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + **kwargs: Any + ) -> _models.ComponentPolicyStatesQueryResults: + """Queries component policy states for the subscription level policy assignment. + + :param policy_assignment_name: Policy assignment name. Required. + :type policy_assignment_name: str + :param component_policy_states_resource: The virtual resource under ComponentPolicyStates + resource type. In a given time range, 'latest' represents the latest component policy state(s). + "latest" Required. + :type component_policy_states_resource: str or + ~azure.mgmt.policyinsights.models.ComponentPolicyStatesResource + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword order_by: Ordering expression using OData notation. One or more comma-separated column + names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, + ResourceId asc". Default value is None. + :paramtype order_by: str + :keyword select: Select expression using OData notation. Limits the columns on each record to + just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Default value is None. + :paramtype select: str + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :keyword apply: OData apply expression for aggregations. Default value is None. + :paramtype apply: str + :return: ComponentPolicyStatesQueryResults. The ComponentPolicyStatesQueryResults is compatible + with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.ComponentPolicyStatesQueryResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( + "authorization_namespace", "Microsoft.Authorization" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[_models.ComponentPolicyStatesQueryResults] = kwargs.pop("cls", None) + + _request = build_component_policy_states_list_query_results_for_subscription_level_policy_assignment_request( + policy_assignment_name=policy_assignment_name, + component_policy_states_resource=component_policy_states_resource, + subscription_id=self._config.subscription_id, + top=top, + order_by=order_by, + select=select, + from_parameter=from_parameter, + to=to, + filter=filter, + apply=apply, + authorization_namespace=authorization_namespace, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ComponentPolicyStatesQueryResults, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_query_results_for_resource_group_level_policy_assignment( # pylint: disable=name-too-long,too-many-locals + self, + resource_group_name: str, + policy_assignment_name: str, + component_policy_states_resource: Union[str, _models.ComponentPolicyStatesResource], + *, + top: Optional[int] = None, + order_by: Optional[str] = None, + select: Optional[str] = None, + from_parameter: Optional[datetime.datetime] = None, + to: Optional[datetime.datetime] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + **kwargs: Any + ) -> _models.ComponentPolicyStatesQueryResults: + """Queries component policy states for the resource group level policy assignment. + + :param resource_group_name: Resource group name. Required. + :type resource_group_name: str + :param policy_assignment_name: Policy assignment name. Required. + :type policy_assignment_name: str + :param component_policy_states_resource: The virtual resource under ComponentPolicyStates + resource type. In a given time range, 'latest' represents the latest component policy state(s). + "latest" Required. + :type component_policy_states_resource: str or + ~azure.mgmt.policyinsights.models.ComponentPolicyStatesResource + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword order_by: Ordering expression using OData notation. One or more comma-separated column + names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, + ResourceId asc". Default value is None. + :paramtype order_by: str + :keyword select: Select expression using OData notation. Limits the columns on each record to + just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". Default value is None. + :paramtype select: str + :keyword from_parameter: ISO 8601 formatted timestamp specifying the start time of the interval + to query. When not specified, the service uses ($to - 1-day). Default value is None. + :paramtype from_parameter: ~datetime.datetime + :keyword to: ISO 8601 formatted timestamp specifying the end time of the interval to query. + When not specified, the service uses request time. Default value is None. + :paramtype to: ~datetime.datetime + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :keyword apply: OData apply expression for aggregations. Default value is None. + :paramtype apply: str + :return: ComponentPolicyStatesQueryResults. The ComponentPolicyStatesQueryResults is compatible + with MutableMapping + :rtype: ~azure.mgmt.policyinsights.models.ComponentPolicyStatesQueryResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( + "authorization_namespace", "Microsoft.Authorization" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) + cls: ClsType[_models.ComponentPolicyStatesQueryResults] = kwargs.pop("cls", None) + + _request = build_component_policy_states_list_query_results_for_resource_group_level_policy_assignment_request( + resource_group_name=resource_group_name, + policy_assignment_name=policy_assignment_name, + component_policy_states_resource=component_policy_states_resource, + subscription_id=self._config.subscription_id, + top=top, + order_by=order_by, + select=select, + from_parameter=from_parameter, + to=to, + filter=filter, + apply=apply, + authorization_namespace=authorization_namespace, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -109,13 +11306,449 @@ def list(self, **kwargs: Any) -> _models.OperationsListResults: response = pipeline_response.http_response if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("OperationsListResults", pipeline_response.http_response) + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ComponentPolicyStatesQueryResults, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore + + +class PolicyTrackedResourcesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.policyinsights.PolicyInsightsClient`'s + :attr:`policy_tracked_resources` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: PolicyInsightsClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_query_results_for_management_group( + self, + management_group_name: str, + policy_tracked_resources_resource: Union[str, _models.PolicyTrackedResourcesResourceType], + *, + top: Optional[int] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.PolicyTrackedResource"]: + """Queries policy tracked resources under the management group. + + :param management_group_name: Management group name. Required. + :type management_group_name: str + :param policy_tracked_resources_resource: The name of the virtual resource under + PolicyTrackedResources resource type; only "default" is allowed. "default" Required. + :type policy_tracked_resources_resource: str or + ~azure.mgmt.policyinsights.models.PolicyTrackedResourcesResourceType + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :return: An iterator like instance of PolicyTrackedResource + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.PolicyTrackedResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( + "management_groups_namespace", "Microsoft.Management" + ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01-preview")) + cls: ClsType[List[_models.PolicyTrackedResource]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_policy_tracked_resources_list_query_results_for_management_group_request( + management_group_name=management_group_name, + policy_tracked_resources_resource=policy_tracked_resources_resource, + top=top, + filter=filter, + management_groups_namespace=management_groups_namespace, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.PolicyTrackedResource], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_query_results_for_subscription( + self, + policy_tracked_resources_resource: Union[str, _models.PolicyTrackedResourcesResourceType], + *, + top: Optional[int] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.PolicyTrackedResource"]: + """Queries policy tracked resources under the subscription. + + :param policy_tracked_resources_resource: The name of the virtual resource under + PolicyTrackedResources resource type; only "default" is allowed. "default" Required. + :type policy_tracked_resources_resource: str or + ~azure.mgmt.policyinsights.models.PolicyTrackedResourcesResourceType + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :return: An iterator like instance of PolicyTrackedResource + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.PolicyTrackedResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01-preview")) + cls: ClsType[List[_models.PolicyTrackedResource]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_policy_tracked_resources_list_query_results_for_subscription_request( + policy_tracked_resources_resource=policy_tracked_resources_resource, + subscription_id=self._config.subscription_id, + top=top, + filter=filter, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.PolicyTrackedResource], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_query_results_for_resource_group( + self, + resource_group_name: str, + policy_tracked_resources_resource: Union[str, _models.PolicyTrackedResourcesResourceType], + *, + top: Optional[int] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.PolicyTrackedResource"]: + """Queries policy tracked resources under the resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param policy_tracked_resources_resource: The name of the virtual resource under + PolicyTrackedResources resource type; only "default" is allowed. "default" Required. + :type policy_tracked_resources_resource: str or + ~azure.mgmt.policyinsights.models.PolicyTrackedResourcesResourceType + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :return: An iterator like instance of PolicyTrackedResource + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.PolicyTrackedResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01-preview")) + cls: ClsType[List[_models.PolicyTrackedResource]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_policy_tracked_resources_list_query_results_for_resource_group_request( + resource_group_name=resource_group_name, + policy_tracked_resources_resource=policy_tracked_resources_resource, + subscription_id=self._config.subscription_id, + top=top, + filter=filter, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.PolicyTrackedResource], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_query_results_for_resource( + self, + resource_id: str, + policy_tracked_resources_resource: Union[str, _models.PolicyTrackedResourcesResourceType], + *, + top: Optional[int] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.PolicyTrackedResource"]: + """Queries policy tracked resources under the resource. + + :param resource_id: Resource ID. Required. + :type resource_id: str + :param policy_tracked_resources_resource: The name of the virtual resource under + PolicyTrackedResources resource type; only "default" is allowed. "default" Required. + :type policy_tracked_resources_resource: str or + ~azure.mgmt.policyinsights.models.PolicyTrackedResourcesResourceType + :keyword top: Maximum number of records to return. Default value is None. + :paramtype top: int + :keyword filter: OData filter expression. Default value is None. + :paramtype filter: str + :return: An iterator like instance of PolicyTrackedResource + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.PolicyTrackedResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01-preview")) + cls: ClsType[List[_models.PolicyTrackedResource]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_policy_tracked_resources_list_query_results_for_resource_request( + resource_id=resource_id, + policy_tracked_resources_resource=policy_tracked_resources_resource, + top=top, + filter=filter, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + _request = HttpRequest("GET", next_link) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.PolicyTrackedResource], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.QueryFailure, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/operations/_patch.py b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/operations/_patch.py index f7dd32510333..87676c65a8f0 100644 --- a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/operations/_patch.py +++ b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/operations/_patch.py @@ -1,14 +1,15 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# 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. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/operations/_policy_events_operations.py b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/operations/_policy_events_operations.py deleted file mode 100644 index a7252135c4c7..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/operations/_policy_events_operations.py +++ /dev/null @@ -1,1821 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression,too-many-lines -# 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 collections.abc import MutableMapping -import datetime -from typing import Any, Callable, Dict, Literal, Optional, TypeVar, Union - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import PolicyInsightsClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_query_results_for_management_group_request( # pylint: disable=name-too-long - policy_events_resource: Union[str, _models.PolicyEventsResourceType], - management_group_name: str, - *, - top: Optional[int] = None, - order_by: Optional[str] = None, - select: Optional[str] = None, - from_property: Optional[datetime.datetime] = None, - to: Optional[datetime.datetime] = None, - filter: Optional[str] = None, - apply: Optional[str] = None, - skip_token: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( - "management_groups_namespace", "Microsoft.Management" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/providers/{managementGroupsNamespace}/managementGroups/{managementGroupName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults", - ) - path_format_arguments = { - "policyEventsResource": _SERIALIZER.url("policy_events_resource", policy_events_resource, "str"), - "managementGroupsNamespace": _SERIALIZER.url("management_groups_namespace", management_groups_namespace, "str"), - "managementGroupName": _SERIALIZER.url("management_group_name", management_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int", minimum=0) - if order_by is not None: - _params["$orderby"] = _SERIALIZER.query("order_by", order_by, "str") - if select is not None: - _params["$select"] = _SERIALIZER.query("select", select, "str") - if from_property is not None: - _params["$from"] = _SERIALIZER.query("from_property", from_property, "iso-8601") - if to is not None: - _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - if apply is not None: - _params["$apply"] = _SERIALIZER.query("apply", apply, "str") - if skip_token is not None: - _params["$skiptoken"] = _SERIALIZER.query("skip_token", skip_token, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_next_link_request(next_link: str, *, skip_token: Optional[str] = None, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "{nextLink}") - path_format_arguments = { - "nextLink": _SERIALIZER.url("next_link", next_link, "str", skip_quote=True), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if skip_token is not None: - _params["$skiptoken"] = _SERIALIZER.query("skip_token", skip_token, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_query_results_for_subscription_request( # pylint: disable=name-too-long - policy_events_resource: Union[str, _models.PolicyEventsResourceType], - subscription_id: str, - *, - top: Optional[int] = None, - order_by: Optional[str] = None, - select: Optional[str] = None, - from_property: Optional[datetime.datetime] = None, - to: Optional[datetime.datetime] = None, - filter: Optional[str] = None, - apply: Optional[str] = None, - skip_token: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults", - ) - path_format_arguments = { - "policyEventsResource": _SERIALIZER.url("policy_events_resource", policy_events_resource, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int", minimum=0) - if order_by is not None: - _params["$orderby"] = _SERIALIZER.query("order_by", order_by, "str") - if select is not None: - _params["$select"] = _SERIALIZER.query("select", select, "str") - if from_property is not None: - _params["$from"] = _SERIALIZER.query("from_property", from_property, "iso-8601") - if to is not None: - _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - if apply is not None: - _params["$apply"] = _SERIALIZER.query("apply", apply, "str") - if skip_token is not None: - _params["$skiptoken"] = _SERIALIZER.query("skip_token", skip_token, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_next_link_request(next_link: str, *, skip_token: Optional[str] = None, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "{nextLink}") - path_format_arguments = { - "nextLink": _SERIALIZER.url("next_link", next_link, "str", skip_quote=True), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if skip_token is not None: - _params["$skiptoken"] = _SERIALIZER.query("skip_token", skip_token, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_query_results_for_resource_group_request( # pylint: disable=name-too-long - policy_events_resource: Union[str, _models.PolicyEventsResourceType], - subscription_id: str, - resource_group_name: str, - *, - top: Optional[int] = None, - order_by: Optional[str] = None, - select: Optional[str] = None, - from_property: Optional[datetime.datetime] = None, - to: Optional[datetime.datetime] = None, - filter: Optional[str] = None, - apply: Optional[str] = None, - skip_token: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults", - ) - path_format_arguments = { - "policyEventsResource": _SERIALIZER.url("policy_events_resource", policy_events_resource, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int", minimum=0) - if order_by is not None: - _params["$orderby"] = _SERIALIZER.query("order_by", order_by, "str") - if select is not None: - _params["$select"] = _SERIALIZER.query("select", select, "str") - if from_property is not None: - _params["$from"] = _SERIALIZER.query("from_property", from_property, "iso-8601") - if to is not None: - _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - if apply is not None: - _params["$apply"] = _SERIALIZER.query("apply", apply, "str") - if skip_token is not None: - _params["$skiptoken"] = _SERIALIZER.query("skip_token", skip_token, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_next_link_request(next_link: str, *, skip_token: Optional[str] = None, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "{nextLink}") - path_format_arguments = { - "nextLink": _SERIALIZER.url("next_link", next_link, "str", skip_quote=True), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if skip_token is not None: - _params["$skiptoken"] = _SERIALIZER.query("skip_token", skip_token, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_query_results_for_resource_request( # pylint: disable=name-too-long - policy_events_resource: Union[str, _models.PolicyEventsResourceType], - resource_id: str, - *, - top: Optional[int] = None, - order_by: Optional[str] = None, - select: Optional[str] = None, - from_property: Optional[datetime.datetime] = None, - to: Optional[datetime.datetime] = None, - filter: Optional[str] = None, - apply: Optional[str] = None, - expand: Optional[str] = None, - skip_token: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/{resourceId}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults", - ) - path_format_arguments = { - "policyEventsResource": _SERIALIZER.url("policy_events_resource", policy_events_resource, "str"), - "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int", minimum=0) - if order_by is not None: - _params["$orderby"] = _SERIALIZER.query("order_by", order_by, "str") - if select is not None: - _params["$select"] = _SERIALIZER.query("select", select, "str") - if from_property is not None: - _params["$from"] = _SERIALIZER.query("from_property", from_property, "iso-8601") - if to is not None: - _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - if apply is not None: - _params["$apply"] = _SERIALIZER.query("apply", apply, "str") - if expand is not None: - _params["$expand"] = _SERIALIZER.query("expand", expand, "str") - if skip_token is not None: - _params["$skiptoken"] = _SERIALIZER.query("skip_token", skip_token, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_next_link_request(next_link: str, *, skip_token: Optional[str] = None, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "{nextLink}") - path_format_arguments = { - "nextLink": _SERIALIZER.url("next_link", next_link, "str", skip_quote=True), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if skip_token is not None: - _params["$skiptoken"] = _SERIALIZER.query("skip_token", skip_token, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_query_results_for_policy_set_definition_request( # pylint: disable=name-too-long - policy_events_resource: Union[str, _models.PolicyEventsResourceType], - subscription_id: str, - policy_set_definition_name: str, - *, - top: Optional[int] = None, - order_by: Optional[str] = None, - select: Optional[str] = None, - from_property: Optional[datetime.datetime] = None, - to: Optional[datetime.datetime] = None, - filter: Optional[str] = None, - apply: Optional[str] = None, - skip_token: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( - "authorization_namespace", "Microsoft.Authorization" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policySetDefinitions/{policySetDefinitionName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults", - ) - path_format_arguments = { - "policyEventsResource": _SERIALIZER.url("policy_events_resource", policy_events_resource, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "authorizationNamespace": _SERIALIZER.url("authorization_namespace", authorization_namespace, "str"), - "policySetDefinitionName": _SERIALIZER.url("policy_set_definition_name", policy_set_definition_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int", minimum=0) - if order_by is not None: - _params["$orderby"] = _SERIALIZER.query("order_by", order_by, "str") - if select is not None: - _params["$select"] = _SERIALIZER.query("select", select, "str") - if from_property is not None: - _params["$from"] = _SERIALIZER.query("from_property", from_property, "iso-8601") - if to is not None: - _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - if apply is not None: - _params["$apply"] = _SERIALIZER.query("apply", apply, "str") - if skip_token is not None: - _params["$skiptoken"] = _SERIALIZER.query("skip_token", skip_token, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_next_link_request(next_link: str, *, skip_token: Optional[str] = None, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "{nextLink}") - path_format_arguments = { - "nextLink": _SERIALIZER.url("next_link", next_link, "str", skip_quote=True), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if skip_token is not None: - _params["$skiptoken"] = _SERIALIZER.query("skip_token", skip_token, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_query_results_for_policy_definition_request( # pylint: disable=name-too-long - policy_events_resource: Union[str, _models.PolicyEventsResourceType], - subscription_id: str, - policy_definition_name: str, - *, - top: Optional[int] = None, - order_by: Optional[str] = None, - select: Optional[str] = None, - from_property: Optional[datetime.datetime] = None, - to: Optional[datetime.datetime] = None, - filter: Optional[str] = None, - apply: Optional[str] = None, - skip_token: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( - "authorization_namespace", "Microsoft.Authorization" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyDefinitions/{policyDefinitionName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults", - ) - path_format_arguments = { - "policyEventsResource": _SERIALIZER.url("policy_events_resource", policy_events_resource, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "authorizationNamespace": _SERIALIZER.url("authorization_namespace", authorization_namespace, "str"), - "policyDefinitionName": _SERIALIZER.url("policy_definition_name", policy_definition_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int", minimum=0) - if order_by is not None: - _params["$orderby"] = _SERIALIZER.query("order_by", order_by, "str") - if select is not None: - _params["$select"] = _SERIALIZER.query("select", select, "str") - if from_property is not None: - _params["$from"] = _SERIALIZER.query("from_property", from_property, "iso-8601") - if to is not None: - _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - if apply is not None: - _params["$apply"] = _SERIALIZER.query("apply", apply, "str") - if skip_token is not None: - _params["$skiptoken"] = _SERIALIZER.query("skip_token", skip_token, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_next_link_request(next_link: str, *, skip_token: Optional[str] = None, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "{nextLink}") - path_format_arguments = { - "nextLink": _SERIALIZER.url("next_link", next_link, "str", skip_quote=True), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if skip_token is not None: - _params["$skiptoken"] = _SERIALIZER.query("skip_token", skip_token, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_query_results_for_subscription_level_policy_assignment_request( # pylint: disable=name-too-long - policy_events_resource: Union[str, _models.PolicyEventsResourceType], - subscription_id: str, - policy_assignment_name: str, - *, - top: Optional[int] = None, - order_by: Optional[str] = None, - select: Optional[str] = None, - from_property: Optional[datetime.datetime] = None, - to: Optional[datetime.datetime] = None, - filter: Optional[str] = None, - apply: Optional[str] = None, - skip_token: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( - "authorization_namespace", "Microsoft.Authorization" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults", - ) - path_format_arguments = { - "policyEventsResource": _SERIALIZER.url("policy_events_resource", policy_events_resource, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "authorizationNamespace": _SERIALIZER.url("authorization_namespace", authorization_namespace, "str"), - "policyAssignmentName": _SERIALIZER.url("policy_assignment_name", policy_assignment_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int", minimum=0) - if order_by is not None: - _params["$orderby"] = _SERIALIZER.query("order_by", order_by, "str") - if select is not None: - _params["$select"] = _SERIALIZER.query("select", select, "str") - if from_property is not None: - _params["$from"] = _SERIALIZER.query("from_property", from_property, "iso-8601") - if to is not None: - _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - if apply is not None: - _params["$apply"] = _SERIALIZER.query("apply", apply, "str") - if skip_token is not None: - _params["$skiptoken"] = _SERIALIZER.query("skip_token", skip_token, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_next_link_request(next_link: str, *, skip_token: Optional[str] = None, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "{nextLink}") - path_format_arguments = { - "nextLink": _SERIALIZER.url("next_link", next_link, "str", skip_quote=True), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if skip_token is not None: - _params["$skiptoken"] = _SERIALIZER.query("skip_token", skip_token, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_query_results_for_resource_group_level_policy_assignment_request( # pylint: disable=name-too-long - policy_events_resource: Union[str, _models.PolicyEventsResourceType], - subscription_id: str, - resource_group_name: str, - policy_assignment_name: str, - *, - top: Optional[int] = None, - order_by: Optional[str] = None, - select: Optional[str] = None, - from_property: Optional[datetime.datetime] = None, - to: Optional[datetime.datetime] = None, - filter: Optional[str] = None, - apply: Optional[str] = None, - skip_token: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( - "authorization_namespace", "Microsoft.Authorization" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults", - ) - path_format_arguments = { - "policyEventsResource": _SERIALIZER.url("policy_events_resource", policy_events_resource, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "authorizationNamespace": _SERIALIZER.url("authorization_namespace", authorization_namespace, "str"), - "policyAssignmentName": _SERIALIZER.url("policy_assignment_name", policy_assignment_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int", minimum=0) - if order_by is not None: - _params["$orderby"] = _SERIALIZER.query("order_by", order_by, "str") - if select is not None: - _params["$select"] = _SERIALIZER.query("select", select, "str") - if from_property is not None: - _params["$from"] = _SERIALIZER.query("from_property", from_property, "iso-8601") - if to is not None: - _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - if apply is not None: - _params["$apply"] = _SERIALIZER.query("apply", apply, "str") - if skip_token is not None: - _params["$skiptoken"] = _SERIALIZER.query("skip_token", skip_token, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_next_link_request(next_link: str, *, skip_token: Optional[str] = None, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "{nextLink}") - path_format_arguments = { - "nextLink": _SERIALIZER.url("next_link", next_link, "str", skip_quote=True), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if skip_token is not None: - _params["$skiptoken"] = _SERIALIZER.query("skip_token", skip_token, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -class PolicyEventsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.policyinsights.PolicyInsightsClient`'s - :attr:`policy_events` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: PolicyInsightsClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_query_results_for_management_group( - self, - policy_events_resource: Union[str, _models.PolicyEventsResourceType], - management_group_name: str, - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> ItemPaged["_models.PolicyEvent"]: - """Queries policy events for the resources under the management group. - - :param policy_events_resource: The name of the virtual resource under PolicyEvents resource - type; only "default" is allowed. "default" Required. - :type policy_events_resource: str or ~azure.mgmt.policyinsights.models.PolicyEventsResourceType - :param management_group_name: Management group name. Required. - :type management_group_name: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either PolicyEvent or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.PolicyEvent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( - "management_groups_namespace", "Microsoft.Management" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.PolicyEventsQueryResults] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_list_query_results_for_management_group_request( - policy_events_resource=policy_events_resource, - management_group_name=management_group_name, - top=_top, - order_by=_order_by, - select=_select, - from_property=_from_property, - to=_to, - filter=_filter, - apply=_apply, - skip_token=_skip_token, - management_groups_namespace=management_groups_namespace, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_next_link_request( - next_link=next_link, - skip_token=_skip_token, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("PolicyEventsQueryResults", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.odata_next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_query_results_for_subscription( - self, - policy_events_resource: Union[str, _models.PolicyEventsResourceType], - subscription_id: str, - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> ItemPaged["_models.PolicyEvent"]: - """Queries policy events for the resources under the subscription. - - :param policy_events_resource: The name of the virtual resource under PolicyEvents resource - type; only "default" is allowed. "default" Required. - :type policy_events_resource: str or ~azure.mgmt.policyinsights.models.PolicyEventsResourceType - :param subscription_id: Microsoft Azure subscription ID. Required. - :type subscription_id: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either PolicyEvent or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.PolicyEvent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.PolicyEventsQueryResults] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_list_query_results_for_subscription_request( - policy_events_resource=policy_events_resource, - subscription_id=subscription_id, - top=_top, - order_by=_order_by, - select=_select, - from_property=_from_property, - to=_to, - filter=_filter, - apply=_apply, - skip_token=_skip_token, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_next_link_request( - next_link=next_link, - skip_token=_skip_token, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("PolicyEventsQueryResults", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.odata_next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_query_results_for_resource_group( - self, - policy_events_resource: Union[str, _models.PolicyEventsResourceType], - subscription_id: str, - resource_group_name: str, - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> ItemPaged["_models.PolicyEvent"]: - """Queries policy events for the resources under the resource group. - - :param policy_events_resource: The name of the virtual resource under PolicyEvents resource - type; only "default" is allowed. "default" Required. - :type policy_events_resource: str or ~azure.mgmt.policyinsights.models.PolicyEventsResourceType - :param subscription_id: Microsoft Azure subscription ID. Required. - :type subscription_id: str - :param resource_group_name: Resource group name. Required. - :type resource_group_name: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either PolicyEvent or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.PolicyEvent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.PolicyEventsQueryResults] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_list_query_results_for_resource_group_request( - policy_events_resource=policy_events_resource, - subscription_id=subscription_id, - resource_group_name=resource_group_name, - top=_top, - order_by=_order_by, - select=_select, - from_property=_from_property, - to=_to, - filter=_filter, - apply=_apply, - skip_token=_skip_token, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_next_link_request( - next_link=next_link, - skip_token=_skip_token, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("PolicyEventsQueryResults", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.odata_next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_query_results_for_resource( - self, - policy_events_resource: Union[str, _models.PolicyEventsResourceType], - resource_id: str, - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> ItemPaged["_models.PolicyEvent"]: - """Queries policy events for the resource. - - :param policy_events_resource: The name of the virtual resource under PolicyEvents resource - type; only "default" is allowed. "default" Required. - :type policy_events_resource: str or ~azure.mgmt.policyinsights.models.PolicyEventsResourceType - :param resource_id: Resource ID. Required. - :type resource_id: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either PolicyEvent or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.PolicyEvent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.PolicyEventsQueryResults] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _expand = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _expand = query_options.expand - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_list_query_results_for_resource_request( - policy_events_resource=policy_events_resource, - resource_id=resource_id, - top=_top, - order_by=_order_by, - select=_select, - from_property=_from_property, - to=_to, - filter=_filter, - apply=_apply, - expand=_expand, - skip_token=_skip_token, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _expand = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _expand = query_options.expand - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_next_link_request( - next_link=next_link, - skip_token=_skip_token, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("PolicyEventsQueryResults", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.odata_next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_query_results_for_policy_set_definition( # pylint: disable=name-too-long - self, - policy_events_resource: Union[str, _models.PolicyEventsResourceType], - subscription_id: str, - policy_set_definition_name: str, - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> ItemPaged["_models.PolicyEvent"]: - """Queries policy events for the subscription level policy set definition. - - :param policy_events_resource: The name of the virtual resource under PolicyEvents resource - type; only "default" is allowed. "default" Required. - :type policy_events_resource: str or ~azure.mgmt.policyinsights.models.PolicyEventsResourceType - :param subscription_id: Microsoft Azure subscription ID. Required. - :type subscription_id: str - :param policy_set_definition_name: Policy set definition name. Required. - :type policy_set_definition_name: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either PolicyEvent or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.PolicyEvent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( - "authorization_namespace", "Microsoft.Authorization" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.PolicyEventsQueryResults] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_list_query_results_for_policy_set_definition_request( - policy_events_resource=policy_events_resource, - subscription_id=subscription_id, - policy_set_definition_name=policy_set_definition_name, - top=_top, - order_by=_order_by, - select=_select, - from_property=_from_property, - to=_to, - filter=_filter, - apply=_apply, - skip_token=_skip_token, - authorization_namespace=authorization_namespace, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_next_link_request( - next_link=next_link, - skip_token=_skip_token, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("PolicyEventsQueryResults", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.odata_next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_query_results_for_policy_definition( - self, - policy_events_resource: Union[str, _models.PolicyEventsResourceType], - subscription_id: str, - policy_definition_name: str, - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> ItemPaged["_models.PolicyEvent"]: - """Queries policy events for the subscription level policy definition. - - :param policy_events_resource: The name of the virtual resource under PolicyEvents resource - type; only "default" is allowed. "default" Required. - :type policy_events_resource: str or ~azure.mgmt.policyinsights.models.PolicyEventsResourceType - :param subscription_id: Microsoft Azure subscription ID. Required. - :type subscription_id: str - :param policy_definition_name: Policy definition name. Required. - :type policy_definition_name: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either PolicyEvent or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.PolicyEvent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( - "authorization_namespace", "Microsoft.Authorization" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.PolicyEventsQueryResults] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_list_query_results_for_policy_definition_request( - policy_events_resource=policy_events_resource, - subscription_id=subscription_id, - policy_definition_name=policy_definition_name, - top=_top, - order_by=_order_by, - select=_select, - from_property=_from_property, - to=_to, - filter=_filter, - apply=_apply, - skip_token=_skip_token, - authorization_namespace=authorization_namespace, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_next_link_request( - next_link=next_link, - skip_token=_skip_token, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("PolicyEventsQueryResults", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.odata_next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_query_results_for_subscription_level_policy_assignment( # pylint: disable=name-too-long - self, - policy_events_resource: Union[str, _models.PolicyEventsResourceType], - subscription_id: str, - policy_assignment_name: str, - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> ItemPaged["_models.PolicyEvent"]: - """Queries policy events for the subscription level policy assignment. - - :param policy_events_resource: The name of the virtual resource under PolicyEvents resource - type; only "default" is allowed. "default" Required. - :type policy_events_resource: str or ~azure.mgmt.policyinsights.models.PolicyEventsResourceType - :param subscription_id: Microsoft Azure subscription ID. Required. - :type subscription_id: str - :param policy_assignment_name: Policy assignment name. Required. - :type policy_assignment_name: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either PolicyEvent or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.PolicyEvent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( - "authorization_namespace", "Microsoft.Authorization" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.PolicyEventsQueryResults] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_list_query_results_for_subscription_level_policy_assignment_request( - policy_events_resource=policy_events_resource, - subscription_id=subscription_id, - policy_assignment_name=policy_assignment_name, - top=_top, - order_by=_order_by, - select=_select, - from_property=_from_property, - to=_to, - filter=_filter, - apply=_apply, - skip_token=_skip_token, - authorization_namespace=authorization_namespace, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_next_link_request( - next_link=next_link, - skip_token=_skip_token, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("PolicyEventsQueryResults", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.odata_next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_query_results_for_resource_group_level_policy_assignment( # pylint: disable=name-too-long - self, - policy_events_resource: Union[str, _models.PolicyEventsResourceType], - subscription_id: str, - resource_group_name: str, - policy_assignment_name: str, - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> ItemPaged["_models.PolicyEvent"]: - """Queries policy events for the resource group level policy assignment. - - :param policy_events_resource: The name of the virtual resource under PolicyEvents resource - type; only "default" is allowed. "default" Required. - :type policy_events_resource: str or ~azure.mgmt.policyinsights.models.PolicyEventsResourceType - :param subscription_id: Microsoft Azure subscription ID. Required. - :type subscription_id: str - :param resource_group_name: Resource group name. Required. - :type resource_group_name: str - :param policy_assignment_name: Policy assignment name. Required. - :type policy_assignment_name: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either PolicyEvent or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.PolicyEvent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( - "authorization_namespace", "Microsoft.Authorization" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.PolicyEventsQueryResults] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_list_query_results_for_resource_group_level_policy_assignment_request( - policy_events_resource=policy_events_resource, - subscription_id=subscription_id, - resource_group_name=resource_group_name, - policy_assignment_name=policy_assignment_name, - top=_top, - order_by=_order_by, - select=_select, - from_property=_from_property, - to=_to, - filter=_filter, - apply=_apply, - skip_token=_skip_token, - authorization_namespace=authorization_namespace, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_next_link_request( - next_link=next_link, - skip_token=_skip_token, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("PolicyEventsQueryResults", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.odata_next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/operations/_policy_metadata_operations.py b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/operations/_policy_metadata_operations.py deleted file mode 100644 index 8e9db59eb497..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/operations/_policy_metadata_operations.py +++ /dev/null @@ -1,222 +0,0 @@ -# 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 collections.abc import MutableMapping -from typing import Any, Callable, Dict, Optional, TypeVar - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import PolicyInsightsClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_get_resource_request(resource_name: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/providers/Microsoft.PolicyInsights/policyMetadata/{resourceName}") - path_format_arguments = { - "resourceName": _SERIALIZER.url("resource_name", resource_name, "str", skip_quote=True), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_request(*, top: Optional[int] = None, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/providers/Microsoft.PolicyInsights/policyMetadata") - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int", minimum=0) - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class PolicyMetadataOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.policyinsights.PolicyInsightsClient`'s - :attr:`policy_metadata` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: PolicyInsightsClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get_resource(self, resource_name: str, **kwargs: Any) -> _models.PolicyMetadata: - """Get policy metadata resource. - - :param resource_name: The name of the policy metadata resource. Required. - :type resource_name: str - :return: PolicyMetadata or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.PolicyMetadata - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.PolicyMetadata] = kwargs.pop("cls", None) - - _request = build_get_resource_request( - resource_name=resource_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("PolicyMetadata", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list( - self, query_options: Optional[_models.QueryOptions] = None, **kwargs: Any - ) -> ItemPaged["_models.SlimPolicyMetadata"]: - """Get a list of the policy metadata resources. - - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either SlimPolicyMetadata or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.SlimPolicyMetadata] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.PolicyMetadataCollection] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - if query_options is not None: - _top = query_options.top - - _request = build_list_request( - top=_top, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("PolicyMetadataCollection", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/operations/_policy_restrictions_operations.py b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/operations/_policy_restrictions_operations.py deleted file mode 100644 index b9ebd2b44da6..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/operations/_policy_restrictions_operations.py +++ /dev/null @@ -1,489 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, Dict, IO, Literal, Optional, TypeVar, Union, overload - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import PolicyInsightsClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_check_at_subscription_scope_request( # pylint: disable=name-too-long - subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/checkPolicyRestrictions" - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_check_at_resource_group_scope_request( # pylint: disable=name-too-long - resource_group_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/checkPolicyRestrictions", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_check_at_management_group_scope_request( # pylint: disable=name-too-long - management_group_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( - "management_groups_namespace", "Microsoft.Management" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/providers/{managementGroupsNamespace}/managementGroups/{managementGroupId}/providers/Microsoft.PolicyInsights/checkPolicyRestrictions", - ) - path_format_arguments = { - "managementGroupsNamespace": _SERIALIZER.url("management_groups_namespace", management_groups_namespace, "str"), - "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -class PolicyRestrictionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.policyinsights.PolicyInsightsClient`'s - :attr:`policy_restrictions` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: PolicyInsightsClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - def check_at_subscription_scope( - self, parameters: _models.CheckRestrictionsRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.CheckRestrictionsResult: - """Checks what restrictions Azure Policy will place on a resource within a subscription. - - :param parameters: The check policy restrictions parameters. Required. - :type parameters: ~azure.mgmt.policyinsights.models.CheckRestrictionsRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: CheckRestrictionsResult or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.CheckRestrictionsResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def check_at_subscription_scope( - self, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.CheckRestrictionsResult: - """Checks what restrictions Azure Policy will place on a resource within a subscription. - - :param parameters: The check policy restrictions parameters. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: CheckRestrictionsResult or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.CheckRestrictionsResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def check_at_subscription_scope( - self, parameters: Union[_models.CheckRestrictionsRequest, IO[bytes]], **kwargs: Any - ) -> _models.CheckRestrictionsResult: - """Checks what restrictions Azure Policy will place on a resource within a subscription. - - :param parameters: The check policy restrictions parameters. Is either a - CheckRestrictionsRequest type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.policyinsights.models.CheckRestrictionsRequest or IO[bytes] - :return: CheckRestrictionsResult or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.CheckRestrictionsResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CheckRestrictionsResult] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "CheckRestrictionsRequest") - - _request = build_check_at_subscription_scope_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("CheckRestrictionsResult", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def check_at_resource_group_scope( - self, - resource_group_name: str, - parameters: _models.CheckRestrictionsRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.CheckRestrictionsResult: - """Checks what restrictions Azure Policy will place on a resource within a resource group. Use - this when the resource group the resource will be created in is already known. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param parameters: The check policy restrictions parameters. Required. - :type parameters: ~azure.mgmt.policyinsights.models.CheckRestrictionsRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: CheckRestrictionsResult or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.CheckRestrictionsResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def check_at_resource_group_scope( - self, resource_group_name: str, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.CheckRestrictionsResult: - """Checks what restrictions Azure Policy will place on a resource within a resource group. Use - this when the resource group the resource will be created in is already known. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param parameters: The check policy restrictions parameters. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: CheckRestrictionsResult or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.CheckRestrictionsResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def check_at_resource_group_scope( - self, resource_group_name: str, parameters: Union[_models.CheckRestrictionsRequest, IO[bytes]], **kwargs: Any - ) -> _models.CheckRestrictionsResult: - """Checks what restrictions Azure Policy will place on a resource within a resource group. Use - this when the resource group the resource will be created in is already known. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param parameters: The check policy restrictions parameters. Is either a - CheckRestrictionsRequest type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.policyinsights.models.CheckRestrictionsRequest or IO[bytes] - :return: CheckRestrictionsResult or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.CheckRestrictionsResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CheckRestrictionsResult] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "CheckRestrictionsRequest") - - _request = build_check_at_resource_group_scope_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("CheckRestrictionsResult", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def check_at_management_group_scope( - self, - management_group_id: str, - parameters: _models.CheckManagementGroupRestrictionsRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.CheckRestrictionsResult: - """Checks what restrictions Azure Policy will place on resources within a management group. - - :param management_group_id: Management group ID. Required. - :type management_group_id: str - :param parameters: The check policy restrictions parameters. Required. - :type parameters: ~azure.mgmt.policyinsights.models.CheckManagementGroupRestrictionsRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: CheckRestrictionsResult or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.CheckRestrictionsResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def check_at_management_group_scope( - self, management_group_id: str, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.CheckRestrictionsResult: - """Checks what restrictions Azure Policy will place on resources within a management group. - - :param management_group_id: Management group ID. Required. - :type management_group_id: str - :param parameters: The check policy restrictions parameters. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: CheckRestrictionsResult or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.CheckRestrictionsResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def check_at_management_group_scope( - self, - management_group_id: str, - parameters: Union[_models.CheckManagementGroupRestrictionsRequest, IO[bytes]], - **kwargs: Any - ) -> _models.CheckRestrictionsResult: - """Checks what restrictions Azure Policy will place on resources within a management group. - - :param management_group_id: Management group ID. Required. - :type management_group_id: str - :param parameters: The check policy restrictions parameters. Is either a - CheckManagementGroupRestrictionsRequest type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.policyinsights.models.CheckManagementGroupRestrictionsRequest or - IO[bytes] - :return: CheckRestrictionsResult or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.CheckRestrictionsResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( - "management_groups_namespace", "Microsoft.Management" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CheckRestrictionsResult] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "CheckManagementGroupRestrictionsRequest") - - _request = build_check_at_management_group_scope_request( - management_group_id=management_group_id, - management_groups_namespace=management_groups_namespace, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("CheckRestrictionsResult", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/operations/_policy_states_operations.py b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/operations/_policy_states_operations.py deleted file mode 100644 index b95b72efb66d..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/operations/_policy_states_operations.py +++ /dev/null @@ -1,3180 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression,too-many-lines -# 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 collections.abc import MutableMapping -import datetime -from typing import Any, Callable, Dict, Iterator, Literal, Optional, TypeVar, Union, cast - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import PolicyInsightsClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_query_results_for_management_group_request( # pylint: disable=name-too-long - policy_states_resource: Union[str, _models.PolicyStatesResource], - management_group_name: str, - *, - top: Optional[int] = None, - order_by: Optional[str] = None, - select: Optional[str] = None, - from_property: Optional[datetime.datetime] = None, - to: Optional[datetime.datetime] = None, - filter: Optional[str] = None, - apply: Optional[str] = None, - skip_token: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( - "management_groups_namespace", "Microsoft.Management" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/providers/{managementGroupsNamespace}/managementGroups/{managementGroupName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults", - ) - path_format_arguments = { - "policyStatesResource": _SERIALIZER.url("policy_states_resource", policy_states_resource, "str"), - "managementGroupsNamespace": _SERIALIZER.url("management_groups_namespace", management_groups_namespace, "str"), - "managementGroupName": _SERIALIZER.url("management_group_name", management_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int", minimum=0) - if order_by is not None: - _params["$orderby"] = _SERIALIZER.query("order_by", order_by, "str") - if select is not None: - _params["$select"] = _SERIALIZER.query("select", select, "str") - if from_property is not None: - _params["$from"] = _SERIALIZER.query("from_property", from_property, "iso-8601") - if to is not None: - _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - if apply is not None: - _params["$apply"] = _SERIALIZER.query("apply", apply, "str") - if skip_token is not None: - _params["$skiptoken"] = _SERIALIZER.query("skip_token", skip_token, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_next_link_request(next_link: str, *, skip_token: Optional[str] = None, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "{nextLink}") - path_format_arguments = { - "nextLink": _SERIALIZER.url("next_link", next_link, "str", skip_quote=True), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if skip_token is not None: - _params["$skiptoken"] = _SERIALIZER.query("skip_token", skip_token, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_summarize_for_management_group_request( # pylint: disable=name-too-long - policy_states_summary_resource: Union[str, _models.PolicyStatesSummaryResourceType], - management_group_name: str, - *, - top: Optional[int] = None, - from_property: Optional[datetime.datetime] = None, - to: Optional[datetime.datetime] = None, - filter: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( - "management_groups_namespace", "Microsoft.Management" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/providers/{managementGroupsNamespace}/managementGroups/{managementGroupName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize", - ) - path_format_arguments = { - "policyStatesSummaryResource": _SERIALIZER.url( - "policy_states_summary_resource", policy_states_summary_resource, "str" - ), - "managementGroupsNamespace": _SERIALIZER.url("management_groups_namespace", management_groups_namespace, "str"), - "managementGroupName": _SERIALIZER.url("management_group_name", management_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int", minimum=0) - if from_property is not None: - _params["$from"] = _SERIALIZER.query("from_property", from_property, "iso-8601") - if to is not None: - _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_query_results_for_subscription_request( # pylint: disable=name-too-long - policy_states_resource: Union[str, _models.PolicyStatesResource], - subscription_id: str, - *, - top: Optional[int] = None, - order_by: Optional[str] = None, - select: Optional[str] = None, - from_property: Optional[datetime.datetime] = None, - to: Optional[datetime.datetime] = None, - filter: Optional[str] = None, - apply: Optional[str] = None, - skip_token: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults", - ) - path_format_arguments = { - "policyStatesResource": _SERIALIZER.url("policy_states_resource", policy_states_resource, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int", minimum=0) - if order_by is not None: - _params["$orderby"] = _SERIALIZER.query("order_by", order_by, "str") - if select is not None: - _params["$select"] = _SERIALIZER.query("select", select, "str") - if from_property is not None: - _params["$from"] = _SERIALIZER.query("from_property", from_property, "iso-8601") - if to is not None: - _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - if apply is not None: - _params["$apply"] = _SERIALIZER.query("apply", apply, "str") - if skip_token is not None: - _params["$skiptoken"] = _SERIALIZER.query("skip_token", skip_token, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_next_link_request(next_link: str, *, skip_token: Optional[str] = None, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "{nextLink}") - path_format_arguments = { - "nextLink": _SERIALIZER.url("next_link", next_link, "str", skip_quote=True), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if skip_token is not None: - _params["$skiptoken"] = _SERIALIZER.query("skip_token", skip_token, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_summarize_for_subscription_request( - policy_states_summary_resource: Union[str, _models.PolicyStatesSummaryResourceType], - subscription_id: str, - *, - top: Optional[int] = None, - from_property: Optional[datetime.datetime] = None, - to: Optional[datetime.datetime] = None, - filter: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize", - ) - path_format_arguments = { - "policyStatesSummaryResource": _SERIALIZER.url( - "policy_states_summary_resource", policy_states_summary_resource, "str" - ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int", minimum=0) - if from_property is not None: - _params["$from"] = _SERIALIZER.query("from_property", from_property, "iso-8601") - if to is not None: - _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_query_results_for_resource_group_request( # pylint: disable=name-too-long - policy_states_resource: Union[str, _models.PolicyStatesResource], - subscription_id: str, - resource_group_name: str, - *, - top: Optional[int] = None, - order_by: Optional[str] = None, - select: Optional[str] = None, - from_property: Optional[datetime.datetime] = None, - to: Optional[datetime.datetime] = None, - filter: Optional[str] = None, - apply: Optional[str] = None, - skip_token: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults", - ) - path_format_arguments = { - "policyStatesResource": _SERIALIZER.url("policy_states_resource", policy_states_resource, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int", minimum=0) - if order_by is not None: - _params["$orderby"] = _SERIALIZER.query("order_by", order_by, "str") - if select is not None: - _params["$select"] = _SERIALIZER.query("select", select, "str") - if from_property is not None: - _params["$from"] = _SERIALIZER.query("from_property", from_property, "iso-8601") - if to is not None: - _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - if apply is not None: - _params["$apply"] = _SERIALIZER.query("apply", apply, "str") - if skip_token is not None: - _params["$skiptoken"] = _SERIALIZER.query("skip_token", skip_token, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_next_link_request(next_link: str, *, skip_token: Optional[str] = None, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "{nextLink}") - path_format_arguments = { - "nextLink": _SERIALIZER.url("next_link", next_link, "str", skip_quote=True), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if skip_token is not None: - _params["$skiptoken"] = _SERIALIZER.query("skip_token", skip_token, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_summarize_for_resource_group_request( # pylint: disable=name-too-long - policy_states_summary_resource: Union[str, _models.PolicyStatesSummaryResourceType], - subscription_id: str, - resource_group_name: str, - *, - top: Optional[int] = None, - from_property: Optional[datetime.datetime] = None, - to: Optional[datetime.datetime] = None, - filter: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize", - ) - path_format_arguments = { - "policyStatesSummaryResource": _SERIALIZER.url( - "policy_states_summary_resource", policy_states_summary_resource, "str" - ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int", minimum=0) - if from_property is not None: - _params["$from"] = _SERIALIZER.query("from_property", from_property, "iso-8601") - if to is not None: - _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_query_results_for_resource_request( # pylint: disable=name-too-long - policy_states_resource: Union[str, _models.PolicyStatesResource], - resource_id: str, - *, - top: Optional[int] = None, - order_by: Optional[str] = None, - select: Optional[str] = None, - from_property: Optional[datetime.datetime] = None, - to: Optional[datetime.datetime] = None, - filter: Optional[str] = None, - apply: Optional[str] = None, - expand: Optional[str] = None, - skip_token: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/{resourceId}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults", - ) - path_format_arguments = { - "policyStatesResource": _SERIALIZER.url("policy_states_resource", policy_states_resource, "str"), - "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int", minimum=0) - if order_by is not None: - _params["$orderby"] = _SERIALIZER.query("order_by", order_by, "str") - if select is not None: - _params["$select"] = _SERIALIZER.query("select", select, "str") - if from_property is not None: - _params["$from"] = _SERIALIZER.query("from_property", from_property, "iso-8601") - if to is not None: - _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - if apply is not None: - _params["$apply"] = _SERIALIZER.query("apply", apply, "str") - if expand is not None: - _params["$expand"] = _SERIALIZER.query("expand", expand, "str") - if skip_token is not None: - _params["$skiptoken"] = _SERIALIZER.query("skip_token", skip_token, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_next_link_request(next_link: str, *, skip_token: Optional[str] = None, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "{nextLink}") - path_format_arguments = { - "nextLink": _SERIALIZER.url("next_link", next_link, "str", skip_quote=True), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if skip_token is not None: - _params["$skiptoken"] = _SERIALIZER.query("skip_token", skip_token, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_summarize_for_resource_request( - policy_states_summary_resource: Union[str, _models.PolicyStatesSummaryResourceType], - resource_id: str, - *, - top: Optional[int] = None, - from_property: Optional[datetime.datetime] = None, - to: Optional[datetime.datetime] = None, - filter: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/{resourceId}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize", - ) - path_format_arguments = { - "policyStatesSummaryResource": _SERIALIZER.url( - "policy_states_summary_resource", policy_states_summary_resource, "str" - ), - "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int", minimum=0) - if from_property is not None: - _params["$from"] = _SERIALIZER.query("from_property", from_property, "iso-8601") - if to is not None: - _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_trigger_subscription_evaluation_request( # pylint: disable=name-too-long - subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyStates/latest/triggerEvaluation", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_trigger_resource_group_evaluation_request( # pylint: disable=name-too-long - subscription_id: str, resource_group_name: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyStates/latest/triggerEvaluation", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_query_results_for_policy_set_definition_request( # pylint: disable=name-too-long - policy_states_resource: Union[str, _models.PolicyStatesResource], - subscription_id: str, - policy_set_definition_name: str, - *, - top: Optional[int] = None, - order_by: Optional[str] = None, - select: Optional[str] = None, - from_property: Optional[datetime.datetime] = None, - to: Optional[datetime.datetime] = None, - filter: Optional[str] = None, - apply: Optional[str] = None, - skip_token: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( - "authorization_namespace", "Microsoft.Authorization" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policySetDefinitions/{policySetDefinitionName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults", - ) - path_format_arguments = { - "policyStatesResource": _SERIALIZER.url("policy_states_resource", policy_states_resource, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "authorizationNamespace": _SERIALIZER.url("authorization_namespace", authorization_namespace, "str"), - "policySetDefinitionName": _SERIALIZER.url("policy_set_definition_name", policy_set_definition_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int", minimum=0) - if order_by is not None: - _params["$orderby"] = _SERIALIZER.query("order_by", order_by, "str") - if select is not None: - _params["$select"] = _SERIALIZER.query("select", select, "str") - if from_property is not None: - _params["$from"] = _SERIALIZER.query("from_property", from_property, "iso-8601") - if to is not None: - _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - if apply is not None: - _params["$apply"] = _SERIALIZER.query("apply", apply, "str") - if skip_token is not None: - _params["$skiptoken"] = _SERIALIZER.query("skip_token", skip_token, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_next_link_request(next_link: str, *, skip_token: Optional[str] = None, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "{nextLink}") - path_format_arguments = { - "nextLink": _SERIALIZER.url("next_link", next_link, "str", skip_quote=True), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if skip_token is not None: - _params["$skiptoken"] = _SERIALIZER.query("skip_token", skip_token, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_summarize_for_policy_set_definition_request( # pylint: disable=name-too-long - policy_states_summary_resource: Union[str, _models.PolicyStatesSummaryResourceType], - subscription_id: str, - policy_set_definition_name: str, - *, - top: Optional[int] = None, - from_property: Optional[datetime.datetime] = None, - to: Optional[datetime.datetime] = None, - filter: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( - "authorization_namespace", "Microsoft.Authorization" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policySetDefinitions/{policySetDefinitionName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize", - ) - path_format_arguments = { - "policyStatesSummaryResource": _SERIALIZER.url( - "policy_states_summary_resource", policy_states_summary_resource, "str" - ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "authorizationNamespace": _SERIALIZER.url("authorization_namespace", authorization_namespace, "str"), - "policySetDefinitionName": _SERIALIZER.url("policy_set_definition_name", policy_set_definition_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int", minimum=0) - if from_property is not None: - _params["$from"] = _SERIALIZER.query("from_property", from_property, "iso-8601") - if to is not None: - _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_query_results_for_policy_definition_request( # pylint: disable=name-too-long - policy_states_resource: Union[str, _models.PolicyStatesResource], - subscription_id: str, - policy_definition_name: str, - *, - top: Optional[int] = None, - order_by: Optional[str] = None, - select: Optional[str] = None, - from_property: Optional[datetime.datetime] = None, - to: Optional[datetime.datetime] = None, - filter: Optional[str] = None, - apply: Optional[str] = None, - skip_token: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( - "authorization_namespace", "Microsoft.Authorization" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyDefinitions/{policyDefinitionName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults", - ) - path_format_arguments = { - "policyStatesResource": _SERIALIZER.url("policy_states_resource", policy_states_resource, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "authorizationNamespace": _SERIALIZER.url("authorization_namespace", authorization_namespace, "str"), - "policyDefinitionName": _SERIALIZER.url("policy_definition_name", policy_definition_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int", minimum=0) - if order_by is not None: - _params["$orderby"] = _SERIALIZER.query("order_by", order_by, "str") - if select is not None: - _params["$select"] = _SERIALIZER.query("select", select, "str") - if from_property is not None: - _params["$from"] = _SERIALIZER.query("from_property", from_property, "iso-8601") - if to is not None: - _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - if apply is not None: - _params["$apply"] = _SERIALIZER.query("apply", apply, "str") - if skip_token is not None: - _params["$skiptoken"] = _SERIALIZER.query("skip_token", skip_token, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_next_link_request(next_link: str, *, skip_token: Optional[str] = None, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "{nextLink}") - path_format_arguments = { - "nextLink": _SERIALIZER.url("next_link", next_link, "str", skip_quote=True), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if skip_token is not None: - _params["$skiptoken"] = _SERIALIZER.query("skip_token", skip_token, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_summarize_for_policy_definition_request( # pylint: disable=name-too-long - policy_states_summary_resource: Union[str, _models.PolicyStatesSummaryResourceType], - subscription_id: str, - policy_definition_name: str, - *, - top: Optional[int] = None, - from_property: Optional[datetime.datetime] = None, - to: Optional[datetime.datetime] = None, - filter: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( - "authorization_namespace", "Microsoft.Authorization" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyDefinitions/{policyDefinitionName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize", - ) - path_format_arguments = { - "policyStatesSummaryResource": _SERIALIZER.url( - "policy_states_summary_resource", policy_states_summary_resource, "str" - ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "authorizationNamespace": _SERIALIZER.url("authorization_namespace", authorization_namespace, "str"), - "policyDefinitionName": _SERIALIZER.url("policy_definition_name", policy_definition_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int", minimum=0) - if from_property is not None: - _params["$from"] = _SERIALIZER.query("from_property", from_property, "iso-8601") - if to is not None: - _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_query_results_for_subscription_level_policy_assignment_request( # pylint: disable=name-too-long - policy_states_resource: Union[str, _models.PolicyStatesResource], - subscription_id: str, - policy_assignment_name: str, - *, - top: Optional[int] = None, - order_by: Optional[str] = None, - select: Optional[str] = None, - from_property: Optional[datetime.datetime] = None, - to: Optional[datetime.datetime] = None, - filter: Optional[str] = None, - apply: Optional[str] = None, - skip_token: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( - "authorization_namespace", "Microsoft.Authorization" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults", - ) - path_format_arguments = { - "policyStatesResource": _SERIALIZER.url("policy_states_resource", policy_states_resource, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "authorizationNamespace": _SERIALIZER.url("authorization_namespace", authorization_namespace, "str"), - "policyAssignmentName": _SERIALIZER.url("policy_assignment_name", policy_assignment_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int", minimum=0) - if order_by is not None: - _params["$orderby"] = _SERIALIZER.query("order_by", order_by, "str") - if select is not None: - _params["$select"] = _SERIALIZER.query("select", select, "str") - if from_property is not None: - _params["$from"] = _SERIALIZER.query("from_property", from_property, "iso-8601") - if to is not None: - _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - if apply is not None: - _params["$apply"] = _SERIALIZER.query("apply", apply, "str") - if skip_token is not None: - _params["$skiptoken"] = _SERIALIZER.query("skip_token", skip_token, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_next_link_request(next_link: str, *, skip_token: Optional[str] = None, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "{nextLink}") - path_format_arguments = { - "nextLink": _SERIALIZER.url("next_link", next_link, "str", skip_quote=True), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if skip_token is not None: - _params["$skiptoken"] = _SERIALIZER.query("skip_token", skip_token, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_summarize_for_subscription_level_policy_assignment_request( # pylint: disable=name-too-long - policy_states_summary_resource: Union[str, _models.PolicyStatesSummaryResourceType], - subscription_id: str, - policy_assignment_name: str, - *, - top: Optional[int] = None, - from_property: Optional[datetime.datetime] = None, - to: Optional[datetime.datetime] = None, - filter: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( - "authorization_namespace", "Microsoft.Authorization" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize", - ) - path_format_arguments = { - "policyStatesSummaryResource": _SERIALIZER.url( - "policy_states_summary_resource", policy_states_summary_resource, "str" - ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "authorizationNamespace": _SERIALIZER.url("authorization_namespace", authorization_namespace, "str"), - "policyAssignmentName": _SERIALIZER.url("policy_assignment_name", policy_assignment_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int", minimum=0) - if from_property is not None: - _params["$from"] = _SERIALIZER.query("from_property", from_property, "iso-8601") - if to is not None: - _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_query_results_for_resource_group_level_policy_assignment_request( # pylint: disable=name-too-long - policy_states_resource: Union[str, _models.PolicyStatesResource], - subscription_id: str, - resource_group_name: str, - policy_assignment_name: str, - *, - top: Optional[int] = None, - order_by: Optional[str] = None, - select: Optional[str] = None, - from_property: Optional[datetime.datetime] = None, - to: Optional[datetime.datetime] = None, - filter: Optional[str] = None, - apply: Optional[str] = None, - skip_token: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( - "authorization_namespace", "Microsoft.Authorization" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults", - ) - path_format_arguments = { - "policyStatesResource": _SERIALIZER.url("policy_states_resource", policy_states_resource, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "authorizationNamespace": _SERIALIZER.url("authorization_namespace", authorization_namespace, "str"), - "policyAssignmentName": _SERIALIZER.url("policy_assignment_name", policy_assignment_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int", minimum=0) - if order_by is not None: - _params["$orderby"] = _SERIALIZER.query("order_by", order_by, "str") - if select is not None: - _params["$select"] = _SERIALIZER.query("select", select, "str") - if from_property is not None: - _params["$from"] = _SERIALIZER.query("from_property", from_property, "iso-8601") - if to is not None: - _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - if apply is not None: - _params["$apply"] = _SERIALIZER.query("apply", apply, "str") - if skip_token is not None: - _params["$skiptoken"] = _SERIALIZER.query("skip_token", skip_token, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_next_link_request(next_link: str, *, skip_token: Optional[str] = None, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "{nextLink}") - path_format_arguments = { - "nextLink": _SERIALIZER.url("next_link", next_link, "str", skip_quote=True), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if skip_token is not None: - _params["$skiptoken"] = _SERIALIZER.query("skip_token", skip_token, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_summarize_for_resource_group_level_policy_assignment_request( # pylint: disable=name-too-long - policy_states_summary_resource: Union[str, _models.PolicyStatesSummaryResourceType], - subscription_id: str, - resource_group_name: str, - policy_assignment_name: str, - *, - top: Optional[int] = None, - from_property: Optional[datetime.datetime] = None, - to: Optional[datetime.datetime] = None, - filter: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( - "authorization_namespace", "Microsoft.Authorization" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize", - ) - path_format_arguments = { - "policyStatesSummaryResource": _SERIALIZER.url( - "policy_states_summary_resource", policy_states_summary_resource, "str" - ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "authorizationNamespace": _SERIALIZER.url("authorization_namespace", authorization_namespace, "str"), - "policyAssignmentName": _SERIALIZER.url("policy_assignment_name", policy_assignment_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int", minimum=0) - if from_property is not None: - _params["$from"] = _SERIALIZER.query("from_property", from_property, "iso-8601") - if to is not None: - _params["$to"] = _SERIALIZER.query("to", to, "iso-8601") - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -class PolicyStatesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.policyinsights.PolicyInsightsClient`'s - :attr:`policy_states` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: PolicyInsightsClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_query_results_for_management_group( - self, - policy_states_resource: Union[str, _models.PolicyStatesResource], - management_group_name: str, - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> ItemPaged["_models.PolicyState"]: - """Queries policy states for the resources under the management group. - - :param policy_states_resource: The virtual resource under PolicyStates resource type. In a - given time range, 'latest' represents the latest policy state(s), whereas 'default' represents - all policy state(s). Known values are: "default" and "latest". Required. - :type policy_states_resource: str or ~azure.mgmt.policyinsights.models.PolicyStatesResource - :param management_group_name: Management group name. Required. - :type management_group_name: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either PolicyState or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.PolicyState] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( - "management_groups_namespace", "Microsoft.Management" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.PolicyStatesQueryResults] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_list_query_results_for_management_group_request( - policy_states_resource=policy_states_resource, - management_group_name=management_group_name, - top=_top, - order_by=_order_by, - select=_select, - from_property=_from_property, - to=_to, - filter=_filter, - apply=_apply, - skip_token=_skip_token, - management_groups_namespace=management_groups_namespace, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_next_link_request( - next_link=next_link, - skip_token=_skip_token, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("PolicyStatesQueryResults", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.odata_next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def summarize_for_management_group( - self, - policy_states_summary_resource: Union[str, _models.PolicyStatesSummaryResourceType], - management_group_name: str, - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> _models.SummarizeResults: - """Summarizes policy states for the resources under the management group. - - :param policy_states_summary_resource: The virtual resource under PolicyStates resource type - for summarize action. In a given time range, 'latest' represents the latest policy state(s) and - is the only allowed value. "latest" Required. - :type policy_states_summary_resource: str or - ~azure.mgmt.policyinsights.models.PolicyStatesSummaryResourceType - :param management_group_name: Management group name. Required. - :type management_group_name: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: SummarizeResults or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.SummarizeResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( - "management_groups_namespace", "Microsoft.Management" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.SummarizeResults] = kwargs.pop("cls", None) - - _top = None - _from_property = None - _to = None - _filter = None - if query_options is not None: - _filter = query_options.filter - _from_property = query_options.from_property - _to = query_options.to - _top = query_options.top - - _request = build_summarize_for_management_group_request( - policy_states_summary_resource=policy_states_summary_resource, - management_group_name=management_group_name, - top=_top, - from_property=_from_property, - to=_to, - filter=_filter, - management_groups_namespace=management_groups_namespace, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SummarizeResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_query_results_for_subscription( - self, - policy_states_resource: Union[str, _models.PolicyStatesResource], - subscription_id: str, - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> ItemPaged["_models.PolicyState"]: - """Queries policy states for the resources under the subscription. - - :param policy_states_resource: The virtual resource under PolicyStates resource type. In a - given time range, 'latest' represents the latest policy state(s), whereas 'default' represents - all policy state(s). Known values are: "default" and "latest". Required. - :type policy_states_resource: str or ~azure.mgmt.policyinsights.models.PolicyStatesResource - :param subscription_id: Microsoft Azure subscription ID. Required. - :type subscription_id: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either PolicyState or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.PolicyState] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.PolicyStatesQueryResults] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_list_query_results_for_subscription_request( - policy_states_resource=policy_states_resource, - subscription_id=subscription_id, - top=_top, - order_by=_order_by, - select=_select, - from_property=_from_property, - to=_to, - filter=_filter, - apply=_apply, - skip_token=_skip_token, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_next_link_request( - next_link=next_link, - skip_token=_skip_token, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("PolicyStatesQueryResults", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.odata_next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def summarize_for_subscription( - self, - policy_states_summary_resource: Union[str, _models.PolicyStatesSummaryResourceType], - subscription_id: str, - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> _models.SummarizeResults: - """Summarizes policy states for the resources under the subscription. - - :param policy_states_summary_resource: The virtual resource under PolicyStates resource type - for summarize action. In a given time range, 'latest' represents the latest policy state(s) and - is the only allowed value. "latest" Required. - :type policy_states_summary_resource: str or - ~azure.mgmt.policyinsights.models.PolicyStatesSummaryResourceType - :param subscription_id: Microsoft Azure subscription ID. Required. - :type subscription_id: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: SummarizeResults or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.SummarizeResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.SummarizeResults] = kwargs.pop("cls", None) - - _top = None - _from_property = None - _to = None - _filter = None - if query_options is not None: - _filter = query_options.filter - _from_property = query_options.from_property - _to = query_options.to - _top = query_options.top - - _request = build_summarize_for_subscription_request( - policy_states_summary_resource=policy_states_summary_resource, - subscription_id=subscription_id, - top=_top, - from_property=_from_property, - to=_to, - filter=_filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SummarizeResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_query_results_for_resource_group( - self, - policy_states_resource: Union[str, _models.PolicyStatesResource], - subscription_id: str, - resource_group_name: str, - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> ItemPaged["_models.PolicyState"]: - """Queries policy states for the resources under the resource group. - - :param policy_states_resource: The virtual resource under PolicyStates resource type. In a - given time range, 'latest' represents the latest policy state(s), whereas 'default' represents - all policy state(s). Known values are: "default" and "latest". Required. - :type policy_states_resource: str or ~azure.mgmt.policyinsights.models.PolicyStatesResource - :param subscription_id: Microsoft Azure subscription ID. Required. - :type subscription_id: str - :param resource_group_name: Resource group name. Required. - :type resource_group_name: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either PolicyState or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.PolicyState] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.PolicyStatesQueryResults] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_list_query_results_for_resource_group_request( - policy_states_resource=policy_states_resource, - subscription_id=subscription_id, - resource_group_name=resource_group_name, - top=_top, - order_by=_order_by, - select=_select, - from_property=_from_property, - to=_to, - filter=_filter, - apply=_apply, - skip_token=_skip_token, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_next_link_request( - next_link=next_link, - skip_token=_skip_token, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("PolicyStatesQueryResults", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.odata_next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def summarize_for_resource_group( - self, - policy_states_summary_resource: Union[str, _models.PolicyStatesSummaryResourceType], - subscription_id: str, - resource_group_name: str, - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> _models.SummarizeResults: - """Summarizes policy states for the resources under the resource group. - - :param policy_states_summary_resource: The virtual resource under PolicyStates resource type - for summarize action. In a given time range, 'latest' represents the latest policy state(s) and - is the only allowed value. "latest" Required. - :type policy_states_summary_resource: str or - ~azure.mgmt.policyinsights.models.PolicyStatesSummaryResourceType - :param subscription_id: Microsoft Azure subscription ID. Required. - :type subscription_id: str - :param resource_group_name: Resource group name. Required. - :type resource_group_name: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: SummarizeResults or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.SummarizeResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.SummarizeResults] = kwargs.pop("cls", None) - - _top = None - _from_property = None - _to = None - _filter = None - if query_options is not None: - _filter = query_options.filter - _from_property = query_options.from_property - _to = query_options.to - _top = query_options.top - - _request = build_summarize_for_resource_group_request( - policy_states_summary_resource=policy_states_summary_resource, - subscription_id=subscription_id, - resource_group_name=resource_group_name, - top=_top, - from_property=_from_property, - to=_to, - filter=_filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SummarizeResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_query_results_for_resource( - self, - policy_states_resource: Union[str, _models.PolicyStatesResource], - resource_id: str, - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> ItemPaged["_models.PolicyState"]: - """Queries policy states for the resource. - - :param policy_states_resource: The virtual resource under PolicyStates resource type. In a - given time range, 'latest' represents the latest policy state(s), whereas 'default' represents - all policy state(s). Known values are: "default" and "latest". Required. - :type policy_states_resource: str or ~azure.mgmt.policyinsights.models.PolicyStatesResource - :param resource_id: Resource ID. Required. - :type resource_id: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either PolicyState or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.PolicyState] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.PolicyStatesQueryResults] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _expand = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _expand = query_options.expand - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_list_query_results_for_resource_request( - policy_states_resource=policy_states_resource, - resource_id=resource_id, - top=_top, - order_by=_order_by, - select=_select, - from_property=_from_property, - to=_to, - filter=_filter, - apply=_apply, - expand=_expand, - skip_token=_skip_token, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _expand = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _expand = query_options.expand - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_next_link_request( - next_link=next_link, - skip_token=_skip_token, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("PolicyStatesQueryResults", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.odata_next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def summarize_for_resource( - self, - policy_states_summary_resource: Union[str, _models.PolicyStatesSummaryResourceType], - resource_id: str, - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> _models.SummarizeResults: - """Summarizes policy states for the resource. - - :param policy_states_summary_resource: The virtual resource under PolicyStates resource type - for summarize action. In a given time range, 'latest' represents the latest policy state(s) and - is the only allowed value. "latest" Required. - :type policy_states_summary_resource: str or - ~azure.mgmt.policyinsights.models.PolicyStatesSummaryResourceType - :param resource_id: Resource ID. Required. - :type resource_id: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: SummarizeResults or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.SummarizeResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.SummarizeResults] = kwargs.pop("cls", None) - - _top = None - _from_property = None - _to = None - _filter = None - if query_options is not None: - _filter = query_options.filter - _from_property = query_options.from_property - _to = query_options.to - _top = query_options.top - - _request = build_summarize_for_resource_request( - policy_states_summary_resource=policy_states_summary_resource, - resource_id=resource_id, - top=_top, - from_property=_from_property, - to=_to, - filter=_filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SummarizeResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _trigger_subscription_evaluation_initial(self, subscription_id: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_trigger_subscription_evaluation_request( - subscription_id=subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_trigger_subscription_evaluation(self, subscription_id: str, **kwargs: Any) -> LROPoller[None]: - """Triggers a policy evaluation scan for all the resources under the subscription. - - :param subscription_id: Microsoft Azure subscription ID. Required. - :type subscription_id: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._trigger_subscription_evaluation_initial( - subscription_id=subscription_id, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _trigger_resource_group_evaluation_initial( # pylint: disable=name-too-long - self, subscription_id: str, resource_group_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_trigger_resource_group_evaluation_request( - subscription_id=subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_trigger_resource_group_evaluation( - self, subscription_id: str, resource_group_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Triggers a policy evaluation scan for all the resources under the resource group. - - :param subscription_id: Microsoft Azure subscription ID. Required. - :type subscription_id: str - :param resource_group_name: Resource group name. Required. - :type resource_group_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._trigger_resource_group_evaluation_initial( - subscription_id=subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_query_results_for_policy_set_definition( # pylint: disable=name-too-long - self, - policy_states_resource: Union[str, _models.PolicyStatesResource], - subscription_id: str, - policy_set_definition_name: str, - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> ItemPaged["_models.PolicyState"]: - """Queries policy states for the subscription level policy set definition. - - :param policy_states_resource: The virtual resource under PolicyStates resource type. In a - given time range, 'latest' represents the latest policy state(s), whereas 'default' represents - all policy state(s). Known values are: "default" and "latest". Required. - :type policy_states_resource: str or ~azure.mgmt.policyinsights.models.PolicyStatesResource - :param subscription_id: Microsoft Azure subscription ID. Required. - :type subscription_id: str - :param policy_set_definition_name: Policy set definition name. Required. - :type policy_set_definition_name: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either PolicyState or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.PolicyState] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( - "authorization_namespace", "Microsoft.Authorization" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.PolicyStatesQueryResults] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_list_query_results_for_policy_set_definition_request( - policy_states_resource=policy_states_resource, - subscription_id=subscription_id, - policy_set_definition_name=policy_set_definition_name, - top=_top, - order_by=_order_by, - select=_select, - from_property=_from_property, - to=_to, - filter=_filter, - apply=_apply, - skip_token=_skip_token, - authorization_namespace=authorization_namespace, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_next_link_request( - next_link=next_link, - skip_token=_skip_token, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("PolicyStatesQueryResults", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.odata_next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def summarize_for_policy_set_definition( - self, - policy_states_summary_resource: Union[str, _models.PolicyStatesSummaryResourceType], - subscription_id: str, - policy_set_definition_name: str, - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> _models.SummarizeResults: - """Summarizes policy states for the subscription level policy set definition. - - :param policy_states_summary_resource: The virtual resource under PolicyStates resource type - for summarize action. In a given time range, 'latest' represents the latest policy state(s) and - is the only allowed value. "latest" Required. - :type policy_states_summary_resource: str or - ~azure.mgmt.policyinsights.models.PolicyStatesSummaryResourceType - :param subscription_id: Microsoft Azure subscription ID. Required. - :type subscription_id: str - :param policy_set_definition_name: Policy set definition name. Required. - :type policy_set_definition_name: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: SummarizeResults or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.SummarizeResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( - "authorization_namespace", "Microsoft.Authorization" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.SummarizeResults] = kwargs.pop("cls", None) - - _top = None - _from_property = None - _to = None - _filter = None - if query_options is not None: - _filter = query_options.filter - _from_property = query_options.from_property - _to = query_options.to - _top = query_options.top - - _request = build_summarize_for_policy_set_definition_request( - policy_states_summary_resource=policy_states_summary_resource, - subscription_id=subscription_id, - policy_set_definition_name=policy_set_definition_name, - top=_top, - from_property=_from_property, - to=_to, - filter=_filter, - authorization_namespace=authorization_namespace, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SummarizeResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_query_results_for_policy_definition( - self, - policy_states_resource: Union[str, _models.PolicyStatesResource], - subscription_id: str, - policy_definition_name: str, - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> ItemPaged["_models.PolicyState"]: - """Queries policy states for the subscription level policy definition. - - :param policy_states_resource: The virtual resource under PolicyStates resource type. In a - given time range, 'latest' represents the latest policy state(s), whereas 'default' represents - all policy state(s). Known values are: "default" and "latest". Required. - :type policy_states_resource: str or ~azure.mgmt.policyinsights.models.PolicyStatesResource - :param subscription_id: Microsoft Azure subscription ID. Required. - :type subscription_id: str - :param policy_definition_name: Policy definition name. Required. - :type policy_definition_name: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either PolicyState or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.PolicyState] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( - "authorization_namespace", "Microsoft.Authorization" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.PolicyStatesQueryResults] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_list_query_results_for_policy_definition_request( - policy_states_resource=policy_states_resource, - subscription_id=subscription_id, - policy_definition_name=policy_definition_name, - top=_top, - order_by=_order_by, - select=_select, - from_property=_from_property, - to=_to, - filter=_filter, - apply=_apply, - skip_token=_skip_token, - authorization_namespace=authorization_namespace, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_next_link_request( - next_link=next_link, - skip_token=_skip_token, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("PolicyStatesQueryResults", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.odata_next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def summarize_for_policy_definition( - self, - policy_states_summary_resource: Union[str, _models.PolicyStatesSummaryResourceType], - subscription_id: str, - policy_definition_name: str, - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> _models.SummarizeResults: - """Summarizes policy states for the subscription level policy definition. - - :param policy_states_summary_resource: The virtual resource under PolicyStates resource type - for summarize action. In a given time range, 'latest' represents the latest policy state(s) and - is the only allowed value. "latest" Required. - :type policy_states_summary_resource: str or - ~azure.mgmt.policyinsights.models.PolicyStatesSummaryResourceType - :param subscription_id: Microsoft Azure subscription ID. Required. - :type subscription_id: str - :param policy_definition_name: Policy definition name. Required. - :type policy_definition_name: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: SummarizeResults or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.SummarizeResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( - "authorization_namespace", "Microsoft.Authorization" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.SummarizeResults] = kwargs.pop("cls", None) - - _top = None - _from_property = None - _to = None - _filter = None - if query_options is not None: - _filter = query_options.filter - _from_property = query_options.from_property - _to = query_options.to - _top = query_options.top - - _request = build_summarize_for_policy_definition_request( - policy_states_summary_resource=policy_states_summary_resource, - subscription_id=subscription_id, - policy_definition_name=policy_definition_name, - top=_top, - from_property=_from_property, - to=_to, - filter=_filter, - authorization_namespace=authorization_namespace, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SummarizeResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_query_results_for_subscription_level_policy_assignment( # pylint: disable=name-too-long - self, - policy_states_resource: Union[str, _models.PolicyStatesResource], - subscription_id: str, - policy_assignment_name: str, - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> ItemPaged["_models.PolicyState"]: - """Queries policy states for the subscription level policy assignment. - - :param policy_states_resource: The virtual resource under PolicyStates resource type. In a - given time range, 'latest' represents the latest policy state(s), whereas 'default' represents - all policy state(s). Known values are: "default" and "latest". Required. - :type policy_states_resource: str or ~azure.mgmt.policyinsights.models.PolicyStatesResource - :param subscription_id: Microsoft Azure subscription ID. Required. - :type subscription_id: str - :param policy_assignment_name: Policy assignment name. Required. - :type policy_assignment_name: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either PolicyState or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.PolicyState] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( - "authorization_namespace", "Microsoft.Authorization" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.PolicyStatesQueryResults] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_list_query_results_for_subscription_level_policy_assignment_request( - policy_states_resource=policy_states_resource, - subscription_id=subscription_id, - policy_assignment_name=policy_assignment_name, - top=_top, - order_by=_order_by, - select=_select, - from_property=_from_property, - to=_to, - filter=_filter, - apply=_apply, - skip_token=_skip_token, - authorization_namespace=authorization_namespace, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_next_link_request( - next_link=next_link, - skip_token=_skip_token, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("PolicyStatesQueryResults", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.odata_next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def summarize_for_subscription_level_policy_assignment( # pylint: disable=name-too-long - self, - policy_states_summary_resource: Union[str, _models.PolicyStatesSummaryResourceType], - subscription_id: str, - policy_assignment_name: str, - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> _models.SummarizeResults: - """Summarizes policy states for the subscription level policy assignment. - - :param policy_states_summary_resource: The virtual resource under PolicyStates resource type - for summarize action. In a given time range, 'latest' represents the latest policy state(s) and - is the only allowed value. "latest" Required. - :type policy_states_summary_resource: str or - ~azure.mgmt.policyinsights.models.PolicyStatesSummaryResourceType - :param subscription_id: Microsoft Azure subscription ID. Required. - :type subscription_id: str - :param policy_assignment_name: Policy assignment name. Required. - :type policy_assignment_name: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: SummarizeResults or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.SummarizeResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( - "authorization_namespace", "Microsoft.Authorization" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.SummarizeResults] = kwargs.pop("cls", None) - - _top = None - _from_property = None - _to = None - _filter = None - if query_options is not None: - _filter = query_options.filter - _from_property = query_options.from_property - _to = query_options.to - _top = query_options.top - - _request = build_summarize_for_subscription_level_policy_assignment_request( - policy_states_summary_resource=policy_states_summary_resource, - subscription_id=subscription_id, - policy_assignment_name=policy_assignment_name, - top=_top, - from_property=_from_property, - to=_to, - filter=_filter, - authorization_namespace=authorization_namespace, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SummarizeResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_query_results_for_resource_group_level_policy_assignment( # pylint: disable=name-too-long - self, - policy_states_resource: Union[str, _models.PolicyStatesResource], - subscription_id: str, - resource_group_name: str, - policy_assignment_name: str, - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> ItemPaged["_models.PolicyState"]: - """Queries policy states for the resource group level policy assignment. - - :param policy_states_resource: The virtual resource under PolicyStates resource type. In a - given time range, 'latest' represents the latest policy state(s), whereas 'default' represents - all policy state(s). Known values are: "default" and "latest". Required. - :type policy_states_resource: str or ~azure.mgmt.policyinsights.models.PolicyStatesResource - :param subscription_id: Microsoft Azure subscription ID. Required. - :type subscription_id: str - :param resource_group_name: Resource group name. Required. - :type resource_group_name: str - :param policy_assignment_name: Policy assignment name. Required. - :type policy_assignment_name: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either PolicyState or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.PolicyState] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( - "authorization_namespace", "Microsoft.Authorization" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.PolicyStatesQueryResults] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_list_query_results_for_resource_group_level_policy_assignment_request( - policy_states_resource=policy_states_resource, - subscription_id=subscription_id, - resource_group_name=resource_group_name, - policy_assignment_name=policy_assignment_name, - top=_top, - order_by=_order_by, - select=_select, - from_property=_from_property, - to=_to, - filter=_filter, - apply=_apply, - skip_token=_skip_token, - authorization_namespace=authorization_namespace, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _top = None - _order_by = None - _select = None - _from_property = None - _to = None - _filter = None - _apply = None - _skip_token = None - if query_options is not None: - _apply = query_options.apply - _filter = query_options.filter - _from_property = query_options.from_property - _order_by = query_options.order_by - _select = query_options.select - _skip_token = query_options.skip_token - _to = query_options.to - _top = query_options.top - - _request = build_next_link_request( - next_link=next_link, - skip_token=_skip_token, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("PolicyStatesQueryResults", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.odata_next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def summarize_for_resource_group_level_policy_assignment( # pylint: disable=name-too-long - self, - policy_states_summary_resource: Union[str, _models.PolicyStatesSummaryResourceType], - subscription_id: str, - resource_group_name: str, - policy_assignment_name: str, - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> _models.SummarizeResults: - """Summarizes policy states for the resource group level policy assignment. - - :param policy_states_summary_resource: The virtual resource under PolicyStates resource type - for summarize action. In a given time range, 'latest' represents the latest policy state(s) and - is the only allowed value. "latest" Required. - :type policy_states_summary_resource: str or - ~azure.mgmt.policyinsights.models.PolicyStatesSummaryResourceType - :param subscription_id: Microsoft Azure subscription ID. Required. - :type subscription_id: str - :param resource_group_name: Resource group name. Required. - :type resource_group_name: str - :param policy_assignment_name: Policy assignment name. Required. - :type policy_assignment_name: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: SummarizeResults or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.SummarizeResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - authorization_namespace: Literal["Microsoft.Authorization"] = kwargs.pop( - "authorization_namespace", "Microsoft.Authorization" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.SummarizeResults] = kwargs.pop("cls", None) - - _top = None - _from_property = None - _to = None - _filter = None - if query_options is not None: - _filter = query_options.filter - _from_property = query_options.from_property - _to = query_options.to - _top = query_options.top - - _request = build_summarize_for_resource_group_level_policy_assignment_request( - policy_states_summary_resource=policy_states_summary_resource, - subscription_id=subscription_id, - resource_group_name=resource_group_name, - policy_assignment_name=policy_assignment_name, - top=_top, - from_property=_from_property, - to=_to, - filter=_filter, - authorization_namespace=authorization_namespace, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SummarizeResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/operations/_policy_tracked_resources_operations.py b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/operations/_policy_tracked_resources_operations.py deleted file mode 100644 index 77f8b714c9ca..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/operations/_policy_tracked_resources_operations.py +++ /dev/null @@ -1,576 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from typing import Any, Callable, Dict, Literal, Optional, TypeVar, Union - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import PolicyInsightsClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_query_results_for_management_group_request( # pylint: disable=name-too-long - management_group_name: str, - policy_tracked_resources_resource: Union[str, _models.PolicyTrackedResourcesResourceType], - *, - top: Optional[int] = None, - filter: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( - "management_groups_namespace", "Microsoft.Management" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/providers/{managementGroupsNamespace}/managementGroups/{managementGroupName}/providers/Microsoft.PolicyInsights/policyTrackedResources/{policyTrackedResourcesResource}/queryResults", - ) - path_format_arguments = { - "managementGroupsNamespace": _SERIALIZER.url("management_groups_namespace", management_groups_namespace, "str"), - "managementGroupName": _SERIALIZER.url("management_group_name", management_group_name, "str"), - "policyTrackedResourcesResource": _SERIALIZER.url( - "policy_tracked_resources_resource", policy_tracked_resources_resource, "str" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int", minimum=0) - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_query_results_for_subscription_request( # pylint: disable=name-too-long - policy_tracked_resources_resource: Union[str, _models.PolicyTrackedResourcesResourceType], - subscription_id: str, - *, - top: Optional[int] = None, - filter: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyTrackedResources/{policyTrackedResourcesResource}/queryResults", - ) - path_format_arguments = { - "policyTrackedResourcesResource": _SERIALIZER.url( - "policy_tracked_resources_resource", policy_tracked_resources_resource, "str" - ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int", minimum=0) - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_query_results_for_resource_group_request( # pylint: disable=name-too-long - resource_group_name: str, - policy_tracked_resources_resource: Union[str, _models.PolicyTrackedResourcesResourceType], - subscription_id: str, - *, - top: Optional[int] = None, - filter: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyTrackedResources/{policyTrackedResourcesResource}/queryResults", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "policyTrackedResourcesResource": _SERIALIZER.url( - "policy_tracked_resources_resource", policy_tracked_resources_resource, "str" - ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int", minimum=0) - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_query_results_for_resource_request( # pylint: disable=name-too-long - resource_id: str, - policy_tracked_resources_resource: Union[str, _models.PolicyTrackedResourcesResourceType], - *, - top: Optional[int] = None, - filter: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/{resourceId}/providers/Microsoft.PolicyInsights/policyTrackedResources/{policyTrackedResourcesResource}/queryResults", - ) - path_format_arguments = { - "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), - "policyTrackedResourcesResource": _SERIALIZER.url( - "policy_tracked_resources_resource", policy_tracked_resources_resource, "str" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int", minimum=0) - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -class PolicyTrackedResourcesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.policyinsights.PolicyInsightsClient`'s - :attr:`policy_tracked_resources` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: PolicyInsightsClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_query_results_for_management_group( - self, - management_group_name: str, - policy_tracked_resources_resource: Union[str, _models.PolicyTrackedResourcesResourceType], - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> ItemPaged["_models.PolicyTrackedResource"]: - """Queries policy tracked resources under the management group. - - :param management_group_name: Management group name. Required. - :type management_group_name: str - :param policy_tracked_resources_resource: The name of the virtual resource under - PolicyTrackedResources resource type; only "default" is allowed. "default" Required. - :type policy_tracked_resources_resource: str or - ~azure.mgmt.policyinsights.models.PolicyTrackedResourcesResourceType - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either PolicyTrackedResource or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.PolicyTrackedResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( - "management_groups_namespace", "Microsoft.Management" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01-preview")) - cls: ClsType[_models.PolicyTrackedResourcesQueryResults] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - _filter = None - if query_options is not None: - _filter = query_options.filter - _top = query_options.top - - _request = build_list_query_results_for_management_group_request( - management_group_name=management_group_name, - policy_tracked_resources_resource=policy_tracked_resources_resource, - top=_top, - filter=_filter, - management_groups_namespace=management_groups_namespace, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("PolicyTrackedResourcesQueryResults", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_query_results_for_subscription( - self, - policy_tracked_resources_resource: Union[str, _models.PolicyTrackedResourcesResourceType], - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> ItemPaged["_models.PolicyTrackedResource"]: - """Queries policy tracked resources under the subscription. - - :param policy_tracked_resources_resource: The name of the virtual resource under - PolicyTrackedResources resource type; only "default" is allowed. "default" Required. - :type policy_tracked_resources_resource: str or - ~azure.mgmt.policyinsights.models.PolicyTrackedResourcesResourceType - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either PolicyTrackedResource or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.PolicyTrackedResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01-preview")) - cls: ClsType[_models.PolicyTrackedResourcesQueryResults] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - _filter = None - if query_options is not None: - _filter = query_options.filter - _top = query_options.top - - _request = build_list_query_results_for_subscription_request( - policy_tracked_resources_resource=policy_tracked_resources_resource, - subscription_id=self._config.subscription_id, - top=_top, - filter=_filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("PolicyTrackedResourcesQueryResults", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_query_results_for_resource_group( - self, - resource_group_name: str, - policy_tracked_resources_resource: Union[str, _models.PolicyTrackedResourcesResourceType], - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> ItemPaged["_models.PolicyTrackedResource"]: - """Queries policy tracked resources under the resource group. - - :param resource_group_name: Resource group name. Required. - :type resource_group_name: str - :param policy_tracked_resources_resource: The name of the virtual resource under - PolicyTrackedResources resource type; only "default" is allowed. "default" Required. - :type policy_tracked_resources_resource: str or - ~azure.mgmt.policyinsights.models.PolicyTrackedResourcesResourceType - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either PolicyTrackedResource or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.PolicyTrackedResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01-preview")) - cls: ClsType[_models.PolicyTrackedResourcesQueryResults] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - _filter = None - if query_options is not None: - _filter = query_options.filter - _top = query_options.top - - _request = build_list_query_results_for_resource_group_request( - resource_group_name=resource_group_name, - policy_tracked_resources_resource=policy_tracked_resources_resource, - subscription_id=self._config.subscription_id, - top=_top, - filter=_filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("PolicyTrackedResourcesQueryResults", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_query_results_for_resource( - self, - resource_id: str, - policy_tracked_resources_resource: Union[str, _models.PolicyTrackedResourcesResourceType], - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> ItemPaged["_models.PolicyTrackedResource"]: - """Queries policy tracked resources under the resource. - - :param resource_id: Resource ID. Required. - :type resource_id: str - :param policy_tracked_resources_resource: The name of the virtual resource under - PolicyTrackedResources resource type; only "default" is allowed. "default" Required. - :type policy_tracked_resources_resource: str or - ~azure.mgmt.policyinsights.models.PolicyTrackedResourcesResourceType - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either PolicyTrackedResource or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.PolicyTrackedResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-07-01-preview")) - cls: ClsType[_models.PolicyTrackedResourcesQueryResults] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - _filter = None - if query_options is not None: - _filter = query_options.filter - _top = query_options.top - - _request = build_list_query_results_for_resource_request( - resource_id=resource_id, - policy_tracked_resources_resource=policy_tracked_resources_resource, - top=_top, - filter=_filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("PolicyTrackedResourcesQueryResults", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.QueryFailure, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/operations/_remediations_operations.py b/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/operations/_remediations_operations.py deleted file mode 100644 index f7e889216741..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/operations/_remediations_operations.py +++ /dev/null @@ -1,2625 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression,too-many-lines -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, Dict, IO, Literal, Optional, TypeVar, Union, overload - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import PolicyInsightsClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_deployments_at_management_group_request( # pylint: disable=name-too-long - management_group_id: str, remediation_name: str, *, top: Optional[int] = None, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( - "management_groups_namespace", "Microsoft.Management" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/providers/{managementGroupsNamespace}/managementGroups/{managementGroupId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/listDeployments", - ) - path_format_arguments = { - "managementGroupsNamespace": _SERIALIZER.url("management_groups_namespace", management_groups_namespace, "str"), - "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), - "remediationName": _SERIALIZER.url("remediation_name", remediation_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int", minimum=0) - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_cancel_at_management_group_request( - management_group_id: str, remediation_name: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( - "management_groups_namespace", "Microsoft.Management" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/providers/{managementGroupsNamespace}/managementGroups/{managementGroupId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/cancel", - ) - path_format_arguments = { - "managementGroupsNamespace": _SERIALIZER.url("management_groups_namespace", management_groups_namespace, "str"), - "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), - "remediationName": _SERIALIZER.url("remediation_name", remediation_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_for_management_group_request( - management_group_id: str, *, top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( - "management_groups_namespace", "Microsoft.Management" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/providers/{managementGroupsNamespace}/managementGroups/{managementGroupId}/providers/Microsoft.PolicyInsights/remediations", - ) - path_format_arguments = { - "managementGroupsNamespace": _SERIALIZER.url("management_groups_namespace", management_groups_namespace, "str"), - "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int", minimum=0) - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_at_management_group_request( # pylint: disable=name-too-long - management_group_id: str, remediation_name: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( - "management_groups_namespace", "Microsoft.Management" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/providers/{managementGroupsNamespace}/managementGroups/{managementGroupId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", - ) - path_format_arguments = { - "managementGroupsNamespace": _SERIALIZER.url("management_groups_namespace", management_groups_namespace, "str"), - "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), - "remediationName": _SERIALIZER.url("remediation_name", remediation_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_at_management_group_request( - management_group_id: str, remediation_name: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( - "management_groups_namespace", "Microsoft.Management" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/providers/{managementGroupsNamespace}/managementGroups/{managementGroupId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", - ) - path_format_arguments = { - "managementGroupsNamespace": _SERIALIZER.url("management_groups_namespace", management_groups_namespace, "str"), - "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), - "remediationName": _SERIALIZER.url("remediation_name", remediation_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_at_management_group_request( - management_group_id: str, remediation_name: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( - "management_groups_namespace", "Microsoft.Management" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/providers/{managementGroupsNamespace}/managementGroups/{managementGroupId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", - ) - path_format_arguments = { - "managementGroupsNamespace": _SERIALIZER.url("management_groups_namespace", management_groups_namespace, "str"), - "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), - "remediationName": _SERIALIZER.url("remediation_name", remediation_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_deployments_at_subscription_request( # pylint: disable=name-too-long - remediation_name: str, subscription_id: str, *, top: Optional[int] = None, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/listDeployments", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "remediationName": _SERIALIZER.url("remediation_name", remediation_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int", minimum=0) - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_cancel_at_subscription_request(remediation_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/cancel", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "remediationName": _SERIALIZER.url("remediation_name", remediation_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_for_subscription_request( - subscription_id: str, *, top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/remediations") - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int", minimum=0) - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_at_subscription_request( # pylint: disable=name-too-long - remediation_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "remediationName": _SERIALIZER.url("remediation_name", remediation_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_at_subscription_request(remediation_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "remediationName": _SERIALIZER.url("remediation_name", remediation_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_at_subscription_request(remediation_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "remediationName": _SERIALIZER.url("remediation_name", remediation_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_deployments_at_resource_group_request( # pylint: disable=name-too-long - resource_group_name: str, remediation_name: str, subscription_id: str, *, top: Optional[int] = None, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/listDeployments", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "remediationName": _SERIALIZER.url("remediation_name", remediation_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int", minimum=0) - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_cancel_at_resource_group_request( - resource_group_name: str, remediation_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/cancel", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "remediationName": _SERIALIZER.url("remediation_name", remediation_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_for_resource_group_request( - resource_group_name: str, - subscription_id: str, - *, - top: Optional[int] = None, - filter: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/remediations", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int", minimum=0) - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_at_resource_group_request( # pylint: disable=name-too-long - resource_group_name: str, remediation_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "remediationName": _SERIALIZER.url("remediation_name", remediation_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_at_resource_group_request( - resource_group_name: str, remediation_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "remediationName": _SERIALIZER.url("remediation_name", remediation_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_at_resource_group_request( - resource_group_name: str, remediation_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "remediationName": _SERIALIZER.url("remediation_name", remediation_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_deployments_at_resource_request( # pylint: disable=name-too-long - resource_id: str, remediation_name: str, *, top: Optional[int] = None, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/{resourceId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/listDeployments", - ) - path_format_arguments = { - "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), - "remediationName": _SERIALIZER.url("remediation_name", remediation_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int", minimum=0) - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_cancel_at_resource_request(resource_id: str, remediation_name: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", "/{resourceId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/cancel" - ) - path_format_arguments = { - "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), - "remediationName": _SERIALIZER.url("remediation_name", remediation_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_for_resource_request( - resource_id: str, *, top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/{resourceId}/providers/Microsoft.PolicyInsights/remediations") - path_format_arguments = { - "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int", minimum=0) - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_at_resource_request( # pylint: disable=name-too-long - resource_id: str, remediation_name: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/{resourceId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}") - path_format_arguments = { - "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), - "remediationName": _SERIALIZER.url("remediation_name", remediation_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_at_resource_request(resource_id: str, remediation_name: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/{resourceId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}") - path_format_arguments = { - "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), - "remediationName": _SERIALIZER.url("remediation_name", remediation_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_at_resource_request(resource_id: str, remediation_name: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/{resourceId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}") - path_format_arguments = { - "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), - "remediationName": _SERIALIZER.url("remediation_name", remediation_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class RemediationsOperations: # pylint: disable=too-many-public-methods - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.policyinsights.PolicyInsightsClient`'s - :attr:`remediations` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: PolicyInsightsClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_deployments_at_management_group( - self, - management_group_id: str, - remediation_name: str, - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> ItemPaged["_models.RemediationDeployment"]: - """Gets all deployments for a remediation at management group scope. - - :param management_group_id: Management group ID. Required. - :type management_group_id: str - :param remediation_name: The name of the remediation. Required. - :type remediation_name: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either RemediationDeployment or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.RemediationDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( - "management_groups_namespace", "Microsoft.Management" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.RemediationDeploymentsListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - if query_options is not None: - _top = query_options.top - - _request = build_list_deployments_at_management_group_request( - management_group_id=management_group_id, - remediation_name=remediation_name, - top=_top, - management_groups_namespace=management_groups_namespace, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("RemediationDeploymentsListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def cancel_at_management_group( - self, management_group_id: str, remediation_name: str, **kwargs: Any - ) -> _models.Remediation: - """Cancels a remediation at management group scope. - - :param management_group_id: Management group ID. Required. - :type management_group_id: str - :param remediation_name: The name of the remediation. Required. - :type remediation_name: str - :return: Remediation or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.Remediation - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( - "management_groups_namespace", "Microsoft.Management" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.Remediation] = kwargs.pop("cls", None) - - _request = build_cancel_at_management_group_request( - management_group_id=management_group_id, - remediation_name=remediation_name, - management_groups_namespace=management_groups_namespace, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Remediation", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_for_management_group( - self, management_group_id: str, query_options: Optional[_models.QueryOptions] = None, **kwargs: Any - ) -> ItemPaged["_models.Remediation"]: - """Gets all remediations for the management group. - - :param management_group_id: Management group ID. Required. - :type management_group_id: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either Remediation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.Remediation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( - "management_groups_namespace", "Microsoft.Management" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.RemediationListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - _filter = None - if query_options is not None: - _filter = query_options.filter - _top = query_options.top - - _request = build_list_for_management_group_request( - management_group_id=management_group_id, - top=_top, - filter=_filter, - management_groups_namespace=management_groups_namespace, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("RemediationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @overload - def create_or_update_at_management_group( - self, - management_group_id: str, - remediation_name: str, - parameters: _models.Remediation, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Remediation: - """Creates or updates a remediation at management group scope. - - :param management_group_id: Management group ID. Required. - :type management_group_id: str - :param remediation_name: The name of the remediation. Required. - :type remediation_name: str - :param parameters: The remediation parameters. Required. - :type parameters: ~azure.mgmt.policyinsights.models.Remediation - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Remediation or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.Remediation - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update_at_management_group( - self, - management_group_id: str, - remediation_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Remediation: - """Creates or updates a remediation at management group scope. - - :param management_group_id: Management group ID. Required. - :type management_group_id: str - :param remediation_name: The name of the remediation. Required. - :type remediation_name: str - :param parameters: The remediation parameters. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: Remediation or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.Remediation - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update_at_management_group( - self, - management_group_id: str, - remediation_name: str, - parameters: Union[_models.Remediation, IO[bytes]], - **kwargs: Any - ) -> _models.Remediation: - """Creates or updates a remediation at management group scope. - - :param management_group_id: Management group ID. Required. - :type management_group_id: str - :param remediation_name: The name of the remediation. Required. - :type remediation_name: str - :param parameters: The remediation parameters. Is either a Remediation type or a IO[bytes] - type. Required. - :type parameters: ~azure.mgmt.policyinsights.models.Remediation or IO[bytes] - :return: Remediation or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.Remediation - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( - "management_groups_namespace", "Microsoft.Management" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Remediation] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "Remediation") - - _request = build_create_or_update_at_management_group_request( - management_group_id=management_group_id, - remediation_name=remediation_name, - management_groups_namespace=management_groups_namespace, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Remediation", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def get_at_management_group( - self, management_group_id: str, remediation_name: str, **kwargs: Any - ) -> _models.Remediation: - """Gets an existing remediation at management group scope. - - :param management_group_id: Management group ID. Required. - :type management_group_id: str - :param remediation_name: The name of the remediation. Required. - :type remediation_name: str - :return: Remediation or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.Remediation - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( - "management_groups_namespace", "Microsoft.Management" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.Remediation] = kwargs.pop("cls", None) - - _request = build_get_at_management_group_request( - management_group_id=management_group_id, - remediation_name=remediation_name, - management_groups_namespace=management_groups_namespace, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Remediation", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete_at_management_group( - self, management_group_id: str, remediation_name: str, **kwargs: Any - ) -> Optional[_models.Remediation]: - """Deletes an existing remediation at management group scope. - - :param management_group_id: Management group ID. Required. - :type management_group_id: str - :param remediation_name: The name of the remediation. Required. - :type remediation_name: str - :return: Remediation or None or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.Remediation or None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - management_groups_namespace: Literal["Microsoft.Management"] = kwargs.pop( - "management_groups_namespace", "Microsoft.Management" - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[Optional[_models.Remediation]] = kwargs.pop("cls", None) - - _request = build_delete_at_management_group_request( - management_group_id=management_group_id, - remediation_name=remediation_name, - management_groups_namespace=management_groups_namespace, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("Remediation", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_deployments_at_subscription( - self, remediation_name: str, query_options: Optional[_models.QueryOptions] = None, **kwargs: Any - ) -> ItemPaged["_models.RemediationDeployment"]: - """Gets all deployments for a remediation at subscription scope. - - :param remediation_name: The name of the remediation. Required. - :type remediation_name: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either RemediationDeployment or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.RemediationDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.RemediationDeploymentsListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - if query_options is not None: - _top = query_options.top - - _request = build_list_deployments_at_subscription_request( - remediation_name=remediation_name, - subscription_id=self._config.subscription_id, - top=_top, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("RemediationDeploymentsListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def cancel_at_subscription(self, remediation_name: str, **kwargs: Any) -> _models.Remediation: - """Cancels a remediation at subscription scope. - - :param remediation_name: The name of the remediation. Required. - :type remediation_name: str - :return: Remediation or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.Remediation - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.Remediation] = kwargs.pop("cls", None) - - _request = build_cancel_at_subscription_request( - remediation_name=remediation_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Remediation", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_for_subscription( - self, query_options: Optional[_models.QueryOptions] = None, **kwargs: Any - ) -> ItemPaged["_models.Remediation"]: - """Gets all remediations for the subscription. - - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either Remediation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.Remediation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.RemediationListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - _filter = None - if query_options is not None: - _filter = query_options.filter - _top = query_options.top - - _request = build_list_for_subscription_request( - subscription_id=self._config.subscription_id, - top=_top, - filter=_filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("RemediationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @overload - def create_or_update_at_subscription( - self, - remediation_name: str, - parameters: _models.Remediation, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Remediation: - """Creates or updates a remediation at subscription scope. - - :param remediation_name: The name of the remediation. Required. - :type remediation_name: str - :param parameters: The remediation parameters. Required. - :type parameters: ~azure.mgmt.policyinsights.models.Remediation - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Remediation or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.Remediation - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update_at_subscription( - self, remediation_name: str, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Remediation: - """Creates or updates a remediation at subscription scope. - - :param remediation_name: The name of the remediation. Required. - :type remediation_name: str - :param parameters: The remediation parameters. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: Remediation or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.Remediation - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update_at_subscription( - self, remediation_name: str, parameters: Union[_models.Remediation, IO[bytes]], **kwargs: Any - ) -> _models.Remediation: - """Creates or updates a remediation at subscription scope. - - :param remediation_name: The name of the remediation. Required. - :type remediation_name: str - :param parameters: The remediation parameters. Is either a Remediation type or a IO[bytes] - type. Required. - :type parameters: ~azure.mgmt.policyinsights.models.Remediation or IO[bytes] - :return: Remediation or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.Remediation - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Remediation] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "Remediation") - - _request = build_create_or_update_at_subscription_request( - remediation_name=remediation_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Remediation", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def get_at_subscription(self, remediation_name: str, **kwargs: Any) -> _models.Remediation: - """Gets an existing remediation at subscription scope. - - :param remediation_name: The name of the remediation. Required. - :type remediation_name: str - :return: Remediation or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.Remediation - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.Remediation] = kwargs.pop("cls", None) - - _request = build_get_at_subscription_request( - remediation_name=remediation_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Remediation", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete_at_subscription(self, remediation_name: str, **kwargs: Any) -> Optional[_models.Remediation]: - """Deletes an existing remediation at subscription scope. - - :param remediation_name: The name of the remediation. Required. - :type remediation_name: str - :return: Remediation or None or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.Remediation or None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[Optional[_models.Remediation]] = kwargs.pop("cls", None) - - _request = build_delete_at_subscription_request( - remediation_name=remediation_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("Remediation", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_deployments_at_resource_group( - self, - resource_group_name: str, - remediation_name: str, - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> ItemPaged["_models.RemediationDeployment"]: - """Gets all deployments for a remediation at resource group scope. - - :param resource_group_name: Resource group name. Required. - :type resource_group_name: str - :param remediation_name: The name of the remediation. Required. - :type remediation_name: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either RemediationDeployment or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.RemediationDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.RemediationDeploymentsListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - if query_options is not None: - _top = query_options.top - - _request = build_list_deployments_at_resource_group_request( - resource_group_name=resource_group_name, - remediation_name=remediation_name, - subscription_id=self._config.subscription_id, - top=_top, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("RemediationDeploymentsListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def cancel_at_resource_group( - self, resource_group_name: str, remediation_name: str, **kwargs: Any - ) -> _models.Remediation: - """Cancels a remediation at resource group scope. - - :param resource_group_name: Resource group name. Required. - :type resource_group_name: str - :param remediation_name: The name of the remediation. Required. - :type remediation_name: str - :return: Remediation or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.Remediation - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.Remediation] = kwargs.pop("cls", None) - - _request = build_cancel_at_resource_group_request( - resource_group_name=resource_group_name, - remediation_name=remediation_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Remediation", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_for_resource_group( - self, resource_group_name: str, query_options: Optional[_models.QueryOptions] = None, **kwargs: Any - ) -> ItemPaged["_models.Remediation"]: - """Gets all remediations for the subscription. - - :param resource_group_name: Resource group name. Required. - :type resource_group_name: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either Remediation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.Remediation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.RemediationListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - _filter = None - if query_options is not None: - _filter = query_options.filter - _top = query_options.top - - _request = build_list_for_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - top=_top, - filter=_filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("RemediationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @overload - def create_or_update_at_resource_group( - self, - resource_group_name: str, - remediation_name: str, - parameters: _models.Remediation, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Remediation: - """Creates or updates a remediation at resource group scope. - - :param resource_group_name: Resource group name. Required. - :type resource_group_name: str - :param remediation_name: The name of the remediation. Required. - :type remediation_name: str - :param parameters: The remediation parameters. Required. - :type parameters: ~azure.mgmt.policyinsights.models.Remediation - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Remediation or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.Remediation - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update_at_resource_group( - self, - resource_group_name: str, - remediation_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Remediation: - """Creates or updates a remediation at resource group scope. - - :param resource_group_name: Resource group name. Required. - :type resource_group_name: str - :param remediation_name: The name of the remediation. Required. - :type remediation_name: str - :param parameters: The remediation parameters. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: Remediation or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.Remediation - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update_at_resource_group( - self, - resource_group_name: str, - remediation_name: str, - parameters: Union[_models.Remediation, IO[bytes]], - **kwargs: Any - ) -> _models.Remediation: - """Creates or updates a remediation at resource group scope. - - :param resource_group_name: Resource group name. Required. - :type resource_group_name: str - :param remediation_name: The name of the remediation. Required. - :type remediation_name: str - :param parameters: The remediation parameters. Is either a Remediation type or a IO[bytes] - type. Required. - :type parameters: ~azure.mgmt.policyinsights.models.Remediation or IO[bytes] - :return: Remediation or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.Remediation - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Remediation] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "Remediation") - - _request = build_create_or_update_at_resource_group_request( - resource_group_name=resource_group_name, - remediation_name=remediation_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Remediation", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def get_at_resource_group( - self, resource_group_name: str, remediation_name: str, **kwargs: Any - ) -> _models.Remediation: - """Gets an existing remediation at resource group scope. - - :param resource_group_name: Resource group name. Required. - :type resource_group_name: str - :param remediation_name: The name of the remediation. Required. - :type remediation_name: str - :return: Remediation or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.Remediation - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.Remediation] = kwargs.pop("cls", None) - - _request = build_get_at_resource_group_request( - resource_group_name=resource_group_name, - remediation_name=remediation_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Remediation", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete_at_resource_group( - self, resource_group_name: str, remediation_name: str, **kwargs: Any - ) -> Optional[_models.Remediation]: - """Deletes an existing remediation at resource group scope. - - :param resource_group_name: Resource group name. Required. - :type resource_group_name: str - :param remediation_name: The name of the remediation. Required. - :type remediation_name: str - :return: Remediation or None or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.Remediation or None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[Optional[_models.Remediation]] = kwargs.pop("cls", None) - - _request = build_delete_at_resource_group_request( - resource_group_name=resource_group_name, - remediation_name=remediation_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("Remediation", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_deployments_at_resource( - self, - resource_id: str, - remediation_name: str, - query_options: Optional[_models.QueryOptions] = None, - **kwargs: Any - ) -> ItemPaged["_models.RemediationDeployment"]: - """Gets all deployments for a remediation at resource scope. - - :param resource_id: Resource ID. Required. - :type resource_id: str - :param remediation_name: The name of the remediation. Required. - :type remediation_name: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either RemediationDeployment or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.RemediationDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.RemediationDeploymentsListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - if query_options is not None: - _top = query_options.top - - _request = build_list_deployments_at_resource_request( - resource_id=resource_id, - remediation_name=remediation_name, - top=_top, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("RemediationDeploymentsListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def cancel_at_resource(self, resource_id: str, remediation_name: str, **kwargs: Any) -> _models.Remediation: - """Cancel a remediation at resource scope. - - :param resource_id: Resource ID. Required. - :type resource_id: str - :param remediation_name: The name of the remediation. Required. - :type remediation_name: str - :return: Remediation or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.Remediation - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.Remediation] = kwargs.pop("cls", None) - - _request = build_cancel_at_resource_request( - resource_id=resource_id, - remediation_name=remediation_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Remediation", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_for_resource( - self, resource_id: str, query_options: Optional[_models.QueryOptions] = None, **kwargs: Any - ) -> ItemPaged["_models.Remediation"]: - """Gets all remediations for a resource. - - :param resource_id: Resource ID. Required. - :type resource_id: str - :param query_options: Parameter group. Default value is None. - :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions - :return: An iterator like instance of either Remediation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.Remediation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.RemediationListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - _top = None - _filter = None - if query_options is not None: - _filter = query_options.filter - _top = query_options.top - - _request = build_list_for_resource_request( - resource_id=resource_id, - top=_top, - filter=_filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("RemediationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @overload - def create_or_update_at_resource( - self, - resource_id: str, - remediation_name: str, - parameters: _models.Remediation, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Remediation: - """Creates or updates a remediation at resource scope. - - :param resource_id: Resource ID. Required. - :type resource_id: str - :param remediation_name: The name of the remediation. Required. - :type remediation_name: str - :param parameters: The remediation parameters. Required. - :type parameters: ~azure.mgmt.policyinsights.models.Remediation - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Remediation or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.Remediation - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update_at_resource( - self, - resource_id: str, - remediation_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Remediation: - """Creates or updates a remediation at resource scope. - - :param resource_id: Resource ID. Required. - :type resource_id: str - :param remediation_name: The name of the remediation. Required. - :type remediation_name: str - :param parameters: The remediation parameters. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: Remediation or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.Remediation - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update_at_resource( - self, resource_id: str, remediation_name: str, parameters: Union[_models.Remediation, IO[bytes]], **kwargs: Any - ) -> _models.Remediation: - """Creates or updates a remediation at resource scope. - - :param resource_id: Resource ID. Required. - :type resource_id: str - :param remediation_name: The name of the remediation. Required. - :type remediation_name: str - :param parameters: The remediation parameters. Is either a Remediation type or a IO[bytes] - type. Required. - :type parameters: ~azure.mgmt.policyinsights.models.Remediation or IO[bytes] - :return: Remediation or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.Remediation - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Remediation] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "Remediation") - - _request = build_create_or_update_at_resource_request( - resource_id=resource_id, - remediation_name=remediation_name, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Remediation", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def get_at_resource(self, resource_id: str, remediation_name: str, **kwargs: Any) -> _models.Remediation: - """Gets an existing remediation at resource scope. - - :param resource_id: Resource ID. Required. - :type resource_id: str - :param remediation_name: The name of the remediation. Required. - :type remediation_name: str - :return: Remediation or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.Remediation - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[_models.Remediation] = kwargs.pop("cls", None) - - _request = build_get_at_resource_request( - resource_id=resource_id, - remediation_name=remediation_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Remediation", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete_at_resource( - self, resource_id: str, remediation_name: str, **kwargs: Any - ) -> Optional[_models.Remediation]: - """Deletes an existing remediation at individual resource scope. - - :param resource_id: Resource ID. Required. - :type resource_id: str - :param remediation_name: The name of the remediation. Required. - :type remediation_name: str - :return: Remediation or None or the result of cls(response) - :rtype: ~azure.mgmt.policyinsights.models.Remediation or None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) - cls: ClsType[Optional[_models.Remediation]] = kwargs.pop("cls", None) - - _request = build_delete_at_resource_request( - resource_id=resource_id, - remediation_name=remediation_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("Remediation", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/code_report_swagger.json b/sdk/policyinsights/azure-mgmt-policyinsights/code_report_swagger.json new file mode 100644 index 000000000000..9ba350113491 --- /dev/null +++ b/sdk/policyinsights/azure-mgmt-policyinsights/code_report_swagger.json @@ -0,0 +1,15218 @@ +{ + "azure.mgmt.policyinsights": { + "class_nodes": { + "PolicyInsightsClient": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "credential": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "base_url": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "cloud_setting": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "close": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "client_side_validation": { + "attr_type": false + }, + "policy_tracked_resources": { + "attr_type": "PolicyTrackedResourcesOperations" + }, + "remediations": { + "attr_type": "RemediationsOperations" + }, + "policy_events": { + "attr_type": "PolicyEventsOperations" + }, + "policy_states": { + "attr_type": "PolicyStatesOperations" + }, + "policy_metadata": { + "attr_type": "PolicyMetadataOperations" + }, + "policy_restrictions": { + "attr_type": "PolicyRestrictionsOperations" + }, + "component_policy_states": { + "attr_type": "ComponentPolicyStatesOperations" + }, + "operations": { + "attr_type": "Operations" + }, + "attestations": { + "attr_type": "AttestationsOperations" + } + } + } + }, + "function_nodes": {} + }, + "azure.mgmt.policyinsights.operations": { + "class_nodes": { + "AttestationsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update_at_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "Attestation", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_create_or_update_at_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "Attestation", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_create_or_update_at_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "Attestation", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "delete_at_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "delete_at_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "delete_at_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get_at_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get_at_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get_at_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_for_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_for_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_for_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ComponentPolicyStatesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_policy_definition": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_definition_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "component_policy_states_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "order_by": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "select": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "from_parameter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "to": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "apply": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "component_policy_states_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "order_by": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "select": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "from_parameter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "to": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "apply": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "expand": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "component_policy_states_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "order_by": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "select": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "from_parameter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "to": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "apply": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_resource_group_level_policy_assignment": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_assignment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "component_policy_states_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "order_by": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "select": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "from_parameter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "to": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "apply": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "component_policy_states_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "order_by": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "select": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "from_parameter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "to": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "apply": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_subscription_level_policy_assignment": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_assignment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "component_policy_states_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "order_by": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "select": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "from_parameter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "to": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "apply": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "Operations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "PolicyEventsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_management_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_events_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_policy_definition": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_events_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_definition_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_policy_set_definition": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_events_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_set_definition_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_events_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_events_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_resource_group_level_policy_assignment": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_events_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_assignment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_events_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_subscription_level_policy_assignment": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_events_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_assignment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "PolicyMetadataOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "PolicyRestrictionsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "check_at_management_group_scope": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "CheckManagementGroupRestrictionsRequest", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "check_at_resource_group_scope": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "CheckRestrictionsRequest", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "check_at_subscription_scope": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "CheckRestrictionsRequest", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "PolicyStatesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_trigger_resource_group_evaluation": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_trigger_subscription_evaluation": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_management_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_policy_definition": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_definition_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_policy_set_definition": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_set_definition_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_resource_group_level_policy_assignment": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_assignment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_subscription_level_policy_assignment": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_assignment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "summarize_for_management_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_summary_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "summarize_for_policy_definition": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_summary_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_definition_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "summarize_for_policy_set_definition": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_summary_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_set_definition_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "summarize_for_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_summary_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "summarize_for_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_summary_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "summarize_for_resource_group_level_policy_assignment": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_summary_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_assignment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "summarize_for_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_summary_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "summarize_for_subscription_level_policy_assignment": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_summary_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_assignment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "PolicyTrackedResourcesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_management_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_tracked_resources_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_tracked_resources_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_tracked_resources_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_tracked_resources_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "RemediationsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "cancel_at_management_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "cancel_at_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "cancel_at_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "cancel_at_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update_at_management_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "Remediation", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "create_or_update_at_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "Remediation", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "create_or_update_at_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "Remediation", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "create_or_update_at_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "Remediation", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "delete_at_management_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "delete_at_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "delete_at_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "delete_at_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get_at_management_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get_at_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get_at_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get_at_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_deployments_at_management_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_deployments_at_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_deployments_at_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_deployments_at_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_for_management_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_for_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_for_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_for_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + } + }, + "function_nodes": {} + }, + "azure.mgmt.policyinsights.models": { + "class_nodes": { + "Attestation": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_assignment_id": { + "default": null, + "param_type": "keyword_only" + }, + "policy_definition_reference_id": { + "default": "none", + "param_type": "keyword_only" + }, + "compliance_state": { + "default": "none", + "param_type": "keyword_only" + }, + "expires_on": { + "default": "none", + "param_type": "keyword_only" + }, + "owner": { + "default": "none", + "param_type": "keyword_only" + }, + "comments": { + "default": "none", + "param_type": "keyword_only" + }, + "evidence": { + "default": "none", + "param_type": "keyword_only" + }, + "assessment_date": { + "default": "none", + "param_type": "keyword_only" + }, + "metadata": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "system_data": { + "attr_type": null + }, + "policy_assignment_id": { + "attr_type": "policy_assignment_id" + }, + "policy_definition_reference_id": { + "attr_type": "policy_definition_reference_id" + }, + "compliance_state": { + "attr_type": "compliance_state" + }, + "expires_on": { + "attr_type": "expires_on" + }, + "owner": { + "attr_type": "owner" + }, + "comments": { + "attr_type": "comments" + }, + "evidence": { + "attr_type": "evidence" + }, + "provisioning_state": { + "attr_type": null + }, + "last_compliance_state_change_at": { + "attr_type": null + }, + "assessment_date": { + "attr_type": "assessment_date" + }, + "metadata": { + "attr_type": "metadata" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "AttestationEvidence": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "description": { + "default": "none", + "param_type": "keyword_only" + }, + "source_uri": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "description": { + "attr_type": "description" + }, + "source_uri": { + "attr_type": "source_uri" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "AttestationListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "CheckManagementGroupRestrictionsRequest": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_details": { + "default": "none", + "param_type": "keyword_only" + }, + "pending_fields": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "resource_details": { + "attr_type": "resource_details" + }, + "pending_fields": { + "attr_type": "pending_fields" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "CheckRestrictionEvaluationDetails": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "evaluated_expressions": { + "default": "none", + "param_type": "keyword_only" + }, + "if_not_exists_details": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "evaluated_expressions": { + "attr_type": "evaluated_expressions" + }, + "if_not_exists_details": { + "attr_type": "if_not_exists_details" + }, + "reason": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "CheckRestrictionsRequest": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_details": { + "default": null, + "param_type": "keyword_only" + }, + "pending_fields": { + "default": "none", + "param_type": "keyword_only" + }, + "include_audit_effect": { + "default": "bool", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "resource_details": { + "attr_type": "resource_details" + }, + "pending_fields": { + "attr_type": "pending_fields" + }, + "include_audit_effect": { + "attr_type": "include_audit_effect" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "CheckRestrictionsResourceDetails": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_content": { + "default": null, + "param_type": "keyword_only" + }, + "api_version": { + "default": "none", + "param_type": "keyword_only" + }, + "scope": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "resource_content": { + "attr_type": "resource_content" + }, + "api_version": { + "attr_type": "api_version" + }, + "scope": { + "attr_type": "scope" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "CheckRestrictionsResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "field_restrictions": { + "attr_type": null + }, + "content_evaluation_result": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "CheckRestrictionsResultContentEvaluationResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_evaluations": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "policy_evaluations": { + "attr_type": "policy_evaluations" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ComplianceDetail": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "compliance_state": { + "default": "none", + "param_type": "keyword_only" + }, + "count": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "compliance_state": { + "attr_type": "compliance_state" + }, + "count": { + "attr_type": "count" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ComplianceState": { + "type": "Enum", + "methods": {}, + "properties": { + "COMPLIANT": "COMPLIANT", + "NON_COMPLIANT": "NON_COMPLIANT", + "UNKNOWN": "UNKNOWN", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ComponentEventDetails": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "additional_properties": { + "default": "none", + "param_type": "keyword_only" + }, + "id": { + "default": "none", + "param_type": "keyword_only" + }, + "type": { + "default": "none", + "param_type": "keyword_only" + }, + "name": { + "default": "none", + "param_type": "keyword_only" + }, + "timestamp": { + "default": "none", + "param_type": "keyword_only" + }, + "tenant_id": { + "default": "none", + "param_type": "keyword_only" + }, + "principal_oid": { + "default": "none", + "param_type": "keyword_only" + }, + "policy_definition_action": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "additional_properties": { + "attr_type": null + }, + "id": { + "attr_type": "id" + }, + "type": { + "attr_type": "type" + }, + "name": { + "attr_type": "name" + }, + "timestamp": { + "attr_type": "timestamp" + }, + "tenant_id": { + "attr_type": "tenant_id" + }, + "principal_oid": { + "attr_type": "principal_oid" + }, + "policy_definition_action": { + "attr_type": "policy_definition_action" + } + } + }, + "ComponentExpressionEvaluationDetails": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "result": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "result": { + "attr_type": "result" + }, + "expression": { + "attr_type": null + }, + "expression_kind": { + "attr_type": null + }, + "path": { + "attr_type": null + }, + "expression_value": { + "attr_type": null + }, + "target_value": { + "attr_type": null + }, + "operator": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ComponentPolicyEvaluationDetails": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "reason": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "evaluated_expressions": { + "attr_type": null + }, + "reason": { + "attr_type": "reason" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ComponentPolicyState": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "additional_properties": { + "default": "none", + "param_type": "keyword_only" + }, + "policy_evaluation_details": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "additional_properties": { + "attr_type": null + }, + "odata_id": { + "attr_type": null + }, + "odata_context": { + "attr_type": null + }, + "timestamp": { + "attr_type": null + }, + "component_id": { + "attr_type": null + }, + "component_type": { + "attr_type": null + }, + "component_name": { + "attr_type": null + }, + "resource_id": { + "attr_type": null + }, + "policy_assignment_id": { + "attr_type": null + }, + "policy_definition_id": { + "attr_type": null + }, + "subscription_id": { + "attr_type": null + }, + "resource_type": { + "attr_type": null + }, + "resource_location": { + "attr_type": null + }, + "resource_group": { + "attr_type": null + }, + "policy_assignment_name": { + "attr_type": null + }, + "policy_assignment_owner": { + "attr_type": null + }, + "policy_assignment_parameters": { + "attr_type": null + }, + "policy_assignment_scope": { + "attr_type": null + }, + "policy_definition_name": { + "attr_type": null + }, + "policy_definition_action": { + "attr_type": null + }, + "policy_definition_category": { + "attr_type": null + }, + "policy_set_definition_id": { + "attr_type": null + }, + "policy_set_definition_name": { + "attr_type": null + }, + "policy_set_definition_owner": { + "attr_type": null + }, + "policy_set_definition_category": { + "attr_type": null + }, + "policy_set_definition_parameters": { + "attr_type": null + }, + "policy_definition_reference_id": { + "attr_type": null + }, + "compliance_state": { + "attr_type": null + }, + "policy_evaluation_details": { + "attr_type": "policy_evaluation_details" + }, + "policy_definition_group_names": { + "attr_type": null + }, + "policy_definition_version": { + "attr_type": null + }, + "policy_set_definition_version": { + "attr_type": null + }, + "policy_assignment_version": { + "attr_type": null + } + } + }, + "ComponentPolicyStatesQueryResults": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "odata_context": { + "default": "none", + "param_type": "keyword_only" + }, + "odata_count": { + "default": "none", + "param_type": "keyword_only" + }, + "value": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "odata_context": { + "attr_type": "odata_context" + }, + "odata_count": { + "attr_type": "odata_count" + }, + "value": { + "attr_type": "value" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ComponentPolicyStatesResource": { + "type": "Enum", + "methods": {}, + "properties": { + "LATEST": "LATEST", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ComponentStateDetails": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "additional_properties": { + "default": "none", + "param_type": "keyword_only" + }, + "id": { + "default": "none", + "param_type": "keyword_only" + }, + "type": { + "default": "none", + "param_type": "keyword_only" + }, + "name": { + "default": "none", + "param_type": "keyword_only" + }, + "timestamp": { + "default": "none", + "param_type": "keyword_only" + }, + "compliance_state": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "additional_properties": { + "attr_type": null + }, + "id": { + "attr_type": "id" + }, + "type": { + "attr_type": "type" + }, + "name": { + "attr_type": "name" + }, + "timestamp": { + "attr_type": "timestamp" + }, + "compliance_state": { + "attr_type": "compliance_state" + } + } + }, + "CreatedByType": { + "type": "Enum", + "methods": {}, + "properties": { + "APPLICATION": "APPLICATION", + "KEY": "KEY", + "MANAGED_IDENTITY": "MANAGED_IDENTITY", + "USER": "USER", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ErrorDefinition": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "code": { + "attr_type": null + }, + "message": { + "attr_type": null + }, + "target": { + "attr_type": null + }, + "details": { + "attr_type": null + }, + "additional_info": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ErrorDefinitionAutoGenerated": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "code": { + "attr_type": null + }, + "message": { + "attr_type": null + }, + "target": { + "attr_type": null + }, + "details": { + "attr_type": null + }, + "additional_info": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ErrorDefinitionAutoGenerated2": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "code": { + "attr_type": null + }, + "message": { + "attr_type": null + }, + "target": { + "attr_type": null + }, + "details": { + "attr_type": null + }, + "additional_info": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ErrorResponse": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "error": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "error": { + "attr_type": "error" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ErrorResponseAutoGenerated": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "error": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "error": { + "attr_type": "error" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ErrorResponseAutoGenerated2": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "error": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "error": { + "attr_type": "error" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ExpressionEvaluationDetails": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "result": { + "default": "none", + "param_type": "keyword_only" + }, + "expression": { + "default": "none", + "param_type": "keyword_only" + }, + "path": { + "default": "none", + "param_type": "keyword_only" + }, + "expression_value": { + "default": "none", + "param_type": "keyword_only" + }, + "target_value": { + "default": "none", + "param_type": "keyword_only" + }, + "operator": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "result": { + "attr_type": "result" + }, + "expression": { + "attr_type": "expression" + }, + "expression_kind": { + "attr_type": null + }, + "path": { + "attr_type": "path" + }, + "expression_value": { + "attr_type": "expression_value" + }, + "target_value": { + "attr_type": "target_value" + }, + "operator": { + "attr_type": "operator" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "FieldRestriction": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "result": { + "attr_type": null + }, + "default_value": { + "attr_type": null + }, + "values": { + "attr_type": null + }, + "policy": { + "attr_type": null + }, + "policy_effect": { + "attr_type": null + }, + "reason": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "FieldRestrictionResult": { + "type": "Enum", + "methods": {}, + "properties": { + "AUDIT": "AUDIT", + "DENY": "DENY", + "REMOVED": "REMOVED", + "REQUIRED": "REQUIRED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "FieldRestrictions": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "restrictions": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "field": { + "attr_type": null + }, + "restrictions": { + "attr_type": "restrictions" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "IfNotExistsEvaluationDetails": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": "none", + "param_type": "keyword_only" + }, + "total_resources": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "resource_id": { + "attr_type": "resource_id" + }, + "total_resources": { + "attr_type": "total_resources" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "Operation": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "name": { + "default": "none", + "param_type": "keyword_only" + }, + "is_data_action": { + "default": "none", + "param_type": "keyword_only" + }, + "display": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name": { + "attr_type": "name" + }, + "is_data_action": { + "attr_type": "is_data_action" + }, + "display": { + "attr_type": "display" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "OperationDisplay": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "provider": { + "default": "none", + "param_type": "keyword_only" + }, + "resource": { + "default": "none", + "param_type": "keyword_only" + }, + "operation": { + "default": "none", + "param_type": "keyword_only" + }, + "description": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "provider": { + "attr_type": "provider" + }, + "resource": { + "attr_type": "resource" + }, + "operation": { + "attr_type": "operation" + }, + "description": { + "attr_type": "description" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "OperationsListResults": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "odata_count": { + "default": "none", + "param_type": "keyword_only" + }, + "value": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "odata_count": { + "attr_type": "odata_count" + }, + "value": { + "attr_type": "value" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "PendingField": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "field": { + "default": null, + "param_type": "keyword_only" + }, + "values": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "field": { + "attr_type": "field" + }, + "values": { + "attr_type": "values" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "PolicyAssignmentSummary": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_assignment_id": { + "default": "none", + "param_type": "keyword_only" + }, + "policy_set_definition_id": { + "default": "none", + "param_type": "keyword_only" + }, + "results": { + "default": "none", + "param_type": "keyword_only" + }, + "policy_definitions": { + "default": "none", + "param_type": "keyword_only" + }, + "policy_groups": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "policy_assignment_id": { + "attr_type": "policy_assignment_id" + }, + "policy_set_definition_id": { + "attr_type": "policy_set_definition_id" + }, + "results": { + "attr_type": "results" + }, + "policy_definitions": { + "attr_type": "policy_definitions" + }, + "policy_groups": { + "attr_type": "policy_groups" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "PolicyDefinitionSummary": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_definition_id": { + "default": "none", + "param_type": "keyword_only" + }, + "policy_definition_reference_id": { + "default": "none", + "param_type": "keyword_only" + }, + "policy_definition_group_names": { + "default": "none", + "param_type": "keyword_only" + }, + "effect": { + "default": "none", + "param_type": "keyword_only" + }, + "results": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "policy_definition_id": { + "attr_type": "policy_definition_id" + }, + "policy_definition_reference_id": { + "attr_type": "policy_definition_reference_id" + }, + "policy_definition_group_names": { + "attr_type": "policy_definition_group_names" + }, + "effect": { + "attr_type": "effect" + }, + "results": { + "attr_type": "results" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "PolicyDetails": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "policy_definition_id": { + "attr_type": null + }, + "policy_assignment_id": { + "attr_type": null + }, + "policy_assignment_display_name": { + "attr_type": null + }, + "policy_assignment_scope": { + "attr_type": null + }, + "policy_set_definition_id": { + "attr_type": null + }, + "policy_definition_reference_id": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "PolicyEffectDetails": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "policy_effect": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "PolicyEvaluationDetails": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "evaluated_expressions": { + "default": "none", + "param_type": "keyword_only" + }, + "if_not_exists_details": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "evaluated_expressions": { + "attr_type": "evaluated_expressions" + }, + "if_not_exists_details": { + "attr_type": "if_not_exists_details" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "PolicyEvaluationResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "policy_info": { + "attr_type": null + }, + "evaluation_result": { + "attr_type": null + }, + "evaluation_details": { + "attr_type": null + }, + "effect_details": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "PolicyEvent": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "additional_properties": { + "default": "none", + "param_type": "keyword_only" + }, + "odata_id": { + "default": "none", + "param_type": "keyword_only" + }, + "odata_context": { + "default": "none", + "param_type": "keyword_only" + }, + "timestamp": { + "default": "none", + "param_type": "keyword_only" + }, + "resource_id": { + "default": "none", + "param_type": "keyword_only" + }, + "policy_assignment_id": { + "default": "none", + "param_type": "keyword_only" + }, + "policy_definition_id": { + "default": "none", + "param_type": "keyword_only" + }, + "effective_parameters": { + "default": "none", + "param_type": "keyword_only" + }, + "is_compliant": { + "default": "none", + "param_type": "keyword_only" + }, + "subscription_id": { + "default": "none", + "param_type": "keyword_only" + }, + "resource_type": { + "default": "none", + "param_type": "keyword_only" + }, + "resource_location": { + "default": "none", + "param_type": "keyword_only" + }, + "resource_group": { + "default": "none", + "param_type": "keyword_only" + }, + "resource_tags": { + "default": "none", + "param_type": "keyword_only" + }, + "policy_assignment_name": { + "default": "none", + "param_type": "keyword_only" + }, + "policy_assignment_owner": { + "default": "none", + "param_type": "keyword_only" + }, + "policy_assignment_parameters": { + "default": "none", + "param_type": "keyword_only" + }, + "policy_assignment_scope": { + "default": "none", + "param_type": "keyword_only" + }, + "policy_definition_name": { + "default": "none", + "param_type": "keyword_only" + }, + "policy_definition_action": { + "default": "none", + "param_type": "keyword_only" + }, + "policy_definition_category": { + "default": "none", + "param_type": "keyword_only" + }, + "policy_set_definition_id": { + "default": "none", + "param_type": "keyword_only" + }, + "policy_set_definition_name": { + "default": "none", + "param_type": "keyword_only" + }, + "policy_set_definition_owner": { + "default": "none", + "param_type": "keyword_only" + }, + "policy_set_definition_category": { + "default": "none", + "param_type": "keyword_only" + }, + "policy_set_definition_parameters": { + "default": "none", + "param_type": "keyword_only" + }, + "management_group_ids": { + "default": "none", + "param_type": "keyword_only" + }, + "policy_definition_reference_id": { + "default": "none", + "param_type": "keyword_only" + }, + "compliance_state": { + "default": "none", + "param_type": "keyword_only" + }, + "tenant_id": { + "default": "none", + "param_type": "keyword_only" + }, + "principal_oid": { + "default": "none", + "param_type": "keyword_only" + }, + "components": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "additional_properties": { + "attr_type": null + }, + "odata_id": { + "attr_type": "odata_id" + }, + "odata_context": { + "attr_type": "odata_context" + }, + "timestamp": { + "attr_type": "timestamp" + }, + "resource_id": { + "attr_type": "resource_id" + }, + "policy_assignment_id": { + "attr_type": "policy_assignment_id" + }, + "policy_definition_id": { + "attr_type": "policy_definition_id" + }, + "effective_parameters": { + "attr_type": "effective_parameters" + }, + "is_compliant": { + "attr_type": "is_compliant" + }, + "subscription_id": { + "attr_type": "subscription_id" + }, + "resource_type": { + "attr_type": "resource_type" + }, + "resource_location": { + "attr_type": "resource_location" + }, + "resource_group": { + "attr_type": "resource_group" + }, + "resource_tags": { + "attr_type": "resource_tags" + }, + "policy_assignment_name": { + "attr_type": "policy_assignment_name" + }, + "policy_assignment_owner": { + "attr_type": "policy_assignment_owner" + }, + "policy_assignment_parameters": { + "attr_type": "policy_assignment_parameters" + }, + "policy_assignment_scope": { + "attr_type": "policy_assignment_scope" + }, + "policy_definition_name": { + "attr_type": "policy_definition_name" + }, + "policy_definition_action": { + "attr_type": "policy_definition_action" + }, + "policy_definition_category": { + "attr_type": "policy_definition_category" + }, + "policy_set_definition_id": { + "attr_type": "policy_set_definition_id" + }, + "policy_set_definition_name": { + "attr_type": "policy_set_definition_name" + }, + "policy_set_definition_owner": { + "attr_type": "policy_set_definition_owner" + }, + "policy_set_definition_category": { + "attr_type": "policy_set_definition_category" + }, + "policy_set_definition_parameters": { + "attr_type": "policy_set_definition_parameters" + }, + "management_group_ids": { + "attr_type": "management_group_ids" + }, + "policy_definition_reference_id": { + "attr_type": "policy_definition_reference_id" + }, + "compliance_state": { + "attr_type": "compliance_state" + }, + "tenant_id": { + "attr_type": "tenant_id" + }, + "principal_oid": { + "attr_type": "principal_oid" + }, + "components": { + "attr_type": "components" + } + } + }, + "PolicyEventsQueryResults": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "odata_context": { + "default": "none", + "param_type": "keyword_only" + }, + "odata_count": { + "default": "none", + "param_type": "keyword_only" + }, + "odata_next_link": { + "default": "none", + "param_type": "keyword_only" + }, + "value": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "odata_context": { + "attr_type": "odata_context" + }, + "odata_count": { + "attr_type": "odata_count" + }, + "odata_next_link": { + "attr_type": "odata_next_link" + }, + "value": { + "attr_type": "value" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "PolicyEventsResourceType": { + "type": "Enum", + "methods": {}, + "properties": { + "DEFAULT": "DEFAULT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "PolicyGroupSummary": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_group_name": { + "default": "none", + "param_type": "keyword_only" + }, + "results": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "policy_group_name": { + "attr_type": "policy_group_name" + }, + "results": { + "attr_type": "results" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "PolicyMetadata": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "id": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "metadata_id": { + "attr_type": null + }, + "category": { + "attr_type": null + }, + "title": { + "attr_type": null + }, + "owner": { + "attr_type": null + }, + "additional_content_url": { + "attr_type": null + }, + "metadata": { + "attr_type": null + }, + "description": { + "attr_type": null + }, + "requirements": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "PolicyMetadataCollection": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "PolicyMetadataProperties": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "description": { + "attr_type": null + }, + "requirements": { + "attr_type": null + }, + "metadata_id": { + "attr_type": null + }, + "category": { + "attr_type": null + }, + "title": { + "attr_type": null + }, + "owner": { + "attr_type": null + }, + "additional_content_url": { + "attr_type": null + }, + "metadata": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "PolicyMetadataSlimProperties": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "metadata_id": { + "attr_type": null + }, + "category": { + "attr_type": null + }, + "title": { + "attr_type": null + }, + "owner": { + "attr_type": null + }, + "additional_content_url": { + "attr_type": null + }, + "metadata": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "PolicyReference": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "policy_definition_id": { + "attr_type": null + }, + "policy_set_definition_id": { + "attr_type": null + }, + "policy_definition_reference_id": { + "attr_type": null + }, + "policy_assignment_id": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "PolicyState": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "additional_properties": { + "default": "none", + "param_type": "keyword_only" + }, + "odata_id": { + "default": "none", + "param_type": "keyword_only" + }, + "odata_context": { + "default": "none", + "param_type": "keyword_only" + }, + "timestamp": { + "default": "none", + "param_type": "keyword_only" + }, + "resource_id": { + "default": "none", + "param_type": "keyword_only" + }, + "policy_assignment_id": { + "default": "none", + "param_type": "keyword_only" + }, + "policy_definition_id": { + "default": "none", + "param_type": "keyword_only" + }, + "effective_parameters": { + "default": "none", + "param_type": "keyword_only" + }, + "is_compliant": { + "default": "none", + "param_type": "keyword_only" + }, + "subscription_id": { + "default": "none", + "param_type": "keyword_only" + }, + "resource_type": { + "default": "none", + "param_type": "keyword_only" + }, + "resource_location": { + "default": "none", + "param_type": "keyword_only" + }, + "resource_group": { + "default": "none", + "param_type": "keyword_only" + }, + "resource_tags": { + "default": "none", + "param_type": "keyword_only" + }, + "policy_assignment_name": { + "default": "none", + "param_type": "keyword_only" + }, + "policy_assignment_owner": { + "default": "none", + "param_type": "keyword_only" + }, + "policy_assignment_parameters": { + "default": "none", + "param_type": "keyword_only" + }, + "policy_assignment_scope": { + "default": "none", + "param_type": "keyword_only" + }, + "policy_definition_name": { + "default": "none", + "param_type": "keyword_only" + }, + "policy_definition_action": { + "default": "none", + "param_type": "keyword_only" + }, + "policy_definition_category": { + "default": "none", + "param_type": "keyword_only" + }, + "policy_set_definition_id": { + "default": "none", + "param_type": "keyword_only" + }, + "policy_set_definition_name": { + "default": "none", + "param_type": "keyword_only" + }, + "policy_set_definition_owner": { + "default": "none", + "param_type": "keyword_only" + }, + "policy_set_definition_category": { + "default": "none", + "param_type": "keyword_only" + }, + "policy_set_definition_parameters": { + "default": "none", + "param_type": "keyword_only" + }, + "management_group_ids": { + "default": "none", + "param_type": "keyword_only" + }, + "policy_definition_reference_id": { + "default": "none", + "param_type": "keyword_only" + }, + "compliance_state": { + "default": "none", + "param_type": "keyword_only" + }, + "policy_evaluation_details": { + "default": "none", + "param_type": "keyword_only" + }, + "policy_definition_group_names": { + "default": "none", + "param_type": "keyword_only" + }, + "components": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "additional_properties": { + "attr_type": null + }, + "odata_id": { + "attr_type": "odata_id" + }, + "odata_context": { + "attr_type": "odata_context" + }, + "timestamp": { + "attr_type": "timestamp" + }, + "resource_id": { + "attr_type": "resource_id" + }, + "policy_assignment_id": { + "attr_type": "policy_assignment_id" + }, + "policy_definition_id": { + "attr_type": "policy_definition_id" + }, + "effective_parameters": { + "attr_type": "effective_parameters" + }, + "is_compliant": { + "attr_type": "is_compliant" + }, + "subscription_id": { + "attr_type": "subscription_id" + }, + "resource_type": { + "attr_type": "resource_type" + }, + "resource_location": { + "attr_type": "resource_location" + }, + "resource_group": { + "attr_type": "resource_group" + }, + "resource_tags": { + "attr_type": "resource_tags" + }, + "policy_assignment_name": { + "attr_type": "policy_assignment_name" + }, + "policy_assignment_owner": { + "attr_type": "policy_assignment_owner" + }, + "policy_assignment_parameters": { + "attr_type": "policy_assignment_parameters" + }, + "policy_assignment_scope": { + "attr_type": "policy_assignment_scope" + }, + "policy_definition_name": { + "attr_type": "policy_definition_name" + }, + "policy_definition_action": { + "attr_type": "policy_definition_action" + }, + "policy_definition_category": { + "attr_type": "policy_definition_category" + }, + "policy_set_definition_id": { + "attr_type": "policy_set_definition_id" + }, + "policy_set_definition_name": { + "attr_type": "policy_set_definition_name" + }, + "policy_set_definition_owner": { + "attr_type": "policy_set_definition_owner" + }, + "policy_set_definition_category": { + "attr_type": "policy_set_definition_category" + }, + "policy_set_definition_parameters": { + "attr_type": "policy_set_definition_parameters" + }, + "management_group_ids": { + "attr_type": "management_group_ids" + }, + "policy_definition_reference_id": { + "attr_type": "policy_definition_reference_id" + }, + "compliance_state": { + "attr_type": "compliance_state" + }, + "policy_evaluation_details": { + "attr_type": "policy_evaluation_details" + }, + "policy_definition_group_names": { + "attr_type": "policy_definition_group_names" + }, + "components": { + "attr_type": "components" + }, + "policy_definition_version": { + "attr_type": null + }, + "policy_set_definition_version": { + "attr_type": null + }, + "policy_assignment_version": { + "attr_type": null + } + } + }, + "PolicyStatesQueryResults": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "odata_context": { + "default": "none", + "param_type": "keyword_only" + }, + "odata_count": { + "default": "none", + "param_type": "keyword_only" + }, + "odata_next_link": { + "default": "none", + "param_type": "keyword_only" + }, + "value": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "odata_context": { + "attr_type": "odata_context" + }, + "odata_count": { + "attr_type": "odata_count" + }, + "odata_next_link": { + "attr_type": "odata_next_link" + }, + "value": { + "attr_type": "value" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "PolicyStatesResource": { + "type": "Enum", + "methods": {}, + "properties": { + "DEFAULT": "DEFAULT", + "LATEST": "LATEST", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "PolicyStatesSummaryResourceType": { + "type": "Enum", + "methods": {}, + "properties": { + "LATEST": "LATEST", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "PolicyTrackedResource": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "tracked_resource_id": { + "attr_type": null + }, + "policy_details": { + "attr_type": null + }, + "created_by": { + "attr_type": null + }, + "last_modified_by": { + "attr_type": null + }, + "last_update_utc": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "PolicyTrackedResourcesQueryResults": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "PolicyTrackedResourcesResourceType": { + "type": "Enum", + "methods": {}, + "properties": { + "DEFAULT": "DEFAULT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "QueryFailure": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "error": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "error": { + "attr_type": "error" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "QueryFailureError": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "code": { + "attr_type": null + }, + "message": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "QueryOptions": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "order_by": { + "default": "none", + "param_type": "keyword_only" + }, + "select": { + "default": "none", + "param_type": "keyword_only" + }, + "from_property": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "apply": { + "default": "none", + "param_type": "keyword_only" + }, + "skip_token": { + "default": "none", + "param_type": "keyword_only" + }, + "expand": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "top": { + "attr_type": "top" + }, + "filter": { + "attr_type": "filter" + }, + "order_by": { + "attr_type": "order_by" + }, + "select": { + "attr_type": "select" + }, + "from_property": { + "attr_type": "from_property" + }, + "to": { + "attr_type": "to" + }, + "apply": { + "attr_type": "apply" + }, + "skip_token": { + "attr_type": "skip_token" + }, + "expand": { + "attr_type": "expand" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "Remediation": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_assignment_id": { + "default": "none", + "param_type": "keyword_only" + }, + "policy_definition_reference_id": { + "default": "none", + "param_type": "keyword_only" + }, + "resource_discovery_mode": { + "default": "none", + "param_type": "keyword_only" + }, + "filters": { + "default": "none", + "param_type": "keyword_only" + }, + "resource_count": { + "default": "none", + "param_type": "keyword_only" + }, + "parallel_deployments": { + "default": "none", + "param_type": "keyword_only" + }, + "failure_threshold": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "id": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "system_data": { + "attr_type": null + }, + "policy_assignment_id": { + "attr_type": "policy_assignment_id" + }, + "policy_definition_reference_id": { + "attr_type": "policy_definition_reference_id" + }, + "resource_discovery_mode": { + "attr_type": "resource_discovery_mode" + }, + "provisioning_state": { + "attr_type": null + }, + "created_on": { + "attr_type": null + }, + "last_updated_on": { + "attr_type": null + }, + "filters": { + "attr_type": "filters" + }, + "deployment_status": { + "attr_type": null + }, + "status_message": { + "attr_type": null + }, + "correlation_id": { + "attr_type": null + }, + "resource_count": { + "attr_type": "resource_count" + }, + "parallel_deployments": { + "attr_type": "parallel_deployments" + }, + "failure_threshold": { + "attr_type": "failure_threshold" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "RemediationDeployment": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "remediated_resource_id": { + "attr_type": null + }, + "deployment_id": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "resource_location": { + "attr_type": null + }, + "error": { + "attr_type": null + }, + "created_on": { + "attr_type": null + }, + "last_updated_on": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "RemediationDeploymentSummary": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "total_deployments": { + "attr_type": null + }, + "successful_deployments": { + "attr_type": null + }, + "failed_deployments": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "RemediationDeploymentsListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "RemediationFilters": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "locations": { + "default": "none", + "param_type": "keyword_only" + }, + "resource_ids": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "locations": { + "attr_type": "locations" + }, + "resource_ids": { + "attr_type": "resource_ids" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "RemediationListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "RemediationPropertiesFailureThreshold": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "percentage": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "percentage": { + "attr_type": "percentage" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "Resource": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ResourceDiscoveryMode": { + "type": "Enum", + "methods": {}, + "properties": { + "EXISTING_NON_COMPLIANT": "EXISTING_NON_COMPLIANT", + "RE_EVALUATE_COMPLIANCE": "RE_EVALUATE_COMPLIANCE", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "SlimPolicyMetadata": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "id": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "metadata_id": { + "attr_type": null + }, + "category": { + "attr_type": null + }, + "title": { + "attr_type": null + }, + "owner": { + "attr_type": null + }, + "additional_content_url": { + "attr_type": null + }, + "metadata": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SummarizeResults": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "odata_context": { + "default": "none", + "param_type": "keyword_only" + }, + "odata_count": { + "default": "none", + "param_type": "keyword_only" + }, + "value": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "odata_context": { + "attr_type": "odata_context" + }, + "odata_count": { + "attr_type": "odata_count" + }, + "value": { + "attr_type": "value" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "Summary": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "odata_id": { + "default": "none", + "param_type": "keyword_only" + }, + "odata_context": { + "default": "none", + "param_type": "keyword_only" + }, + "results": { + "default": "none", + "param_type": "keyword_only" + }, + "policy_assignments": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "odata_id": { + "attr_type": "odata_id" + }, + "odata_context": { + "attr_type": "odata_context" + }, + "results": { + "attr_type": "results" + }, + "policy_assignments": { + "attr_type": "policy_assignments" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SummaryResults": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_results_uri": { + "default": "none", + "param_type": "keyword_only" + }, + "non_compliant_resources": { + "default": "none", + "param_type": "keyword_only" + }, + "non_compliant_policies": { + "default": "none", + "param_type": "keyword_only" + }, + "resource_details": { + "default": "none", + "param_type": "keyword_only" + }, + "policy_details": { + "default": "none", + "param_type": "keyword_only" + }, + "policy_group_details": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "query_results_uri": { + "attr_type": "query_results_uri" + }, + "non_compliant_resources": { + "attr_type": "non_compliant_resources" + }, + "non_compliant_policies": { + "attr_type": "non_compliant_policies" + }, + "resource_details": { + "attr_type": "resource_details" + }, + "policy_details": { + "attr_type": "policy_details" + }, + "policy_group_details": { + "attr_type": "policy_group_details" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SystemData": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "created_by": { + "default": "none", + "param_type": "keyword_only" + }, + "created_by_type": { + "default": "none", + "param_type": "keyword_only" + }, + "created_at": { + "default": "none", + "param_type": "keyword_only" + }, + "last_modified_by": { + "default": "none", + "param_type": "keyword_only" + }, + "last_modified_by_type": { + "default": "none", + "param_type": "keyword_only" + }, + "last_modified_at": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "created_by": { + "attr_type": "created_by" + }, + "created_by_type": { + "attr_type": "created_by_type" + }, + "created_at": { + "attr_type": "created_at" + }, + "last_modified_by": { + "attr_type": "last_modified_by" + }, + "last_modified_by_type": { + "attr_type": "last_modified_by_type" + }, + "last_modified_at": { + "attr_type": "last_modified_at" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "TrackedResourceModificationDetails": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "policy_details": { + "attr_type": null + }, + "deployment_id": { + "attr_type": null + }, + "deployment_time": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "TypedErrorInfo": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "type": { + "attr_type": null + }, + "info": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + } + }, + "function_nodes": {} + }, + "azure.mgmt.policyinsights.aio": { + "class_nodes": { + "PolicyInsightsClient": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "credential": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "base_url": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "cloud_setting": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "close": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": true, + "overloads": [] + } + }, + "properties": { + "client_side_validation": { + "attr_type": false + }, + "policy_tracked_resources": { + "attr_type": "PolicyTrackedResourcesOperations" + }, + "remediations": { + "attr_type": "RemediationsOperations" + }, + "policy_events": { + "attr_type": "PolicyEventsOperations" + }, + "policy_states": { + "attr_type": "PolicyStatesOperations" + }, + "policy_metadata": { + "attr_type": "PolicyMetadataOperations" + }, + "policy_restrictions": { + "attr_type": "PolicyRestrictionsOperations" + }, + "component_policy_states": { + "attr_type": "ComponentPolicyStatesOperations" + }, + "operations": { + "attr_type": "Operations" + }, + "attestations": { + "attr_type": "AttestationsOperations" + } + } + } + }, + "function_nodes": {} + }, + "azure.mgmt.policyinsights.aio.operations": { + "class_nodes": { + "AttestationsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update_at_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "Attestation", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_create_or_update_at_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "Attestation", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_create_or_update_at_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "Attestation", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "delete_at_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "delete_at_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "delete_at_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get_at_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get_at_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get_at_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_for_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_for_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_for_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ComponentPolicyStatesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_policy_definition": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_definition_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "component_policy_states_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "order_by": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "select": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "from_parameter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "to": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "apply": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_query_results_for_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "component_policy_states_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "order_by": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "select": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "from_parameter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "to": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "apply": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "expand": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_query_results_for_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "component_policy_states_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "order_by": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "select": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "from_parameter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "to": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "apply": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_query_results_for_resource_group_level_policy_assignment": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_assignment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "component_policy_states_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "order_by": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "select": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "from_parameter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "to": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "apply": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_query_results_for_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "component_policy_states_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "order_by": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "select": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "from_parameter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "to": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "apply": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_query_results_for_subscription_level_policy_assignment": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_assignment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "component_policy_states_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "order_by": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "select": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "from_parameter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "to": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "apply": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + } + }, + "properties": {} + }, + "Operations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + } + }, + "properties": {} + }, + "PolicyEventsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_management_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_events_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_policy_definition": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_events_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_definition_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_policy_set_definition": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_events_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_set_definition_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_events_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_events_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_resource_group_level_policy_assignment": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_events_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_assignment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_events_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_subscription_level_policy_assignment": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_events_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_assignment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "PolicyMetadataOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "PolicyRestrictionsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "check_at_management_group_scope": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "CheckManagementGroupRestrictionsRequest", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "check_at_resource_group_scope": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "CheckRestrictionsRequest", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "check_at_subscription_scope": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "CheckRestrictionsRequest", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "PolicyStatesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_trigger_resource_group_evaluation": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_trigger_subscription_evaluation": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_query_results_for_management_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_policy_definition": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_definition_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_policy_set_definition": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_set_definition_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_resource_group_level_policy_assignment": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_assignment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_subscription_level_policy_assignment": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_assignment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "summarize_for_management_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_summary_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "summarize_for_policy_definition": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_summary_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_definition_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "summarize_for_policy_set_definition": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_summary_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_set_definition_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "summarize_for_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_summary_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "summarize_for_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_summary_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "summarize_for_resource_group_level_policy_assignment": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_summary_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_assignment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "summarize_for_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_summary_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "summarize_for_subscription_level_policy_assignment": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_summary_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_assignment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + } + }, + "properties": {} + }, + "PolicyTrackedResourcesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_management_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_tracked_resources_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_tracked_resources_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_tracked_resources_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_tracked_resources_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "RemediationsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "cancel_at_management_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "cancel_at_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "cancel_at_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "cancel_at_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "create_or_update_at_management_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "Remediation", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "create_or_update_at_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "Remediation", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "create_or_update_at_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "Remediation", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "create_or_update_at_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "Remediation", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "delete_at_management_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "delete_at_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "delete_at_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "delete_at_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get_at_management_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get_at_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get_at_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get_at_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_deployments_at_management_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_deployments_at_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_deployments_at_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_deployments_at_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_for_management_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_for_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_for_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_for_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_options": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + } + }, + "function_nodes": {} + } +} \ No newline at end of file diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/code_report_typespec.json b/sdk/policyinsights/azure-mgmt-policyinsights/code_report_typespec.json new file mode 100644 index 000000000000..be4176c47f9c --- /dev/null +++ b/sdk/policyinsights/azure-mgmt-policyinsights/code_report_typespec.json @@ -0,0 +1,20025 @@ +{ + "azure.mgmt.policyinsights": { + "class_nodes": { + "PolicyInsightsClient": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "credential": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "base_url": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "cloud_setting": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "close": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "send_request": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "request": { + "default": null, + "param_type": "positional_or_keyword" + }, + "stream": { + "default": "bool", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "client_side_validation": { + "attr_type": false + }, + "operations": { + "attr_type": "Operations" + }, + "remediations": { + "attr_type": "RemediationsOperations" + }, + "attestations": { + "attr_type": "AttestationsOperations" + }, + "policy_metadata": { + "attr_type": "PolicyMetadataOperations" + }, + "policy_events": { + "attr_type": "PolicyEventsOperations" + }, + "policy_states": { + "attr_type": "PolicyStatesOperations" + }, + "policy_restrictions": { + "attr_type": "PolicyRestrictionsOperations" + }, + "component_policy_states": { + "attr_type": "ComponentPolicyStatesOperations" + }, + "policy_tracked_resources": { + "attr_type": "PolicyTrackedResourcesOperations" + } + } + } + }, + "function_nodes": {} + }, + "azure.mgmt.policyinsights.operations": { + "class_nodes": { + "AttestationsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update_at_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "Attestation", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "JSON", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_create_or_update_at_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "Attestation", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "JSON", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_create_or_update_at_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "Attestation", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "JSON", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "delete_at_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "delete_at_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "delete_at_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get_at_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get_at_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get_at_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_for_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_for_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_for_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ComponentPolicyStatesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_policy_definition": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_definition_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "component_policy_states_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "order_by": { + "default": "none", + "param_type": "keyword_only" + }, + "select": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "apply": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "component_policy_states_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "order_by": { + "default": "none", + "param_type": "keyword_only" + }, + "select": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "apply": { + "default": "none", + "param_type": "keyword_only" + }, + "expand": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "component_policy_states_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "order_by": { + "default": "none", + "param_type": "keyword_only" + }, + "select": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "apply": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_resource_group_level_policy_assignment": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_assignment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "component_policy_states_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "order_by": { + "default": "none", + "param_type": "keyword_only" + }, + "select": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "apply": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "component_policy_states_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "order_by": { + "default": "none", + "param_type": "keyword_only" + }, + "select": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "apply": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_subscription_level_policy_assignment": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_assignment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "component_policy_states_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "order_by": { + "default": "none", + "param_type": "keyword_only" + }, + "select": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "apply": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "Operations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "PolicyEventsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_management_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_events_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "order_by": { + "default": "none", + "param_type": "keyword_only" + }, + "select": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "apply": { + "default": "none", + "param_type": "keyword_only" + }, + "skip_token": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_policy_definition": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_events_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_definition_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "order_by": { + "default": "none", + "param_type": "keyword_only" + }, + "select": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "apply": { + "default": "none", + "param_type": "keyword_only" + }, + "skip_token": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_policy_set_definition": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_events_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_set_definition_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "order_by": { + "default": "none", + "param_type": "keyword_only" + }, + "select": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "apply": { + "default": "none", + "param_type": "keyword_only" + }, + "skip_token": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_events_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "order_by": { + "default": "none", + "param_type": "keyword_only" + }, + "select": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "apply": { + "default": "none", + "param_type": "keyword_only" + }, + "expand": { + "default": "none", + "param_type": "keyword_only" + }, + "skip_token": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_events_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "order_by": { + "default": "none", + "param_type": "keyword_only" + }, + "select": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "apply": { + "default": "none", + "param_type": "keyword_only" + }, + "skip_token": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_resource_group_level_policy_assignment": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_events_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_assignment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "order_by": { + "default": "none", + "param_type": "keyword_only" + }, + "select": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "apply": { + "default": "none", + "param_type": "keyword_only" + }, + "skip_token": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_events_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "order_by": { + "default": "none", + "param_type": "keyword_only" + }, + "select": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "apply": { + "default": "none", + "param_type": "keyword_only" + }, + "skip_token": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_subscription_level_policy_assignment": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_events_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_assignment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "order_by": { + "default": "none", + "param_type": "keyword_only" + }, + "select": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "apply": { + "default": "none", + "param_type": "keyword_only" + }, + "skip_token": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "PolicyMetadataOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "PolicyRestrictionsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "check_at_management_group_scope": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "CheckManagementGroupRestrictionsRequest", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "JSON", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "check_at_resource_group_scope": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "CheckRestrictionsRequest", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "JSON", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "check_at_subscription_scope": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "CheckRestrictionsRequest", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "JSON", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "PolicyStatesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_trigger_resource_group_evaluation": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_trigger_subscription_evaluation": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_management_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "order_by": { + "default": "none", + "param_type": "keyword_only" + }, + "select": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "apply": { + "default": "none", + "param_type": "keyword_only" + }, + "skip_token": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_policy_definition": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_definition_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "order_by": { + "default": "none", + "param_type": "keyword_only" + }, + "select": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "apply": { + "default": "none", + "param_type": "keyword_only" + }, + "skip_token": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_policy_set_definition": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_set_definition_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "order_by": { + "default": "none", + "param_type": "keyword_only" + }, + "select": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "apply": { + "default": "none", + "param_type": "keyword_only" + }, + "skip_token": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "order_by": { + "default": "none", + "param_type": "keyword_only" + }, + "select": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "apply": { + "default": "none", + "param_type": "keyword_only" + }, + "expand": { + "default": "none", + "param_type": "keyword_only" + }, + "skip_token": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "order_by": { + "default": "none", + "param_type": "keyword_only" + }, + "select": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "apply": { + "default": "none", + "param_type": "keyword_only" + }, + "skip_token": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_resource_group_level_policy_assignment": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_assignment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "order_by": { + "default": "none", + "param_type": "keyword_only" + }, + "select": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "apply": { + "default": "none", + "param_type": "keyword_only" + }, + "skip_token": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "order_by": { + "default": "none", + "param_type": "keyword_only" + }, + "select": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "apply": { + "default": "none", + "param_type": "keyword_only" + }, + "skip_token": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_subscription_level_policy_assignment": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_assignment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "order_by": { + "default": "none", + "param_type": "keyword_only" + }, + "select": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "apply": { + "default": "none", + "param_type": "keyword_only" + }, + "skip_token": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "summarize_for_management_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_summary_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "summarize_for_policy_definition": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_summary_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_definition_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "summarize_for_policy_set_definition": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_summary_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_set_definition_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "summarize_for_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_summary_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "summarize_for_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_summary_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "summarize_for_resource_group_level_policy_assignment": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_summary_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_assignment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "summarize_for_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_summary_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "summarize_for_subscription_level_policy_assignment": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_summary_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_assignment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "PolicyTrackedResourcesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_management_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_tracked_resources_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_tracked_resources_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_tracked_resources_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_tracked_resources_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "RemediationsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "cancel_at_management_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "cancel_at_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "cancel_at_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "cancel_at_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update_at_management_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "Remediation", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "JSON", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "create_or_update_at_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "Remediation", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "JSON", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "create_or_update_at_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "Remediation", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "JSON", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "create_or_update_at_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "Remediation", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "JSON", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "delete_at_management_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "delete_at_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "delete_at_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "delete_at_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get_at_management_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get_at_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get_at_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get_at_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_deployments_at_management_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_deployments_at_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_deployments_at_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_deployments_at_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_for_management_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_for_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_for_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_for_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + } + }, + "function_nodes": {} + }, + "azure.mgmt.policyinsights.models": { + "class_nodes": { + "Attestation": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "properties": { + "type": "_models.AttestationProperties", + "default": null, + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "mapping": { + "type": "Mapping[str, Any]", + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "properties": null, + "id": "Optional", + "name": "Optional", + "type": "Optional", + "system_data": "Optional" + } + }, + "AttestationEvidence": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "description": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "source_uri": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "mapping": { + "type": "Mapping[str, Any]", + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "description": "Optional", + "source_uri": "Optional" + } + }, + "AttestationProperties": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_assignment_id": { + "type": "str", + "default": null, + "param_type": "keyword_only" + }, + "policy_definition_reference_id": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "compliance_state": { + "type": "Optional[Union[str, _models.ComplianceState]]", + "default": null, + "param_type": "keyword_only" + }, + "expires_on": { + "type": "Optional[datetime]", + "default": null, + "param_type": "keyword_only" + }, + "owner": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "comments": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "evidence": { + "type": "Optional[list[_models.AttestationEvidence]]", + "default": null, + "param_type": "keyword_only" + }, + "assessment_date": { + "type": "Optional[datetime]", + "default": null, + "param_type": "keyword_only" + }, + "metadata": { + "type": "Optional[Any]", + "default": null, + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "mapping": { + "type": "Mapping[str, Any]", + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "policy_assignment_id": null, + "policy_definition_reference_id": "Optional", + "compliance_state": "Optional", + "expires_on": "Optional", + "owner": "Optional", + "comments": "Optional", + "evidence": "Optional", + "provisioning_state": "Optional", + "last_compliance_state_change_at": "Optional", + "assessment_date": "Optional", + "metadata": "Optional" + } + }, + "CheckManagementGroupRestrictionsRequest": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_details": { + "type": "Optional[_models.CheckRestrictionsResourceDetails]", + "default": null, + "param_type": "keyword_only" + }, + "pending_fields": { + "type": "Optional[list[_models.PendingField]]", + "default": null, + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "mapping": { + "type": "Mapping[str, Any]", + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "resource_details": "Optional", + "pending_fields": "Optional" + } + }, + "CheckRestrictionEvaluationDetails": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "evaluated_expressions": { + "type": "Optional[list[_models.ExpressionEvaluationDetails]]", + "default": null, + "param_type": "keyword_only" + }, + "if_not_exists_details": { + "type": "Optional[_models.IfNotExistsEvaluationDetails]", + "default": null, + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "mapping": { + "type": "Mapping[str, Any]", + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "evaluated_expressions": "Optional", + "if_not_exists_details": "Optional", + "reason": "Optional" + } + }, + "CheckRestrictionsRequest": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_details": { + "type": "_models.CheckRestrictionsResourceDetails", + "default": null, + "param_type": "keyword_only" + }, + "pending_fields": { + "type": "Optional[list[_models.PendingField]]", + "default": null, + "param_type": "keyword_only" + }, + "include_audit_effect": { + "type": "Optional[bool]", + "default": null, + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "mapping": { + "type": "Mapping[str, Any]", + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "resource_details": null, + "pending_fields": "Optional", + "include_audit_effect": "Optional" + } + }, + "CheckRestrictionsResourceDetails": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_content": { + "type": "Any", + "default": null, + "param_type": "keyword_only" + }, + "api_version": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "scope": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "mapping": { + "type": "Mapping[str, Any]", + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "resource_content": null, + "api_version": "Optional", + "scope": "Optional" + } + }, + "CheckRestrictionsResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "field_restrictions": "Optional", + "content_evaluation_result": "Optional" + } + }, + "CheckRestrictionsResultContentEvaluationResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_evaluations": { + "type": "Optional[list[_models.PolicyEvaluationResult]]", + "default": null, + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "mapping": { + "type": "Mapping[str, Any]", + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "policy_evaluations": "Optional" + } + }, + "ComplianceDetail": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "compliance_state": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "count": { + "type": "Optional[int]", + "default": null, + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "mapping": { + "type": "Mapping[str, Any]", + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "compliance_state": "Optional", + "count": "Optional" + } + }, + "ComplianceState": { + "type": "Enum", + "methods": {}, + "properties": { + "COMPLIANT": "COMPLIANT", + "NON_COMPLIANT": "NON_COMPLIANT", + "UNKNOWN": "UNKNOWN", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ComponentEventDetails": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "id": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "type": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "name": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "timestamp": { + "type": "Optional[datetime]", + "default": null, + "param_type": "keyword_only" + }, + "tenant_id": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "principal_oid": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "policy_definition_action": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "mapping": { + "type": "Mapping[str, Any]", + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "id": "Optional", + "type": "Optional", + "name": "Optional", + "timestamp": "Optional", + "tenant_id": "Optional", + "principal_oid": "Optional", + "policy_definition_action": "Optional" + } + }, + "ComponentExpressionEvaluationDetails": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "result": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "mapping": { + "type": "Mapping[str, Any]", + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "result": "Optional", + "expression": "Optional", + "expression_kind": "Optional", + "path": "Optional", + "expression_value": "Optional", + "target_value": "Optional", + "operator": "Optional" + } + }, + "ComponentPolicyEvaluationDetails": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "reason": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "mapping": { + "type": "Mapping[str, Any]", + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "evaluated_expressions": "Optional", + "reason": "Optional" + } + }, + "ComponentPolicyState": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_evaluation_details": { + "type": "Optional[_models.ComponentPolicyEvaluationDetails]", + "default": null, + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "mapping": { + "type": "Mapping[str, Any]", + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "odata_id": "Optional", + "odata_context": "Optional", + "timestamp": "Optional", + "component_id": "Optional", + "component_type": "Optional", + "component_name": "Optional", + "resource_id": "Optional", + "policy_assignment_id": "Optional", + "policy_definition_id": "Optional", + "subscription_id": "Optional", + "resource_type": "Optional", + "resource_location": "Optional", + "resource_group": "Optional", + "policy_assignment_name": "Optional", + "policy_assignment_owner": "Optional", + "policy_assignment_parameters": "Optional", + "policy_assignment_scope": "Optional", + "policy_definition_name": "Optional", + "policy_definition_action": "Optional", + "policy_definition_category": "Optional", + "policy_set_definition_id": "Optional", + "policy_set_definition_name": "Optional", + "policy_set_definition_owner": "Optional", + "policy_set_definition_category": "Optional", + "policy_set_definition_parameters": "Optional", + "policy_definition_reference_id": "Optional", + "compliance_state": "Optional", + "policy_evaluation_details": "Optional", + "policy_definition_group_names": "Optional", + "policy_definition_version": "Optional", + "policy_set_definition_version": "Optional", + "policy_assignment_version": "Optional" + } + }, + "ComponentPolicyStatesQueryResults": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "odata_context": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "odata_count": { + "type": "Optional[int]", + "default": null, + "param_type": "keyword_only" + }, + "value": { + "type": "Optional[list[_models.ComponentPolicyState]]", + "default": null, + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "mapping": { + "type": "Mapping[str, Any]", + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "odata_context": "Optional", + "odata_count": "Optional", + "value": "Optional" + } + }, + "ComponentPolicyStatesResource": { + "type": "Enum", + "methods": {}, + "properties": { + "LATEST": "LATEST", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ComponentStateDetails": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "id": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "type": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "name": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "timestamp": { + "type": "Optional[datetime]", + "default": null, + "param_type": "keyword_only" + }, + "compliance_state": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "mapping": { + "type": "Mapping[str, Any]", + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "id": "Optional", + "type": "Optional", + "name": "Optional", + "timestamp": "Optional", + "compliance_state": "Optional" + } + }, + "CreatedByType": { + "type": "Enum", + "methods": {}, + "properties": { + "APPLICATION": "APPLICATION", + "KEY": "KEY", + "MANAGED_IDENTITY": "MANAGED_IDENTITY", + "USER": "USER", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ErrorDefinition": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "code": "Optional", + "message": "Optional", + "target": "Optional", + "details": "Optional", + "additional_info": "Optional" + } + }, + "ErrorResponse": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "error": { + "type": "Optional[_models.ErrorDefinition]", + "default": null, + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "mapping": { + "type": "Mapping[str, Any]", + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "error": "Optional" + } + }, + "ExpressionEvaluationDetails": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "result": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "expression": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "path": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "expression_value": { + "type": "Optional[Any]", + "default": null, + "param_type": "keyword_only" + }, + "target_value": { + "type": "Optional[Any]", + "default": null, + "param_type": "keyword_only" + }, + "operator": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "mapping": { + "type": "Mapping[str, Any]", + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "result": "Optional", + "expression": "Optional", + "expression_kind": "Optional", + "path": "Optional", + "expression_value": "Optional", + "target_value": "Optional", + "operator": "Optional" + } + }, + "FieldRestriction": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "result": "Optional", + "default_value": "Optional", + "values_property": "Optional", + "policy": "Optional", + "policy_effect": "Optional", + "reason": "Optional" + } + }, + "FieldRestrictionResult": { + "type": "Enum", + "methods": {}, + "properties": { + "AUDIT": "AUDIT", + "DENY": "DENY", + "REMOVED": "REMOVED", + "REQUIRED": "REQUIRED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "FieldRestrictions": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "restrictions": { + "type": "Optional[list[_models.FieldRestriction]]", + "default": null, + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "mapping": { + "type": "Mapping[str, Any]", + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "field": "Optional", + "restrictions": "Optional" + } + }, + "IfNotExistsEvaluationDetails": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "total_resources": { + "type": "Optional[int]", + "default": null, + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "mapping": { + "type": "Mapping[str, Any]", + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "resource_id": "Optional", + "total_resources": "Optional" + } + }, + "Operation": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "name": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "is_data_action": { + "type": "Optional[bool]", + "default": null, + "param_type": "keyword_only" + }, + "display": { + "type": "Optional[_models.OperationDisplay]", + "default": null, + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "mapping": { + "type": "Mapping[str, Any]", + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name": "Optional", + "is_data_action": "Optional", + "display": "Optional" + } + }, + "OperationDisplay": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "provider": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "resource": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "operation": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "description": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "mapping": { + "type": "Mapping[str, Any]", + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "provider": "Optional", + "resource": "Optional", + "operation": "Optional", + "description": "Optional" + } + }, + "OperationsListResults": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "odata_count": { + "type": "Optional[int]", + "default": null, + "param_type": "keyword_only" + }, + "value": { + "type": "Optional[list[_models.Operation]]", + "default": null, + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "mapping": { + "type": "Mapping[str, Any]", + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "odata_count": "Optional", + "value": "Optional" + } + }, + "PendingField": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "field": { + "type": "str", + "default": null, + "param_type": "keyword_only" + }, + "values_property": { + "type": "Optional[list[str]]", + "default": null, + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "mapping": { + "type": "Mapping[str, Any]", + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "field": null, + "values_property": "Optional" + } + }, + "PolicyAssignmentSummary": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_assignment_id": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "policy_set_definition_id": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "results": { + "type": "Optional[_models.SummaryResults]", + "default": null, + "param_type": "keyword_only" + }, + "policy_definitions": { + "type": "Optional[list[_models.PolicyDefinitionSummary]]", + "default": null, + "param_type": "keyword_only" + }, + "policy_groups": { + "type": "Optional[list[_models.PolicyGroupSummary]]", + "default": null, + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "mapping": { + "type": "Mapping[str, Any]", + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "policy_assignment_id": "Optional", + "policy_set_definition_id": "Optional", + "results": "Optional", + "policy_definitions": "Optional", + "policy_groups": "Optional" + } + }, + "PolicyDefinitionSummary": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_definition_id": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "policy_definition_reference_id": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "policy_definition_group_names": { + "type": "Optional[list[str]]", + "default": null, + "param_type": "keyword_only" + }, + "effect": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "results": { + "type": "Optional[_models.SummaryResults]", + "default": null, + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "mapping": { + "type": "Mapping[str, Any]", + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "policy_definition_id": "Optional", + "policy_definition_reference_id": "Optional", + "policy_definition_group_names": "Optional", + "effect": "Optional", + "results": "Optional" + } + }, + "PolicyDetails": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "policy_definition_id": "Optional", + "policy_assignment_id": "Optional", + "policy_assignment_display_name": "Optional", + "policy_assignment_scope": "Optional", + "policy_set_definition_id": "Optional", + "policy_definition_reference_id": "Optional" + } + }, + "PolicyEffectDetails": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "policy_effect": "Optional" + } + }, + "PolicyEvaluationDetails": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "evaluated_expressions": { + "type": "Optional[list[_models.ExpressionEvaluationDetails]]", + "default": null, + "param_type": "keyword_only" + }, + "if_not_exists_details": { + "type": "Optional[_models.IfNotExistsEvaluationDetails]", + "default": null, + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "mapping": { + "type": "Mapping[str, Any]", + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "evaluated_expressions": "Optional", + "if_not_exists_details": "Optional" + } + }, + "PolicyEvaluationResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "policy_info": "Optional", + "evaluation_result": "Optional", + "evaluation_details": "Optional", + "effect_details": "Optional" + } + }, + "PolicyEvent": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "odata_id": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "odata_context": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "timestamp": { + "type": "Optional[datetime]", + "default": null, + "param_type": "keyword_only" + }, + "resource_id": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "policy_assignment_id": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "policy_definition_id": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "effective_parameters": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "is_compliant": { + "type": "Optional[bool]", + "default": null, + "param_type": "keyword_only" + }, + "subscription_id": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "resource_type": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "resource_location": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "resource_group": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "resource_tags": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "policy_assignment_name": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "policy_assignment_owner": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "policy_assignment_parameters": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "policy_assignment_scope": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "policy_definition_name": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "policy_definition_action": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "policy_definition_category": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "policy_set_definition_id": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "policy_set_definition_name": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "policy_set_definition_owner": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "policy_set_definition_category": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "policy_set_definition_parameters": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "management_group_ids": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "policy_definition_reference_id": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "compliance_state": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "tenant_id": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "principal_oid": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "components": { + "type": "Optional[list[_models.ComponentEventDetails]]", + "default": null, + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "mapping": { + "type": "Mapping[str, Any]", + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "odata_id": "Optional", + "odata_context": "Optional", + "timestamp": "Optional", + "resource_id": "Optional", + "policy_assignment_id": "Optional", + "policy_definition_id": "Optional", + "effective_parameters": "Optional", + "is_compliant": "Optional", + "subscription_id": "Optional", + "resource_type": "Optional", + "resource_location": "Optional", + "resource_group": "Optional", + "resource_tags": "Optional", + "policy_assignment_name": "Optional", + "policy_assignment_owner": "Optional", + "policy_assignment_parameters": "Optional", + "policy_assignment_scope": "Optional", + "policy_definition_name": "Optional", + "policy_definition_action": "Optional", + "policy_definition_category": "Optional", + "policy_set_definition_id": "Optional", + "policy_set_definition_name": "Optional", + "policy_set_definition_owner": "Optional", + "policy_set_definition_category": "Optional", + "policy_set_definition_parameters": "Optional", + "management_group_ids": "Optional", + "policy_definition_reference_id": "Optional", + "compliance_state": "Optional", + "tenant_id": "Optional", + "principal_oid": "Optional", + "components": "Optional" + } + }, + "PolicyEventsResourceType": { + "type": "Enum", + "methods": {}, + "properties": { + "DEFAULT": "DEFAULT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "PolicyGroupSummary": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_group_name": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "results": { + "type": "Optional[_models.SummaryResults]", + "default": null, + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "mapping": { + "type": "Mapping[str, Any]", + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "policy_group_name": "Optional", + "results": "Optional" + } + }, + "PolicyMetadata": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "properties": { + "type": "Optional[_models.PolicyMetadataProperties]", + "default": null, + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "mapping": { + "type": "Mapping[str, Any]", + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "properties": "Optional", + "id": "Optional", + "name": "Optional", + "type": "Optional", + "system_data": "Optional" + } + }, + "PolicyMetadataProperties": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "description": "Optional", + "requirements": "Optional", + "metadata_id": "Optional", + "category": "Optional", + "title": "Optional", + "owner": "Optional", + "additional_content_url": "Optional", + "metadata": "Optional" + } + }, + "PolicyMetadataSlimProperties": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "metadata_id": "Optional", + "category": "Optional", + "title": "Optional", + "owner": "Optional", + "additional_content_url": "Optional", + "metadata": "Optional" + } + }, + "PolicyReference": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "policy_definition_id": "Optional", + "policy_set_definition_id": "Optional", + "policy_definition_reference_id": "Optional", + "policy_assignment_id": "Optional" + } + }, + "PolicyState": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "odata_id": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "odata_context": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "timestamp": { + "type": "Optional[datetime]", + "default": null, + "param_type": "keyword_only" + }, + "resource_id": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "policy_assignment_id": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "policy_definition_id": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "effective_parameters": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "is_compliant": { + "type": "Optional[bool]", + "default": null, + "param_type": "keyword_only" + }, + "subscription_id": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "resource_type": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "resource_location": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "resource_group": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "resource_tags": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "policy_assignment_name": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "policy_assignment_owner": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "policy_assignment_parameters": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "policy_assignment_scope": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "policy_definition_name": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "policy_definition_action": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "policy_definition_category": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "policy_set_definition_id": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "policy_set_definition_name": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "policy_set_definition_owner": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "policy_set_definition_category": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "policy_set_definition_parameters": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "management_group_ids": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "policy_definition_reference_id": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "compliance_state": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "policy_evaluation_details": { + "type": "Optional[_models.PolicyEvaluationDetails]", + "default": null, + "param_type": "keyword_only" + }, + "policy_definition_group_names": { + "type": "Optional[list[str]]", + "default": null, + "param_type": "keyword_only" + }, + "components": { + "type": "Optional[list[_models.ComponentStateDetails]]", + "default": null, + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "mapping": { + "type": "Mapping[str, Any]", + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "odata_id": "Optional", + "odata_context": "Optional", + "timestamp": "Optional", + "resource_id": "Optional", + "policy_assignment_id": "Optional", + "policy_definition_id": "Optional", + "effective_parameters": "Optional", + "is_compliant": "Optional", + "subscription_id": "Optional", + "resource_type": "Optional", + "resource_location": "Optional", + "resource_group": "Optional", + "resource_tags": "Optional", + "policy_assignment_name": "Optional", + "policy_assignment_owner": "Optional", + "policy_assignment_parameters": "Optional", + "policy_assignment_scope": "Optional", + "policy_definition_name": "Optional", + "policy_definition_action": "Optional", + "policy_definition_category": "Optional", + "policy_set_definition_id": "Optional", + "policy_set_definition_name": "Optional", + "policy_set_definition_owner": "Optional", + "policy_set_definition_category": "Optional", + "policy_set_definition_parameters": "Optional", + "management_group_ids": "Optional", + "policy_definition_reference_id": "Optional", + "compliance_state": "Optional", + "policy_evaluation_details": "Optional", + "policy_definition_group_names": "Optional", + "components": "Optional", + "policy_definition_version": "Optional", + "policy_set_definition_version": "Optional", + "policy_assignment_version": "Optional" + } + }, + "PolicyStatesResource": { + "type": "Enum", + "methods": {}, + "properties": { + "DEFAULT": "DEFAULT", + "LATEST": "LATEST", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "PolicyStatesSummaryResourceType": { + "type": "Enum", + "methods": {}, + "properties": { + "LATEST": "LATEST", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "PolicyTrackedResource": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "tracked_resource_id": "Optional", + "policy_details": "Optional", + "created_by": "Optional", + "last_modified_by": "Optional", + "last_update_utc": "Optional" + } + }, + "PolicyTrackedResourcesResourceType": { + "type": "Enum", + "methods": {}, + "properties": { + "DEFAULT": "DEFAULT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ProxyResource": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "id": "Optional", + "name": "Optional", + "type": "Optional", + "system_data": "Optional" + } + }, + "QueryFailure": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "error": { + "type": "Optional[_models.QueryFailureError]", + "default": null, + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "mapping": { + "type": "Mapping[str, Any]", + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "error": "Optional" + } + }, + "QueryFailureError": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "code": "Optional", + "message": "Optional" + } + }, + "Remediation": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "properties": { + "type": "Optional[_models.RemediationProperties]", + "default": null, + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "mapping": { + "type": "Mapping[str, Any]", + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "properties": "Optional", + "id": "Optional", + "name": "Optional", + "type": "Optional", + "system_data": "Optional" + } + }, + "RemediationDeployment": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "remediated_resource_id": "Optional", + "deployment_id": "Optional", + "status": "Optional", + "resource_location": "Optional", + "error": "Optional", + "created_on": "Optional", + "last_updated_on": "Optional" + } + }, + "RemediationDeploymentSummary": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "total_deployments": "Optional", + "successful_deployments": "Optional", + "failed_deployments": "Optional" + } + }, + "RemediationFilters": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "locations": { + "type": "Optional[list[str]]", + "default": null, + "param_type": "keyword_only" + }, + "resource_ids": { + "type": "Optional[list[str]]", + "default": null, + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "mapping": { + "type": "Mapping[str, Any]", + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "locations": "Optional", + "resource_ids": "Optional" + } + }, + "RemediationProperties": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_assignment_id": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "policy_definition_reference_id": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "resource_discovery_mode": { + "type": "Optional[Union[str, _models.ResourceDiscoveryMode]]", + "default": null, + "param_type": "keyword_only" + }, + "filters": { + "type": "Optional[_models.RemediationFilters]", + "default": null, + "param_type": "keyword_only" + }, + "resource_count": { + "type": "Optional[int]", + "default": null, + "param_type": "keyword_only" + }, + "parallel_deployments": { + "type": "Optional[int]", + "default": null, + "param_type": "keyword_only" + }, + "failure_threshold": { + "type": "Optional[_models.RemediationPropertiesFailureThreshold]", + "default": null, + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "mapping": { + "type": "Mapping[str, Any]", + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "policy_assignment_id": "Optional", + "policy_definition_reference_id": "Optional", + "resource_discovery_mode": "Optional", + "provisioning_state": "Optional", + "created_on": "Optional", + "last_updated_on": "Optional", + "filters": "Optional", + "deployment_status": "Optional", + "status_message": "Optional", + "correlation_id": "Optional", + "resource_count": "Optional", + "parallel_deployments": "Optional", + "failure_threshold": "Optional" + } + }, + "RemediationPropertiesFailureThreshold": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "percentage": { + "type": "Optional[float]", + "default": null, + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "mapping": { + "type": "Mapping[str, Any]", + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "percentage": "Optional" + } + }, + "Resource": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "id": "Optional", + "name": "Optional", + "type": "Optional", + "system_data": "Optional" + } + }, + "ResourceDiscoveryMode": { + "type": "Enum", + "methods": {}, + "properties": { + "EXISTING_NON_COMPLIANT": "EXISTING_NON_COMPLIANT", + "RE_EVALUATE_COMPLIANCE": "RE_EVALUATE_COMPLIANCE", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "SlimPolicyMetadata": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "properties": { + "type": "Optional[_models.PolicyMetadataSlimProperties]", + "default": null, + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "mapping": { + "type": "Mapping[str, Any]", + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "properties": "Optional", + "id": "Optional", + "type": "Optional", + "name": "Optional" + } + }, + "SummarizeResults": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "odata_context": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "odata_count": { + "type": "Optional[int]", + "default": null, + "param_type": "keyword_only" + }, + "value": { + "type": "Optional[list[_models.Summary]]", + "default": null, + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "mapping": { + "type": "Mapping[str, Any]", + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "odata_context": "Optional", + "odata_count": "Optional", + "value": "Optional" + } + }, + "Summary": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "odata_id": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "odata_context": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "results": { + "type": "Optional[_models.SummaryResults]", + "default": null, + "param_type": "keyword_only" + }, + "policy_assignments": { + "type": "Optional[list[_models.PolicyAssignmentSummary]]", + "default": null, + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "mapping": { + "type": "Mapping[str, Any]", + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "odata_id": "Optional", + "odata_context": "Optional", + "results": "Optional", + "policy_assignments": "Optional" + } + }, + "SummaryResults": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "query_results_uri": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "non_compliant_resources": { + "type": "Optional[int]", + "default": null, + "param_type": "keyword_only" + }, + "non_compliant_policies": { + "type": "Optional[int]", + "default": null, + "param_type": "keyword_only" + }, + "resource_details": { + "type": "Optional[list[_models.ComplianceDetail]]", + "default": null, + "param_type": "keyword_only" + }, + "policy_details": { + "type": "Optional[list[_models.ComplianceDetail]]", + "default": null, + "param_type": "keyword_only" + }, + "policy_group_details": { + "type": "Optional[list[_models.ComplianceDetail]]", + "default": null, + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "mapping": { + "type": "Mapping[str, Any]", + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "query_results_uri": "Optional", + "non_compliant_resources": "Optional", + "non_compliant_policies": "Optional", + "resource_details": "Optional", + "policy_details": "Optional", + "policy_group_details": "Optional" + } + }, + "SystemData": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "created_by": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "created_by_type": { + "type": "Optional[Union[str, _models.CreatedByType]]", + "default": null, + "param_type": "keyword_only" + }, + "created_at": { + "type": "Optional[datetime]", + "default": null, + "param_type": "keyword_only" + }, + "last_modified_by": { + "type": "Optional[str]", + "default": null, + "param_type": "keyword_only" + }, + "last_modified_by_type": { + "type": "Optional[Union[str, _models.CreatedByType]]", + "default": null, + "param_type": "keyword_only" + }, + "last_modified_at": { + "type": "Optional[datetime]", + "default": null, + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "mapping": { + "type": "Mapping[str, Any]", + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "created_by": "Optional", + "created_by_type": "Optional", + "created_at": "Optional", + "last_modified_by": "Optional", + "last_modified_by_type": "Optional", + "last_modified_at": "Optional" + } + }, + "TrackedResourceModificationDetails": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "policy_details": "Optional", + "deployment_id": "Optional", + "deployment_time": "Optional" + } + }, + "TypedErrorInfo": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "exclude_readonly": { + "default": "bool", + "param_type": "keyword_only" + } + }, + "is_async": false, + "overloads": [] + }, + "clear": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "items": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "keys": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "pop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "popitem": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "setdefault": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key": { + "default": null, + "param_type": "positional_or_keyword" + }, + "default": { + "default": "object", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "values": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "type": "Optional", + "info": "Optional" + } + } + }, + "function_nodes": {} + }, + "azure.mgmt.policyinsights.aio": { + "class_nodes": { + "PolicyInsightsClient": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "credential": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "base_url": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "cloud_setting": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "close": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "send_request": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "request": { + "default": null, + "param_type": "positional_or_keyword" + }, + "stream": { + "default": "bool", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "client_side_validation": { + "attr_type": false + }, + "operations": { + "attr_type": "Operations" + }, + "remediations": { + "attr_type": "RemediationsOperations" + }, + "attestations": { + "attr_type": "AttestationsOperations" + }, + "policy_metadata": { + "attr_type": "PolicyMetadataOperations" + }, + "policy_events": { + "attr_type": "PolicyEventsOperations" + }, + "policy_states": { + "attr_type": "PolicyStatesOperations" + }, + "policy_restrictions": { + "attr_type": "PolicyRestrictionsOperations" + }, + "component_policy_states": { + "attr_type": "ComponentPolicyStatesOperations" + }, + "policy_tracked_resources": { + "attr_type": "PolicyTrackedResourcesOperations" + } + } + } + }, + "function_nodes": {} + }, + "azure.mgmt.policyinsights.aio.operations": { + "class_nodes": { + "AttestationsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update_at_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "Attestation", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "JSON", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_create_or_update_at_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "Attestation", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "JSON", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_create_or_update_at_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "Attestation", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "JSON", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "delete_at_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "delete_at_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "delete_at_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get_at_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get_at_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get_at_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "attestation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_for_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_for_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_for_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ComponentPolicyStatesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_policy_definition": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_definition_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "component_policy_states_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "order_by": { + "default": "none", + "param_type": "keyword_only" + }, + "select": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "apply": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_query_results_for_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "component_policy_states_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "order_by": { + "default": "none", + "param_type": "keyword_only" + }, + "select": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "apply": { + "default": "none", + "param_type": "keyword_only" + }, + "expand": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_query_results_for_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "component_policy_states_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "order_by": { + "default": "none", + "param_type": "keyword_only" + }, + "select": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "apply": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_query_results_for_resource_group_level_policy_assignment": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_assignment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "component_policy_states_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "order_by": { + "default": "none", + "param_type": "keyword_only" + }, + "select": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "apply": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_query_results_for_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "component_policy_states_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "order_by": { + "default": "none", + "param_type": "keyword_only" + }, + "select": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "apply": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_query_results_for_subscription_level_policy_assignment": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_assignment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "component_policy_states_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "order_by": { + "default": "none", + "param_type": "keyword_only" + }, + "select": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "apply": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + } + }, + "properties": {} + }, + "Operations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + } + }, + "properties": {} + }, + "PolicyEventsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_management_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_events_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "order_by": { + "default": "none", + "param_type": "keyword_only" + }, + "select": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "apply": { + "default": "none", + "param_type": "keyword_only" + }, + "skip_token": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_policy_definition": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_events_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_definition_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "order_by": { + "default": "none", + "param_type": "keyword_only" + }, + "select": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "apply": { + "default": "none", + "param_type": "keyword_only" + }, + "skip_token": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_policy_set_definition": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_events_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_set_definition_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "order_by": { + "default": "none", + "param_type": "keyword_only" + }, + "select": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "apply": { + "default": "none", + "param_type": "keyword_only" + }, + "skip_token": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_events_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "order_by": { + "default": "none", + "param_type": "keyword_only" + }, + "select": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "apply": { + "default": "none", + "param_type": "keyword_only" + }, + "expand": { + "default": "none", + "param_type": "keyword_only" + }, + "skip_token": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_events_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "order_by": { + "default": "none", + "param_type": "keyword_only" + }, + "select": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "apply": { + "default": "none", + "param_type": "keyword_only" + }, + "skip_token": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_resource_group_level_policy_assignment": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_events_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_assignment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "order_by": { + "default": "none", + "param_type": "keyword_only" + }, + "select": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "apply": { + "default": "none", + "param_type": "keyword_only" + }, + "skip_token": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_events_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "order_by": { + "default": "none", + "param_type": "keyword_only" + }, + "select": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "apply": { + "default": "none", + "param_type": "keyword_only" + }, + "skip_token": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_subscription_level_policy_assignment": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_events_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_assignment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "order_by": { + "default": "none", + "param_type": "keyword_only" + }, + "select": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "apply": { + "default": "none", + "param_type": "keyword_only" + }, + "skip_token": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "PolicyMetadataOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "PolicyRestrictionsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "check_at_management_group_scope": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "CheckManagementGroupRestrictionsRequest", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "JSON", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "check_at_resource_group_scope": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "CheckRestrictionsRequest", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "JSON", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "check_at_subscription_scope": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "CheckRestrictionsRequest", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "JSON", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "PolicyStatesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_trigger_resource_group_evaluation": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_trigger_subscription_evaluation": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_query_results_for_management_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "order_by": { + "default": "none", + "param_type": "keyword_only" + }, + "select": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "apply": { + "default": "none", + "param_type": "keyword_only" + }, + "skip_token": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_policy_definition": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_definition_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "order_by": { + "default": "none", + "param_type": "keyword_only" + }, + "select": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "apply": { + "default": "none", + "param_type": "keyword_only" + }, + "skip_token": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_policy_set_definition": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_set_definition_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "order_by": { + "default": "none", + "param_type": "keyword_only" + }, + "select": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "apply": { + "default": "none", + "param_type": "keyword_only" + }, + "skip_token": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "order_by": { + "default": "none", + "param_type": "keyword_only" + }, + "select": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "apply": { + "default": "none", + "param_type": "keyword_only" + }, + "expand": { + "default": "none", + "param_type": "keyword_only" + }, + "skip_token": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "order_by": { + "default": "none", + "param_type": "keyword_only" + }, + "select": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "apply": { + "default": "none", + "param_type": "keyword_only" + }, + "skip_token": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_resource_group_level_policy_assignment": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_assignment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "order_by": { + "default": "none", + "param_type": "keyword_only" + }, + "select": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "apply": { + "default": "none", + "param_type": "keyword_only" + }, + "skip_token": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "order_by": { + "default": "none", + "param_type": "keyword_only" + }, + "select": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "apply": { + "default": "none", + "param_type": "keyword_only" + }, + "skip_token": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_subscription_level_policy_assignment": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_assignment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "order_by": { + "default": "none", + "param_type": "keyword_only" + }, + "select": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "apply": { + "default": "none", + "param_type": "keyword_only" + }, + "skip_token": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "summarize_for_management_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_summary_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "summarize_for_policy_definition": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_summary_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_definition_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "summarize_for_policy_set_definition": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_summary_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_set_definition_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "summarize_for_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_summary_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "summarize_for_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_summary_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "summarize_for_resource_group_level_policy_assignment": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_summary_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_assignment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "summarize_for_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_summary_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "summarize_for_subscription_level_policy_assignment": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_states_summary_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_assignment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "from_parameter": { + "default": "none", + "param_type": "keyword_only" + }, + "to": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + } + }, + "properties": {} + }, + "PolicyTrackedResourcesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_management_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_tracked_resources_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_tracked_resources_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_tracked_resources_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_query_results_for_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_tracked_resources_resource": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "RemediationsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "cancel_at_management_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "cancel_at_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "cancel_at_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "cancel_at_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "create_or_update_at_management_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "Remediation", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "JSON", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "create_or_update_at_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "Remediation", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "JSON", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "create_or_update_at_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "Remediation", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "JSON", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "create_or_update_at_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "Remediation", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "JSON", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "delete_at_management_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "delete_at_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "delete_at_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "delete_at_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get_at_management_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get_at_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get_at_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get_at_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_deployments_at_management_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_deployments_at_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_deployments_at_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_deployments_at_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "remediation_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_for_management_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "management_group_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_for_resource": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_for_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_for_subscription": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "keyword_only" + }, + "filter": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + } + }, + "function_nodes": {} + } +} \ No newline at end of file diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/attestations_create_resource_group_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/attestations_create_resource_group_scope.py deleted file mode 100644 index 942f25cc86ce..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/attestations_create_resource_group_scope.py +++ /dev/null @@ -1,61 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python attestations_create_resource_group_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="35ee058e-5fa0-414c-8145-3ebb8d09b6e2", - ) - - response = client.attestations.begin_create_or_update_at_resource_group( - resource_group_name="myRg", - attestation_name="790996e6-9871-4b1f-9cd9-ec42cd6ced1e", - parameters={ - "properties": { - "assessmentDate": "2021-06-10T00:00:00Z", - "comments": "This subscription has passed a security audit.", - "complianceState": "Compliant", - "evidence": [ - { - "description": "The results of the security audit.", - "sourceUri": "https://gist.github.com/contoso/9573e238762c60166c090ae16b814011", - } - ], - "expiresOn": "2021-06-15T00:00:00Z", - "metadata": {"departmentId": "NYC-MARKETING-1"}, - "owner": "55a32e28-3aa5-4eea-9b5a-4cd85153b966", - "policyAssignmentId": "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5", - "policyDefinitionReferenceId": "0b158b46-ff42-4799-8e39-08a5c23b4551", - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/Attestations_CreateResourceGroupScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/attestations_create_resource_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/attestations_create_resource_scope.py deleted file mode 100644 index ca21c1a1e50e..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/attestations_create_resource_scope.py +++ /dev/null @@ -1,61 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python attestations_create_resource_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.attestations.begin_create_or_update_at_resource( - resource_id="subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myrg/providers/microsoft.compute/virtualMachines/devVM", - attestation_name="790996e6-9871-4b1f-9cd9-ec42cd6ced1e", - parameters={ - "properties": { - "assessmentDate": "2021-06-10T00:00:00Z", - "comments": "This subscription has passed a security audit.", - "complianceState": "Compliant", - "evidence": [ - { - "description": "The results of the security audit.", - "sourceUri": "https://gist.github.com/contoso/9573e238762c60166c090ae16b814011", - } - ], - "expiresOn": "2021-06-15T00:00:00Z", - "metadata": {"departmentId": "NYC-MARKETING-1"}, - "owner": "55a32e28-3aa5-4eea-9b5a-4cd85153b966", - "policyAssignmentId": "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5", - "policyDefinitionReferenceId": "0b158b46-ff42-4799-8e39-08a5c23b4551", - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/Attestations_CreateResourceScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/attestations_create_subscription_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/attestations_create_subscription_scope.py deleted file mode 100644 index 10483ca52236..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/attestations_create_subscription_scope.py +++ /dev/null @@ -1,48 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python attestations_create_subscription_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="35ee058e-5fa0-414c-8145-3ebb8d09b6e2", - ) - - response = client.attestations.begin_create_or_update_at_subscription( - attestation_name="790996e6-9871-4b1f-9cd9-ec42cd6ced1e", - parameters={ - "properties": { - "complianceState": "Compliant", - "policyAssignmentId": "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5", - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/Attestations_CreateSubscriptionScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/attestations_create_subscription_scope_all_properties.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/attestations_create_subscription_scope_all_properties.py deleted file mode 100644 index f51bc8620cc3..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/attestations_create_subscription_scope_all_properties.py +++ /dev/null @@ -1,60 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python attestations_create_subscription_scope_all_properties.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="35ee058e-5fa0-414c-8145-3ebb8d09b6e2", - ) - - response = client.attestations.begin_create_or_update_at_subscription( - attestation_name="790996e6-9871-4b1f-9cd9-ec42cd6ced1e", - parameters={ - "properties": { - "assessmentDate": "2021-06-10T00:00:00Z", - "comments": "This subscription has passed a security audit.", - "complianceState": "Compliant", - "evidence": [ - { - "description": "The results of the security audit.", - "sourceUri": "https://gist.github.com/contoso/9573e238762c60166c090ae16b814011", - } - ], - "expiresOn": "2021-06-15T00:00:00Z", - "metadata": {"departmentId": "NYC-MARKETING-1"}, - "owner": "55a32e28-3aa5-4eea-9b5a-4cd85153b966", - "policyAssignmentId": "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5", - "policyDefinitionReferenceId": "0b158b46-ff42-4799-8e39-08a5c23b4551", - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/Attestations_CreateSubscriptionScope_AllProperties.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/attestations_delete_resource_group_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/attestations_delete_resource_group_scope.py deleted file mode 100644 index 394872644764..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/attestations_delete_resource_group_scope.py +++ /dev/null @@ -1,42 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python attestations_delete_resource_group_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="35ee058e-5fa0-414c-8145-3ebb8d09b6e2", - ) - - client.attestations.delete_at_resource_group( - resource_group_name="myRg", - attestation_name="790996e6-9871-4b1f-9cd9-ec42cd6ced1e", - ) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/Attestations_DeleteResourceGroupScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/attestations_delete_resource_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/attestations_delete_resource_scope.py deleted file mode 100644 index 15be32dd43c4..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/attestations_delete_resource_scope.py +++ /dev/null @@ -1,42 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python attestations_delete_resource_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - client.attestations.delete_at_resource( - resource_id="subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myrg/providers/microsoft.compute/virtualMachines/devVM", - attestation_name="790996e6-9871-4b1f-9cd9-ec42cd6ced1e", - ) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/Attestations_DeleteResourceScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/attestations_delete_subscription_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/attestations_delete_subscription_scope.py deleted file mode 100644 index 41cbe3b43f16..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/attestations_delete_subscription_scope.py +++ /dev/null @@ -1,41 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python attestations_delete_subscription_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="35ee058e-5fa0-414c-8145-3ebb8d09b6e2", - ) - - client.attestations.delete_at_subscription( - attestation_name="790996e6-9871-4b1f-9cd9-ec42cd6ced1e", - ) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/Attestations_DeleteSubscriptionScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/attestations_get_resource_group_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/attestations_get_resource_group_scope.py deleted file mode 100644 index 064be56f43d8..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/attestations_get_resource_group_scope.py +++ /dev/null @@ -1,43 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python attestations_get_resource_group_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="35ee058e-5fa0-414c-8145-3ebb8d09b6e2", - ) - - response = client.attestations.get_at_resource_group( - resource_group_name="myRg", - attestation_name="790996e6-9871-4b1f-9cd9-ec42cd6ced1e", - ) - print(response) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/Attestations_GetResourceGroupScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/attestations_get_resource_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/attestations_get_resource_scope.py deleted file mode 100644 index fa06b6c0b254..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/attestations_get_resource_scope.py +++ /dev/null @@ -1,43 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python attestations_get_resource_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.attestations.get_at_resource( - resource_id="subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myrg/providers/microsoft.compute/virtualMachines/devVM", - attestation_name="790996e6-9871-4b1f-9cd9-ec42cd6ced1e", - ) - print(response) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/Attestations_GetResourceScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/attestations_get_subscription_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/attestations_get_subscription_scope.py deleted file mode 100644 index de7bf731c457..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/attestations_get_subscription_scope.py +++ /dev/null @@ -1,42 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python attestations_get_subscription_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="35ee058e-5fa0-414c-8145-3ebb8d09b6e2", - ) - - response = client.attestations.get_at_subscription( - attestation_name="790996e6-9871-4b1f-9cd9-ec42cd6ced1e", - ) - print(response) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/Attestations_GetSubscriptionScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/attestations_list_resource_group_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/attestations_list_resource_group_scope.py deleted file mode 100644 index bf217b7de208..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/attestations_list_resource_group_scope.py +++ /dev/null @@ -1,43 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python attestations_list_resource_group_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="35ee058e-5fa0-414c-8145-3ebb8d09b6e2", - ) - - response = client.attestations.list_for_resource_group( - resource_group_name="myRg", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/Attestations_ListResourceGroupScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/attestations_list_resource_group_scope_with_query.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/attestations_list_resource_group_scope_with_query.py deleted file mode 100644 index af0d457309ae..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/attestations_list_resource_group_scope_with_query.py +++ /dev/null @@ -1,43 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python attestations_list_resource_group_scope_with_query.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="35ee058e-5fa0-414c-8145-3ebb8d09b6e2", - ) - - response = client.attestations.list_for_resource_group( - resource_group_name="myRg", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/Attestations_ListResourceGroupScope_WithQuery.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/attestations_list_resource_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/attestations_list_resource_scope.py deleted file mode 100644 index 83b694954b81..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/attestations_list_resource_scope.py +++ /dev/null @@ -1,43 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python attestations_list_resource_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.attestations.list_for_resource( - resource_id="subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myrg/providers/microsoft.compute/virtualMachines/devVM", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/Attestations_ListResourceScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/attestations_list_resource_scope_with_query.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/attestations_list_resource_scope_with_query.py deleted file mode 100644 index f617d42df06f..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/attestations_list_resource_scope_with_query.py +++ /dev/null @@ -1,43 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python attestations_list_resource_scope_with_query.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.attestations.list_for_resource( - resource_id="subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myrg/providers/microsoft.compute/virtualMachines/devVM", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/Attestations_ListResourceScope_WithQuery.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/attestations_list_subscription_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/attestations_list_subscription_scope.py deleted file mode 100644 index ac3f07802f31..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/attestations_list_subscription_scope.py +++ /dev/null @@ -1,41 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python attestations_list_subscription_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="35ee058e-5fa0-414c-8145-3ebb8d09b6e2", - ) - - response = client.attestations.list_for_subscription() - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/Attestations_ListSubscriptionScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/attestations_list_subscription_scope_with_query.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/attestations_list_subscription_scope_with_query.py deleted file mode 100644 index 275f3b1da635..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/attestations_list_subscription_scope_with_query.py +++ /dev/null @@ -1,41 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python attestations_list_subscription_scope_with_query.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="35ee058e-5fa0-414c-8145-3ebb8d09b6e2", - ) - - response = client.attestations.list_for_subscription() - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/Attestations_ListSubscriptionScope_WithQuery.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/component_policy_states_query_nested_resource_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/component_policy_states_query_nested_resource_scope.py deleted file mode 100644 index 2404e02411ac..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/component_policy_states_query_nested_resource_scope.py +++ /dev/null @@ -1,43 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python component_policy_states_query_nested_resource_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.component_policy_states.list_query_results_for_resource( - resource_id="subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVault", - component_policy_states_resource="latest", - ) - print(response) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/ComponentPolicyStates_QueryNestedResourceScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/component_policy_states_query_resource_group_level_policy_assignment_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/component_policy_states_query_resource_group_level_policy_assignment_scope.py deleted file mode 100644 index aeee3adef5f6..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/component_policy_states_query_resource_group_level_policy_assignment_scope.py +++ /dev/null @@ -1,45 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python component_policy_states_query_resource_group_level_policy_assignment_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - - response = client.component_policy_states.list_query_results_for_resource_group_level_policy_assignment( - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - resource_group_name="myResourceGroup", - policy_assignment_name="myPolicyAssignment", - component_policy_states_resource="latest", - ) - print(response) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/ComponentPolicyStates_QueryResourceGroupLevelPolicyAssignmentScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/component_policy_states_query_resource_group_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/component_policy_states_query_resource_group_scope.py deleted file mode 100644 index 8a902a1aec24..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/component_policy_states_query_resource_group_scope.py +++ /dev/null @@ -1,44 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python component_policy_states_query_resource_group_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - - response = client.component_policy_states.list_query_results_for_resource_group( - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - resource_group_name="myResourceGroup", - component_policy_states_resource="latest", - ) - print(response) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/ComponentPolicyStates_QueryResourceGroupScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/component_policy_states_query_resource_group_scope_group_by_component_type_with_aggregate.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/component_policy_states_query_resource_group_scope_group_by_component_type_with_aggregate.py deleted file mode 100644 index 3ef3c4aac3bb..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/component_policy_states_query_resource_group_scope_group_by_component_type_with_aggregate.py +++ /dev/null @@ -1,44 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python component_policy_states_query_resource_group_scope_group_by_component_type_with_aggregate.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - - response = client.component_policy_states.list_query_results_for_resource_group( - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - resource_group_name="myResourceGroup", - component_policy_states_resource="latest", - ) - print(response) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/ComponentPolicyStates_QueryResourceGroupScopeGroupByComponentTypeWithAggregate.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/component_policy_states_query_resource_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/component_policy_states_query_resource_scope.py deleted file mode 100644 index 6e3e18fb5bd4..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/component_policy_states_query_resource_scope.py +++ /dev/null @@ -1,43 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python component_policy_states_query_resource_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.component_policy_states.list_query_results_for_resource( - resource_id="subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/Vaults/myKVName", - component_policy_states_resource="latest", - ) - print(response) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/ComponentPolicyStates_QueryResourceScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/component_policy_states_query_resource_scope_expand_policy_evaluation_details.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/component_policy_states_query_resource_scope_expand_policy_evaluation_details.py deleted file mode 100644 index d265813b8db8..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/component_policy_states_query_resource_scope_expand_policy_evaluation_details.py +++ /dev/null @@ -1,43 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python component_policy_states_query_resource_scope_expand_policy_evaluation_details.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.component_policy_states.list_query_results_for_resource( - resource_id="subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.ContainerService/managedClusters/myCluster", - component_policy_states_resource="latest", - ) - print(response) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/ComponentPolicyStates_QueryResourceScopeExpandPolicyEvaluationDetails.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/component_policy_states_query_resource_scope_filter_by_component_id.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/component_policy_states_query_resource_scope_filter_by_component_id.py deleted file mode 100644 index e8e1da9b9e8c..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/component_policy_states_query_resource_scope_filter_by_component_id.py +++ /dev/null @@ -1,43 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python component_policy_states_query_resource_scope_filter_by_component_id.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.component_policy_states.list_query_results_for_resource( - resource_id="subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/Vaults/myKVName", - component_policy_states_resource="latest", - ) - print(response) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/ComponentPolicyStates_QueryResourceScopeFilterByComponentId.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/component_policy_states_query_resource_scope_group_by_component_type_with_aggregate.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/component_policy_states_query_resource_scope_group_by_component_type_with_aggregate.py deleted file mode 100644 index b1d7e44f6b32..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/component_policy_states_query_resource_scope_group_by_component_type_with_aggregate.py +++ /dev/null @@ -1,43 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python component_policy_states_query_resource_scope_group_by_component_type_with_aggregate.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.component_policy_states.list_query_results_for_resource( - resource_id="subscriptions/e78961ba-36fe-4739-9212-e3031b4c8db7/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/Vaults/myKVName", - component_policy_states_resource="latest", - ) - print(response) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/ComponentPolicyStates_QueryResourceScopeGroupByComponentTypeWithAggregate.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/component_policy_states_query_subscription_level_policy_assignment_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/component_policy_states_query_subscription_level_policy_assignment_scope.py deleted file mode 100644 index 1d4fb505a531..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/component_policy_states_query_subscription_level_policy_assignment_scope.py +++ /dev/null @@ -1,44 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python component_policy_states_query_subscription_level_policy_assignment_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - - response = client.component_policy_states.list_query_results_for_subscription_level_policy_assignment( - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - policy_assignment_name="ec8f9645-8ecb-4abb-9c0b-5292f19d4003", - component_policy_states_resource="latest", - ) - print(response) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/ComponentPolicyStates_QuerySubscriptionLevelPolicyAssignmentScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/component_policy_states_query_subscription_level_policy_definition_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/component_policy_states_query_subscription_level_policy_definition_scope.py deleted file mode 100644 index 2cda09e983e2..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/component_policy_states_query_subscription_level_policy_definition_scope.py +++ /dev/null @@ -1,44 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python component_policy_states_query_subscription_level_policy_definition_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - - response = client.component_policy_states.list_query_results_for_policy_definition( - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - policy_definition_name="24813039-7534-408a-9842-eb99f45721b1", - component_policy_states_resource="latest", - ) - print(response) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/ComponentPolicyStates_QuerySubscriptionLevelPolicyDefinitionScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/component_policy_states_query_subscription_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/component_policy_states_query_subscription_scope.py deleted file mode 100644 index 1a2b94f5e255..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/component_policy_states_query_subscription_scope.py +++ /dev/null @@ -1,43 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python component_policy_states_query_subscription_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="fff10b27-fff3-fff5-fff8-fffbe01e86a5", - ) - - response = client.component_policy_states.list_query_results_for_subscription( - subscription_id="fff10b27-fff3-fff5-fff8-fffbe01e86a5", - component_policy_states_resource="latest", - ) - print(response) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/ComponentPolicyStates_QuerySubscriptionScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/component_policy_states_query_subscription_scope_group_by_component_type_with_aggregate.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/component_policy_states_query_subscription_scope_group_by_component_type_with_aggregate.py deleted file mode 100644 index f97f41e381db..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/component_policy_states_query_subscription_scope_group_by_component_type_with_aggregate.py +++ /dev/null @@ -1,43 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python component_policy_states_query_subscription_scope_group_by_component_type_with_aggregate.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="e78961ba-36fe-4739-9212-e3031b4c8db7", - ) - - response = client.component_policy_states.list_query_results_for_subscription( - subscription_id="e78961ba-36fe-4739-9212-e3031b4c8db7", - component_policy_states_resource="latest", - ) - print(response) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/ComponentPolicyStates_QuerySubscriptionScopeGroupByComponentTypeWithAggregate.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/operations_list_operations.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/operations_list_operations.py deleted file mode 100644 index 103c10f725ed..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/operations_list_operations.py +++ /dev/null @@ -1,40 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python operations_list_operations.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.operations.list() - print(response) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/Operations_ListOperations.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_filter_and_aggregate_only.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_filter_and_aggregate_only.py deleted file mode 100644 index cac87c0966a8..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_filter_and_aggregate_only.py +++ /dev/null @@ -1,44 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_events_filter_and_aggregate_only.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - - response = client.policy_events.list_query_results_for_subscription( - policy_events_resource="default", - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyEvents_FilterAndAggregateOnly.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_filter_and_group_by_with_aggregate.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_filter_and_group_by_with_aggregate.py deleted file mode 100644 index 2fdebea9dc39..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_filter_and_group_by_with_aggregate.py +++ /dev/null @@ -1,44 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_events_filter_and_group_by_with_aggregate.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - - response = client.policy_events.list_query_results_for_subscription( - policy_events_resource="default", - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyEvents_FilterAndGroupByWithAggregate.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_filter_and_group_by_without_aggregate.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_filter_and_group_by_without_aggregate.py deleted file mode 100644 index 1bf064ca423a..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_filter_and_group_by_without_aggregate.py +++ /dev/null @@ -1,44 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_events_filter_and_group_by_without_aggregate.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - - response = client.policy_events.list_query_results_for_subscription( - policy_events_resource="default", - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyEvents_FilterAndGroupByWithoutAggregate.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_filter_and_multiple_groups.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_filter_and_multiple_groups.py deleted file mode 100644 index 5d044c4d3dda..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_filter_and_multiple_groups.py +++ /dev/null @@ -1,44 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_events_filter_and_multiple_groups.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - - response = client.policy_events.list_query_results_for_subscription( - policy_events_resource="default", - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyEvents_FilterAndMultipleGroups.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_management_group_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_management_group_scope.py deleted file mode 100644 index 86824f27246b..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_management_group_scope.py +++ /dev/null @@ -1,44 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_events_query_management_group_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.policy_events.list_query_results_for_management_group( - policy_events_resource="default", - management_group_name="myManagementGroup", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyEvents_QueryManagementGroupScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_management_group_scope_next_link.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_management_group_scope_next_link.py deleted file mode 100644 index 8781816ae07d..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_management_group_scope_next_link.py +++ /dev/null @@ -1,44 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_events_query_management_group_scope_next_link.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.policy_events.list_query_results_for_management_group( - policy_events_resource="default", - management_group_name="myManagementGroup", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyEvents_QueryManagementGroupScopeNextLink.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_nested_resource_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_nested_resource_scope.py deleted file mode 100644 index d0693e8d78c3..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_nested_resource_scope.py +++ /dev/null @@ -1,44 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_events_query_nested_resource_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.policy_events.list_query_results_for_resource( - policy_events_resource="default", - resource_id="subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyEvents_QueryNestedResourceScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_resource_group_level_policy_assignment_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_resource_group_level_policy_assignment_scope.py deleted file mode 100644 index def3bbc02e18..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_resource_group_level_policy_assignment_scope.py +++ /dev/null @@ -1,46 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_events_query_resource_group_level_policy_assignment_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - - response = client.policy_events.list_query_results_for_resource_group_level_policy_assignment( - policy_events_resource="default", - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - resource_group_name="myResourceGroup", - policy_assignment_name="myPolicyAssignment", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyEvents_QueryResourceGroupLevelPolicyAssignmentScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_resource_group_level_policy_assignment_scope_next_link.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_resource_group_level_policy_assignment_scope_next_link.py deleted file mode 100644 index efecabab7fa2..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_resource_group_level_policy_assignment_scope_next_link.py +++ /dev/null @@ -1,46 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_events_query_resource_group_level_policy_assignment_scope_next_link.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - - response = client.policy_events.list_query_results_for_resource_group_level_policy_assignment( - policy_events_resource="default", - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - resource_group_name="myResourceGroup", - policy_assignment_name="myPolicyAssignment", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyEvents_QueryResourceGroupLevelPolicyAssignmentScopeNextLink.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_resource_group_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_resource_group_scope.py deleted file mode 100644 index 01012db15793..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_resource_group_scope.py +++ /dev/null @@ -1,45 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_events_query_resource_group_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - - response = client.policy_events.list_query_results_for_resource_group( - policy_events_resource="default", - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - resource_group_name="myResourceGroup", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyEvents_QueryResourceGroupScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_resource_group_scope_next_link.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_resource_group_scope_next_link.py deleted file mode 100644 index 054afeeeb894..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_resource_group_scope_next_link.py +++ /dev/null @@ -1,45 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_events_query_resource_group_scope_next_link.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - - response = client.policy_events.list_query_results_for_resource_group( - policy_events_resource="default", - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - resource_group_name="myResourceGroup", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyEvents_QueryResourceGroupScopeNextLink.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_resource_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_resource_scope.py deleted file mode 100644 index ec991186870f..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_resource_scope.py +++ /dev/null @@ -1,44 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_events_query_resource_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.policy_events.list_query_results_for_resource( - policy_events_resource="default", - resource_id="subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyEvents_QueryResourceScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_resource_scope_expand_components.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_resource_scope_expand_components.py deleted file mode 100644 index 16936ac261fd..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_resource_scope_expand_components.py +++ /dev/null @@ -1,44 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_events_query_resource_scope_expand_components.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.policy_events.list_query_results_for_resource( - policy_events_resource="default", - resource_id="subscriptions/e78961ba-36fe-4739-9212-e3031b4c8db7/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/Vaults/myKVName", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyEvents_QueryResourceScopeExpandComponents.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_resource_scope_expand_components_group_by_with_aggregate.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_resource_scope_expand_components_group_by_with_aggregate.py deleted file mode 100644 index 3291071cc09a..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_resource_scope_expand_components_group_by_with_aggregate.py +++ /dev/null @@ -1,44 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_events_query_resource_scope_expand_components_group_by_with_aggregate.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.policy_events.list_query_results_for_resource( - policy_events_resource="default", - resource_id="subscriptions/e78961ba-36fe-4739-9212-e3031b4c8db7/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/Vaults/myKVName", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyEvents_QueryResourceScopeExpandComponentsGroupByWithAggregate.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_resource_scope_next_link.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_resource_scope_next_link.py deleted file mode 100644 index fbe77432db49..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_resource_scope_next_link.py +++ /dev/null @@ -1,44 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_events_query_resource_scope_next_link.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.policy_events.list_query_results_for_resource( - policy_events_resource="default", - resource_id="subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyEvents_QueryResourceScopeNextLink.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_subscription_level_nested_resource_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_subscription_level_nested_resource_scope.py deleted file mode 100644 index 72d13ca910a5..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_subscription_level_nested_resource_scope.py +++ /dev/null @@ -1,44 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_events_query_subscription_level_nested_resource_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.policy_events.list_query_results_for_resource( - policy_events_resource="default", - resource_id="subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResource/someNestedResourceType/someNestedResource", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyEvents_QuerySubscriptionLevelNestedResourceScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_subscription_level_policy_assignment_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_subscription_level_policy_assignment_scope.py deleted file mode 100644 index 27679744ed84..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_subscription_level_policy_assignment_scope.py +++ /dev/null @@ -1,45 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_events_query_subscription_level_policy_assignment_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - - response = client.policy_events.list_query_results_for_subscription_level_policy_assignment( - policy_events_resource="default", - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - policy_assignment_name="ec8f9645-8ecb-4abb-9c0b-5292f19d4003", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyEvents_QuerySubscriptionLevelPolicyAssignmentScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_subscription_level_policy_assignment_scope_next_link.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_subscription_level_policy_assignment_scope_next_link.py deleted file mode 100644 index 4b0c00ea7fa0..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_subscription_level_policy_assignment_scope_next_link.py +++ /dev/null @@ -1,45 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_events_query_subscription_level_policy_assignment_scope_next_link.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - - response = client.policy_events.list_query_results_for_subscription_level_policy_assignment( - policy_events_resource="default", - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - policy_assignment_name="ec8f9645-8ecb-4abb-9c0b-5292f19d4003", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyEvents_QuerySubscriptionLevelPolicyAssignmentScopeNextLink.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_subscription_level_policy_definition_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_subscription_level_policy_definition_scope.py deleted file mode 100644 index ee08d017f67c..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_subscription_level_policy_definition_scope.py +++ /dev/null @@ -1,45 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_events_query_subscription_level_policy_definition_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - - response = client.policy_events.list_query_results_for_policy_definition( - policy_events_resource="default", - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - policy_definition_name="24813039-7534-408a-9842-eb99f45721b1", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyEvents_QuerySubscriptionLevelPolicyDefinitionScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_subscription_level_policy_definition_scope_next_link.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_subscription_level_policy_definition_scope_next_link.py deleted file mode 100644 index 4c8992ee4415..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_subscription_level_policy_definition_scope_next_link.py +++ /dev/null @@ -1,45 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_events_query_subscription_level_policy_definition_scope_next_link.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - - response = client.policy_events.list_query_results_for_policy_definition( - policy_events_resource="default", - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - policy_definition_name="24813039-7534-408a-9842-eb99f45721b1", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyEvents_QuerySubscriptionLevelPolicyDefinitionScopeNextLink.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_subscription_level_policy_set_definition_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_subscription_level_policy_set_definition_scope.py deleted file mode 100644 index 55206d0cd5e5..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_subscription_level_policy_set_definition_scope.py +++ /dev/null @@ -1,45 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_events_query_subscription_level_policy_set_definition_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - - response = client.policy_events.list_query_results_for_policy_set_definition( - policy_events_resource="default", - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - policy_set_definition_name="3e3807c1-65c9-49e0-a406-82d8ae3e338c", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyEvents_QuerySubscriptionLevelPolicySetDefinitionScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_subscription_level_policy_set_definition_scope_next_link.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_subscription_level_policy_set_definition_scope_next_link.py deleted file mode 100644 index 7590579a2888..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_subscription_level_policy_set_definition_scope_next_link.py +++ /dev/null @@ -1,45 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_events_query_subscription_level_policy_set_definition_scope_next_link.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - - response = client.policy_events.list_query_results_for_policy_set_definition( - policy_events_resource="default", - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - policy_set_definition_name="3e3807c1-65c9-49e0-a406-82d8ae3e338c", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyEvents_QuerySubscriptionLevelPolicySetDefinitionScopeNextLink.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_subscription_level_resource_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_subscription_level_resource_scope.py deleted file mode 100644 index 8331a5a86389..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_subscription_level_resource_scope.py +++ /dev/null @@ -1,44 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_events_query_subscription_level_resource_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.policy_events.list_query_results_for_resource( - policy_events_resource="default", - resource_id="subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResourceName", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyEvents_QuerySubscriptionLevelResourceScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_subscription_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_subscription_scope.py deleted file mode 100644 index d6ad5bafe050..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_subscription_scope.py +++ /dev/null @@ -1,44 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_events_query_subscription_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - - response = client.policy_events.list_query_results_for_subscription( - policy_events_resource="default", - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyEvents_QuerySubscriptionScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_subscription_scope_next_link.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_subscription_scope_next_link.py deleted file mode 100644 index fefdf2d62cf2..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_query_subscription_scope_next_link.py +++ /dev/null @@ -1,44 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_events_query_subscription_scope_next_link.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - - response = client.policy_events.list_query_results_for_subscription( - policy_events_resource="default", - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyEvents_QuerySubscriptionScopeNextLink.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_time_range_sort_select_top.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_time_range_sort_select_top.py deleted file mode 100644 index d2bcb847e78a..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_events_time_range_sort_select_top.py +++ /dev/null @@ -1,44 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_events_time_range_sort_select_top.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - - response = client.policy_events.list_query_results_for_subscription( - policy_events_resource="default", - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyEvents_TimeRangeSortSelectTop.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_metadata_get_resource.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_metadata_get_resource.py deleted file mode 100644 index 4aa27919e6f1..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_metadata_get_resource.py +++ /dev/null @@ -1,42 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_metadata_get_resource.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.policy_metadata.get_resource( - resource_name="NIST_SP_800-53_R4_AC-2", - ) - print(response) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyMetadata_GetResource.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_metadata_list.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_metadata_list.py deleted file mode 100644 index 3781822aa3c6..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_metadata_list.py +++ /dev/null @@ -1,41 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_metadata_list.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.policy_metadata.list() - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyMetadata_List.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_metadata_list_with_top.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_metadata_list_with_top.py deleted file mode 100644 index 2e3e9bcd5a2c..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_metadata_list_with_top.py +++ /dev/null @@ -1,41 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_metadata_list_with_top.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.policy_metadata.list() - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyMetadata_List_WithTop.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_restrictions_check_at_management_group_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_restrictions_check_at_management_group_scope.py deleted file mode 100644 index ab07cc322f95..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_restrictions_check_at_management_group_scope.py +++ /dev/null @@ -1,43 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_restrictions_check_at_management_group_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.policy_restrictions.check_at_management_group_scope( - management_group_id="financeMg", - parameters={"pendingFields": [{"field": "type"}]}, - ) - print(response) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyRestrictions_CheckAtManagementGroupScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_restrictions_check_at_resource_group_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_restrictions_check_at_resource_group_scope.py deleted file mode 100644 index 85caaf3cfd4d..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_restrictions_check_at_resource_group_scope.py +++ /dev/null @@ -1,53 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_restrictions_check_at_resource_group_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="35ee058e-5fa0-414c-8145-3ebb8d09b6e2", - ) - - response = client.policy_restrictions.check_at_resource_group_scope( - resource_group_name="vmRg", - parameters={ - "pendingFields": [ - {"field": "name", "values": ["myVMName"]}, - {"field": "location", "values": ["eastus", "westus", "westus2", "westeurope"]}, - {"field": "tags"}, - ], - "resourceDetails": { - "apiVersion": "2019-12-01", - "resourceContent": {"properties": {"priority": "Spot"}, "type": "Microsoft.Compute/virtualMachines"}, - }, - }, - ) - print(response) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyRestrictions_CheckAtResourceGroupScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_restrictions_check_at_resource_group_scope_include_audit_effect.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_restrictions_check_at_resource_group_scope_include_audit_effect.py deleted file mode 100644 index 709e0ec27543..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_restrictions_check_at_resource_group_scope_include_audit_effect.py +++ /dev/null @@ -1,54 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_restrictions_check_at_resource_group_scope_include_audit_effect.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="35ee058e-5fa0-414c-8145-3ebb8d09b6e2", - ) - - response = client.policy_restrictions.check_at_resource_group_scope( - resource_group_name="vmRg", - parameters={ - "includeAuditEffect": True, - "pendingFields": [ - {"field": "name", "values": ["myVMName"]}, - {"field": "location", "values": ["eastus", "westus", "westus2", "westeurope"]}, - {"field": "tags"}, - ], - "resourceDetails": { - "apiVersion": "2019-12-01", - "resourceContent": {"properties": {"priority": "Spot"}, "type": "Microsoft.Compute/virtualMachines"}, - }, - }, - ) - print(response) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyRestrictions_CheckAtResourceGroupScopeIncludeAuditEffect.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_restrictions_check_at_subscription_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_restrictions_check_at_subscription_scope.py deleted file mode 100644 index 2a5604d2a01b..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_restrictions_check_at_subscription_scope.py +++ /dev/null @@ -1,52 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_restrictions_check_at_subscription_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="35ee058e-5fa0-414c-8145-3ebb8d09b6e2", - ) - - response = client.policy_restrictions.check_at_subscription_scope( - parameters={ - "pendingFields": [ - {"field": "name", "values": ["myVMName"]}, - {"field": "location", "values": ["eastus", "westus", "westus2", "westeurope"]}, - {"field": "tags"}, - ], - "resourceDetails": { - "apiVersion": "2019-12-01", - "resourceContent": {"properties": {"priority": "Spot"}, "type": "Microsoft.Compute/virtualMachines"}, - }, - }, - ) - print(response) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyRestrictions_CheckAtSubscriptionScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_restrictions_check_at_subscription_scope_include_audit_effect.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_restrictions_check_at_subscription_scope_include_audit_effect.py deleted file mode 100644 index e64c94675ca9..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_restrictions_check_at_subscription_scope_include_audit_effect.py +++ /dev/null @@ -1,53 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_restrictions_check_at_subscription_scope_include_audit_effect.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="35ee058e-5fa0-414c-8145-3ebb8d09b6e2", - ) - - response = client.policy_restrictions.check_at_subscription_scope( - parameters={ - "includeAuditEffect": True, - "pendingFields": [ - {"field": "name", "values": ["myVMName"]}, - {"field": "location", "values": ["eastus", "westus", "westus2", "westeurope"]}, - {"field": "tags"}, - ], - "resourceDetails": { - "apiVersion": "2019-12-01", - "resourceContent": {"properties": {"priority": "Spot"}, "type": "Microsoft.Compute/virtualMachines"}, - }, - }, - ) - print(response) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyRestrictions_CheckAtSubscriptionScopeIncludeAuditEffect.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_filter_and_aggregate_only.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_filter_and_aggregate_only.py deleted file mode 100644 index adfd505ad384..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_filter_and_aggregate_only.py +++ /dev/null @@ -1,44 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_states_filter_and_aggregate_only.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - - response = client.policy_states.list_query_results_for_subscription( - policy_states_resource="latest", - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyStates_FilterAndAggregateOnly.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_filter_and_group_by_with_aggregate.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_filter_and_group_by_with_aggregate.py deleted file mode 100644 index 064ac27d83fc..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_filter_and_group_by_with_aggregate.py +++ /dev/null @@ -1,44 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_states_filter_and_group_by_with_aggregate.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - - response = client.policy_states.list_query_results_for_subscription( - policy_states_resource="latest", - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyStates_FilterAndGroupByWithAggregate.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_filter_and_group_by_without_aggregate.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_filter_and_group_by_without_aggregate.py deleted file mode 100644 index b0942c2f73df..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_filter_and_group_by_without_aggregate.py +++ /dev/null @@ -1,44 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_states_filter_and_group_by_without_aggregate.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - - response = client.policy_states.list_query_results_for_subscription( - policy_states_resource="latest", - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyStates_FilterAndGroupByWithoutAggregate.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_filter_and_multiple_groups.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_filter_and_multiple_groups.py deleted file mode 100644 index f18d49d323b3..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_filter_and_multiple_groups.py +++ /dev/null @@ -1,44 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_states_filter_and_multiple_groups.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - - response = client.policy_states.list_query_results_for_subscription( - policy_states_resource="latest", - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyStates_FilterAndMultipleGroups.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_management_group_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_management_group_scope.py deleted file mode 100644 index 39fb12370d04..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_management_group_scope.py +++ /dev/null @@ -1,44 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_states_query_management_group_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.policy_states.list_query_results_for_management_group( - policy_states_resource="latest", - management_group_name="myManagementGroup", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyStates_QueryManagementGroupScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_management_group_scope_next_link.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_management_group_scope_next_link.py deleted file mode 100644 index e28617e18f39..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_management_group_scope_next_link.py +++ /dev/null @@ -1,44 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_states_query_management_group_scope_next_link.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.policy_states.list_query_results_for_management_group( - policy_states_resource="latest", - management_group_name="myManagementGroup", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyStates_QueryManagementGroupScopeNextLink.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_nested_resource_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_nested_resource_scope.py deleted file mode 100644 index 9ffb9e170850..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_nested_resource_scope.py +++ /dev/null @@ -1,44 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_states_query_nested_resource_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.policy_states.list_query_results_for_resource( - policy_states_resource="default", - resource_id="subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyStates_QueryNestedResourceScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_resource_group_level_policy_assignment_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_resource_group_level_policy_assignment_scope.py deleted file mode 100644 index 6d790abac39c..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_resource_group_level_policy_assignment_scope.py +++ /dev/null @@ -1,46 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_states_query_resource_group_level_policy_assignment_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - - response = client.policy_states.list_query_results_for_resource_group_level_policy_assignment( - policy_states_resource="latest", - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - resource_group_name="myResourceGroup", - policy_assignment_name="myPolicyAssignment", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyStates_QueryResourceGroupLevelPolicyAssignmentScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_resource_group_level_policy_assignment_scope_next_link.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_resource_group_level_policy_assignment_scope_next_link.py deleted file mode 100644 index 3160b4c4fd57..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_resource_group_level_policy_assignment_scope_next_link.py +++ /dev/null @@ -1,46 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_states_query_resource_group_level_policy_assignment_scope_next_link.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - - response = client.policy_states.list_query_results_for_resource_group_level_policy_assignment( - policy_states_resource="latest", - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - resource_group_name="myResourceGroup", - policy_assignment_name="myPolicyAssignment", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyStates_QueryResourceGroupLevelPolicyAssignmentScopeNextLink.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_resource_group_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_resource_group_scope.py deleted file mode 100644 index 05b406af7cf5..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_resource_group_scope.py +++ /dev/null @@ -1,45 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_states_query_resource_group_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - - response = client.policy_states.list_query_results_for_resource_group( - policy_states_resource="latest", - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - resource_group_name="myResourceGroup", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyStates_QueryResourceGroupScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_resource_group_scope_next_link.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_resource_group_scope_next_link.py deleted file mode 100644 index a5121ec869bb..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_resource_group_scope_next_link.py +++ /dev/null @@ -1,45 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_states_query_resource_group_scope_next_link.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - - response = client.policy_states.list_query_results_for_resource_group( - policy_states_resource="latest", - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - resource_group_name="myResourceGroup", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyStates_QueryResourceGroupScopeNextLink.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_resource_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_resource_scope.py deleted file mode 100644 index 1d32c8a15e91..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_resource_scope.py +++ /dev/null @@ -1,44 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_states_query_resource_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.policy_states.list_query_results_for_resource( - policy_states_resource="default", - resource_id="subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyStates_QueryResourceScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_resource_scope_expand_components.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_resource_scope_expand_components.py deleted file mode 100644 index 359631c70300..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_resource_scope_expand_components.py +++ /dev/null @@ -1,44 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_states_query_resource_scope_expand_components.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.policy_states.list_query_results_for_resource( - policy_states_resource="latest", - resource_id="subscriptions/e78961ba-36fe-4739-9212-e3031b4c8db7/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/Vaults/myKVName", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyStates_QueryResourceScopeExpandComponents.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_resource_scope_expand_components_group_by_with_aggregate.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_resource_scope_expand_components_group_by_with_aggregate.py deleted file mode 100644 index ca628d12299c..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_resource_scope_expand_components_group_by_with_aggregate.py +++ /dev/null @@ -1,44 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_states_query_resource_scope_expand_components_group_by_with_aggregate.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.policy_states.list_query_results_for_resource( - policy_states_resource="latest", - resource_id="subscriptions/e78961ba-36fe-4739-9212-e3031b4c8db7/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/Vaults/myKVName", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyStates_QueryResourceScopeExpandComponentsGroupByWithAggregate.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_resource_scope_expand_policy_evaluation_details.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_resource_scope_expand_policy_evaluation_details.py deleted file mode 100644 index f5c0063668d2..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_resource_scope_expand_policy_evaluation_details.py +++ /dev/null @@ -1,44 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_states_query_resource_scope_expand_policy_evaluation_details.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.policy_states.list_query_results_for_resource( - policy_states_resource="latest", - resource_id="subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyStates_QueryResourceScopeExpandPolicyEvaluationDetails.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_resource_scope_next_link.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_resource_scope_next_link.py deleted file mode 100644 index 0256caedf63d..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_resource_scope_next_link.py +++ /dev/null @@ -1,44 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_states_query_resource_scope_next_link.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.policy_states.list_query_results_for_resource( - policy_states_resource="default", - resource_id="subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyStates_QueryResourceScopeNextLink.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_subscription_level_nested_resource_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_subscription_level_nested_resource_scope.py deleted file mode 100644 index 484cb2d4e6c9..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_subscription_level_nested_resource_scope.py +++ /dev/null @@ -1,44 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_states_query_subscription_level_nested_resource_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.policy_states.list_query_results_for_resource( - policy_states_resource="default", - resource_id="subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResource/someNestedResourceType/someNestedResource", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyStates_QuerySubscriptionLevelNestedResourceScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_subscription_level_policy_assignment_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_subscription_level_policy_assignment_scope.py deleted file mode 100644 index 4dce5b713362..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_subscription_level_policy_assignment_scope.py +++ /dev/null @@ -1,45 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_states_query_subscription_level_policy_assignment_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - - response = client.policy_states.list_query_results_for_subscription_level_policy_assignment( - policy_states_resource="latest", - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - policy_assignment_name="ec8f9645-8ecb-4abb-9c0b-5292f19d4003", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyStates_QuerySubscriptionLevelPolicyAssignmentScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_subscription_level_policy_assignment_scope_next_link.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_subscription_level_policy_assignment_scope_next_link.py deleted file mode 100644 index 3ab59a255b8c..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_subscription_level_policy_assignment_scope_next_link.py +++ /dev/null @@ -1,45 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_states_query_subscription_level_policy_assignment_scope_next_link.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - - response = client.policy_states.list_query_results_for_subscription_level_policy_assignment( - policy_states_resource="latest", - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - policy_assignment_name="ec8f9645-8ecb-4abb-9c0b-5292f19d4003", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyStates_QuerySubscriptionLevelPolicyAssignmentScopeNextLink.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_subscription_level_policy_definition_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_subscription_level_policy_definition_scope.py deleted file mode 100644 index c436946f4848..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_subscription_level_policy_definition_scope.py +++ /dev/null @@ -1,45 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_states_query_subscription_level_policy_definition_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - - response = client.policy_states.list_query_results_for_policy_definition( - policy_states_resource="latest", - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - policy_definition_name="24813039-7534-408a-9842-eb99f45721b1", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyStates_QuerySubscriptionLevelPolicyDefinitionScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_subscription_level_policy_definition_scope_next_link.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_subscription_level_policy_definition_scope_next_link.py deleted file mode 100644 index 3a54c441b231..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_subscription_level_policy_definition_scope_next_link.py +++ /dev/null @@ -1,45 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_states_query_subscription_level_policy_definition_scope_next_link.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - - response = client.policy_states.list_query_results_for_policy_definition( - policy_states_resource="latest", - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - policy_definition_name="24813039-7534-408a-9842-eb99f45721b1", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyStates_QuerySubscriptionLevelPolicyDefinitionScopeNextLink.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_subscription_level_policy_set_definition_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_subscription_level_policy_set_definition_scope.py deleted file mode 100644 index 52acdecc4d2d..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_subscription_level_policy_set_definition_scope.py +++ /dev/null @@ -1,45 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_states_query_subscription_level_policy_set_definition_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - - response = client.policy_states.list_query_results_for_policy_set_definition( - policy_states_resource="latest", - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - policy_set_definition_name="3e3807c1-65c9-49e0-a406-82d8ae3e338c", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyStates_QuerySubscriptionLevelPolicySetDefinitionScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_subscription_level_policy_set_definition_scope_next_link.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_subscription_level_policy_set_definition_scope_next_link.py deleted file mode 100644 index a1dcf98e7d83..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_subscription_level_policy_set_definition_scope_next_link.py +++ /dev/null @@ -1,45 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_states_query_subscription_level_policy_set_definition_scope_next_link.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - - response = client.policy_states.list_query_results_for_policy_set_definition( - policy_states_resource="latest", - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - policy_set_definition_name="3e3807c1-65c9-49e0-a406-82d8ae3e338c", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyStates_QuerySubscriptionLevelPolicySetDefinitionScopeNextLink.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_subscription_level_resource_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_subscription_level_resource_scope.py deleted file mode 100644 index 01a3d1a889f9..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_subscription_level_resource_scope.py +++ /dev/null @@ -1,44 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_states_query_subscription_level_resource_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.policy_states.list_query_results_for_resource( - policy_states_resource="default", - resource_id="subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResourceName", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyStates_QuerySubscriptionLevelResourceScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_subscription_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_subscription_scope.py deleted file mode 100644 index 32b33a20ea11..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_subscription_scope.py +++ /dev/null @@ -1,44 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_states_query_subscription_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - - response = client.policy_states.list_query_results_for_subscription( - policy_states_resource="latest", - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyStates_QuerySubscriptionScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_subscription_scope_next_link.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_subscription_scope_next_link.py deleted file mode 100644 index 2addd3093c6e..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_query_subscription_scope_next_link.py +++ /dev/null @@ -1,44 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_states_query_subscription_scope_next_link.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - - response = client.policy_states.list_query_results_for_subscription( - policy_states_resource="latest", - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyStates_QuerySubscriptionScopeNextLink.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_summarize_management_group_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_summarize_management_group_scope.py deleted file mode 100644 index 840161e78815..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_summarize_management_group_scope.py +++ /dev/null @@ -1,43 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_states_summarize_management_group_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.policy_states.summarize_for_management_group( - policy_states_summary_resource="latest", - management_group_name="myManagementGroup", - ) - print(response) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyStates_SummarizeManagementGroupScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_summarize_resource_group_level_policy_assignment_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_summarize_resource_group_level_policy_assignment_scope.py deleted file mode 100644 index 2e7a99dcfcf9..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_summarize_resource_group_level_policy_assignment_scope.py +++ /dev/null @@ -1,45 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_states_summarize_resource_group_level_policy_assignment_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - - response = client.policy_states.summarize_for_resource_group_level_policy_assignment( - policy_states_summary_resource="latest", - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - resource_group_name="myResourceGroup", - policy_assignment_name="b7a1ca2596524e3ab19597f2", - ) - print(response) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyStates_SummarizeResourceGroupLevelPolicyAssignmentScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_summarize_resource_group_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_summarize_resource_group_scope.py deleted file mode 100644 index d4d3319e15cf..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_summarize_resource_group_scope.py +++ /dev/null @@ -1,44 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_states_summarize_resource_group_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - - response = client.policy_states.summarize_for_resource_group( - policy_states_summary_resource="latest", - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - resource_group_name="myResourceGroup", - ) - print(response) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyStates_SummarizeResourceGroupScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_summarize_resource_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_summarize_resource_scope.py deleted file mode 100644 index ae4f7e17fa64..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_summarize_resource_scope.py +++ /dev/null @@ -1,43 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_states_summarize_resource_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.policy_states.summarize_for_resource( - policy_states_summary_resource="latest", - resource_id="subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault", - ) - print(response) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyStates_SummarizeResourceScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_summarize_subscription_level_policy_assignment_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_summarize_subscription_level_policy_assignment_scope.py deleted file mode 100644 index a14af5fc66bf..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_summarize_subscription_level_policy_assignment_scope.py +++ /dev/null @@ -1,44 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_states_summarize_subscription_level_policy_assignment_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - - response = client.policy_states.summarize_for_subscription_level_policy_assignment( - policy_states_summary_resource="latest", - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - policy_assignment_name="ec8f9645-8ecb-4abb-9c0b-5292f19d4003", - ) - print(response) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyStates_SummarizeSubscriptionLevelPolicyAssignmentScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_summarize_subscription_level_policy_definition_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_summarize_subscription_level_policy_definition_scope.py deleted file mode 100644 index d53ba49275d1..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_summarize_subscription_level_policy_definition_scope.py +++ /dev/null @@ -1,44 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_states_summarize_subscription_level_policy_definition_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - - response = client.policy_states.summarize_for_policy_definition( - policy_states_summary_resource="latest", - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - policy_definition_name="24813039-7534-408a-9842-eb99f45721b1", - ) - print(response) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyStates_SummarizeSubscriptionLevelPolicyDefinitionScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_summarize_subscription_level_policy_set_definition_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_summarize_subscription_level_policy_set_definition_scope.py deleted file mode 100644 index 02bdd53dcbec..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_summarize_subscription_level_policy_set_definition_scope.py +++ /dev/null @@ -1,44 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_states_summarize_subscription_level_policy_set_definition_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - - response = client.policy_states.summarize_for_policy_set_definition( - policy_states_summary_resource="latest", - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - policy_set_definition_name="3e3807c1-65c9-49e0-a406-82d8ae3e338c", - ) - print(response) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyStates_SummarizeSubscriptionLevelPolicySetDefinitionScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_summarize_subscription_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_summarize_subscription_scope.py deleted file mode 100644 index ee366a0b4d43..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_summarize_subscription_scope.py +++ /dev/null @@ -1,43 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_states_summarize_subscription_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - - response = client.policy_states.summarize_for_subscription( - policy_states_summary_resource="latest", - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - print(response) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyStates_SummarizeSubscriptionScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_summarize_subscription_scope_for_policy_group.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_summarize_subscription_scope_for_policy_group.py deleted file mode 100644 index e00ba4f1ba10..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_summarize_subscription_scope_for_policy_group.py +++ /dev/null @@ -1,43 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_states_summarize_subscription_scope_for_policy_group.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - - response = client.policy_states.summarize_for_subscription( - policy_states_summary_resource="latest", - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - print(response) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyStates_SummarizeSubscriptionScopeForPolicyGroup.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_time_range_sort_select_top.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_time_range_sort_select_top.py deleted file mode 100644 index cab88d8fdad4..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_time_range_sort_select_top.py +++ /dev/null @@ -1,44 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_states_time_range_sort_select_top.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - - response = client.policy_states.list_query_results_for_subscription( - policy_states_resource="latest", - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyStates_TimeRangeSortSelectTop.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_trigger_resource_group_evaluation.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_trigger_resource_group_evaluation.py deleted file mode 100644 index 8ad41d10cde7..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_trigger_resource_group_evaluation.py +++ /dev/null @@ -1,42 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_states_trigger_resource_group_evaluation.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - - client.policy_states.begin_trigger_resource_group_evaluation( - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - resource_group_name="myResourceGroup", - ).result() - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyStates_TriggerResourceGroupEvaluation.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_trigger_subscription_evaluation.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_trigger_subscription_evaluation.py deleted file mode 100644 index cf7f204d07c9..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_states_trigger_subscription_evaluation.py +++ /dev/null @@ -1,41 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_states_trigger_subscription_evaluation.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - - client.policy_states.begin_trigger_subscription_evaluation( - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ).result() - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/PolicyStates_TriggerSubscriptionEvaluation.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_tracked_resources_query_management_group_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_tracked_resources_query_management_group_scope.py deleted file mode 100644 index 9dc6330d8ef4..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_tracked_resources_query_management_group_scope.py +++ /dev/null @@ -1,44 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_tracked_resources_query_management_group_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.policy_tracked_resources.list_query_results_for_management_group( - management_group_name="myManagementGroup", - policy_tracked_resources_resource="default", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyTrackedResources_QueryManagementGroupScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_tracked_resources_query_management_group_scope_with_filter_and_top.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_tracked_resources_query_management_group_scope_with_filter_and_top.py deleted file mode 100644 index 600cccd6acb6..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_tracked_resources_query_management_group_scope_with_filter_and_top.py +++ /dev/null @@ -1,44 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_tracked_resources_query_management_group_scope_with_filter_and_top.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.policy_tracked_resources.list_query_results_for_management_group( - management_group_name="myManagementGroup", - policy_tracked_resources_resource="default", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyTrackedResources_QueryManagementGroupScopeWithFilterAndTop.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_tracked_resources_query_resource_group_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_tracked_resources_query_resource_group_scope.py deleted file mode 100644 index c578a7eb341e..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_tracked_resources_query_resource_group_scope.py +++ /dev/null @@ -1,44 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_tracked_resources_query_resource_group_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - - response = client.policy_tracked_resources.list_query_results_for_resource_group( - resource_group_name="myResourceGroup", - policy_tracked_resources_resource="default", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyTrackedResources_QueryResourceGroupScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_tracked_resources_query_resource_group_scope_with_filter_and_top.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_tracked_resources_query_resource_group_scope_with_filter_and_top.py deleted file mode 100644 index c06724b01c1f..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_tracked_resources_query_resource_group_scope_with_filter_and_top.py +++ /dev/null @@ -1,44 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_tracked_resources_query_resource_group_scope_with_filter_and_top.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - - response = client.policy_tracked_resources.list_query_results_for_resource_group( - resource_group_name="myResourceGroup", - policy_tracked_resources_resource="default", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyTrackedResources_QueryResourceGroupScopeWithFilterAndTop.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_tracked_resources_query_resource_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_tracked_resources_query_resource_scope.py deleted file mode 100644 index a41244ae495e..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_tracked_resources_query_resource_scope.py +++ /dev/null @@ -1,44 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_tracked_resources_query_resource_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.policy_tracked_resources.list_query_results_for_resource( - resource_id="subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Example/exampleResourceType/myResource", - policy_tracked_resources_resource="default", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyTrackedResources_QueryResourceScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_tracked_resources_query_resource_scope_with_filter_and_top.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_tracked_resources_query_resource_scope_with_filter_and_top.py deleted file mode 100644 index db665ca1f4b6..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_tracked_resources_query_resource_scope_with_filter_and_top.py +++ /dev/null @@ -1,44 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_tracked_resources_query_resource_scope_with_filter_and_top.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.policy_tracked_resources.list_query_results_for_resource( - resource_id="subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Example/exampleResourceType/myResource", - policy_tracked_resources_resource="default", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyTrackedResources_QueryResourceScopeWithFilterAndTop.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_tracked_resources_query_subscription_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_tracked_resources_query_subscription_scope.py deleted file mode 100644 index e2072ff368b3..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_tracked_resources_query_subscription_scope.py +++ /dev/null @@ -1,43 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_tracked_resources_query_subscription_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - - response = client.policy_tracked_resources.list_query_results_for_subscription( - policy_tracked_resources_resource="default", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyTrackedResources_QuerySubscriptionScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_tracked_resources_query_subscription_scope_with_filter_and_top.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_tracked_resources_query_subscription_scope_with_filter_and_top.py deleted file mode 100644 index 5d5e039f6df1..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/policy_tracked_resources_query_subscription_scope_with_filter_and_top.py +++ /dev/null @@ -1,43 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python policy_tracked_resources_query_subscription_scope_with_filter_and_top.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="fffedd8f-ffff-fffd-fffd-fffed2f84852", - ) - - response = client.policy_tracked_resources.list_query_results_for_subscription( - policy_tracked_resources_resource="default", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyTrackedResources_QuerySubscriptionScopeWithFilterAndTop.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_cancel_management_group_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_cancel_management_group_scope.py deleted file mode 100644 index 31f81fa0e0f4..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_cancel_management_group_scope.py +++ /dev/null @@ -1,43 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python remediations_cancel_management_group_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.remediations.cancel_at_management_group( - management_group_id="financeMg", - remediation_name="myRemediation", - ) - print(response) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/Remediations_CancelManagementGroupScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_cancel_resource_group_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_cancel_resource_group_scope.py deleted file mode 100644 index d663162bba0b..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_cancel_resource_group_scope.py +++ /dev/null @@ -1,43 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python remediations_cancel_resource_group_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="35ee058e-5fa0-414c-8145-3ebb8d09b6e2", - ) - - response = client.remediations.cancel_at_resource_group( - resource_group_name="myResourceGroup", - remediation_name="myRemediation", - ) - print(response) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/Remediations_CancelResourceGroupScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_cancel_resource_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_cancel_resource_scope.py deleted file mode 100644 index d743cf61b5fb..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_cancel_resource_scope.py +++ /dev/null @@ -1,43 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python remediations_cancel_resource_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.remediations.cancel_at_resource( - resource_id="subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storAc1", - remediation_name="myRemediation", - ) - print(response) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/Remediations_CancelResourceScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_cancel_subscription_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_cancel_subscription_scope.py deleted file mode 100644 index 4ef80b491cd9..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_cancel_subscription_scope.py +++ /dev/null @@ -1,42 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python remediations_cancel_subscription_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="35ee058e-5fa0-414c-8145-3ebb8d09b6e2", - ) - - response = client.remediations.cancel_at_subscription( - remediation_name="myRemediation", - ) - print(response) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/Remediations_CancelSubscriptionScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_create_management_group_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_create_management_group_scope.py deleted file mode 100644 index 0b96f5d30edb..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_create_management_group_scope.py +++ /dev/null @@ -1,48 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python remediations_create_management_group_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.remediations.create_or_update_at_management_group( - management_group_id="financeMg", - remediation_name="storageRemediation", - parameters={ - "properties": { - "policyAssignmentId": "/providers/microsoft.management/managementGroups/financeMg/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5" - } - }, - ) - print(response) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/Remediations_CreateManagementGroupScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_create_resource_group_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_create_resource_group_scope.py deleted file mode 100644 index 00b7b7b7ca73..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_create_resource_group_scope.py +++ /dev/null @@ -1,48 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python remediations_create_resource_group_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="35ee058e-5fa0-414c-8145-3ebb8d09b6e2", - ) - - response = client.remediations.create_or_update_at_resource_group( - resource_group_name="myResourceGroup", - remediation_name="storageRemediation", - parameters={ - "properties": { - "policyAssignmentId": "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourceGroups/myResourceGroup/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5" - } - }, - ) - print(response) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/Remediations_CreateResourceGroupScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_create_resource_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_create_resource_scope.py deleted file mode 100644 index 5648a784e8bc..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_create_resource_scope.py +++ /dev/null @@ -1,48 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python remediations_create_resource_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.remediations.create_or_update_at_resource( - resource_id="subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storAc1", - remediation_name="storageRemediation", - parameters={ - "properties": { - "policyAssignmentId": "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourceGroups/myResourceGroup/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5" - } - }, - ) - print(response) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/Remediations_CreateResourceScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_create_subscription_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_create_subscription_scope.py deleted file mode 100644 index 52a50f4a440a..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_create_subscription_scope.py +++ /dev/null @@ -1,47 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python remediations_create_subscription_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="35ee058e-5fa0-414c-8145-3ebb8d09b6e2", - ) - - response = client.remediations.create_or_update_at_subscription( - remediation_name="storageRemediation", - parameters={ - "properties": { - "policyAssignmentId": "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5" - } - }, - ) - print(response) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/Remediations_CreateSubscriptionScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_create_subscription_scope_all_properties.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_create_subscription_scope_all_properties.py deleted file mode 100644 index a219195da8d7..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_create_subscription_scope_all_properties.py +++ /dev/null @@ -1,53 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python remediations_create_subscription_scope_all_properties.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="35ee058e-5fa0-414c-8145-3ebb8d09b6e2", - ) - - response = client.remediations.create_or_update_at_subscription( - remediation_name="storageRemediation", - parameters={ - "properties": { - "failureThreshold": {"percentage": 0.1}, - "filters": {"locations": ["eastus", "westus"]}, - "parallelDeployments": 6, - "policyAssignmentId": "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5", - "policyDefinitionReferenceId": "8c8fa9e4", - "resourceCount": 42, - "resourceDiscoveryMode": "ReEvaluateCompliance", - } - }, - ) - print(response) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/Remediations_CreateSubscriptionScope_AllProperties.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_create_subscription_scope_resource_ids_filter.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_create_subscription_scope_resource_ids_filter.py deleted file mode 100644 index 51f674d5e800..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_create_subscription_scope_resource_ids_filter.py +++ /dev/null @@ -1,63 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python remediations_create_subscription_scope_resource_ids_filter.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="35ee058e-5fa0-414c-8145-3ebb8d09b6e2", - ) - - response = client.remediations.create_or_update_at_subscription( - remediation_name="storageRemediation", - parameters={ - "properties": { - "failureThreshold": {"percentage": 0.1}, - "filters": { - "locations": ["eastus", "westus"], - "resourceIds": [ - "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourceGroups/res2627/providers/Microsoft.Storage/storageAccounts/sto1125", - "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourceGroups/testcmk3/providers/Microsoft.Storage/storageAccounts/sto3699", - "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourceGroups/res9407/providers/Microsoft.Storage/storageAccounts/sto8596", - "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourceGroups/testcmk3/providers/Microsoft.Storage/storageAccounts/sto6637", - "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourceGroups/res8186/providers/Microsoft.Storage/storageAccounts/sto834", - "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourceGroups/testcmk3/providers/Microsoft.Storage/storageAccounts/sto9174", - ], - }, - "parallelDeployments": 6, - "policyAssignmentId": "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5", - "policyDefinitionReferenceId": "8c8fa9e4", - "resourceCount": 42, - "resourceDiscoveryMode": "ExistingNonCompliant", - } - }, - ) - print(response) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/Remediations_CreateSubscriptionScope_ResourceIdsFilter.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_delete_management_group_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_delete_management_group_scope.py deleted file mode 100644 index 5561c0f67f97..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_delete_management_group_scope.py +++ /dev/null @@ -1,43 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python remediations_delete_management_group_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.remediations.delete_at_management_group( - management_group_id="financeMg", - remediation_name="storageRemediation", - ) - print(response) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/Remediations_DeleteManagementGroupScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_delete_resource_group_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_delete_resource_group_scope.py deleted file mode 100644 index eb86ea24ac4e..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_delete_resource_group_scope.py +++ /dev/null @@ -1,43 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python remediations_delete_resource_group_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="35ee058e-5fa0-414c-8145-3ebb8d09b6e2", - ) - - response = client.remediations.delete_at_resource_group( - resource_group_name="myResourceGroup", - remediation_name="storageRemediation", - ) - print(response) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/Remediations_DeleteResourceGroupScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_delete_resource_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_delete_resource_scope.py deleted file mode 100644 index 02b3e4aadcc8..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_delete_resource_scope.py +++ /dev/null @@ -1,43 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python remediations_delete_resource_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.remediations.delete_at_resource( - resource_id="subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storAc1", - remediation_name="storageRemediation", - ) - print(response) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/Remediations_DeleteResourceScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_delete_subscription_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_delete_subscription_scope.py deleted file mode 100644 index 0886e6c0cc93..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_delete_subscription_scope.py +++ /dev/null @@ -1,42 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python remediations_delete_subscription_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="35ee058e-5fa0-414c-8145-3ebb8d09b6e2", - ) - - response = client.remediations.delete_at_subscription( - remediation_name="storageRemediation", - ) - print(response) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/Remediations_DeleteSubscriptionScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_get_management_group_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_get_management_group_scope.py deleted file mode 100644 index ff5f96d1ffee..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_get_management_group_scope.py +++ /dev/null @@ -1,43 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python remediations_get_management_group_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.remediations.get_at_management_group( - management_group_id="financeMg", - remediation_name="storageRemediation", - ) - print(response) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/Remediations_GetManagementGroupScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_get_resource_group_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_get_resource_group_scope.py deleted file mode 100644 index a22e7bb6d2de..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_get_resource_group_scope.py +++ /dev/null @@ -1,43 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python remediations_get_resource_group_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="35ee058e-5fa0-414c-8145-3ebb8d09b6e2", - ) - - response = client.remediations.get_at_resource_group( - resource_group_name="myResourceGroup", - remediation_name="storageRemediation", - ) - print(response) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/Remediations_GetResourceGroupScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_get_resource_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_get_resource_scope.py deleted file mode 100644 index 630f074ed294..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_get_resource_scope.py +++ /dev/null @@ -1,43 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python remediations_get_resource_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.remediations.get_at_resource( - resource_id="subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storAc1", - remediation_name="storageRemediation", - ) - print(response) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/Remediations_GetResourceScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_get_subscription_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_get_subscription_scope.py deleted file mode 100644 index 78148b59cb7e..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_get_subscription_scope.py +++ /dev/null @@ -1,42 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python remediations_get_subscription_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="35ee058e-5fa0-414c-8145-3ebb8d09b6e2", - ) - - response = client.remediations.get_at_subscription( - remediation_name="storageRemediation", - ) - print(response) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/Remediations_GetSubscriptionScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_list_deployments_management_group_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_list_deployments_management_group_scope.py deleted file mode 100644 index 379561560a66..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_list_deployments_management_group_scope.py +++ /dev/null @@ -1,44 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python remediations_list_deployments_management_group_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.remediations.list_deployments_at_management_group( - management_group_id="financeMg", - remediation_name="myRemediation", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/Remediations_ListDeploymentsManagementGroupScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_list_deployments_resource_group_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_list_deployments_resource_group_scope.py deleted file mode 100644 index b1ede6f826bb..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_list_deployments_resource_group_scope.py +++ /dev/null @@ -1,44 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python remediations_list_deployments_resource_group_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="35ee058e-5fa0-414c-8145-3ebb8d09b6e2", - ) - - response = client.remediations.list_deployments_at_resource_group( - resource_group_name="myResourceGroup", - remediation_name="myRemediation", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/Remediations_ListDeploymentsResourceGroupScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_list_deployments_resource_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_list_deployments_resource_scope.py deleted file mode 100644 index 284303d080bf..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_list_deployments_resource_scope.py +++ /dev/null @@ -1,44 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python remediations_list_deployments_resource_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.remediations.list_deployments_at_resource( - resource_id="subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storAc1", - remediation_name="myRemediation", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/Remediations_ListDeploymentsResourceScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_list_deployments_subscription_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_list_deployments_subscription_scope.py deleted file mode 100644 index de75c1626669..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_list_deployments_subscription_scope.py +++ /dev/null @@ -1,43 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python remediations_list_deployments_subscription_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="35ee058e-5fa0-414c-8145-3ebb8d09b6e2", - ) - - response = client.remediations.list_deployments_at_subscription( - remediation_name="myRemediation", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/Remediations_ListDeploymentsSubscriptionScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_list_management_group_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_list_management_group_scope.py deleted file mode 100644 index a5480b82c91f..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_list_management_group_scope.py +++ /dev/null @@ -1,43 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python remediations_list_management_group_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.remediations.list_for_management_group( - management_group_id="financeMg", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/Remediations_ListManagementGroupScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_list_management_group_scope_with_query.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_list_management_group_scope_with_query.py deleted file mode 100644 index 74f3b1eccf05..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_list_management_group_scope_with_query.py +++ /dev/null @@ -1,43 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python remediations_list_management_group_scope_with_query.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.remediations.list_for_management_group( - management_group_id="financeMg", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/Remediations_ListManagementGroupScope_WithQuery.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_list_resource_group_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_list_resource_group_scope.py deleted file mode 100644 index 682edc63aa88..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_list_resource_group_scope.py +++ /dev/null @@ -1,43 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python remediations_list_resource_group_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="35ee058e-5fa0-414c-8145-3ebb8d09b6e2", - ) - - response = client.remediations.list_for_resource_group( - resource_group_name="myResourceGroup", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/Remediations_ListResourceGroupScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_list_resource_group_scope_with_query.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_list_resource_group_scope_with_query.py deleted file mode 100644 index 242f35aa734b..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_list_resource_group_scope_with_query.py +++ /dev/null @@ -1,43 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python remediations_list_resource_group_scope_with_query.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="35ee058e-5fa0-414c-8145-3ebb8d09b6e2", - ) - - response = client.remediations.list_for_resource_group( - resource_group_name="myResourceGroup", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/Remediations_ListResourceGroupScope_WithQuery.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_list_resource_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_list_resource_scope.py deleted file mode 100644 index cce76b5e9d1c..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_list_resource_scope.py +++ /dev/null @@ -1,43 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python remediations_list_resource_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.remediations.list_for_resource( - resource_id="subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storAc1", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/Remediations_ListResourceScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_list_resource_scope_with_query.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_list_resource_scope_with_query.py deleted file mode 100644 index a1321f4f33a9..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_list_resource_scope_with_query.py +++ /dev/null @@ -1,43 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python remediations_list_resource_scope_with_query.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.remediations.list_for_resource( - resource_id="subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storAc1", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/Remediations_ListResourceScope_WithQuery.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_list_subscription_scope.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_list_subscription_scope.py deleted file mode 100644 index a6aea1498c43..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_list_subscription_scope.py +++ /dev/null @@ -1,41 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python remediations_list_subscription_scope.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="35ee058e-5fa0-414c-8145-3ebb8d09b6e2", - ) - - response = client.remediations.list_for_subscription() - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/Remediations_ListSubscriptionScope.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_list_subscription_scope_with_query.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_list_subscription_scope_with_query.py deleted file mode 100644 index aab629ab9b37..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_samples/remediations_list_subscription_scope_with_query.py +++ /dev/null @@ -1,41 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 azure.identity import DefaultAzureCredential - -from azure.mgmt.policyinsights import PolicyInsightsClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-policyinsights -# USAGE - python remediations_list_subscription_scope_with_query.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PolicyInsightsClient( - credential=DefaultAzureCredential(), - subscription_id="35ee058e-5fa0-414c-8145-3ebb8d09b6e2", - ) - - response = client.remediations.list_for_subscription() - for item in response: - print(item) - - -# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2024-10-01/examples/Remediations_ListSubscriptionScope_WithQuery.json -if __name__ == "__main__": - main() diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/conftest.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/conftest.py index 3ca9a4ea2524..bbe3fee1c9b1 100644 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/conftest.py +++ b/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/conftest.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import os diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_attestations_operations.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_attestations_operations.py index 3d28281e9d55..cd9ba7180826 100644 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_attestations_operations.py +++ b/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_attestations_operations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -20,11 +20,12 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_attestations_list_for_subscription(self, resource_group): - response = self.client.attestations.list_for_subscription( + def test_attestations_get_at_subscription(self, resource_group): + response = self.client.attestations.get_at_subscription( + attestation_name="str", api_version="2024-10-01", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @@ -34,19 +35,21 @@ def test_attestations_begin_create_or_update_at_subscription(self, resource_grou response = self.client.attestations.begin_create_or_update_at_subscription( attestation_name="str", parameters={ - "policyAssignmentId": "str", - "assessmentDate": "2020-02-20 00:00:00", - "comments": "str", - "complianceState": "str", - "evidence": [{"description": "str", "sourceUri": "str"}], - "expiresOn": "2020-02-20 00:00:00", + "properties": { + "policyAssignmentId": "str", + "assessmentDate": "2020-02-20 00:00:00", + "comments": "str", + "complianceState": "str", + "evidence": [{"description": "str", "sourceUri": "str"}], + "expiresOn": "2020-02-20 00:00:00", + "lastComplianceStateChangeAt": "2020-02-20 00:00:00", + "metadata": {}, + "owner": "str", + "policyDefinitionReferenceId": "str", + "provisioningState": "str", + }, "id": "str", - "lastComplianceStateChangeAt": "2020-02-20 00:00:00", - "metadata": {}, "name": "str", - "owner": "str", - "policyDefinitionReferenceId": "str", - "provisioningState": "str", "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -65,8 +68,8 @@ def test_attestations_begin_create_or_update_at_subscription(self, resource_grou @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_attestations_get_at_subscription(self, resource_group): - response = self.client.attestations.get_at_subscription( + def test_attestations_delete_at_subscription(self, resource_group): + response = self.client.attestations.delete_at_subscription( attestation_name="str", api_version="2024-10-01", ) @@ -76,23 +79,23 @@ def test_attestations_get_at_subscription(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_attestations_delete_at_subscription(self, resource_group): - response = self.client.attestations.delete_at_subscription( - attestation_name="str", + def test_attestations_list_for_subscription(self, resource_group): + response = self.client.attestations.list_for_subscription( api_version="2024-10-01", ) - + result = [r for r in response] # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_attestations_list_for_resource_group(self, resource_group): - response = self.client.attestations.list_for_resource_group( + def test_attestations_get_at_resource_group(self, resource_group): + response = self.client.attestations.get_at_resource_group( resource_group_name=resource_group.name, + attestation_name="str", api_version="2024-10-01", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @@ -103,19 +106,21 @@ def test_attestations_begin_create_or_update_at_resource_group(self, resource_gr resource_group_name=resource_group.name, attestation_name="str", parameters={ - "policyAssignmentId": "str", - "assessmentDate": "2020-02-20 00:00:00", - "comments": "str", - "complianceState": "str", - "evidence": [{"description": "str", "sourceUri": "str"}], - "expiresOn": "2020-02-20 00:00:00", + "properties": { + "policyAssignmentId": "str", + "assessmentDate": "2020-02-20 00:00:00", + "comments": "str", + "complianceState": "str", + "evidence": [{"description": "str", "sourceUri": "str"}], + "expiresOn": "2020-02-20 00:00:00", + "lastComplianceStateChangeAt": "2020-02-20 00:00:00", + "metadata": {}, + "owner": "str", + "policyDefinitionReferenceId": "str", + "provisioningState": "str", + }, "id": "str", - "lastComplianceStateChangeAt": "2020-02-20 00:00:00", - "metadata": {}, "name": "str", - "owner": "str", - "policyDefinitionReferenceId": "str", - "provisioningState": "str", "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -134,8 +139,8 @@ def test_attestations_begin_create_or_update_at_resource_group(self, resource_gr @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_attestations_get_at_resource_group(self, resource_group): - response = self.client.attestations.get_at_resource_group( + def test_attestations_delete_at_resource_group(self, resource_group): + response = self.client.attestations.delete_at_resource_group( resource_group_name=resource_group.name, attestation_name="str", api_version="2024-10-01", @@ -146,24 +151,24 @@ def test_attestations_get_at_resource_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_attestations_delete_at_resource_group(self, resource_group): - response = self.client.attestations.delete_at_resource_group( + def test_attestations_list_for_resource_group(self, resource_group): + response = self.client.attestations.list_for_resource_group( resource_group_name=resource_group.name, - attestation_name="str", api_version="2024-10-01", ) - + result = [r for r in response] # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_attestations_list_for_resource(self, resource_group): - response = self.client.attestations.list_for_resource( + def test_attestations_get_at_resource(self, resource_group): + response = self.client.attestations.get_at_resource( resource_id="str", + attestation_name="str", api_version="2024-10-01", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @@ -174,19 +179,21 @@ def test_attestations_begin_create_or_update_at_resource(self, resource_group): resource_id="str", attestation_name="str", parameters={ - "policyAssignmentId": "str", - "assessmentDate": "2020-02-20 00:00:00", - "comments": "str", - "complianceState": "str", - "evidence": [{"description": "str", "sourceUri": "str"}], - "expiresOn": "2020-02-20 00:00:00", + "properties": { + "policyAssignmentId": "str", + "assessmentDate": "2020-02-20 00:00:00", + "comments": "str", + "complianceState": "str", + "evidence": [{"description": "str", "sourceUri": "str"}], + "expiresOn": "2020-02-20 00:00:00", + "lastComplianceStateChangeAt": "2020-02-20 00:00:00", + "metadata": {}, + "owner": "str", + "policyDefinitionReferenceId": "str", + "provisioningState": "str", + }, "id": "str", - "lastComplianceStateChangeAt": "2020-02-20 00:00:00", - "metadata": {}, "name": "str", - "owner": "str", - "policyDefinitionReferenceId": "str", - "provisioningState": "str", "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -205,8 +212,8 @@ def test_attestations_begin_create_or_update_at_resource(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_attestations_get_at_resource(self, resource_group): - response = self.client.attestations.get_at_resource( + def test_attestations_delete_at_resource(self, resource_group): + response = self.client.attestations.delete_at_resource( resource_id="str", attestation_name="str", api_version="2024-10-01", @@ -217,12 +224,11 @@ def test_attestations_get_at_resource(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_attestations_delete_at_resource(self, resource_group): - response = self.client.attestations.delete_at_resource( + def test_attestations_list_for_resource(self, resource_group): + response = self.client.attestations.list_for_resource( resource_id="str", - attestation_name="str", api_version="2024-10-01", ) - + result = [r for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_attestations_operations_async.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_attestations_operations_async.py index 2e6579bd0d3c..92dc528f9b99 100644 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_attestations_operations_async.py +++ b/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_attestations_operations_async.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -21,11 +21,12 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_attestations_list_for_subscription(self, resource_group): - response = self.client.attestations.list_for_subscription( + async def test_attestations_get_at_subscription(self, resource_group): + response = await self.client.attestations.get_at_subscription( + attestation_name="str", api_version="2024-10-01", ) - result = [r async for r in response] + # please add some check logic here by yourself # ... @@ -36,19 +37,21 @@ async def test_attestations_begin_create_or_update_at_subscription(self, resourc await self.client.attestations.begin_create_or_update_at_subscription( attestation_name="str", parameters={ - "policyAssignmentId": "str", - "assessmentDate": "2020-02-20 00:00:00", - "comments": "str", - "complianceState": "str", - "evidence": [{"description": "str", "sourceUri": "str"}], - "expiresOn": "2020-02-20 00:00:00", + "properties": { + "policyAssignmentId": "str", + "assessmentDate": "2020-02-20 00:00:00", + "comments": "str", + "complianceState": "str", + "evidence": [{"description": "str", "sourceUri": "str"}], + "expiresOn": "2020-02-20 00:00:00", + "lastComplianceStateChangeAt": "2020-02-20 00:00:00", + "metadata": {}, + "owner": "str", + "policyDefinitionReferenceId": "str", + "provisioningState": "str", + }, "id": "str", - "lastComplianceStateChangeAt": "2020-02-20 00:00:00", - "metadata": {}, "name": "str", - "owner": "str", - "policyDefinitionReferenceId": "str", - "provisioningState": "str", "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -68,8 +71,8 @@ async def test_attestations_begin_create_or_update_at_subscription(self, resourc @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_attestations_get_at_subscription(self, resource_group): - response = await self.client.attestations.get_at_subscription( + async def test_attestations_delete_at_subscription(self, resource_group): + response = await self.client.attestations.delete_at_subscription( attestation_name="str", api_version="2024-10-01", ) @@ -79,23 +82,23 @@ async def test_attestations_get_at_subscription(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_attestations_delete_at_subscription(self, resource_group): - response = await self.client.attestations.delete_at_subscription( - attestation_name="str", + async def test_attestations_list_for_subscription(self, resource_group): + response = self.client.attestations.list_for_subscription( api_version="2024-10-01", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_attestations_list_for_resource_group(self, resource_group): - response = self.client.attestations.list_for_resource_group( + async def test_attestations_get_at_resource_group(self, resource_group): + response = await self.client.attestations.get_at_resource_group( resource_group_name=resource_group.name, + attestation_name="str", api_version="2024-10-01", ) - result = [r async for r in response] + # please add some check logic here by yourself # ... @@ -107,19 +110,21 @@ async def test_attestations_begin_create_or_update_at_resource_group(self, resou resource_group_name=resource_group.name, attestation_name="str", parameters={ - "policyAssignmentId": "str", - "assessmentDate": "2020-02-20 00:00:00", - "comments": "str", - "complianceState": "str", - "evidence": [{"description": "str", "sourceUri": "str"}], - "expiresOn": "2020-02-20 00:00:00", + "properties": { + "policyAssignmentId": "str", + "assessmentDate": "2020-02-20 00:00:00", + "comments": "str", + "complianceState": "str", + "evidence": [{"description": "str", "sourceUri": "str"}], + "expiresOn": "2020-02-20 00:00:00", + "lastComplianceStateChangeAt": "2020-02-20 00:00:00", + "metadata": {}, + "owner": "str", + "policyDefinitionReferenceId": "str", + "provisioningState": "str", + }, "id": "str", - "lastComplianceStateChangeAt": "2020-02-20 00:00:00", - "metadata": {}, "name": "str", - "owner": "str", - "policyDefinitionReferenceId": "str", - "provisioningState": "str", "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -139,8 +144,8 @@ async def test_attestations_begin_create_or_update_at_resource_group(self, resou @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_attestations_get_at_resource_group(self, resource_group): - response = await self.client.attestations.get_at_resource_group( + async def test_attestations_delete_at_resource_group(self, resource_group): + response = await self.client.attestations.delete_at_resource_group( resource_group_name=resource_group.name, attestation_name="str", api_version="2024-10-01", @@ -151,24 +156,24 @@ async def test_attestations_get_at_resource_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_attestations_delete_at_resource_group(self, resource_group): - response = await self.client.attestations.delete_at_resource_group( + async def test_attestations_list_for_resource_group(self, resource_group): + response = self.client.attestations.list_for_resource_group( resource_group_name=resource_group.name, - attestation_name="str", api_version="2024-10-01", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_attestations_list_for_resource(self, resource_group): - response = self.client.attestations.list_for_resource( + async def test_attestations_get_at_resource(self, resource_group): + response = await self.client.attestations.get_at_resource( resource_id="str", + attestation_name="str", api_version="2024-10-01", ) - result = [r async for r in response] + # please add some check logic here by yourself # ... @@ -180,19 +185,21 @@ async def test_attestations_begin_create_or_update_at_resource(self, resource_gr resource_id="str", attestation_name="str", parameters={ - "policyAssignmentId": "str", - "assessmentDate": "2020-02-20 00:00:00", - "comments": "str", - "complianceState": "str", - "evidence": [{"description": "str", "sourceUri": "str"}], - "expiresOn": "2020-02-20 00:00:00", + "properties": { + "policyAssignmentId": "str", + "assessmentDate": "2020-02-20 00:00:00", + "comments": "str", + "complianceState": "str", + "evidence": [{"description": "str", "sourceUri": "str"}], + "expiresOn": "2020-02-20 00:00:00", + "lastComplianceStateChangeAt": "2020-02-20 00:00:00", + "metadata": {}, + "owner": "str", + "policyDefinitionReferenceId": "str", + "provisioningState": "str", + }, "id": "str", - "lastComplianceStateChangeAt": "2020-02-20 00:00:00", - "metadata": {}, "name": "str", - "owner": "str", - "policyDefinitionReferenceId": "str", - "provisioningState": "str", "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -212,8 +219,8 @@ async def test_attestations_begin_create_or_update_at_resource(self, resource_gr @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_attestations_get_at_resource(self, resource_group): - response = await self.client.attestations.get_at_resource( + async def test_attestations_delete_at_resource(self, resource_group): + response = await self.client.attestations.delete_at_resource( resource_id="str", attestation_name="str", api_version="2024-10-01", @@ -224,12 +231,11 @@ async def test_attestations_get_at_resource(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_attestations_delete_at_resource(self, resource_group): - response = await self.client.attestations.delete_at_resource( + async def test_attestations_list_for_resource(self, resource_group): + response = self.client.attestations.list_for_resource( resource_id="str", - attestation_name="str", api_version="2024-10-01", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_component_policy_states_operations.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_component_policy_states_operations.py index 7a4ef0dfb8bd..131e2016f62d 100644 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_component_policy_states_operations.py +++ b/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_component_policy_states_operations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -22,7 +22,6 @@ def setup_method(self, method): @recorded_by_proxy def test_component_policy_states_list_query_results_for_subscription(self, resource_group): response = self.client.component_policy_states.list_query_results_for_subscription( - subscription_id="str", component_policy_states_resource="str", api_version="2024-10-01", ) @@ -34,7 +33,6 @@ def test_component_policy_states_list_query_results_for_subscription(self, resou @recorded_by_proxy def test_component_policy_states_list_query_results_for_resource_group(self, resource_group): response = self.client.component_policy_states.list_query_results_for_resource_group( - subscription_id="str", resource_group_name=resource_group.name, component_policy_states_resource="str", api_version="2024-10-01", @@ -59,7 +57,6 @@ def test_component_policy_states_list_query_results_for_resource(self, resource_ @recorded_by_proxy def test_component_policy_states_list_query_results_for_policy_definition(self, resource_group): response = self.client.component_policy_states.list_query_results_for_policy_definition( - subscription_id="str", policy_definition_name="str", component_policy_states_resource="str", authorization_namespace="Microsoft.Authorization", @@ -73,7 +70,6 @@ def test_component_policy_states_list_query_results_for_policy_definition(self, @recorded_by_proxy def test_component_policy_states_list_query_results_for_subscription_level_policy_assignment(self, resource_group): response = self.client.component_policy_states.list_query_results_for_subscription_level_policy_assignment( - subscription_id="str", policy_assignment_name="str", component_policy_states_resource="str", authorization_namespace="Microsoft.Authorization", @@ -89,7 +85,6 @@ def test_component_policy_states_list_query_results_for_resource_group_level_pol self, resource_group ): response = self.client.component_policy_states.list_query_results_for_resource_group_level_policy_assignment( - subscription_id="str", resource_group_name=resource_group.name, policy_assignment_name="str", component_policy_states_resource="str", diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_component_policy_states_operations_async.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_component_policy_states_operations_async.py index b6365488243f..fddb63ca19f1 100644 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_component_policy_states_operations_async.py +++ b/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_component_policy_states_operations_async.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -23,7 +23,6 @@ def setup_method(self, method): @recorded_by_proxy_async async def test_component_policy_states_list_query_results_for_subscription(self, resource_group): response = await self.client.component_policy_states.list_query_results_for_subscription( - subscription_id="str", component_policy_states_resource="str", api_version="2024-10-01", ) @@ -35,7 +34,6 @@ async def test_component_policy_states_list_query_results_for_subscription(self, @recorded_by_proxy_async async def test_component_policy_states_list_query_results_for_resource_group(self, resource_group): response = await self.client.component_policy_states.list_query_results_for_resource_group( - subscription_id="str", resource_group_name=resource_group.name, component_policy_states_resource="str", api_version="2024-10-01", @@ -60,7 +58,6 @@ async def test_component_policy_states_list_query_results_for_resource(self, res @recorded_by_proxy_async async def test_component_policy_states_list_query_results_for_policy_definition(self, resource_group): response = await self.client.component_policy_states.list_query_results_for_policy_definition( - subscription_id="str", policy_definition_name="str", component_policy_states_resource="str", authorization_namespace="Microsoft.Authorization", @@ -77,7 +74,6 @@ async def test_component_policy_states_list_query_results_for_subscription_level ): response = ( await self.client.component_policy_states.list_query_results_for_subscription_level_policy_assignment( - subscription_id="str", policy_assignment_name="str", component_policy_states_resource="str", authorization_namespace="Microsoft.Authorization", @@ -95,7 +91,6 @@ async def test_component_policy_states_list_query_results_for_resource_group_lev ): response = ( await self.client.component_policy_states.list_query_results_for_resource_group_level_policy_assignment( - subscription_id="str", resource_group_name=resource_group.name, policy_assignment_name="str", component_policy_states_resource="str", diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_operations.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_operations.py index 2baf50570931..53166e3b0f43 100644 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_operations.py +++ b/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_operations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_operations_async.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_operations_async.py index a4e3feee7028..e23b2721723d 100644 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_operations_async.py +++ b/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_operations_async.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_policy_events_operations.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_policy_events_operations.py index df07c4b9fe93..01c65bd2ce06 100644 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_policy_events_operations.py +++ b/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_policy_events_operations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -36,7 +36,6 @@ def test_policy_events_list_query_results_for_management_group(self, resource_gr def test_policy_events_list_query_results_for_subscription(self, resource_group): response = self.client.policy_events.list_query_results_for_subscription( policy_events_resource="str", - subscription_id="str", api_version="2024-10-01", ) result = [r for r in response] @@ -47,9 +46,8 @@ def test_policy_events_list_query_results_for_subscription(self, resource_group) @recorded_by_proxy def test_policy_events_list_query_results_for_resource_group(self, resource_group): response = self.client.policy_events.list_query_results_for_resource_group( - policy_events_resource="str", - subscription_id="str", resource_group_name=resource_group.name, + policy_events_resource="str", api_version="2024-10-01", ) result = [r for r in response] @@ -73,7 +71,6 @@ def test_policy_events_list_query_results_for_resource(self, resource_group): def test_policy_events_list_query_results_for_policy_set_definition(self, resource_group): response = self.client.policy_events.list_query_results_for_policy_set_definition( policy_events_resource="str", - subscription_id="str", policy_set_definition_name="str", authorization_namespace="Microsoft.Authorization", api_version="2024-10-01", @@ -87,7 +84,6 @@ def test_policy_events_list_query_results_for_policy_set_definition(self, resour def test_policy_events_list_query_results_for_policy_definition(self, resource_group): response = self.client.policy_events.list_query_results_for_policy_definition( policy_events_resource="str", - subscription_id="str", policy_definition_name="str", authorization_namespace="Microsoft.Authorization", api_version="2024-10-01", @@ -101,7 +97,6 @@ def test_policy_events_list_query_results_for_policy_definition(self, resource_g def test_policy_events_list_query_results_for_subscription_level_policy_assignment(self, resource_group): response = self.client.policy_events.list_query_results_for_subscription_level_policy_assignment( policy_events_resource="str", - subscription_id="str", policy_assignment_name="str", authorization_namespace="Microsoft.Authorization", api_version="2024-10-01", @@ -114,9 +109,8 @@ def test_policy_events_list_query_results_for_subscription_level_policy_assignme @recorded_by_proxy def test_policy_events_list_query_results_for_resource_group_level_policy_assignment(self, resource_group): response = self.client.policy_events.list_query_results_for_resource_group_level_policy_assignment( - policy_events_resource="str", - subscription_id="str", resource_group_name=resource_group.name, + policy_events_resource="str", policy_assignment_name="str", authorization_namespace="Microsoft.Authorization", api_version="2024-10-01", diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_policy_events_operations_async.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_policy_events_operations_async.py index 488f0d149769..18dfd305c78d 100644 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_policy_events_operations_async.py +++ b/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_policy_events_operations_async.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -37,7 +37,6 @@ async def test_policy_events_list_query_results_for_management_group(self, resou async def test_policy_events_list_query_results_for_subscription(self, resource_group): response = self.client.policy_events.list_query_results_for_subscription( policy_events_resource="str", - subscription_id="str", api_version="2024-10-01", ) result = [r async for r in response] @@ -48,9 +47,8 @@ async def test_policy_events_list_query_results_for_subscription(self, resource_ @recorded_by_proxy_async async def test_policy_events_list_query_results_for_resource_group(self, resource_group): response = self.client.policy_events.list_query_results_for_resource_group( - policy_events_resource="str", - subscription_id="str", resource_group_name=resource_group.name, + policy_events_resource="str", api_version="2024-10-01", ) result = [r async for r in response] @@ -74,7 +72,6 @@ async def test_policy_events_list_query_results_for_resource(self, resource_grou async def test_policy_events_list_query_results_for_policy_set_definition(self, resource_group): response = self.client.policy_events.list_query_results_for_policy_set_definition( policy_events_resource="str", - subscription_id="str", policy_set_definition_name="str", authorization_namespace="Microsoft.Authorization", api_version="2024-10-01", @@ -88,7 +85,6 @@ async def test_policy_events_list_query_results_for_policy_set_definition(self, async def test_policy_events_list_query_results_for_policy_definition(self, resource_group): response = self.client.policy_events.list_query_results_for_policy_definition( policy_events_resource="str", - subscription_id="str", policy_definition_name="str", authorization_namespace="Microsoft.Authorization", api_version="2024-10-01", @@ -102,7 +98,6 @@ async def test_policy_events_list_query_results_for_policy_definition(self, reso async def test_policy_events_list_query_results_for_subscription_level_policy_assignment(self, resource_group): response = self.client.policy_events.list_query_results_for_subscription_level_policy_assignment( policy_events_resource="str", - subscription_id="str", policy_assignment_name="str", authorization_namespace="Microsoft.Authorization", api_version="2024-10-01", @@ -115,9 +110,8 @@ async def test_policy_events_list_query_results_for_subscription_level_policy_as @recorded_by_proxy_async async def test_policy_events_list_query_results_for_resource_group_level_policy_assignment(self, resource_group): response = self.client.policy_events.list_query_results_for_resource_group_level_policy_assignment( - policy_events_resource="str", - subscription_id="str", resource_group_name=resource_group.name, + policy_events_resource="str", policy_assignment_name="str", authorization_namespace="Microsoft.Authorization", api_version="2024-10-01", diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_policy_metadata_operations.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_policy_metadata_operations.py index 22bae92cfd15..ca301a182338 100644 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_policy_metadata_operations.py +++ b/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_policy_metadata_operations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_policy_metadata_operations_async.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_policy_metadata_operations_async.py index c65064b22e10..35a56d5e8112 100644 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_policy_metadata_operations_async.py +++ b/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_policy_metadata_operations_async.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_policy_restrictions_operations.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_policy_restrictions_operations.py index 95f27b69c8dc..4356bde06225 100644 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_policy_restrictions_operations.py +++ b/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_policy_restrictions_operations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -24,7 +24,7 @@ def test_policy_restrictions_check_at_subscription_scope(self, resource_group): response = self.client.policy_restrictions.check_at_subscription_scope( parameters={ "resourceDetails": {"resourceContent": {}, "apiVersion": "str", "scope": "str"}, - "includeAuditEffect": False, + "includeAuditEffect": bool, "pendingFields": [{"field": "str", "values": ["str"]}], }, api_version="2024-10-01", @@ -40,7 +40,7 @@ def test_policy_restrictions_check_at_resource_group_scope(self, resource_group) resource_group_name=resource_group.name, parameters={ "resourceDetails": {"resourceContent": {}, "apiVersion": "str", "scope": "str"}, - "includeAuditEffect": False, + "includeAuditEffect": bool, "pendingFields": [{"field": "str", "values": ["str"]}], }, api_version="2024-10-01", diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_policy_restrictions_operations_async.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_policy_restrictions_operations_async.py index f0c09a9a6bd1..c0aa30b0bb7f 100644 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_policy_restrictions_operations_async.py +++ b/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_policy_restrictions_operations_async.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -25,7 +25,7 @@ async def test_policy_restrictions_check_at_subscription_scope(self, resource_gr response = await self.client.policy_restrictions.check_at_subscription_scope( parameters={ "resourceDetails": {"resourceContent": {}, "apiVersion": "str", "scope": "str"}, - "includeAuditEffect": False, + "includeAuditEffect": bool, "pendingFields": [{"field": "str", "values": ["str"]}], }, api_version="2024-10-01", @@ -41,7 +41,7 @@ async def test_policy_restrictions_check_at_resource_group_scope(self, resource_ resource_group_name=resource_group.name, parameters={ "resourceDetails": {"resourceContent": {}, "apiVersion": "str", "scope": "str"}, - "includeAuditEffect": False, + "includeAuditEffect": bool, "pendingFields": [{"field": "str", "values": ["str"]}], }, api_version="2024-10-01", diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_policy_states_operations.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_policy_states_operations.py index 326cf9fd65ff..45c5e575d706 100644 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_policy_states_operations.py +++ b/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_policy_states_operations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -49,7 +49,6 @@ def test_policy_states_summarize_for_management_group(self, resource_group): def test_policy_states_list_query_results_for_subscription(self, resource_group): response = self.client.policy_states.list_query_results_for_subscription( policy_states_resource="str", - subscription_id="str", api_version="2024-10-01", ) result = [r for r in response] @@ -61,7 +60,6 @@ def test_policy_states_list_query_results_for_subscription(self, resource_group) def test_policy_states_summarize_for_subscription(self, resource_group): response = self.client.policy_states.summarize_for_subscription( policy_states_summary_resource="str", - subscription_id="str", api_version="2024-10-01", ) @@ -72,9 +70,8 @@ def test_policy_states_summarize_for_subscription(self, resource_group): @recorded_by_proxy def test_policy_states_list_query_results_for_resource_group(self, resource_group): response = self.client.policy_states.list_query_results_for_resource_group( - policy_states_resource="str", - subscription_id="str", resource_group_name=resource_group.name, + policy_states_resource="str", api_version="2024-10-01", ) result = [r for r in response] @@ -85,9 +82,8 @@ def test_policy_states_list_query_results_for_resource_group(self, resource_grou @recorded_by_proxy def test_policy_states_summarize_for_resource_group(self, resource_group): response = self.client.policy_states.summarize_for_resource_group( - policy_states_summary_resource="str", - subscription_id="str", resource_group_name=resource_group.name, + policy_states_summary_resource="str", api_version="2024-10-01", ) @@ -122,7 +118,6 @@ def test_policy_states_summarize_for_resource(self, resource_group): @recorded_by_proxy def test_policy_states_begin_trigger_subscription_evaluation(self, resource_group): response = self.client.policy_states.begin_trigger_subscription_evaluation( - subscription_id="str", api_version="2024-10-01", ).result() # call '.result()' to poll until service return final result @@ -133,7 +128,6 @@ def test_policy_states_begin_trigger_subscription_evaluation(self, resource_grou @recorded_by_proxy def test_policy_states_begin_trigger_resource_group_evaluation(self, resource_group): response = self.client.policy_states.begin_trigger_resource_group_evaluation( - subscription_id="str", resource_group_name=resource_group.name, api_version="2024-10-01", ).result() # call '.result()' to poll until service return final result @@ -146,7 +140,6 @@ def test_policy_states_begin_trigger_resource_group_evaluation(self, resource_gr def test_policy_states_list_query_results_for_policy_set_definition(self, resource_group): response = self.client.policy_states.list_query_results_for_policy_set_definition( policy_states_resource="str", - subscription_id="str", policy_set_definition_name="str", authorization_namespace="Microsoft.Authorization", api_version="2024-10-01", @@ -160,7 +153,6 @@ def test_policy_states_list_query_results_for_policy_set_definition(self, resour def test_policy_states_summarize_for_policy_set_definition(self, resource_group): response = self.client.policy_states.summarize_for_policy_set_definition( policy_states_summary_resource="str", - subscription_id="str", policy_set_definition_name="str", authorization_namespace="Microsoft.Authorization", api_version="2024-10-01", @@ -174,7 +166,6 @@ def test_policy_states_summarize_for_policy_set_definition(self, resource_group) def test_policy_states_list_query_results_for_policy_definition(self, resource_group): response = self.client.policy_states.list_query_results_for_policy_definition( policy_states_resource="str", - subscription_id="str", policy_definition_name="str", authorization_namespace="Microsoft.Authorization", api_version="2024-10-01", @@ -188,7 +179,6 @@ def test_policy_states_list_query_results_for_policy_definition(self, resource_g def test_policy_states_summarize_for_policy_definition(self, resource_group): response = self.client.policy_states.summarize_for_policy_definition( policy_states_summary_resource="str", - subscription_id="str", policy_definition_name="str", authorization_namespace="Microsoft.Authorization", api_version="2024-10-01", @@ -202,7 +192,6 @@ def test_policy_states_summarize_for_policy_definition(self, resource_group): def test_policy_states_list_query_results_for_subscription_level_policy_assignment(self, resource_group): response = self.client.policy_states.list_query_results_for_subscription_level_policy_assignment( policy_states_resource="str", - subscription_id="str", policy_assignment_name="str", authorization_namespace="Microsoft.Authorization", api_version="2024-10-01", @@ -216,7 +205,6 @@ def test_policy_states_list_query_results_for_subscription_level_policy_assignme def test_policy_states_summarize_for_subscription_level_policy_assignment(self, resource_group): response = self.client.policy_states.summarize_for_subscription_level_policy_assignment( policy_states_summary_resource="str", - subscription_id="str", policy_assignment_name="str", authorization_namespace="Microsoft.Authorization", api_version="2024-10-01", @@ -229,9 +217,8 @@ def test_policy_states_summarize_for_subscription_level_policy_assignment(self, @recorded_by_proxy def test_policy_states_list_query_results_for_resource_group_level_policy_assignment(self, resource_group): response = self.client.policy_states.list_query_results_for_resource_group_level_policy_assignment( - policy_states_resource="str", - subscription_id="str", resource_group_name=resource_group.name, + policy_states_resource="str", policy_assignment_name="str", authorization_namespace="Microsoft.Authorization", api_version="2024-10-01", @@ -244,9 +231,8 @@ def test_policy_states_list_query_results_for_resource_group_level_policy_assign @recorded_by_proxy def test_policy_states_summarize_for_resource_group_level_policy_assignment(self, resource_group): response = self.client.policy_states.summarize_for_resource_group_level_policy_assignment( - policy_states_summary_resource="str", - subscription_id="str", resource_group_name=resource_group.name, + policy_states_summary_resource="str", policy_assignment_name="str", authorization_namespace="Microsoft.Authorization", api_version="2024-10-01", diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_policy_states_operations_async.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_policy_states_operations_async.py index 68b3dceadbc6..967ab2307cda 100644 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_policy_states_operations_async.py +++ b/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_policy_states_operations_async.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -50,7 +50,6 @@ async def test_policy_states_summarize_for_management_group(self, resource_group async def test_policy_states_list_query_results_for_subscription(self, resource_group): response = self.client.policy_states.list_query_results_for_subscription( policy_states_resource="str", - subscription_id="str", api_version="2024-10-01", ) result = [r async for r in response] @@ -62,7 +61,6 @@ async def test_policy_states_list_query_results_for_subscription(self, resource_ async def test_policy_states_summarize_for_subscription(self, resource_group): response = await self.client.policy_states.summarize_for_subscription( policy_states_summary_resource="str", - subscription_id="str", api_version="2024-10-01", ) @@ -73,9 +71,8 @@ async def test_policy_states_summarize_for_subscription(self, resource_group): @recorded_by_proxy_async async def test_policy_states_list_query_results_for_resource_group(self, resource_group): response = self.client.policy_states.list_query_results_for_resource_group( - policy_states_resource="str", - subscription_id="str", resource_group_name=resource_group.name, + policy_states_resource="str", api_version="2024-10-01", ) result = [r async for r in response] @@ -86,9 +83,8 @@ async def test_policy_states_list_query_results_for_resource_group(self, resourc @recorded_by_proxy_async async def test_policy_states_summarize_for_resource_group(self, resource_group): response = await self.client.policy_states.summarize_for_resource_group( - policy_states_summary_resource="str", - subscription_id="str", resource_group_name=resource_group.name, + policy_states_summary_resource="str", api_version="2024-10-01", ) @@ -124,7 +120,6 @@ async def test_policy_states_summarize_for_resource(self, resource_group): async def test_policy_states_begin_trigger_subscription_evaluation(self, resource_group): response = await ( await self.client.policy_states.begin_trigger_subscription_evaluation( - subscription_id="str", api_version="2024-10-01", ) ).result() # call '.result()' to poll until service return final result @@ -137,7 +132,6 @@ async def test_policy_states_begin_trigger_subscription_evaluation(self, resourc async def test_policy_states_begin_trigger_resource_group_evaluation(self, resource_group): response = await ( await self.client.policy_states.begin_trigger_resource_group_evaluation( - subscription_id="str", resource_group_name=resource_group.name, api_version="2024-10-01", ) @@ -151,7 +145,6 @@ async def test_policy_states_begin_trigger_resource_group_evaluation(self, resou async def test_policy_states_list_query_results_for_policy_set_definition(self, resource_group): response = self.client.policy_states.list_query_results_for_policy_set_definition( policy_states_resource="str", - subscription_id="str", policy_set_definition_name="str", authorization_namespace="Microsoft.Authorization", api_version="2024-10-01", @@ -165,7 +158,6 @@ async def test_policy_states_list_query_results_for_policy_set_definition(self, async def test_policy_states_summarize_for_policy_set_definition(self, resource_group): response = await self.client.policy_states.summarize_for_policy_set_definition( policy_states_summary_resource="str", - subscription_id="str", policy_set_definition_name="str", authorization_namespace="Microsoft.Authorization", api_version="2024-10-01", @@ -179,7 +171,6 @@ async def test_policy_states_summarize_for_policy_set_definition(self, resource_ async def test_policy_states_list_query_results_for_policy_definition(self, resource_group): response = self.client.policy_states.list_query_results_for_policy_definition( policy_states_resource="str", - subscription_id="str", policy_definition_name="str", authorization_namespace="Microsoft.Authorization", api_version="2024-10-01", @@ -193,7 +184,6 @@ async def test_policy_states_list_query_results_for_policy_definition(self, reso async def test_policy_states_summarize_for_policy_definition(self, resource_group): response = await self.client.policy_states.summarize_for_policy_definition( policy_states_summary_resource="str", - subscription_id="str", policy_definition_name="str", authorization_namespace="Microsoft.Authorization", api_version="2024-10-01", @@ -207,7 +197,6 @@ async def test_policy_states_summarize_for_policy_definition(self, resource_grou async def test_policy_states_list_query_results_for_subscription_level_policy_assignment(self, resource_group): response = self.client.policy_states.list_query_results_for_subscription_level_policy_assignment( policy_states_resource="str", - subscription_id="str", policy_assignment_name="str", authorization_namespace="Microsoft.Authorization", api_version="2024-10-01", @@ -221,7 +210,6 @@ async def test_policy_states_list_query_results_for_subscription_level_policy_as async def test_policy_states_summarize_for_subscription_level_policy_assignment(self, resource_group): response = await self.client.policy_states.summarize_for_subscription_level_policy_assignment( policy_states_summary_resource="str", - subscription_id="str", policy_assignment_name="str", authorization_namespace="Microsoft.Authorization", api_version="2024-10-01", @@ -234,9 +222,8 @@ async def test_policy_states_summarize_for_subscription_level_policy_assignment( @recorded_by_proxy_async async def test_policy_states_list_query_results_for_resource_group_level_policy_assignment(self, resource_group): response = self.client.policy_states.list_query_results_for_resource_group_level_policy_assignment( - policy_states_resource="str", - subscription_id="str", resource_group_name=resource_group.name, + policy_states_resource="str", policy_assignment_name="str", authorization_namespace="Microsoft.Authorization", api_version="2024-10-01", @@ -249,9 +236,8 @@ async def test_policy_states_list_query_results_for_resource_group_level_policy_ @recorded_by_proxy_async async def test_policy_states_summarize_for_resource_group_level_policy_assignment(self, resource_group): response = await self.client.policy_states.summarize_for_resource_group_level_policy_assignment( - policy_states_summary_resource="str", - subscription_id="str", resource_group_name=resource_group.name, + policy_states_summary_resource="str", policy_assignment_name="str", authorization_namespace="Microsoft.Authorization", api_version="2024-10-01", diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_policy_tracked_resources_operations.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_policy_tracked_resources_operations.py index 28323a580dea..53d71a375b5f 100644 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_policy_tracked_resources_operations.py +++ b/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_policy_tracked_resources_operations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_policy_tracked_resources_operations_async.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_policy_tracked_resources_operations_async.py index 4a1da9718fb4..742fd3fba115 100644 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_policy_tracked_resources_operations_async.py +++ b/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_policy_tracked_resources_operations_async.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_remediations_operations.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_remediations_operations.py index 8e44e6340978..04b637a6fbea 100644 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_remediations_operations.py +++ b/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_remediations_operations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -20,21 +20,62 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_remediations_list_deployments_at_management_group(self, resource_group): - response = self.client.remediations.list_deployments_at_management_group( + def test_remediations_get_at_management_group(self, resource_group): + response = self.client.remediations.get_at_management_group( management_group_id="str", remediation_name="str", management_groups_namespace="Microsoft.Management", api_version="2024-10-01", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_remediations_cancel_at_management_group(self, resource_group): - response = self.client.remediations.cancel_at_management_group( + def test_remediations_create_or_update_at_management_group(self, resource_group): + response = self.client.remediations.create_or_update_at_management_group( + management_group_id="str", + remediation_name="str", + parameters={ + "id": "str", + "name": "str", + "properties": { + "correlationId": "str", + "createdOn": "2020-02-20 00:00:00", + "deploymentStatus": {"failedDeployments": 0, "successfulDeployments": 0, "totalDeployments": 0}, + "failureThreshold": {"percentage": 0.0}, + "filters": {"locations": ["str"], "resourceIds": ["str"]}, + "lastUpdatedOn": "2020-02-20 00:00:00", + "parallelDeployments": 0, + "policyAssignmentId": "str", + "policyDefinitionReferenceId": "str", + "provisioningState": "str", + "resourceCount": 0, + "resourceDiscoveryMode": "str", + "statusMessage": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + management_groups_namespace="Microsoft.Management", + api_version="2024-10-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_remediations_delete_at_management_group(self, resource_group): + response = self.client.remediations.delete_at_management_group( management_group_id="str", remediation_name="str", management_groups_namespace="Microsoft.Management", @@ -58,26 +99,38 @@ def test_remediations_list_for_management_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_remediations_create_or_update_at_management_group(self, resource_group): - response = self.client.remediations.create_or_update_at_management_group( - management_group_id="str", + def test_remediations_get_at_subscription(self, resource_group): + response = self.client.remediations.get_at_subscription( + remediation_name="str", + api_version="2024-10-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_remediations_create_or_update_at_subscription(self, resource_group): + response = self.client.remediations.create_or_update_at_subscription( remediation_name="str", parameters={ - "correlationId": "str", - "createdOn": "2020-02-20 00:00:00", - "deploymentStatus": {"failedDeployments": 0, "successfulDeployments": 0, "totalDeployments": 0}, - "failureThreshold": {"percentage": 0.0}, - "filters": {"locations": ["str"], "resourceIds": ["str"]}, "id": "str", - "lastUpdatedOn": "2020-02-20 00:00:00", "name": "str", - "parallelDeployments": 0, - "policyAssignmentId": "str", - "policyDefinitionReferenceId": "str", - "provisioningState": "str", - "resourceCount": 0, - "resourceDiscoveryMode": "str", - "statusMessage": "str", + "properties": { + "correlationId": "str", + "createdOn": "2020-02-20 00:00:00", + "deploymentStatus": {"failedDeployments": 0, "successfulDeployments": 0, "totalDeployments": 0}, + "failureThreshold": {"percentage": 0.0}, + "filters": {"locations": ["str"], "resourceIds": ["str"]}, + "lastUpdatedOn": "2020-02-20 00:00:00", + "parallelDeployments": 0, + "policyAssignmentId": "str", + "policyDefinitionReferenceId": "str", + "provisioningState": "str", + "resourceCount": 0, + "resourceDiscoveryMode": "str", + "statusMessage": "str", + }, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -88,7 +141,6 @@ def test_remediations_create_or_update_at_management_group(self, resource_group) }, "type": "str", }, - management_groups_namespace="Microsoft.Management", api_version="2024-10-01", ) @@ -97,11 +149,9 @@ def test_remediations_create_or_update_at_management_group(self, resource_group) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_remediations_get_at_management_group(self, resource_group): - response = self.client.remediations.get_at_management_group( - management_group_id="str", + def test_remediations_delete_at_subscription(self, resource_group): + response = self.client.remediations.delete_at_subscription( remediation_name="str", - management_groups_namespace="Microsoft.Management", api_version="2024-10-01", ) @@ -110,14 +160,11 @@ def test_remediations_get_at_management_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_remediations_delete_at_management_group(self, resource_group): - response = self.client.remediations.delete_at_management_group( - management_group_id="str", - remediation_name="str", - management_groups_namespace="Microsoft.Management", + def test_remediations_list_for_subscription(self, resource_group): + response = self.client.remediations.list_for_subscription( api_version="2024-10-01", ) - + result = [r for r in response] # please add some check logic here by yourself # ... @@ -145,35 +192,40 @@ def test_remediations_cancel_at_subscription(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_remediations_list_for_subscription(self, resource_group): - response = self.client.remediations.list_for_subscription( + def test_remediations_get_at_resource_group(self, resource_group): + response = self.client.remediations.get_at_resource_group( + resource_group_name=resource_group.name, + remediation_name="str", api_version="2024-10-01", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_remediations_create_or_update_at_subscription(self, resource_group): - response = self.client.remediations.create_or_update_at_subscription( + def test_remediations_create_or_update_at_resource_group(self, resource_group): + response = self.client.remediations.create_or_update_at_resource_group( + resource_group_name=resource_group.name, remediation_name="str", parameters={ - "correlationId": "str", - "createdOn": "2020-02-20 00:00:00", - "deploymentStatus": {"failedDeployments": 0, "successfulDeployments": 0, "totalDeployments": 0}, - "failureThreshold": {"percentage": 0.0}, - "filters": {"locations": ["str"], "resourceIds": ["str"]}, "id": "str", - "lastUpdatedOn": "2020-02-20 00:00:00", "name": "str", - "parallelDeployments": 0, - "policyAssignmentId": "str", - "policyDefinitionReferenceId": "str", - "provisioningState": "str", - "resourceCount": 0, - "resourceDiscoveryMode": "str", - "statusMessage": "str", + "properties": { + "correlationId": "str", + "createdOn": "2020-02-20 00:00:00", + "deploymentStatus": {"failedDeployments": 0, "successfulDeployments": 0, "totalDeployments": 0}, + "failureThreshold": {"percentage": 0.0}, + "filters": {"locations": ["str"], "resourceIds": ["str"]}, + "lastUpdatedOn": "2020-02-20 00:00:00", + "parallelDeployments": 0, + "policyAssignmentId": "str", + "policyDefinitionReferenceId": "str", + "provisioningState": "str", + "resourceCount": 0, + "resourceDiscoveryMode": "str", + "statusMessage": "str", + }, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -192,8 +244,9 @@ def test_remediations_create_or_update_at_subscription(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_remediations_get_at_subscription(self, resource_group): - response = self.client.remediations.get_at_subscription( + def test_remediations_delete_at_resource_group(self, resource_group): + response = self.client.remediations.delete_at_resource_group( + resource_group_name=resource_group.name, remediation_name="str", api_version="2024-10-01", ) @@ -203,12 +256,12 @@ def test_remediations_get_at_subscription(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_remediations_delete_at_subscription(self, resource_group): - response = self.client.remediations.delete_at_subscription( - remediation_name="str", + def test_remediations_list_for_resource_group(self, resource_group): + response = self.client.remediations.list_for_resource_group( + resource_group_name=resource_group.name, api_version="2024-10-01", ) - + result = [r for r in response] # please add some check logic here by yourself # ... @@ -238,37 +291,40 @@ def test_remediations_cancel_at_resource_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_remediations_list_for_resource_group(self, resource_group): - response = self.client.remediations.list_for_resource_group( - resource_group_name=resource_group.name, + def test_remediations_get_at_resource(self, resource_group): + response = self.client.remediations.get_at_resource( + resource_id="str", + remediation_name="str", api_version="2024-10-01", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_remediations_create_or_update_at_resource_group(self, resource_group): - response = self.client.remediations.create_or_update_at_resource_group( - resource_group_name=resource_group.name, + def test_remediations_create_or_update_at_resource(self, resource_group): + response = self.client.remediations.create_or_update_at_resource( + resource_id="str", remediation_name="str", parameters={ - "correlationId": "str", - "createdOn": "2020-02-20 00:00:00", - "deploymentStatus": {"failedDeployments": 0, "successfulDeployments": 0, "totalDeployments": 0}, - "failureThreshold": {"percentage": 0.0}, - "filters": {"locations": ["str"], "resourceIds": ["str"]}, "id": "str", - "lastUpdatedOn": "2020-02-20 00:00:00", "name": "str", - "parallelDeployments": 0, - "policyAssignmentId": "str", - "policyDefinitionReferenceId": "str", - "provisioningState": "str", - "resourceCount": 0, - "resourceDiscoveryMode": "str", - "statusMessage": "str", + "properties": { + "correlationId": "str", + "createdOn": "2020-02-20 00:00:00", + "deploymentStatus": {"failedDeployments": 0, "successfulDeployments": 0, "totalDeployments": 0}, + "failureThreshold": {"percentage": 0.0}, + "filters": {"locations": ["str"], "resourceIds": ["str"]}, + "lastUpdatedOn": "2020-02-20 00:00:00", + "parallelDeployments": 0, + "policyAssignmentId": "str", + "policyDefinitionReferenceId": "str", + "provisioningState": "str", + "resourceCount": 0, + "resourceDiscoveryMode": "str", + "statusMessage": "str", + }, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -287,9 +343,9 @@ def test_remediations_create_or_update_at_resource_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_remediations_get_at_resource_group(self, resource_group): - response = self.client.remediations.get_at_resource_group( - resource_group_name=resource_group.name, + def test_remediations_delete_at_resource(self, resource_group): + response = self.client.remediations.delete_at_resource( + resource_id="str", remediation_name="str", api_version="2024-10-01", ) @@ -299,13 +355,12 @@ def test_remediations_get_at_resource_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_remediations_delete_at_resource_group(self, resource_group): - response = self.client.remediations.delete_at_resource_group( - resource_group_name=resource_group.name, - remediation_name="str", + def test_remediations_list_for_resource(self, resource_group): + response = self.client.remediations.list_for_resource( + resource_id="str", api_version="2024-10-01", ) - + result = [r for r in response] # please add some check logic here by yourself # ... @@ -335,71 +390,24 @@ def test_remediations_cancel_at_resource(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_remediations_list_for_resource(self, resource_group): - response = self.client.remediations.list_for_resource( - resource_id="str", - api_version="2024-10-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_remediations_create_or_update_at_resource(self, resource_group): - response = self.client.remediations.create_or_update_at_resource( - resource_id="str", - remediation_name="str", - parameters={ - "correlationId": "str", - "createdOn": "2020-02-20 00:00:00", - "deploymentStatus": {"failedDeployments": 0, "successfulDeployments": 0, "totalDeployments": 0}, - "failureThreshold": {"percentage": 0.0}, - "filters": {"locations": ["str"], "resourceIds": ["str"]}, - "id": "str", - "lastUpdatedOn": "2020-02-20 00:00:00", - "name": "str", - "parallelDeployments": 0, - "policyAssignmentId": "str", - "policyDefinitionReferenceId": "str", - "provisioningState": "str", - "resourceCount": 0, - "resourceDiscoveryMode": "str", - "statusMessage": "str", - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "type": "str", - }, - api_version="2024-10-01", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_remediations_get_at_resource(self, resource_group): - response = self.client.remediations.get_at_resource( - resource_id="str", + def test_remediations_list_deployments_at_management_group(self, resource_group): + response = self.client.remediations.list_deployments_at_management_group( + management_group_id="str", remediation_name="str", + management_groups_namespace="Microsoft.Management", api_version="2024-10-01", ) - + result = [r for r in response] # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_remediations_delete_at_resource(self, resource_group): - response = self.client.remediations.delete_at_resource( - resource_id="str", + def test_remediations_cancel_at_management_group(self, resource_group): + response = self.client.remediations.cancel_at_management_group( + management_group_id="str", remediation_name="str", + management_groups_namespace="Microsoft.Management", api_version="2024-10-01", ) diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_remediations_operations_async.py b/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_remediations_operations_async.py index 437e14590c53..b675584841d7 100644 --- a/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_remediations_operations_async.py +++ b/sdk/policyinsights/azure-mgmt-policyinsights/generated_tests/test_policy_insights_remediations_operations_async.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -21,21 +21,62 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_remediations_list_deployments_at_management_group(self, resource_group): - response = self.client.remediations.list_deployments_at_management_group( + async def test_remediations_get_at_management_group(self, resource_group): + response = await self.client.remediations.get_at_management_group( management_group_id="str", remediation_name="str", management_groups_namespace="Microsoft.Management", api_version="2024-10-01", ) - result = [r async for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_remediations_cancel_at_management_group(self, resource_group): - response = await self.client.remediations.cancel_at_management_group( + async def test_remediations_create_or_update_at_management_group(self, resource_group): + response = await self.client.remediations.create_or_update_at_management_group( + management_group_id="str", + remediation_name="str", + parameters={ + "id": "str", + "name": "str", + "properties": { + "correlationId": "str", + "createdOn": "2020-02-20 00:00:00", + "deploymentStatus": {"failedDeployments": 0, "successfulDeployments": 0, "totalDeployments": 0}, + "failureThreshold": {"percentage": 0.0}, + "filters": {"locations": ["str"], "resourceIds": ["str"]}, + "lastUpdatedOn": "2020-02-20 00:00:00", + "parallelDeployments": 0, + "policyAssignmentId": "str", + "policyDefinitionReferenceId": "str", + "provisioningState": "str", + "resourceCount": 0, + "resourceDiscoveryMode": "str", + "statusMessage": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + management_groups_namespace="Microsoft.Management", + api_version="2024-10-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_remediations_delete_at_management_group(self, resource_group): + response = await self.client.remediations.delete_at_management_group( management_group_id="str", remediation_name="str", management_groups_namespace="Microsoft.Management", @@ -59,26 +100,38 @@ async def test_remediations_list_for_management_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_remediations_create_or_update_at_management_group(self, resource_group): - response = await self.client.remediations.create_or_update_at_management_group( - management_group_id="str", + async def test_remediations_get_at_subscription(self, resource_group): + response = await self.client.remediations.get_at_subscription( + remediation_name="str", + api_version="2024-10-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_remediations_create_or_update_at_subscription(self, resource_group): + response = await self.client.remediations.create_or_update_at_subscription( remediation_name="str", parameters={ - "correlationId": "str", - "createdOn": "2020-02-20 00:00:00", - "deploymentStatus": {"failedDeployments": 0, "successfulDeployments": 0, "totalDeployments": 0}, - "failureThreshold": {"percentage": 0.0}, - "filters": {"locations": ["str"], "resourceIds": ["str"]}, "id": "str", - "lastUpdatedOn": "2020-02-20 00:00:00", "name": "str", - "parallelDeployments": 0, - "policyAssignmentId": "str", - "policyDefinitionReferenceId": "str", - "provisioningState": "str", - "resourceCount": 0, - "resourceDiscoveryMode": "str", - "statusMessage": "str", + "properties": { + "correlationId": "str", + "createdOn": "2020-02-20 00:00:00", + "deploymentStatus": {"failedDeployments": 0, "successfulDeployments": 0, "totalDeployments": 0}, + "failureThreshold": {"percentage": 0.0}, + "filters": {"locations": ["str"], "resourceIds": ["str"]}, + "lastUpdatedOn": "2020-02-20 00:00:00", + "parallelDeployments": 0, + "policyAssignmentId": "str", + "policyDefinitionReferenceId": "str", + "provisioningState": "str", + "resourceCount": 0, + "resourceDiscoveryMode": "str", + "statusMessage": "str", + }, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -89,7 +142,6 @@ async def test_remediations_create_or_update_at_management_group(self, resource_ }, "type": "str", }, - management_groups_namespace="Microsoft.Management", api_version="2024-10-01", ) @@ -98,11 +150,9 @@ async def test_remediations_create_or_update_at_management_group(self, resource_ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_remediations_get_at_management_group(self, resource_group): - response = await self.client.remediations.get_at_management_group( - management_group_id="str", + async def test_remediations_delete_at_subscription(self, resource_group): + response = await self.client.remediations.delete_at_subscription( remediation_name="str", - management_groups_namespace="Microsoft.Management", api_version="2024-10-01", ) @@ -111,14 +161,11 @@ async def test_remediations_get_at_management_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_remediations_delete_at_management_group(self, resource_group): - response = await self.client.remediations.delete_at_management_group( - management_group_id="str", - remediation_name="str", - management_groups_namespace="Microsoft.Management", + async def test_remediations_list_for_subscription(self, resource_group): + response = self.client.remediations.list_for_subscription( api_version="2024-10-01", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... @@ -146,35 +193,40 @@ async def test_remediations_cancel_at_subscription(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_remediations_list_for_subscription(self, resource_group): - response = self.client.remediations.list_for_subscription( + async def test_remediations_get_at_resource_group(self, resource_group): + response = await self.client.remediations.get_at_resource_group( + resource_group_name=resource_group.name, + remediation_name="str", api_version="2024-10-01", ) - result = [r async for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_remediations_create_or_update_at_subscription(self, resource_group): - response = await self.client.remediations.create_or_update_at_subscription( + async def test_remediations_create_or_update_at_resource_group(self, resource_group): + response = await self.client.remediations.create_or_update_at_resource_group( + resource_group_name=resource_group.name, remediation_name="str", parameters={ - "correlationId": "str", - "createdOn": "2020-02-20 00:00:00", - "deploymentStatus": {"failedDeployments": 0, "successfulDeployments": 0, "totalDeployments": 0}, - "failureThreshold": {"percentage": 0.0}, - "filters": {"locations": ["str"], "resourceIds": ["str"]}, "id": "str", - "lastUpdatedOn": "2020-02-20 00:00:00", "name": "str", - "parallelDeployments": 0, - "policyAssignmentId": "str", - "policyDefinitionReferenceId": "str", - "provisioningState": "str", - "resourceCount": 0, - "resourceDiscoveryMode": "str", - "statusMessage": "str", + "properties": { + "correlationId": "str", + "createdOn": "2020-02-20 00:00:00", + "deploymentStatus": {"failedDeployments": 0, "successfulDeployments": 0, "totalDeployments": 0}, + "failureThreshold": {"percentage": 0.0}, + "filters": {"locations": ["str"], "resourceIds": ["str"]}, + "lastUpdatedOn": "2020-02-20 00:00:00", + "parallelDeployments": 0, + "policyAssignmentId": "str", + "policyDefinitionReferenceId": "str", + "provisioningState": "str", + "resourceCount": 0, + "resourceDiscoveryMode": "str", + "statusMessage": "str", + }, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -193,8 +245,9 @@ async def test_remediations_create_or_update_at_subscription(self, resource_grou @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_remediations_get_at_subscription(self, resource_group): - response = await self.client.remediations.get_at_subscription( + async def test_remediations_delete_at_resource_group(self, resource_group): + response = await self.client.remediations.delete_at_resource_group( + resource_group_name=resource_group.name, remediation_name="str", api_version="2024-10-01", ) @@ -204,12 +257,12 @@ async def test_remediations_get_at_subscription(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_remediations_delete_at_subscription(self, resource_group): - response = await self.client.remediations.delete_at_subscription( - remediation_name="str", + async def test_remediations_list_for_resource_group(self, resource_group): + response = self.client.remediations.list_for_resource_group( + resource_group_name=resource_group.name, api_version="2024-10-01", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... @@ -239,37 +292,40 @@ async def test_remediations_cancel_at_resource_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_remediations_list_for_resource_group(self, resource_group): - response = self.client.remediations.list_for_resource_group( - resource_group_name=resource_group.name, + async def test_remediations_get_at_resource(self, resource_group): + response = await self.client.remediations.get_at_resource( + resource_id="str", + remediation_name="str", api_version="2024-10-01", ) - result = [r async for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_remediations_create_or_update_at_resource_group(self, resource_group): - response = await self.client.remediations.create_or_update_at_resource_group( - resource_group_name=resource_group.name, + async def test_remediations_create_or_update_at_resource(self, resource_group): + response = await self.client.remediations.create_or_update_at_resource( + resource_id="str", remediation_name="str", parameters={ - "correlationId": "str", - "createdOn": "2020-02-20 00:00:00", - "deploymentStatus": {"failedDeployments": 0, "successfulDeployments": 0, "totalDeployments": 0}, - "failureThreshold": {"percentage": 0.0}, - "filters": {"locations": ["str"], "resourceIds": ["str"]}, "id": "str", - "lastUpdatedOn": "2020-02-20 00:00:00", "name": "str", - "parallelDeployments": 0, - "policyAssignmentId": "str", - "policyDefinitionReferenceId": "str", - "provisioningState": "str", - "resourceCount": 0, - "resourceDiscoveryMode": "str", - "statusMessage": "str", + "properties": { + "correlationId": "str", + "createdOn": "2020-02-20 00:00:00", + "deploymentStatus": {"failedDeployments": 0, "successfulDeployments": 0, "totalDeployments": 0}, + "failureThreshold": {"percentage": 0.0}, + "filters": {"locations": ["str"], "resourceIds": ["str"]}, + "lastUpdatedOn": "2020-02-20 00:00:00", + "parallelDeployments": 0, + "policyAssignmentId": "str", + "policyDefinitionReferenceId": "str", + "provisioningState": "str", + "resourceCount": 0, + "resourceDiscoveryMode": "str", + "statusMessage": "str", + }, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -288,9 +344,9 @@ async def test_remediations_create_or_update_at_resource_group(self, resource_gr @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_remediations_get_at_resource_group(self, resource_group): - response = await self.client.remediations.get_at_resource_group( - resource_group_name=resource_group.name, + async def test_remediations_delete_at_resource(self, resource_group): + response = await self.client.remediations.delete_at_resource( + resource_id="str", remediation_name="str", api_version="2024-10-01", ) @@ -300,13 +356,12 @@ async def test_remediations_get_at_resource_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_remediations_delete_at_resource_group(self, resource_group): - response = await self.client.remediations.delete_at_resource_group( - resource_group_name=resource_group.name, - remediation_name="str", + async def test_remediations_list_for_resource(self, resource_group): + response = self.client.remediations.list_for_resource( + resource_id="str", api_version="2024-10-01", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... @@ -336,71 +391,24 @@ async def test_remediations_cancel_at_resource(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_remediations_list_for_resource(self, resource_group): - response = self.client.remediations.list_for_resource( - resource_id="str", - api_version="2024-10-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_remediations_create_or_update_at_resource(self, resource_group): - response = await self.client.remediations.create_or_update_at_resource( - resource_id="str", - remediation_name="str", - parameters={ - "correlationId": "str", - "createdOn": "2020-02-20 00:00:00", - "deploymentStatus": {"failedDeployments": 0, "successfulDeployments": 0, "totalDeployments": 0}, - "failureThreshold": {"percentage": 0.0}, - "filters": {"locations": ["str"], "resourceIds": ["str"]}, - "id": "str", - "lastUpdatedOn": "2020-02-20 00:00:00", - "name": "str", - "parallelDeployments": 0, - "policyAssignmentId": "str", - "policyDefinitionReferenceId": "str", - "provisioningState": "str", - "resourceCount": 0, - "resourceDiscoveryMode": "str", - "statusMessage": "str", - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "type": "str", - }, - api_version="2024-10-01", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_remediations_get_at_resource(self, resource_group): - response = await self.client.remediations.get_at_resource( - resource_id="str", + async def test_remediations_list_deployments_at_management_group(self, resource_group): + response = self.client.remediations.list_deployments_at_management_group( + management_group_id="str", remediation_name="str", + management_groups_namespace="Microsoft.Management", api_version="2024-10-01", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_remediations_delete_at_resource(self, resource_group): - response = await self.client.remediations.delete_at_resource( - resource_id="str", + async def test_remediations_cancel_at_management_group(self, resource_group): + response = await self.client.remediations.cancel_at_management_group( + management_group_id="str", remediation_name="str", + management_groups_namespace="Microsoft.Management", api_version="2024-10-01", ) diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/pyproject.toml b/sdk/policyinsights/azure-mgmt-policyinsights/pyproject.toml index 540da07d41af..09c41c8d68ae 100644 --- a/sdk/policyinsights/azure-mgmt-policyinsights/pyproject.toml +++ b/sdk/policyinsights/azure-mgmt-policyinsights/pyproject.toml @@ -1,6 +1,88 @@ +[build-system] +requires = [ + "setuptools>=77.0.3", + "wheel", +] +build-backend = "setuptools.build_meta" + +[project] +name = "azure-mgmt-policyinsights" +authors = [ + { name = "Microsoft Corporation", email = "azpysdkhelp@microsoft.com" }, +] +description = "Microsoft Azure Policyinsights Management Client Library for Python" +license = "MIT" +classifiers = [ + "Development Status :: 4 - Beta", + "Programming Language :: Python", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", +] +requires-python = ">=3.9" +keywords = [ + "azure", + "azure sdk", +] +dependencies = [ + "isodate>=0.6.1", + "azure-mgmt-core>=1.6.0", + "typing-extensions>=4.6.0", +] +dynamic = [ + "version", + "readme", +] + +[project.urls] +repository = "https://github.com/Azure/azure-sdk-for-python" + +[tool.setuptools.dynamic.version] +attr = "azure.mgmt.policyinsights._version.VERSION" + +[tool.setuptools.dynamic.readme] +file = [ + "README.md", + "CHANGELOG.md", +] +content-type = "text/markdown" + +[tool.setuptools.packages.find] +exclude = [ + "tests*", + "generated_tests*", + "samples*", + "generated_samples*", + "doc*", + "azure", + "azure.mgmt", +] + +[tool.setuptools.package-data] +pytyped = [ + "py.typed", +] + [tool.azure-sdk-build] breaking = false mypy = false pyright = false type_check_samples = false verifytypes = false + +[packaging] +package_name = "azure-mgmt-policyinsights" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "Policy Insights" +package_doc_id = "" +is_stable = false +is_arm = true +sample_link = "" +title = "PolicyInsightsClient" +need_msrestazure = false +need_azuremgmtcore = true +exclude_folders = "" diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/sdk_packaging.toml b/sdk/policyinsights/azure-mgmt-policyinsights/sdk_packaging.toml deleted file mode 100644 index 46609b5cbf39..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/sdk_packaging.toml +++ /dev/null @@ -1,9 +0,0 @@ -[packaging] -package_name = "azure-mgmt-policyinsights" -package_nspkg = "azure-mgmt-nspkg" -package_pprint_name = "Policy Insights" -package_doc_id = "" -is_stable = false -is_arm = true -sample_link = "" -title = "PolicyInsightsClient" diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/setup.py b/sdk/policyinsights/azure-mgmt-policyinsights/setup.py deleted file mode 100644 index dcf631fd3553..000000000000 --- a/sdk/policyinsights/azure-mgmt-policyinsights/setup.py +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/env python - -# ------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -------------------------------------------------------------------------- - -import re -import os.path -from io import open -from setuptools import find_packages, setup - -# Change the PACKAGE_NAME only to change folder and different name -PACKAGE_NAME = "azure-mgmt-policyinsights" -PACKAGE_PPRINT_NAME = "Policy Insights" - -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") -# a-b-c => a.b.c -namespace_name = PACKAGE_NAME.replace("-", ".") - -# Version extraction inspired from 'requests' -with open( - os.path.join(package_folder_path, "version.py") - if os.path.exists(os.path.join(package_folder_path, "version.py")) - else os.path.join(package_folder_path, "_version.py"), - "r", -) as fd: - version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) - -if not version: - raise RuntimeError("Cannot find version information") - -with open("README.md", encoding="utf-8") as f: - readme = f.read() -with open("CHANGELOG.md", encoding="utf-8") as f: - changelog = f.read() - -setup( - name=PACKAGE_NAME, - version=version, - description="Microsoft Azure {} Client Library for Python".format(PACKAGE_PPRINT_NAME), - long_description=readme + "\n\n" + changelog, - long_description_content_type="text/markdown", - license="MIT License", - author="Microsoft Corporation", - author_email="azpysdkhelp@microsoft.com", - url="https://github.com/Azure/azure-sdk-for-python", - keywords="azure, azure sdk", # update with search keywords relevant to the azure service / product - classifiers=[ - "Development Status :: 4 - Beta", - "Programming Language :: Python", - "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "License :: OSI Approved :: MIT License", - ], - zip_safe=False, - packages=find_packages( - exclude=[ - "tests", - # Exclude packages that will be covered by PEP420 or nspkg - "azure", - "azure.mgmt", - ] - ), - include_package_data=True, - package_data={ - "pytyped": ["py.typed"], - }, - install_requires=[ - "isodate>=0.6.1", - "typing-extensions>=4.6.0", - "azure-common>=1.1", - "azure-mgmt-core>=1.5.0", - ], - python_requires=">=3.9", -) diff --git a/sdk/policyinsights/azure-mgmt-policyinsights/tsp-location.yaml b/sdk/policyinsights/azure-mgmt-policyinsights/tsp-location.yaml new file mode 100644 index 000000000000..cc169a7118b4 --- /dev/null +++ b/sdk/policyinsights/azure-mgmt-policyinsights/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/PolicyInsights +commit: cf32d44a757a20b34b33f5e22f85bea90dd0e4d3 +repo: Azure/azure-rest-api-specs +additionalDirectories: