{
 "additionalIdentifiers": [
  [
   "/properties/GatewayId",
   "/properties/LinkId"
  ]
 ],
 "additionalProperties": false,
 "conditionalCreateOnlyProperties": [
  "/properties/GatewayId",
  "/properties/PeerGatewayId",
  "/properties/LinkAttributes",
  "/properties/HttpResponderAllowed"
 ],
 "definitions": {
  "Arn": {
   "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-]+$",
   "type": "string"
  },
  "CreatedTimestamp": {
   "type": "string"
  },
  "Filter": {
   "additionalProperties": false,
   "properties": {
    "Criteria": {
     "insertionOrder": false,
     "items": {
      "$ref": "#/definitions/FilterCriterion"
     },
     "type": "array",
     "uniqueItems": false
    }
   },
   "required": [
    "Criteria"
   ],
   "type": "object"
  },
  "FilterCriterion": {
   "additionalProperties": false,
   "properties": {
    "Path": {
     "type": "string"
    },
    "Values": {
     "insertionOrder": false,
     "items": {
      "type": "string"
     },
     "minItems": 1,
     "type": "array",
     "uniqueItems": false
    }
   },
   "required": [
    "Path",
    "Values"
   ],
   "type": "object"
  },
  "GatewayId": {
   "pattern": "^rtb-gw-[a-z0-9-]{1,25}$",
   "type": "string"
  },
  "HeaderTagAction": {
   "additionalProperties": false,
   "properties": {
    "Name": {
     "type": "string"
    },
    "Value": {
     "type": "string"
    }
   },
   "required": [
    "Name",
    "Value"
   ],
   "type": "object"
  },
  "HttpResponderAllowed": {
   "type": "boolean"
  },
  "LinkAttributes": {
   "additionalProperties": false,
   "properties": {
    "CustomerProvidedId": {
     "type": "string"
    },
    "ResponderErrorMasking": {
     "insertionOrder": false,
     "items": {
      "$ref": "#/definitions/ResponderErrorMaskingForHttpCode"
     },
     "maxItems": 200,
     "minItems": 1,
     "type": "array",
     "uniqueItems": false
    }
   },
   "type": "object"
  },
  "LinkDirection": {
   "enum": [
    "REQUEST",
    "RESPONSE"
   ],
   "type": "string"
  },
  "LinkId": {
   "pattern": "^link-[a-z0-9-]{1,25}$",
   "type": "string"
  },
  "LinkLogSettings": {
   "additionalProperties": false,
   "properties": {
    "ApplicationLogs": {
     "additionalProperties": false,
     "properties": {
      "LinkApplicationLogSampling": {
       "additionalProperties": false,
       "properties": {
        "ErrorLog": {
         "maximum": 100.0,
         "minimum": 0.0,
         "type": "number"
        },
        "FilterLog": {
         "maximum": 100.0,
         "minimum": 0.0,
         "type": "number"
        }
       },
       "required": [
        "ErrorLog",
        "FilterLog"
       ],
       "type": "object"
      }
     },
     "required": [
      "LinkApplicationLogSampling"
     ],
     "type": "object"
    }
   },
   "required": [
    "ApplicationLogs"
   ],
   "type": "object"
  },
  "LinkStatus": {
   "enum": [
    "PENDING_CREATION",
    "PENDING_REQUEST",
    "REQUESTED",
    "ACCEPTED",
    "ACTIVE",
    "REJECTED",
    "FAILED",
    "PENDING_DELETION",
    "DELETED",
    "PENDING_UPDATE",
    "PENDING_ISOLATION",
    "ISOLATED",
    "PENDING_RESTORATION",
    "UNKNOWN_TO_SDK_VERSION"
   ],
   "type": "string"
  },
  "ModuleConfiguration": {
   "additionalProperties": false,
   "properties": {
    "DependsOn": {
     "insertionOrder": false,
     "items": {
      "pattern": "^[A-Za-z0-9 -]+$",
      "type": "string"
     },
     "type": "array",
     "uniqueItems": false
    },
    "ModuleParameters": {
     "$ref": "#/definitions/ModuleParameters"
    },
    "Name": {
     "pattern": "^[A-Za-z0-9 -]+$",
     "type": "string"
    },
    "Version": {
     "pattern": "^[a-z0-9]{1,25}$",
     "type": "string"
    }
   },
   "required": [
    "Name"
   ],
   "type": "object"
  },
  "ModuleConfigurationList": {
   "insertionOrder": false,
   "items": {
    "$ref": "#/definitions/ModuleConfiguration"
   },
   "type": "array",
   "uniqueItems": false
  },
  "ModuleParameters": {
   "oneOf": [
    {
     "additionalProperties": false,
     "properties": {
      "NoBid": {
       "$ref": "#/definitions/NoBidModuleParameters"
      }
     },
     "required": [
      "NoBid"
     ]
    },
    {
     "additionalProperties": false,
     "properties": {
      "OpenRtbAttribute": {
       "$ref": "#/definitions/OpenRtbAttributeModuleParameters"
      }
     },
     "required": [
      "OpenRtbAttribute"
     ]
    }
   ],
   "type": "object"
  },
  "NoBidAction": {
   "additionalProperties": false,
   "properties": {
    "NoBidReasonCode": {
     "minimum": 0,
     "type": "integer"
    }
   },
   "type": "object"
  },
  "NoBidModuleParameters": {
   "additionalProperties": false,
   "properties": {
    "PassThroughPercentage": {
     "maximum": 100.0,
     "minimum": 0.0,
     "type": "number"
    },
    "Reason": {
     "maxLength": 50,
     "minLength": 1,
     "pattern": "^[a-zA-Z0-9]*$",
     "type": "string"
    },
    "ReasonCode": {
     "maximum": 10,
     "minimum": 0,
     "type": "integer"
    }
   },
   "type": "object"
  },
  "OpenRtbAttributeModuleParameters": {
   "additionalProperties": false,
   "properties": {
    "Action": {
     "oneOf": [
      {
       "additionalProperties": false,
       "properties": {
        "NoBid": {
         "$ref": "#/definitions/NoBidAction"
        }
       },
       "required": [
        "NoBid"
       ]
      },
      {
       "additionalProperties": false,
       "properties": {
        "HeaderTag": {
         "$ref": "#/definitions/HeaderTagAction"
        }
       },
       "required": [
        "HeaderTag"
       ]
      }
     ],
     "type": "object"
    },
    "FilterConfiguration": {
     "insertionOrder": false,
     "items": {
      "$ref": "#/definitions/Filter"
     },
     "type": "array",
     "uniqueItems": false
    },
    "FilterType": {
     "enum": [
      "INCLUDE",
      "EXCLUDE"
     ],
     "type": "string"
    },
    "HoldbackPercentage": {
     "maximum": 100.0,
     "minimum": 0.0,
     "type": "number"
    }
   },
   "required": [
    "FilterType",
    "FilterConfiguration",
    "Action",
    "HoldbackPercentage"
   ],
   "type": "object"
  },
  "ResponderErrorMaskingForHttpCode": {
   "additionalProperties": false,
   "properties": {
    "Action": {
     "enum": [
      "NO_BID",
      "PASSTHROUGH"
     ],
     "type": "string"
    },
    "HttpCode": {
     "maxLength": 7,
     "minLength": 3,
     "pattern": "^DEFAULT|4XX|5XX|\\d{3}$",
     "type": "string"
    },
    "LoggingTypes": {
     "insertionOrder": false,
     "items": {
      "$ref": "#/definitions/ResponderErrorMaskingLoggingType"
     },
     "maxItems": 2,
     "minItems": 1,
     "type": "array",
     "uniqueItems": true
    },
    "ResponseLoggingPercentage": {
     "maximum": 100,
     "minimum": 0,
     "type": "number"
    }
   },
   "required": [
    "HttpCode",
    "Action",
    "LoggingTypes"
   ],
   "type": "object"
  },
  "ResponderErrorMaskingLoggingType": {
   "enum": [
    "NONE",
    "METRIC",
    "RESPONSE"
   ],
   "type": "string"
  },
  "Tag": {
   "additionalProperties": false,
   "properties": {
    "Key": {
     "maxLength": 128,
     "minLength": 1,
     "pattern": "^(resourceArn|internalId|[a-zA-Z0-9+\\-=._:/@]+)$",
     "type": "string"
    },
    "Value": {
     "maxLength": 256,
     "minLength": 0,
     "type": "string"
    }
   },
   "required": [
    "Key"
   ],
   "type": "object"
  },
  "Tags": {
   "insertionOrder": false,
   "items": {
    "$ref": "#/definitions/Tag"
   },
   "maxItems": 50,
   "minItems": 0,
   "type": "array",
   "uniqueItems": true
  },
  "UpdatedTimestamp": {
   "type": "string"
  }
 },
 "primaryIdentifier": [
  "/properties/Arn"
 ],
 "properties": {
  "Arn": {
   "$ref": "#/definitions/Arn"
  },
  "CreatedTimestamp": {
   "$ref": "#/definitions/CreatedTimestamp"
  },
  "GatewayId": {
   "$ref": "#/definitions/GatewayId"
  },
  "HttpResponderAllowed": {
   "$ref": "#/definitions/HttpResponderAllowed"
  },
  "LinkAttributes": {
   "$ref": "#/definitions/LinkAttributes"
  },
  "LinkDirection": {
   "$ref": "#/definitions/LinkDirection"
  },
  "LinkId": {
   "$ref": "#/definitions/LinkId"
  },
  "LinkLogSettings": {
   "$ref": "#/definitions/LinkLogSettings"
  },
  "LinkStatus": {
   "$ref": "#/definitions/LinkStatus"
  },
  "ModuleConfigurationList": {
   "$ref": "#/definitions/ModuleConfigurationList"
  },
  "PeerGatewayId": {
   "$ref": "#/definitions/GatewayId"
  },
  "Tags": {
   "$ref": "#/definitions/Tags"
  },
  "UpdatedTimestamp": {
   "$ref": "#/definitions/UpdatedTimestamp"
  }
 },
 "readOnlyProperties": [
  "/properties/LinkId",
  "/properties/Arn",
  "/properties/LinkStatus",
  "/properties/CreatedTimestamp",
  "/properties/UpdatedTimestamp",
  "/properties/LinkDirection"
 ],
 "required": [
  "GatewayId",
  "PeerGatewayId",
  "LinkLogSettings"
 ],
 "tagging": {
  "cloudFormationSystemTags": true,
  "tagOnCreate": true,
  "tagProperty": "/properties/Tags",
  "tagUpdatable": true,
  "taggable": true
 },
 "typeName": "AWS::RTBFabric::Link",
 "writeOnlyProperties": [
  "/properties/HttpResponderAllowed",
  "/properties/ModuleConfigurationList"
 ]
}
