Interface IProgramBuilder
interface IProgramBuilder
Extends com.amazon.apmf.IStandard
Builder that will create the Program object.
Methods
identifier()
Sets the identifer of the program in the program builder and returns an instance of the builder.IProgramBuilder*identifier(stringidentifier)
Parameters
identifier
string — Required
The identifier for a program in an electronic program guide list.
This field is required and has a maximum length of 8192 bytes.
Returns
IProgramBuilder*
The ProgramBuilder object with identifier set.
Throws
IllegalStateError— if the function is called after this builder instance has already built an object once.InvalidArgumentError— if the field exceeds maximum length of 8192 bytes.InvalidArgumentError— if a string that is not valid UTF-8 is passed in.
channelDescriptor()
Sets the channel descriptor of the program in the program builder and returns an instance of the builder.IProgramBuilder*channelDescriptor(IChannelDescriptor*channelDescriptor)
Parameters
channelDescriptor
IChannelDescriptor* — Required
The uniquely identifying descriptor of the channel on which this program is airing.
This field is required.
Returns
IProgramBuilder*
The ProgramBuilder object with channelDescriptor set.
Throws
IllegalStateError— if the function is called after this builder instance has already built an object once.
startTime()
Sets the start time of the program in the program builder and returns an instance of the builder.IProgramBuilder*startTime(com.amazon.apmf.RawTimeValuestartTime)
Parameters
startTime
com.amazon.apmf.RawTimeValue — Required
The epoch time indicating the start time of a program.
This field can represent a past or future value. This field is required.
Returns
IProgramBuilder*
The ProgramBuilder object with startTime set.
Throws
IllegalStateError— if the function is called after this builder instance has already built an object once.
endTime()
Sets the end time of the program in the program builder and returns an instance of the builder.IProgramBuilder*endTime(com.amazon.apmf.RawTimeValueendTime)
Parameters
endTime
com.amazon.apmf.RawTimeValue — Required
The epoch time indicating the end time of a program.
This field can represent a past or future value. This field is required.
Returns
IProgramBuilder*
The ProgramBuilder object with endTime set.
Throws
IllegalStateError— if the function is called after this builder instance has already built an object once.
title()
Sets the title of the program in the program builder and returns an instance of the builder.IProgramBuilder*title(stringtitle)
Parameters
title
string — Required
The title or name for the specific program. For example, “MCIS: Los Angeles”.
This field is required.
The string will be truncated if its length exceeds 255 bytes and the last 3 bytes will be replaced with ”…”.
Returns
IProgramBuilder*
The ProgramBuilder object with title set.
Throws
IllegalStateError— if the function is called after this builder instance has already built an object once.InvalidArgumentError— if a string that is not valid UTF-8 is passed in.
subtitle()
Sets the subtitle of the program in the program builder and returns an instance of the builder.IProgramBuilder*subtitle(stringsubtitle)
Parameters
subtitle
string — Required
The subordinate title for a specific program. For example, “Maybe Today” which is an episode name for “MCIS: Los Angeles”.
This field is optional but SHALL be provided if applicable and known.
The string will be truncated if its length exceeds 255 bytes and the last 3 bytes will be replaced with ”…”.
Returns
IProgramBuilder*
The ProgramBuilder object with subtitle set.
Throws
IllegalStateError— if the function is called after this builder instance has already built an object once.InvalidArgumentError— if a string that is not valid UTF-8 is passed in.
description()
Sets the description of the program in the program builder and returns an instance of the builder.IProgramBuilder*description(stringdescription)
Parameters
description
string — Required
The brief description for the specific program. For example, a description of an episode.
This field is optional but SHALL be provided if known.
The string will be truncated if its length exceeds 8192 bytes and the last 3 bytes will be replaced with ”…”.
Returns
IProgramBuilder*
The ProgramBuilder object with description set.
Throws
IllegalStateError— if the function is called after this builder instance has already built an object once.InvalidArgumentError— if a string that is not valid UTF-8 is passed in.
ratings()
Sets the ratings of the program in the program builder and returns an instance of the builder.IProgramBuilder*ratings(string[]ratings)
Parameters
ratings
string[] — Required
The list of strings used to indicate the level of parental guidance recommended for the particular program.
This can be any rating system used in the country or region where the program is broadcasted.
Providing parental guidance ratings is optional but they SHALL be provided if known.
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
IProgramBuilder*
The ProgramBuilder object with ratings set.
Throws
IllegalStateError— if the function is called after this builder instance has already built an object once.InvalidArgumentError— if a string that is not valid UTF-8 is passed in.
genres()
Sets the genres of the program in the program builder and returns an instance of the builder.IProgramBuilder*genres(string[]genres)
Parameters
genres
string[] — Required
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.
Providing genres is optional but they SHALL be provided if known.
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
IProgramBuilder*
The ProgramBuilder object with genres set.
Throws
IllegalStateError— if the function is called after this builder instance has already built an object once.InvalidArgumentError— if a string that is not valid UTF-8 is passed in.
thumbnailUrl()
Sets the thumbnailUrl of the program in the program builder and returns an instance of the builder.IProgramBuilder*thumbnailUrl(stringthumbnailUrl)
Parameters
thumbnailUrl
string — Required
The URL where the thumbnail image can be found. Used to render program thumbnails.
This field is optional.
This field has a maximum length of 8192 bytes.
Returns
IProgramBuilder*
The ProgramBuilder object with thumbnailUrl set.
Throws
IllegalStateError— if the function is called after this builder instance has already built an object once.InvalidArgumentError— if the field exceeds maximum length of 8192 bytes.InvalidArgumentError— if a string that is not valid UTF-8 is passed in.
posterArtUrl()
Sets the posterArtUrl of the program in the program builder and returns an instance of the builder.IProgramBuilder*posterArtUrl(stringposterArtUrl)
Parameters
posterArtUrl
string — Required
The URL where the poster art image can be found. Used to render larger sized program
images such as the background banner for the detail view. This field is optional.
This field has a maximum length of 8192 bytes.
Returns
IProgramBuilder*
The ProgramBuilder object with posterArtUrl set.
Throws
IllegalStateError— if the function is called after this builder instance has already built an object once.InvalidArgumentError— if the field exceeds maximum length of 8192 bytes.InvalidArgumentError— if a string that is not valid UTF-8 is passed in.
seriesInfo()
Sets the seriesInfo of the program in the program builder and returns an instance of the builder.IProgramBuilder*seriesInfo(ISeriesInfo*seriesInfo)
Parameters
seriesInfo
ISeriesInfo* — Required
Series-related information for the program, such as season and episode number.
This field is optional but SHOULD be provided if the program represents an episode and this
information is available.
Returns
IProgramBuilder*
The ProgramBuilder object with seriesInfo set.
Throws
IllegalStateError— if the function is called after this builder instance has already built an object once.
attributes()
Sets the attributes in the program builder and returns an instance of the builder.IProgramBuilder*attributes(string[]attributes)
Parameters
attributes
string[] — Required
Properties of the program.
Please refer to the developer guide for a recommended list of canonical values for this field.
This field is optional but SHALL be provided if known.
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
IProgramBuilder*
The ProgramBuilder object with attributes set.
Throws
IllegalStateError— if the function is called after this builder instance has already built an object once.InvalidArgumentError— if a string that is not valid UTF-8 is passed in.
build()
Builds and returns a pointer to an instance of theIProgram*build()
IProgram object.
This function should be called after the desired fields of the program
builder have been set using the other builder functions. The build() function should
only be called once per builder object.
Returns
IProgram*
An instance of a Program object with all of the data that was set.
Throws
InvalidArgumentError— if one or more of the required fields are not provided to the builder.IllegalStateError— if the function is called after this builder instance has already built an object once.

