{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-cloudwatch/json-schema/amazon-cloudwatch-put-account-policy-response-schema.json",
  "title": "PutAccountPolicyResponse",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-cloudwatch-account-policy-api-openapi.yml#/components/schemas/PutAccountPolicyResponse",
  "type": "object",
  "properties": {
    "accountPolicy": {
      "$ref": "#/$defs/AccountPolicy"
    },
    "dryRunResult": {
      "$ref": "#/$defs/DryRunResult"
    }
  },
  "$defs": {
    "AccountPolicy": {
      "type": "object",
      "properties": {
        "policyName": {
          "type": "string",
          "description": "The name of the account policy."
        },
        "policyDocument": {
          "type": "string",
          "description": "The policy document for this account policy. The JSON specified in policyDocument can be up to 30,720 characters."
        },
        "lastUpdatedTime": {
          "type": "integer",
          "description": "The date and time that this policy was most recently updated."
        },
        "policyType": {
          "type": "string",
          "enum": [
            "DATA_PROTECTION_POLICY",
            "SUBSCRIPTION_FILTER_POLICY",
            "FIELD_INDEX_POLICY",
            "TRANSFORMER_POLICY",
            "METRIC_EXTRACTION_POLICY",
            "RETENTION_POLICY"
          ],
          "description": "The type of policy for this account policy."
        },
        "scope": {
          "type": "string",
          "enum": [
            "ALL"
          ],
          "description": "The scope of the account policy."
        },
        "selectionCriteria": {
          "type": "string",
          "description": "The log group selection criteria that is used for this policy."
        },
        "accountId": {
          "type": "string",
          "description": "The Amazon Web Services account ID that the policy applies to."
        }
      }
    },
    "DryRunResult": {
      "type": "object",
      "properties": {
        "totalMatchedLogGroups": {
          "type": "integer",
          "description": "The number of log groups in the scope of the policy that were analyzed. This value is the sum of increasedRetentionLogGroupCount, decreasedRetentionLogGroupCount, and unchangedRetentionLogGroupCount, and does not include log groups that could not be analyzed."
        },
        "increasedRetentionLogGroupCount": {
          "type": "integer",
          "description": "The number of log groups whose effective retention period would become longer."
        },
        "decreasedRetentionLogGroupCount": {
          "type": "integer",
          "description": "The number of log groups whose effective retention period would become shorter."
        },
        "unchangedRetentionLogGroupCount": {
          "type": "integer",
          "description": "The number of log groups whose effective retention period would not change."
        },
        "failedAnalysisCount": {
          "type": "integer",
          "description": "The number of log groups in the scope of the policy that could not be analyzed. These log groups are not included in totalMatchedLogGroups."
        },
        "topLogGroupsImpacted": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/LogGroupImpact"
          },
          "description": "Up to 20 log groups in the scope of the policy, sorted by stored bytes in descending order. This list can include log groups whose effective retention period would not change."
        }
      }
    },
    "LogGroupImpact": {
      "type": "object",
      "properties": {
        "logGroupName": {
          "type": "string",
          "description": "The name of the log group."
        },
        "currentRetention": {
          "type": "string",
          "description": "The current effective retention period of the log group, in days. A value of NEVER_EXPIRE indicates that log events in the log group never expire."
        },
        "proposedRetention": {
          "type": "string",
          "description": "The effective retention period of the log group, in days, after the change. A value of NEVER_EXPIRE indicates that log events in the log group would never expire."
        },
        "storedBytes": {
          "type": "integer",
          "description": "The number of bytes stored in the log group."
        }
      }
    }
  }
}