{
  "typeName" : "AWS::MediaTailor::PlaybackConfiguration",
  "description" : "Resource schema for AWS::MediaTailor::PlaybackConfiguration",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-mediatailor.git",
  "properties" : {
    "AdConditioningConfiguration" : {
      "$ref" : "#/definitions/AdConditioningConfiguration"
    },
    "AdDecisionServerUrl" : {
      "description" : "The URL for the ad decision server (ADS). This includes the specification of static parameters and placeholders for dynamic parameters. AWS Elemental MediaTailor substitutes player-specific and session-specific parameters as needed when calling the ADS. Alternately, for testing you can provide a static VAST URL. The maximum length is 25,000 characters.",
      "type" : "string"
    },
    "AvailSuppression" : {
      "description" : "The configuration for avail suppression, also known as ad suppression. For more information about ad suppression, see Ad Suppression (https://docs.aws.amazon.com/mediatailor/latest/ug/ad-behavior.html).",
      "$ref" : "#/definitions/AvailSuppression"
    },
    "Bumper" : {
      "description" : "The configuration for bumpers. Bumpers are short audio or video clips that play at the start or before the end of an ad break. To learn more about bumpers, see Bumpers (https://docs.aws.amazon.com/mediatailor/latest/ug/bumpers.html).",
      "$ref" : "#/definitions/Bumper"
    },
    "CdnConfiguration" : {
      "description" : "The configuration for using a content delivery network (CDN), like Amazon CloudFront, for content and ad segment management.",
      "$ref" : "#/definitions/CdnConfiguration"
    },
    "ConfigurationAliases" : {
      "description" : "The player parameters and aliases used as dynamic variables during session initialization. For more information, see Domain Variables. ",
      "$ref" : "#/definitions/ConfigurationAliases"
    },
    "DashConfiguration" : {
      "description" : "The configuration for DASH content.",
      "$ref" : "#/definitions/DashConfiguration"
    },
    "InsertionMode" : {
      "description" : "The setting that controls whether players can use stitched or guided ad insertion. The default, STITCHED_ONLY, forces all player sessions to use stitched (server-side) ad insertion. Choosing PLAYER_SELECT allows players to select either stitched or guided ad insertion at session-initialization time. The default for players that do not specify an insertion mode is stitched.",
      "$ref" : "#/definitions/InsertionMode"
    },
    "LivePreRollConfiguration" : {
      "description" : "The configuration for pre-roll ad insertion.",
      "$ref" : "#/definitions/LivePreRollConfiguration"
    },
    "ManifestProcessingRules" : {
      "description" : "The configuration for manifest processing rules. Manifest processing rules enable customization of the personalized manifests created by MediaTailor.",
      "$ref" : "#/definitions/ManifestProcessingRules"
    },
    "Name" : {
      "description" : "The identifier for the playback configuration.",
      "type" : "string",
      "pattern" : "^[a-zA-Z0-9_-]+$",
      "maxLength" : 64,
      "minLength" : 1
    },
    "PersonalizationThresholdSeconds" : {
      "description" : "Defines the maximum duration of underfilled ad time (in seconds) allowed in an ad break. If the duration of underfilled ad time exceeds the personalization threshold, then the personalization of the ad break is abandoned and the underlying content is shown. This feature applies to ad replacement in live and VOD streams, rather than ad insertion, because it relies on an underlying content stream. For more information about ad break behavior, including ad replacement and insertion, see Ad Behavior in AWS Elemental MediaTailor (https://docs.aws.amazon.com/mediatailor/latest/ug/ad-behavior.html).",
      "type" : "integer"
    },
    "SessionInitializationEndpointPrefix" : {
      "description" : "The URL that the player uses to initialize a session that uses client-side reporting.",
      "type" : "string"
    },
    "HlsConfiguration" : {
      "description" : "The configuration for HLS content.",
      "$ref" : "#/definitions/HlsConfiguration"
    },
    "LogConfiguration" : {
      "description" : "The configuration that defines where AWS Elemental MediaTailor sends logs for the playback configuration.",
      "$ref" : "#/definitions/LogConfiguration"
    },
    "PlaybackConfigurationArn" : {
      "description" : "The Amazon Resource Name (ARN) for the playback configuration.",
      "type" : "string"
    },
    "PlaybackEndpointPrefix" : {
      "description" : "The URL that the player accesses to get a manifest from MediaTailor. This session will use server-side reporting.",
      "type" : "string"
    },
    "SlateAdUrl" : {
      "description" : "The URL for a high-quality video asset to transcode and use to fill in time that's not used by ads. AWS Elemental MediaTailor shows the slate to fill in gaps in media content. Configuring the slate is optional for non-VPAID configurations. For VPAID, the slate is required because MediaTailor provides it in the slots that are designated for dynamic ad content. The slate must be a high-quality asset that contains both audio and video.",
      "type" : "string"
    },
    "Tags" : {
      "description" : "The tags to assign to the playback configuration.",
      "type" : "array",
      "uniqueItems" : true,
      "insertionOrder" : false,
      "items" : {
        "$ref" : "#/definitions/Tag"
      }
    },
    "TranscodeProfileName" : {
      "description" : "The name that is used to associate this playback configuration with a custom transcode profile. This overrides the dynamic transcoding defaults of MediaTailor. Use this only if you have already set up custom profiles with the help of AWS Support.",
      "type" : "string"
    },
    "VideoContentSourceUrl" : {
      "description" : "The URL prefix for the parent manifest for the stream, minus the asset ID. The maximum length is 512 characters.",
      "type" : "string"
    },
    "AdDecisionServerConfiguration" : {
      "$ref" : "#/definitions/AdDecisionServerConfiguration"
    }
  },
  "definitions" : {
    "AdConditioningConfiguration" : {
      "type" : "object",
      "description" : "<p>The setting that indicates what conditioning MediaTailor will perform on ads that the ad decision server (ADS) returns.</p>",
      "properties" : {
        "StreamingMediaFileConditioning" : {
          "$ref" : "#/definitions/StreamingMediaFileConditioning"
        }
      },
      "required" : [ "StreamingMediaFileConditioning" ],
      "additionalProperties" : false
    },
    "AvailSuppression" : {
      "description" : "The configuration for avail suppression, also known as ad suppression. For more information about ad suppression, see Ad Suppression (https://docs.aws.amazon.com/mediatailor/latest/ug/ad-behavior.html).",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Mode" : {
          "description" : "Sets the ad suppression mode. By default, ad suppression is off and all ad breaks are filled with ads or slate. When Mode is set to BEHIND_LIVE_EDGE, ad suppression is active and MediaTailor won't fill ad breaks on or behind the ad suppression Value time in the manifest lookback window. When Mode is set to AFTER_LIVE_EDGE, ad suppression is active and MediaTailor won't fill ad breaks that are within the live edge plus the avail suppression value.",
          "type" : "string",
          "enum" : [ "OFF", "BEHIND_LIVE_EDGE", "AFTER_LIVE_EDGE" ]
        },
        "Value" : {
          "description" : "A live edge offset time in HH:MM:SS. MediaTailor won't fill ad breaks on or behind this time in the manifest lookback window. If Value is set to 00:00:00, it is in sync with the live edge, and MediaTailor won't fill any ad breaks on or behind the live edge. If you set a Value time, MediaTailor won't fill any ad breaks on or behind this time in the manifest lookback window. For example, if you set 00:45:00, then MediaTailor will fill ad breaks that occur within 45 minutes behind the live edge, but won't fill ad breaks on or behind 45 minutes behind the live edge.",
          "type" : "string"
        },
        "FillPolicy" : {
          "description" : "Defines the policy to apply to the avail suppression mode. BEHIND_LIVE_EDGE will always use the full avail suppression policy. AFTER_LIVE_EDGE mode can be used to invoke partial ad break fills when a session starts mid-break. Valid values are FULL_AVAIL_ONLY and PARTIAL_AVAIL",
          "type" : "string",
          "enum" : [ "PARTIAL_AVAIL", "FULL_AVAIL_ONLY" ]
        }
      }
    },
    "Bumper" : {
      "description" : "The configuration for bumpers. Bumpers are short audio or video clips that play at the start or before the end of an ad break. To learn more about bumpers, see Bumpers (https://docs.aws.amazon.com/mediatailor/latest/ug/bumpers.html).",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "StartUrl" : {
          "description" : "The URL for the start bumper asset.",
          "type" : "string"
        },
        "EndUrl" : {
          "description" : "The URL for the end bumper asset.",
          "type" : "string"
        }
      }
    },
    "CdnConfiguration" : {
      "description" : "The configuration for using a content delivery network (CDN), like Amazon CloudFront, for content and ad segment management.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "AdSegmentUrlPrefix" : {
          "description" : "A non-default content delivery network (CDN) to serve ad segments. By default, AWS Elemental MediaTailor uses Amazon CloudFront with default cache settings as its CDN for ad segments. To set up an alternate CDN, create a rule in your CDN for the origin ads.mediatailor.&lt;region>.amazonaws.com. Then specify the rule's name in this AdSegmentUrlPrefix. When AWS Elemental MediaTailor serves a manifest, it reports your CDN as the source for ad segments.",
          "type" : "string"
        },
        "ContentSegmentUrlPrefix" : {
          "description" : "A content delivery network (CDN) to cache content segments, so that content requests don't always have to go to the origin server. First, create a rule in your CDN for the content segment origin server. Then specify the rule's name in this ContentSegmentUrlPrefix. When AWS Elemental MediaTailor serves a manifest, it reports your CDN as the source for content segments.",
          "type" : "string"
        }
      }
    },
    "ConfigurationAliases" : {
      "description" : "The predefined aliases for dynamic variables.",
      "additionalProperties" : false,
      "patternProperties" : {
        "player_params\\.\\w+\\Z" : {
          "type" : "object"
        }
      }
    },
    "DashConfiguration" : {
      "description" : "The configuration for DASH PUT operations.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "MpdLocation" : {
          "description" : "The setting that controls whether MediaTailor includes the Location tag in DASH manifests. MediaTailor populates the Location tag with the URL for manifest update requests, to be used by players that don't support sticky redirects. Disable this if you have CDN routing rules set up for accessing MediaTailor manifests, and you are either using client-side reporting or your players support sticky HTTP redirects. Valid values are DISABLED and EMT_DEFAULT. The EMT_DEFAULT setting enables the inclusion of the tag and is the default value.",
          "type" : "string"
        },
        "OriginManifestType" : {
          "description" : "The setting that controls whether MediaTailor handles manifests from the origin server as multi-period manifests or single-period manifests. If your origin server produces single-period manifests, set this to SINGLE_PERIOD. The default setting is MULTI_PERIOD. For multi-period manifests, omit this setting or set it to MULTI_PERIOD.",
          "type" : "string",
          "enum" : [ "SINGLE_PERIOD", "MULTI_PERIOD" ]
        },
        "ManifestEndpointPrefix" : {
          "description" : "The URL generated by MediaTailor to initiate a DASH playback session. The session uses server-side reporting.",
          "type" : "string"
        }
      }
    },
    "StreamingMediaFileConditioning" : {
      "type" : "string",
      "enum" : [ "TRANSCODE", "NONE" ]
    },
    "InsertionMode" : {
      "type" : "string",
      "enum" : [ "STITCHED_ONLY", "PLAYER_SELECT" ]
    },
    "LivePreRollConfiguration" : {
      "description" : "The configuration for pre-roll ad insertion.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "AdDecisionServerUrl" : {
          "description" : "The URL for the ad decision server (ADS) for pre-roll ads. This includes the specification of static parameters and placeholders for dynamic parameters. AWS Elemental MediaTailor substitutes player-specific and session-specific parameters as needed when calling the ADS. Alternately, for testing, you can provide a static VAST URL. The maximum length is 25,000 characters.",
          "type" : "string"
        },
        "MaxDurationSeconds" : {
          "description" : "The maximum allowed duration for the pre-roll ad avail. AWS Elemental MediaTailor won't play pre-roll ads to exceed this duration, regardless of the total duration of ads that the ADS returns.",
          "type" : "integer"
        }
      }
    },
    "ManifestProcessingRules" : {
      "description" : "The configuration for manifest processing rules. Manifest processing rules enable customization of the personalized manifests created by MediaTailor.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "AdMarkerPassthrough" : {
          "description" : "For HLS, when set to true, MediaTailor passes through EXT-X-CUE-IN, EXT-X-CUE-OUT, and EXT-X-SPLICEPOINT-SCTE35 ad markers from the origin manifest to the MediaTailor personalized manifest. No logic is applied to these ad markers. For example, if EXT-X-CUE-OUT has a value of 60, but no ads are filled for that ad break, MediaTailor will not set the value to 0.",
          "$ref" : "#/definitions/AdMarkerPassthrough"
        }
      }
    },
    "AdMarkerPassthrough" : {
      "description" : "For HLS, when set to true, MediaTailor passes through EXT-X-CUE-IN, EXT-X-CUE-OUT, and EXT-X-SPLICEPOINT-SCTE35 ad markers from the origin manifest to the MediaTailor personalized manifest. No logic is applied to these ad markers. For example, if EXT-X-CUE-OUT has a value of 60, but no ads are filled for that ad break, MediaTailor will not set the value to 0.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Enabled" : {
          "description" : "Enables ad marker passthrough for your configuration.",
          "type" : "boolean"
        }
      }
    },
    "Tag" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Key" : {
          "type" : "string"
        },
        "Value" : {
          "type" : "string"
        }
      },
      "required" : [ "Value", "Key" ]
    },
    "HlsConfiguration" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "ManifestEndpointPrefix" : {
          "description" : "The URL that is used to initiate a playback session for devices that support Apple HLS. The session uses server-side reporting.",
          "type" : "string"
        }
      }
    },
    "LogConfiguration" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "AdsInteractionLog" : {
          "description" : "The event types that MediaTailor emits in logs for interactions with the ADS.",
          "$ref" : "#/definitions/AdsInteractionLog"
        },
        "EnabledLoggingStrategies" : {
          "description" : "The method used for collecting logs from AWS Elemental MediaTailor. To configure MediaTailor to send logs directly to Amazon CloudWatch Logs, choose LEGACY_CLOUDWATCH. To configure MediaTailor to send logs to CloudWatch, which then vends the logs to your destination of choice, choose VENDED_LOGS. Supported destinations are CloudWatch Logs log group, Amazon S3 bucket, and Amazon Data Firehose stream. To use vended logs, you must configure the delivery destination in Amazon CloudWatch",
          "type" : "array",
          "items" : {
            "type" : "string"
          }
        },
        "ManifestServiceInteractionLog" : {
          "description" : "The event types that MediaTailor emits in logs for interactions with the origin server.",
          "$ref" : "#/definitions/ManifestServiceInteractionLog"
        },
        "PercentEnabled" : {
          "description" : "The percentage of session logs that MediaTailor sends to your CloudWatch Logs account. For example, if your playback configuration has 1000 sessions and percentEnabled is set to 60, MediaTailor sends logs for 600 of the sessions to CloudWatch Logs. MediaTailor decides at random which of the playback configuration sessions to send logs for. If you want to view logs for a specific session, you can use the debug log mode.",
          "type" : "integer",
          "minimum" : 0,
          "maximum" : 100
        }
      },
      "required" : [ "PercentEnabled" ]
    },
    "AdsInteractionLog" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "ExcludeEventTypes" : {
          "type" : "array",
          "description" : "Indicates that MediaTailor won't emit the selected events in the logs for playback sessions that are initialized with this configuration.",
          "items" : {
            "type" : "string"
          }
        },
        "PublishOptInEventTypes" : {
          "type" : "array",
          "description" : "Indicates that MediaTailor emits RAW_ADS_RESPONSE logs for playback sessions that are initialized with this configuration.",
          "items" : {
            "type" : "string"
          }
        }
      }
    },
    "ManifestServiceInteractionLog" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "ExcludeEventTypes" : {
          "type" : "array",
          "description" : "Indicates that MediaTailor won't emit the selected events in the logs for playback sessions that are initialized with this configuration.",
          "items" : {
            "type" : "string"
          }
        }
      }
    },
    "AdDecisionServerConfiguration" : {
      "description" : "The configuration for the request to the specified Ad Decision Server URL.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "HttpRequest" : {
          "$ref" : "#/definitions/HttpRequest"
        }
      },
      "required" : [ "HttpRequest" ]
    },
    "HttpRequest" : {
      "description" : "The configuration for the request to the Ad Decision Server URL.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "HttpMethod" : {
          "description" : "Supported HTTP Methods for the request to the Ad Decision Server URL.",
          "type" : "string",
          "enum" : [ "GET", "POST" ]
        },
        "Body" : {
          "description" : "The body of the request to the Ad Decision Server URL. The maximum length is 100,000 characters.",
          "type" : "string"
        },
        "Headers" : {
          "$ref" : "#/definitions/AdDecisionServerConfigurationHttpHeaders"
        },
        "CompressRequest" : {
          "description" : "The compression type of the request sent to the Ad Decision Server URL. Only the POST HTTP Method permits compression other than NONE.",
          "type" : "string",
          "enum" : [ "NONE", "GZIP" ]
        }
      }
    },
    "AdDecisionServerConfigurationHttpHeaders" : {
      "description" : "The headers in the request sent to the Ad Decision Server URL. The max length is 10,000 characters.",
      "type" : "object",
      "additionalProperties" : false,
      "patternProperties" : {
        ".*" : {
          "type" : "string"
        }
      }
    }
  },
  "tagging" : {
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : true,
    "cloudFormationSystemTags" : false,
    "tagProperty" : "/properties/Tags",
    "permissions" : [ "mediatailor:TagResource", "mediatailor:UntagResource" ]
  },
  "additionalProperties" : false,
  "required" : [ "Name", "VideoContentSourceUrl", "AdDecisionServerUrl" ],
  "primaryIdentifier" : [ "/properties/Name" ],
  "createOnlyProperties" : [ "/properties/Name" ],
  "readOnlyProperties" : [ "/properties/SessionInitializationEndpointPrefix", "/properties/HlsConfiguration/ManifestEndpointPrefix", "/properties/DashConfiguration/ManifestEndpointPrefix", "/properties/PlaybackConfigurationArn", "/properties/PlaybackEndpointPrefix" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "mediatailor:PutPlaybackConfiguration", "mediatailor:ConfigureLogsForPlaybackConfiguration", "iam:CreateServiceLinkedRole", "mediatailor:UntagResource", "mediatailor:TagResource", "mediatailor:GetPlaybackConfiguration" ]
    },
    "read" : {
      "permissions" : [ "mediatailor:GetPlaybackConfiguration" ]
    },
    "update" : {
      "permissions" : [ "mediatailor:PutPlaybackConfiguration", "mediatailor:ConfigureLogsForPlaybackConfiguration", "iam:CreateServiceLinkedRole", "mediatailor:UntagResource", "mediatailor:TagResource", "mediatailor:GetPlaybackConfiguration" ]
    },
    "delete" : {
      "permissions" : [ "mediatailor:DeletePlaybackConfiguration", "mediatailor:GetPlaybackConfiguration" ]
    },
    "list" : {
      "permissions" : [ "mediatailor:ListPlaybackConfigurations" ]
    }
  }
}