ProgramBuilder
Builder that creates an instance of the Program
object.
Extends
Constructors
new ProgramBuilder()
new ProgramBuilder():
ProgramBuilder
Returns
Inherited from
Properties
_className
protected
readonly
_className:string
='ProgramBuilder'
Overrides
Methods
attributes()
attributes(
attributes
):ProgramBuilder
Sets the attributes of the Program
.
Parameters
attributes
string
[]
of the Program
.
Please refer to the developer guide for a recommended list of canonical values for this field.
The maximum size of the list is 32. If there are more than 32 items, the extra items will be removed.
The maximmum size of each item is 255 bytes, any items that exceeds this length will be truncated and the last 3 bytes replaced with "…".
Returns
The ProgramBuilder
object with attributes set.
Details
This field is optional for the program.
Throws
IllegalStateError
if the function is called after this builder instance
has already built an object once.
Throws
InvalidArgumentError
if a string that is not valid UTF-8 is passed in.
build()
build():
IProgram
Builds the Program
object from the provided parameters.
Returns
The built Program
object.
Throws
InvalidArgumentError
if one or more of the required fields are missing.
Throws
IllegalStateError
if the function is called after this builder instance
has already built an object once.
Overrides
channelDescriptor()
channelDescriptor(
channelDescriptor
):ProgramBuilder
Sets the ChannelDescriptor
of the program.
Parameters
channelDescriptor
The uniquely identifying descriptor of the channel on which this program is airing.
Returns
The ProgramBuilder
object with ChannelDescriptor
set.
Details
This field is required in order to build a Program
object.
Throws
IllegalStateError
if the function is called after this builder instance
has already built an object once.
description()
description(
description
):ProgramBuilder
Sets the description of the program.
Parameters
description
string
The brief description for the specific program. For example, a description of an episode. The string will be truncated with "…" if its length exceeds 8192 bytes.
Returns
The ProgramBuilder
object with description set.
Details
This field is optional but SHALL be provided if known.
Throws
IllegalStateError
if the function is called after this builder instance
has already built an object once.
Throws
InvalidArgumentError
if a string that is not valid UTF-8 is passed in.
endTimeMs()
endTimeMs(
endTimeMs
):ProgramBuilder
Sets the end time of the program.
Parameters
endTimeMs
number
The epoch time (in ms sinch epoch) indicating the end time of a program. This field can represent a past or future value.
Returns
The ProgramBuilder
object with end time set.
Details
This field is required in order to build a Program object.
Throws
IllegalStateError
if the function is called after this builder instance
has already built an object once.
genres()
genres(
genres
):ProgramBuilder
Sets the genres of the program.
Parameters
genres
string
[]
The list of genres that apply to the program. Please refer to the developer guide for a recommended list of canonical values for this field. The maximum size of the list is 32. If there are more than 32 items, the extra items will be removed. The maximmum size of each item is 255 bytes, any items that exceeds this length will be truncated and the last 3 bytes replaced with "…".
Returns
The ProgramBuilder
object with genres set.
Details
This field is optional but SHALL be provided if known.
Throws
IllegalStateError
if the function is called after this builder instance
has already built an object once.
Throws
InvalidArgumentError
if a string that is not valid UTF-8 is passed in.
identifier()
identifier(
identifier
):ProgramBuilder
Sets the identifier of the program.
Parameters
identifier
string
The identifier for a program in an electronic program guide list.
This field is required in order to build the Program
.
This field has a maximum length of 8192 bytes.
Returns
The ProgramBuilder
object with program identifier set.
Throws
IllegalStateError
if the function is called after this builder instance
has already built an object once.
Throws
InvalidArgumentError
if the field exceeds the maximum length of 8192 bytes.
Throws
InvalidArgumentError
if a string that is not valid UTF-8 is passed in.
markBuilderAsUsed()
protected
markBuilderAsUsed():void
Returns
void
Inherited from
posterArtUrl()
posterArtUrl(
url
):ProgramBuilder
Sets the poster art url of the program.
Parameters
url
string
Returns
The ProgramBuilder
object with poster art url set.
Details
This field is optional but SHALL be provided if known.
Throws
IllegalStateError
if the function is called after this builder instance
has already built an object once.
Throws
InvalidArgumentError if the field exceeds the maximum length of 8192.
Throws
InvalidArgumentError
if a string that is not valid UTF-8 is passed in.
ratings()
ratings(
ratings
):ProgramBuilder
Sets the ratings of the program.
Parameters
ratings
string
[]
The list of strings used to indicate the level of parental guidance recommended for a particular program. This can be any rating system used in the country or region where the program is broadcasted. Please refer to the developer guide for a recommended list of canonical values for this field. The maximum size of the list is 32. If there are more than 32 items, the extra items will be removed. The maximmum size of each item is 255 bytes, any items that exceeds this length will be truncated and the last 3 bytes replaced with "…".
Returns
The ProgramBuilder
object with ratings set.
Details
This field is optional but SHALL be provided if known.
Throws
IllegalStateError
if the function is called after this builder instance
has already built an object once.
Throws
InvalidArgumentError
if a string that is not valid UTF-8 is passed in.
seriesInfo()
seriesInfo(
seriesInfo
):ProgramBuilder
Sets the series information of the program.
Parameters
seriesInfo
Series-related information for the program, such as season and episode number.
Returns
The ProgramBuilder
object with seriesInfo set.
Details
This field is optional but SHALL be provided if the program represents an episode and this information is available.
Throws
IllegalStateError
if the function is called after this builder instance
has already built an object once.
startTimeMs()
startTimeMs(
starTime
):ProgramBuilder
Sets the start time of the program.
Parameters
starTime
number
Returns
The ProgramBuilder
object with start time set.
Details
This field is required in order to build a Program
object.
Throws
IllegalStateError
if the function is called after this builder instance
has already built an object once.
subtitle()
subtitle(
subtitle
):ProgramBuilder
Sets the subtitle of the program.
Parameters
subtitle
string
The subordinate title for a specific program. For example, “Maybe Today" which is an episode name for “MCIS: Los Angeles”. The string will be truncated if its length exceeds 255 bytes and the last 3 bytes will be replaced with "…".
Returns
The ProgramBuilder
object with subtitle set.
Details
This field is optional but SHALL be provided if applicable and known.
Throws
IllegalStateError
if the function is called after this builder instance
has already built an object once.
Throws
InvalidArgumentError
if a string that is not valid UTF-8 is passed in.
throwErrorIfBuilderAlreadyUsed()
protected
throwErrorIfBuilderAlreadyUsed():void
Returns
void
Inherited from
Builder
.throwErrorIfBuilderAlreadyUsed
thumbnailUrl()
thumbnailUrl(
url
):ProgramBuilder
Sets the thumbnail url of the program.
Parameters
url
string
Returns
The ProgramBuilder
object with thumbnail url set.
Details
This field is optional but SHALL be provided if known.
Throws
IllegalStateError
if the function is called after this builder instance
has already built an object once.
Throws
InvalidArgumentError if the field exceeds the maximum length of 8192 bytes.
Throws
InvalidArgumentError
if a string that is not valid UTF-8 is passed in.
title()
title(
title
):ProgramBuilder
Sets the title of the program.
Parameters
title
string
The title or name for the specific program. For example, “MCIS: Los Angeles”. The string will be truncated if its length exceeds 255 bytes and the last 3 bytes will be replaced with "…".
Returns
The ProgramBuilder
object with title set.
Details
This field is required in order to build a Program
object.
Throws
IllegalStateError
if the function is called after this builder instance
has already built an object once.
Throws
InvalidArgumentError
if a string that is not valid UTF-8 is passed in.
Last updated: Sep 30, 2025