{
  "typeName" : "AWS::SSMContacts::Contact",
  "description" : "Resource Type definition for AWS::SSMContacts::Contact",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-rpdk.git",
  "definitions" : {
    "ContactTargetInfo" : {
      "type" : "object",
      "description" : "The contact that SSM Incident Manager is engaging during an incident.",
      "properties" : {
        "ContactId" : {
          "description" : "The Amazon Resource Name (ARN) of the contact.",
          "type" : "string"
        },
        "IsEssential" : {
          "type" : "boolean",
          "description" : "A Boolean value determining if the contact's acknowledgement stops the progress of stages in the plan."
        }
      },
      "required" : [ "ContactId", "IsEssential" ],
      "additionalProperties" : false
    },
    "ChannelTargetInfo" : {
      "type" : "object",
      "description" : "Information about the contact channel that SSM Incident Manager uses to engage the contact.",
      "properties" : {
        "ChannelId" : {
          "description" : "The Amazon Resource Name (ARN) of the contact channel.",
          "type" : "string"
        },
        "RetryIntervalInMinutes" : {
          "type" : "integer",
          "description" : "The number of minutes to wait to retry sending engagement in the case the engagement initially fails."
        }
      },
      "required" : [ "ChannelId", "RetryIntervalInMinutes" ],
      "additionalProperties" : false
    },
    "Stage" : {
      "description" : "A set amount of time that an escalation plan or engagement plan engages the specified contacts or contact methods.",
      "type" : "object",
      "properties" : {
        "DurationInMinutes" : {
          "description" : "The time to wait until beginning the next stage.",
          "type" : "integer"
        },
        "Targets" : {
          "type" : "array",
          "description" : "The contacts or contact methods that the escalation plan or engagement plan is engaging.",
          "items" : {
            "$ref" : "#/definitions/Targets"
          }
        }
      },
      "required" : [ "DurationInMinutes" ],
      "additionalProperties" : false
    },
    "Targets" : {
      "description" : "The contacts or contact methods that the escalation plan or engagement plan is engaging.",
      "type" : "object",
      "properties" : {
        "ContactTargetInfo" : {
          "$ref" : "#/definitions/ContactTargetInfo"
        },
        "ChannelTargetInfo" : {
          "$ref" : "#/definitions/ChannelTargetInfo"
        }
      },
      "additionalProperties" : false,
      "oneOf" : [ {
        "required" : [ "ChannelTargetInfo" ]
      }, {
        "required" : [ "ContactTargetInfo" ]
      } ]
    }
  },
  "properties" : {
    "Alias" : {
      "description" : "Alias of the contact. String value with 20 to 256 characters. Only alphabetical, numeric characters, dash, or underscore allowed.",
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 255,
      "pattern" : "^[a-z0-9_\\-\\.]*$"
    },
    "DisplayName" : {
      "description" : "Name of the contact. String value with 3 to 256 characters. Only alphabetical, space, numeric characters, dash, or underscore allowed.",
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 255,
      "pattern" : "^[a-zA-Z0-9_\\-\\s]*$"
    },
    "Type" : {
      "description" : "Contact type, which specify type of contact. Currently supported values: “PERSONAL”, “SHARED”, “OTHER“.",
      "type" : "string",
      "enum" : [ "PERSONAL", "CUSTOM", "SERVICE", "ESCALATION" ]
    },
    "Plan" : {
      "description" : "The stages that an escalation plan or engagement plan engages contacts and contact methods in.",
      "type" : "array",
      "items" : {
        "$ref" : "#/definitions/Stage"
      }
    },
    "Arn" : {
      "type" : "string",
      "description" : "The Amazon Resource Name (ARN) of the contact."
    }
  },
  "additionalProperties" : false,
  "required" : [ "Alias", "DisplayName", "Type", "Plan" ],
  "primaryIdentifier" : [ "/properties/Arn" ],
  "writeOnlyProperties" : [ "/properties/Plan" ],
  "readOnlyProperties" : [ "/properties/Arn" ],
  "createOnlyProperties" : [ "/properties/Alias", "/properties/Type" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "ssm-contacts:CreateContact" ]
    },
    "read" : {
      "permissions" : [ "ssm-contacts:GetContact" ]
    },
    "update" : {
      "permissions" : [ "ssm-contacts:UpdateContact" ]
    },
    "delete" : {
      "permissions" : [ "ssm-contacts:DeleteContact" ]
    },
    "list" : {
      "permissions" : [ "ssm-contacts:ListContacts" ]
    }
  }
}