{
  "typeName" : "AWS::QuickSight::Analysis",
  "description" : "Definition of the AWS::QuickSight::Analysis Resource Type.",
  "definitions" : {
    "AnalysisError" : {
      "type" : "object",
      "description" : "<p>A metadata error structure for an analysis.</p>",
      "properties" : {
        "Type" : {
          "$ref" : "#/definitions/AnalysisErrorType"
        },
        "Message" : {
          "type" : "string",
          "pattern" : ".*\\S.*",
          "description" : "<p>The message associated with the analysis error.</p>"
        }
      },
      "additionalProperties" : false
    },
    "AnalysisErrorType" : {
      "type" : "string",
      "enum" : [ "ACCESS_DENIED", "SOURCE_NOT_FOUND", "DATA_SET_NOT_FOUND", "INTERNAL_FAILURE", "PARAMETER_VALUE_INCOMPATIBLE", "PARAMETER_TYPE_INVALID", "PARAMETER_NOT_FOUND", "COLUMN_TYPE_MISMATCH", "COLUMN_GEOGRAPHIC_ROLE_MISMATCH", "COLUMN_REPLACEMENT_MISSING" ]
    },
    "AnalysisSourceEntity" : {
      "type" : "object",
      "description" : "<p>The source entity of an analysis.</p>",
      "properties" : {
        "SourceTemplate" : {
          "$ref" : "#/definitions/AnalysisSourceTemplate"
        }
      },
      "additionalProperties" : false
    },
    "AnalysisSourceTemplate" : {
      "type" : "object",
      "description" : "<p>The source template of an analysis.</p>",
      "properties" : {
        "DataSetReferences" : {
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/DataSetReference"
          },
          "minItems" : 1,
          "description" : "<p>The dataset references of the source template of an analysis.</p>"
        },
        "Arn" : {
          "type" : "string",
          "description" : "<p>The Amazon Resource Name (ARN) of the source template of an analysis.</p>"
        }
      },
      "required" : [ "Arn", "DataSetReferences" ],
      "additionalProperties" : false
    },
    "DataSetReference" : {
      "type" : "object",
      "description" : "<p>Dataset reference.</p>",
      "properties" : {
        "DataSetArn" : {
          "type" : "string",
          "description" : "<p>Dataset Amazon Resource Name (ARN).</p>"
        },
        "DataSetPlaceholder" : {
          "type" : "string",
          "pattern" : ".*\\S.*",
          "description" : "<p>Dataset placeholder.</p>"
        }
      },
      "required" : [ "DataSetArn", "DataSetPlaceholder" ],
      "additionalProperties" : false
    },
    "DateTimeParameter" : {
      "type" : "object",
      "description" : "<p>A date-time parameter.</p>",
      "properties" : {
        "Values" : {
          "type" : "array",
          "items" : {
            "type" : "string"
          },
          "description" : "<p>The values for the date-time parameter.</p>"
        },
        "Name" : {
          "type" : "string",
          "pattern" : ".*\\S.*",
          "description" : "<p>A display name for the date-time parameter.</p>"
        }
      },
      "required" : [ "Name", "Values" ],
      "additionalProperties" : false
    },
    "DecimalParameter" : {
      "type" : "object",
      "description" : "<p>A decimal parameter.</p>",
      "properties" : {
        "Values" : {
          "type" : "array",
          "items" : {
            "type" : "number"
          },
          "description" : "<p>The values for the decimal parameter.</p>"
        },
        "Name" : {
          "type" : "string",
          "pattern" : ".*\\S.*",
          "description" : "<p>A display name for the decimal parameter.</p>"
        }
      },
      "required" : [ "Name", "Values" ],
      "additionalProperties" : false
    },
    "IntegerParameter" : {
      "type" : "object",
      "description" : "<p>An integer parameter.</p>",
      "properties" : {
        "Values" : {
          "type" : "array",
          "items" : {
            "type" : "number"
          },
          "description" : "<p>The values for the integer parameter.</p>"
        },
        "Name" : {
          "type" : "string",
          "pattern" : ".*\\S.*",
          "description" : "<p>The name of the integer parameter.</p>"
        }
      },
      "required" : [ "Name", "Values" ],
      "additionalProperties" : false
    },
    "Parameters" : {
      "type" : "object",
      "description" : "<p>A list of QuickSight parameters and the list's override values.</p>",
      "properties" : {
        "StringParameters" : {
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/StringParameter"
          },
          "maxItems" : 100,
          "minItems" : 0,
          "description" : "<p>String parameters.</p>"
        },
        "DecimalParameters" : {
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/DecimalParameter"
          },
          "maxItems" : 100,
          "minItems" : 0,
          "description" : "<p>Decimal parameters.</p>"
        },
        "IntegerParameters" : {
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/IntegerParameter"
          },
          "maxItems" : 100,
          "minItems" : 0,
          "description" : "<p>Integer parameters.</p>"
        },
        "DateTimeParameters" : {
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/DateTimeParameter"
          },
          "maxItems" : 100,
          "minItems" : 0,
          "description" : "<p>Date-time parameters.</p>"
        }
      },
      "additionalProperties" : false
    },
    "ResourcePermission" : {
      "type" : "object",
      "description" : "<p>Permission for the resource.</p>",
      "properties" : {
        "Actions" : {
          "type" : "array",
          "items" : {
            "type" : "string"
          },
          "maxItems" : 16,
          "minItems" : 1,
          "description" : "<p>The IAM action to grant or revoke permissions on.</p>"
        },
        "Principal" : {
          "type" : "string",
          "maxLength" : 256,
          "minLength" : 1,
          "description" : "<p>The Amazon Resource Name (ARN) of the principal. This can be one of the\n            following:</p>\n        <ul>\n            <li>\n                <p>The ARN of an Amazon QuickSight user or group associated with a data source or dataset. (This is common.)</p>\n            </li>\n            <li>\n                <p>The ARN of an Amazon QuickSight user, group, or namespace associated with an analysis, dashboard, template, or theme. (This is common.)</p>\n            </li>\n            <li>\n                <p>The ARN of an AWS account root: This is an IAM ARN rather than a QuickSight\n                    ARN. Use this option only to share resources (templates) across AWS accounts.\n                    (This is less common.) </p>\n            </li>\n         </ul>"
        }
      },
      "required" : [ "Actions", "Principal" ],
      "additionalProperties" : false
    },
    "ResourceStatus" : {
      "type" : "string",
      "enum" : [ "CREATION_IN_PROGRESS", "CREATION_SUCCESSFUL", "CREATION_FAILED", "UPDATE_IN_PROGRESS", "UPDATE_SUCCESSFUL", "UPDATE_FAILED", "DELETED" ]
    },
    "Sheet" : {
      "type" : "object",
      "description" : "<p>A <i>sheet</i>, which is an object that contains a set of visuals that\n            are viewed together on one page in the Amazon QuickSight console. Every analysis and dashboard\n            contains at least one sheet. Each sheet contains at least one visualization widget, for\n            example a chart, pivot table, or narrative insight. Sheets can be associated with other\n            components, such as controls, filters, and so on.</p>",
      "properties" : {
        "SheetId" : {
          "type" : "string",
          "maxLength" : 2048,
          "minLength" : 1,
          "pattern" : "[\\w\\-]+",
          "description" : "<p>The unique identifier associated with a sheet.</p>"
        },
        "Name" : {
          "type" : "string",
          "pattern" : ".*\\S.*",
          "description" : "<p>The name of a sheet. This name is displayed on the sheet's tab in the QuickSight\n            console.</p>"
        }
      },
      "additionalProperties" : false
    },
    "StringParameter" : {
      "type" : "object",
      "description" : "<p>A string parameter.</p>",
      "properties" : {
        "Values" : {
          "type" : "array",
          "items" : {
            "type" : "string"
          },
          "description" : "<p>The values of a string parameter.</p>"
        },
        "Name" : {
          "type" : "string",
          "pattern" : ".*\\S.*",
          "description" : "<p>A display name for a string parameter.</p>"
        }
      },
      "required" : [ "Name", "Values" ],
      "additionalProperties" : false
    },
    "Tag" : {
      "type" : "object",
      "description" : "<p>The key or keys of the key-value pairs for the resource tag or tags assigned to the\n            resource.</p>",
      "properties" : {
        "Value" : {
          "type" : "string",
          "maxLength" : 256,
          "minLength" : 1,
          "description" : "<p>Tag value.</p>"
        },
        "Key" : {
          "type" : "string",
          "maxLength" : 128,
          "minLength" : 1,
          "description" : "<p>Tag key.</p>"
        }
      },
      "required" : [ "Key", "Value" ],
      "additionalProperties" : false
    }
  },
  "properties" : {
    "AnalysisId" : {
      "type" : "string",
      "maxLength" : 2048,
      "minLength" : 1,
      "pattern" : "[\\w\\-]+"
    },
    "Arn" : {
      "type" : "string",
      "description" : "<p>The Amazon Resource Name (ARN) of the analysis.</p>"
    },
    "AwsAccountId" : {
      "type" : "string",
      "maxLength" : 12,
      "minLength" : 12,
      "pattern" : "^[0-9]{12}$"
    },
    "CreatedTime" : {
      "type" : "string",
      "description" : "<p>The time that the analysis was created.</p>",
      "format" : "string"
    },
    "DataSetArns" : {
      "type" : "array",
      "items" : {
        "type" : "string"
      },
      "maxItems" : 100,
      "minItems" : 0,
      "description" : "<p>The ARNs of the datasets of the analysis.</p>"
    },
    "Errors" : {
      "type" : "array",
      "items" : {
        "$ref" : "#/definitions/AnalysisError"
      },
      "minItems" : 1,
      "description" : "<p>Errors associated with the analysis.</p>"
    },
    "LastUpdatedTime" : {
      "type" : "string",
      "description" : "<p>The time that the analysis was last updated.</p>",
      "format" : "string"
    },
    "Name" : {
      "type" : "string",
      "maxLength" : 2048,
      "minLength" : 1,
      "pattern" : "[\\u0020-\\u00FF]+",
      "description" : "<p>The descriptive name of the analysis.</p>"
    },
    "Parameters" : {
      "$ref" : "#/definitions/Parameters"
    },
    "Permissions" : {
      "type" : "array",
      "items" : {
        "$ref" : "#/definitions/ResourcePermission"
      },
      "maxItems" : 64,
      "minItems" : 1,
      "description" : "<p>A structure that describes the principals and the resource-level permissions on an\n            analysis. You can use the <code>Permissions</code> structure to grant permissions by\n            providing a list of AWS Identity and Access Management (IAM) action information for each\n            principal listed by Amazon Resource Name (ARN). </p>\n\n        <p>To specify no permissions, omit <code>Permissions</code>.</p>"
    },
    "Sheets" : {
      "type" : "array",
      "items" : {
        "$ref" : "#/definitions/Sheet"
      },
      "maxItems" : 20,
      "minItems" : 0,
      "description" : "<p>A list of the associated sheets with the unique identifier and name of each sheet.</p>"
    },
    "SourceEntity" : {
      "$ref" : "#/definitions/AnalysisSourceEntity"
    },
    "Status" : {
      "$ref" : "#/definitions/ResourceStatus"
    },
    "Tags" : {
      "type" : "array",
      "items" : {
        "$ref" : "#/definitions/Tag"
      },
      "maxItems" : 200,
      "minItems" : 1,
      "description" : "<p>Contains a map of the key-value pairs for the resource tag or tags assigned to the\n            analysis.</p>"
    },
    "ThemeArn" : {
      "type" : "string",
      "description" : "<p>The ARN of the theme of the analysis.</p>"
    }
  },
  "required" : [ "AwsAccountId", "AnalysisId", "SourceEntity" ],
  "additionalProperties" : false,
  "writeOnlyProperties" : [ "/properties/Parameters", "/properties/SourceEntity", "/properties/LastUpdatedTime", "/properties/Status", "/properties/Sheets" ],
  "createOnlyProperties" : [ "/properties/AnalysisId", "/properties/AwsAccountId" ],
  "readOnlyProperties" : [ "/properties/AnalysisError", "/properties/CreatedTime", "/properties/LastUpdatedTime", "/properties/Status", "/properties/Sheets", "/properties/DataSetArns", "/properties/Arn" ],
  "primaryIdentifier" : [ "/properties/AnalysisId", "/properties/AwsAccountId" ],
  "handlers" : {
    "read" : {
      "permissions" : [ "quicksight:DescribeAnalysis" ]
    },
    "create" : {
      "permissions" : [ "quicksight:DescribeAnalysis", "quicksight:DescribeAnalysisPermissions", "quicksight:CreateAnalysis", "quicksight:DescribeTemplate", "quicksight:DescribeTheme", "quicksight:PassDataSet", "quicksight:ListTagsForResource" ]
    },
    "list" : {
      "permissions" : [ "quicksight:ListAnalyses" ]
    },
    "update" : {
      "permissions" : [ "quicksight:DescribeAnalysis", "quicksight:DescribeAnalysisPermissions", "quicksight:UpdateAnalysis", "quicksight:UpdateAnalysisPermissions", "quicksight:DescribeTheme", "quicksight:TagResource", "quicksight:UntagResource", "quicksight:ListTagsForResource" ]
    },
    "delete" : {
      "permissions" : [ "quicksight:DescribeAnalysis", "quicksight:DeleteAnalysis" ]
    }
  }
}