Interface IChannelMetadataBuilder
interface IChannelMetadataBuilder
Extends com.amazon.apmf.IStandard
Builder object that will create the ChannelMetadata object.
Methods
name()
Sets the name in the channel metadata builder and returns an instance of the builder.IChannelMetadataBuilder*name(stringname)
Parameters
name
string — Required
The name indicates the marketing name for the channel, such as “The CW” or “Comedy Central”.
This field is required and cannot be an empty string.
The string will be truncated if its length exceeds 255 bytes and the last 3 bytes will be replaced with ”…”.
Returns
IChannelMetadataBuilder*
The ChannelMetadataBuilder object with channel name 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.
channelType()
Sets the source type in the channel metadata builder and returns an instance of the builder. This field should only be set to OTT as the other channel types are not available yet.IChannelMetadataBuilder*channelType(ChannelTypechannelType)
Parameters
channelType
ChannelType — Required
The channel type represents the source of the channel.
This must be one of the sources defined in the ChannelType struct. This field is required.
Returns
IChannelMetadataBuilder*
The ChannelMetadataBuilder object with channel channelType set.
Throws
IllegalStateError— if the function is called after this builder instance has already built an object once.
externalIdList()
Sets the externalIdList in the channel metadata builder and returns an instance of the builder.IChannelMetadataBuilder*externalIdList(ExternalId[]externalIdList)
Parameters
externalIdList
ExternalId[] — Required
The list of identifiers for external lineup sources to which the channel should be associated.
This field is optional.
The maximum size of the list is 255. If there are more than 255 items, the extra items will be removed.
The maximum length for a field in ExternalId is 8192 bytes.
Returns
IChannelMetadataBuilder*
The ChannelMetadataBuilder object with channel externalIdList set.
Throws
IllegalStateError— if the function is called after this builder instance has already built an object once.InvalidArgumentError— if any of the fields in ExternalId exceeds maximum length of 8192 bytes.InvalidArgumentError— if a string that is not valid UTF-8 is passed in.
genres()
Sets the genres in the channel metadata builder and returns an instance of the builder.IChannelMetadataBuilder*genres(string[]genres)
Parameters
genres
string[] — Required
The list of genres that apply to the channel.
This field is optional but 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
IChannelMetadataBuilder*
The ChannelMetadataBuilder object with channel 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.
attributes()
Sets the attributes in the channel metadata builder and returns an instance of the builder.IChannelMetadataBuilder*attributes(string[]attributes)
Parameters
attributes
string[] — Required
Properties of the channel, which are checked when filtering, ordering, or searching for channels.
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
IChannelMetadataBuilder*
The ChannelMetadataBuilder object with channel 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.
videoResolution()
Sets the video resolution in the channel metadata builder and returns an instance of the builder. This channel metadata field is optional but SHALL be provided if known.IChannelMetadataBuilder*videoResolution(stringvideoResolution)
Parameters
videoResolution
string — Required
The video resolution of the channel.
Please refer to the developer guide for a recommended list of canonical values for this field.
The string will be truncated if its length exceeds 127 bytes and the last 3 bytes will be replaced with ”…”.
Returns
IChannelMetadataBuilder*
The ChannelMetadataBuilder object with channel videoResolution 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.
logoUrl()
Sets the logo URL in the channel metadata builder and returns an instance of the builder.IChannelMetadataBuilder*logoUrl(stringlogoUrl)
Parameters
logoUrl
string — Required
The URL where the channel logo can be found. Used to render channel thumbnails.
This channel metadata field is optional but SHALL be provided if known.
This field has a maximum length of 8192 bytes.
Returns
IChannelMetadataBuilder*
The ChannelMetadataBuilder object with channel logoUrl 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.
sortRank()
Sets the sort rank in the channel metadata builder and returns an instance of the builder. Channels with lower integer values for the sort rank will be display before channels with higher sort rank values in the Electronic Programming Guide (EPG) for this app. This field is optional, and will be defaulted to MAX Int32 if not provided. Please reach out to your Amazon contact if you want to display channels according to their sort rank values.IChannelMetadataBuilder*sortRank(i32sortRank)
Parameters
sortRank
i32 — Required
The sorting rank of this channel relative to other channels.
Returns
IChannelMetadataBuilder*
The ChannelMetadataBuilder object with channel sortRank set.
Throws
IllegalStateError— if the function is called after this builder instance has already built an object once.
build()
Builds and returns a pointer to an instance of theIChannelMetadata*build()
IChannelMetadata object.
This function should be called after the desired fields of the channel metadata
builder have been set using the other builder functions. The build() function should
only be called once per builder object.
Returns
IChannelMetadata*
An instance of a ChannelMetadata 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.

