{
  "typeName" : "AWS::RTBFabric::InboundExternalLink",
  "description" : "Resource Type definition for AWS::RTBFabric::InboundExternalLink Resource Type",
  "definitions" : {
    "LinkId" : {
      "type" : "string",
      "pattern" : "^link-[a-z0-9-]{1,25}$"
    },
    "GatewayId" : {
      "type" : "string",
      "pattern" : "^rtb-gw-[a-z0-9-]{1,25}$"
    },
    "ResponderErrorMaskingLoggingType" : {
      "type" : "string",
      "enum" : [ "NONE", "METRIC", "RESPONSE" ]
    },
    "ResponderErrorMaskingForHttpCode" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "HttpCode" : {
          "type" : "string",
          "pattern" : "^DEFAULT|4XX|5XX|\\d{3}$",
          "maxLength" : 7,
          "minLength" : 3
        },
        "Action" : {
          "type" : "string",
          "enum" : [ "NO_BID", "PASSTHROUGH" ]
        },
        "LoggingTypes" : {
          "type" : "array",
          "insertionOrder" : false,
          "uniqueItems" : true,
          "items" : {
            "$ref" : "#/definitions/ResponderErrorMaskingLoggingType"
          },
          "minItems" : 1,
          "maxItems" : 2
        },
        "ResponseLoggingPercentage" : {
          "type" : "number",
          "minimum" : 0,
          "maximum" : 100
        }
      },
      "required" : [ "HttpCode", "Action", "LoggingTypes" ]
    },
    "LinkAttributes" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "ResponderErrorMasking" : {
          "type" : "array",
          "insertionOrder" : false,
          "uniqueItems" : false,
          "items" : {
            "$ref" : "#/definitions/ResponderErrorMaskingForHttpCode"
          },
          "minItems" : 1,
          "maxItems" : 200
        },
        "CustomerProvidedId" : {
          "type" : "string"
        }
      }
    },
    "LinkStatus" : {
      "type" : "string",
      "enum" : [ "PENDING_CREATION", "PENDING_REQUEST", "REQUESTED", "ACCEPTED", "ACTIVE", "REJECTED", "FAILED", "PENDING_DELETION", "DELETED", "PENDING_UPDATE", "PENDING_ISOLATION", "ISOLATED", "PENDING_RESTORATION", "UNKNOWN_TO_SDK_VERSION" ]
    },
    "CreatedTimestamp" : {
      "type" : "string"
    },
    "UpdatedTimestamp" : {
      "type" : "string"
    },
    "Arn" : {
      "type" : "string",
      "maxLength" : 2048,
      "minLength" : 20,
      "pattern" : "^arn:aws:rtbfabric:[a-zA-Z0-9_-]+:[0-9]{12}:gateway/[a-zA-Z0-9-]+/link/[a-zA-Z0-9-]+$"
    },
    "DomainName" : {
      "type" : "string",
      "pattern" : "^(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?)(?:\\.(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?))+$"
    },
    "Tag" : {
      "description" : "A key-value pair to associate with a resource.",
      "type" : "object",
      "additionalProperties" : false,
      "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,
          "pattern" : "^(resourceArn|internalId|[a-zA-Z0-9+\\-=._:/@]+)$"
        },
        "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" ]
    },
    "Tags" : {
      "type" : "array",
      "insertionOrder" : false,
      "uniqueItems" : true,
      "items" : {
        "$ref" : "#/definitions/Tag"
      },
      "minItems" : 0,
      "maxItems" : 50,
      "description" : "Tags to assign to the Link."
    },
    "LinkLogSettings" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "ApplicationLogs" : {
          "type" : "object",
          "additionalProperties" : false,
          "properties" : {
            "LinkApplicationLogSampling" : {
              "type" : "object",
              "additionalProperties" : false,
              "properties" : {
                "ErrorLog" : {
                  "type" : "number",
                  "minimum" : 0.0,
                  "maximum" : 100.0
                },
                "FilterLog" : {
                  "type" : "number",
                  "minimum" : 0.0,
                  "maximum" : 100.0
                }
              },
              "required" : [ "ErrorLog", "FilterLog" ]
            }
          },
          "required" : [ "LinkApplicationLogSampling" ]
        }
      },
      "required" : [ "ApplicationLogs" ]
    }
  },
  "properties" : {
    "Tags" : {
      "$ref" : "#/definitions/Tags"
    },
    "LinkId" : {
      "$ref" : "#/definitions/LinkId"
    },
    "GatewayId" : {
      "$ref" : "#/definitions/GatewayId"
    },
    "LinkAttributes" : {
      "$ref" : "#/definitions/LinkAttributes"
    },
    "LinkLogSettings" : {
      "$ref" : "#/definitions/LinkLogSettings"
    },
    "LinkStatus" : {
      "$ref" : "#/definitions/LinkStatus"
    },
    "CreatedTimestamp" : {
      "$ref" : "#/definitions/CreatedTimestamp"
    },
    "UpdatedTimestamp" : {
      "$ref" : "#/definitions/UpdatedTimestamp"
    },
    "Arn" : {
      "$ref" : "#/definitions/Arn"
    },
    "DomainName" : {
      "$ref" : "#/definitions/DomainName"
    }
  },
  "required" : [ "GatewayId", "LinkLogSettings" ],
  "readOnlyProperties" : [ "/properties/LinkId", "/properties/Arn", "/properties/DomainName", "/properties/LinkStatus", "/properties/CreatedTimestamp", "/properties/UpdatedTimestamp" ],
  "conditionalCreateOnlyProperties" : [ "/properties/GatewayId", "/properties/LinkAttributes", "/properties/LinkLogSettings" ],
  "primaryIdentifier" : [ "/properties/Arn" ],
  "additionalIdentifiers" : [ [ "/properties/GatewayId", "/properties/LinkId" ] ],
  "handlers" : {
    "create" : {
      "permissions" : [ "rtbfabric:CreateInboundExternalLink", "rtbfabric:GetInboundExternalLink", "rtbfabric:TagResource", "rtbfabric:ListTagsForResource", "iam:CreateServiceLinkedRole" ]
    },
    "read" : {
      "permissions" : [ "rtbfabric:GetInboundExternalLink", "rtbfabric:ListTagsForResource" ]
    },
    "update" : {
      "permissions" : [ "rtbfabric:GetInboundExternalLink", "rtbfabric:TagResource", "rtbfabric:UntagResource", "rtbfabric:ListTagsForResource" ]
    },
    "delete" : {
      "permissions" : [ "rtbfabric:DeleteInboundExternalLink", "rtbfabric:GetInboundExternalLink" ]
    },
    "list" : {
      "handlerSchema" : {
        "properties" : {
          "GatewayId" : {
            "type" : "string",
            "pattern" : "^rtb-gw-[a-z0-9-]{1,25}$"
          }
        },
        "required" : [ "GatewayId" ]
      },
      "permissions" : [ "rtbfabric:ListLinks" ]
    }
  },
  "tagging" : {
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : true,
    "cloudFormationSystemTags" : true,
    "tagProperty" : "/properties/Tags",
    "permissions" : [ "rtbfabric:TagResource", "rtbfabric:UntagResource", "rtbfabric:ListTagsForResource" ]
  },
  "additionalProperties" : false
}