{
  "typeName" : "AWS::CodePipeline::Webhook",
  "description" : "Resource Type definition for AWS::CodePipeline::Webhook",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-codepipeline-webhook",
  "definitions" : {
    "WebhookFilterRule" : {
      "description" : "A list of rules applied to the body/payload sent in the POST request to a webhook URL. All defined rules must pass for the request to be accepted and the pipeline started.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "JsonPath" : {
          "description" : "A JsonPath expression that is applied to the body/payload of the webhook. The value selected by the JsonPath expression must match the value specified in the MatchEquals field. Otherwise, the request is ignored.",
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 150
        },
        "MatchEquals" : {
          "description" : "The value selected by the JsonPath expression must match what is supplied in the MatchEquals field. Otherwise, the request is ignored.",
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 150
        }
      },
      "required" : [ "JsonPath" ]
    },
    "WebhookAuthConfiguration" : {
      "description" : "Properties that configure the authentication applied to incoming webhook trigger requests",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "AllowedIPRange" : {
          "description" : "The property used to configure acceptance of webhooks in an IP address range. For IP, only the AllowedIPRange property must be set. This property must be set to a valid CIDR range.",
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 100
        },
        "SecretToken" : {
          "description" : "The property used to configure GitHub authentication. For GITHUB_HMAC, only the SecretToken property must be set.",
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 100
        }
      }
    },
    "Tag" : {
      "description" : "A key-value pair to associate with a resource.",
      "type" : "object",
      "properties" : {
        "Key" : {
          "type" : "string",
          "description" : "The key name of the tag. You can specify a value that is 1 to 128 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -.",
          "minLength" : 1,
          "maxLength" : 128
        },
        "Value" : {
          "type" : "string",
          "description" : "The value for the tag. You can specify a value that is 0 to 256 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -.",
          "minLength" : 0,
          "maxLength" : 256
        }
      },
      "required" : [ "Key", "Value" ],
      "additionalProperties" : false
    }
  },
  "properties" : {
    "AuthenticationConfiguration" : {
      "description" : "Properties that configure the authentication applied to incoming webhook trigger requests",
      "$ref" : "#/definitions/WebhookAuthConfiguration"
    },
    "Filters" : {
      "description" : "A list of rules applied to the body/payload sent in the POST request to a webhook URL",
      "type" : "array",
      "uniqueItems" : false,
      "insertionOrder" : true,
      "items" : {
        "$ref" : "#/definitions/WebhookFilterRule"
      }
    },
    "Authentication" : {
      "description" : "Supported options are GITHUB_HMAC, IP, and UNAUTHENTICATED.",
      "type" : "string",
      "enum" : [ "GITHUB_HMAC", "IP", "UNAUTHENTICATED" ]
    },
    "TargetPipeline" : {
      "description" : "The name of the pipeline you want to connect to the webhook.",
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 100,
      "pattern" : "[A-Za-z0-9.@\\-_]+"
    },
    "TargetAction" : {
      "description" : "The name of the action in a pipeline you want to connect to the webhook.",
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 100,
      "pattern" : "[A-Za-z0-9.@\\-_]+"
    },
    "Id" : {
      "description" : "logical id of the webhook",
      "type" : "string"
    },
    "Url" : {
      "description" : "The webhook URL generated by AWS CodePipeline",
      "type" : "string"
    },
    "Name" : {
      "description" : "The name of the webhook",
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 100,
      "pattern" : "[A-Za-z0-9.@\\-_]+"
    },
    "TargetPipelineVersion" : {
      "description" : "The version number of the pipeline to be connected to the trigger request.",
      "type" : "integer"
    },
    "RegisterWithThirdParty" : {
      "description" : "Configures a connection between the webhook that was created and the external tool with events to be detected.",
      "type" : "boolean"
    },
    "Tags" : {
      "description" : "An array of key-value pairs to apply to this resource.",
      "type" : "array",
      "uniqueItems" : true,
      "insertionOrder" : false,
      "items" : {
        "$ref" : "#/definitions/Tag"
      }
    }
  },
  "additionalProperties" : false,
  "required" : [ "AuthenticationConfiguration", "Filters", "Authentication", "TargetPipeline", "TargetAction" ],
  "createOnlyProperties" : [ "/properties/Name" ],
  "readOnlyProperties" : [ "/properties/Id", "/properties/Url" ],
  "writeOnlyProperties" : [ "/properties/TargetPipelineVersion", "/properties/RegisterWithThirdParty", "/properties/AuthenticationConfiguration/SecretToken" ],
  "primaryIdentifier" : [ "/properties/Id" ],
  "tagging" : {
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : true,
    "cloudFormationSystemTags" : false,
    "tagProperty" : "/properties/Tags",
    "permissions" : [ "codepipeline:TagResource", "codepipeline:UntagResource" ]
  },
  "handlers" : {
    "create" : {
      "permissions" : [ "codepipeline:ListWebhooks", "codepipeline:RegisterWebhookWithThirdParty", "codepipeline:PutWebhook", "codepipeline:TagResource" ]
    },
    "read" : {
      "permissions" : [ "codepipeline:ListWebhooks" ]
    },
    "update" : {
      "permissions" : [ "codepipeline:ListWebhooks", "codepipeline:RegisterWebhookWithThirdParty", "codepipeline:PutWebhook", "codepipeline:DeregisterWebhookWithThirdParty", "codepipeline:TagResource", "codepipeline:UntagResource" ]
    },
    "delete" : {
      "permissions" : [ "codepipeline:ListWebhooks", "codepipeline:DeleteWebhook", "codepipeline:DeregisterWebhookWithThirdParty", "codepipeline:UntagResource" ]
    },
    "list" : {
      "permissions" : [ "codepipeline:ListWebhooks" ]
    }
  }
}