as

Settings
Sign out
Notifications
Alexa
亚马逊应用商店
AWS
文档
Support
Contact Us
My Cases
新手入门
设计和开发
应用发布
参考
支持
跳转到主要内容
Builder that creates an instance of the LiveEvent object.

Extends

  • Builder

Constructors

new LiveEventBuilder()

new LiveEventBuilder(): LiveEventBuilder

Returns

LiveEventBuilder

Methods

attributes()

attributes(attributes: string[]): LiveEventBuilder
Sets the attributes of the live event in the live event builder and returns an instance of the builder.

Parameters

attributes
string[] Properties of the live event. 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 ”…”.

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.

Returns

LiveEventBuilder ILiveEventBuilder The LiveEventBuilder object with attributes set.

build()

build(): ILiveEvent
Builds the LiveEvent object from the provided parameters. This function should be called after the desired fields of the live event builder have been set using the other builder functions. The build() function should only be called once per builder object.

Throws

  • InvalidArgumentError If one or more of the required fields are missing.
  • IllegalStateError if the function is called after this builder instance has already built an object once.

Returns

ILiveEvent ILiveEvent The built LiveEvent object.

description()

description(description: string): LiveEventBuilder
Sets the description of the live event in the live event builder and returns an instance of the builder.

Parameters

description
string The brief description of the live event. This field is optional. The string will be truncated if its length exceeds 8192 bytes and the last 3 bytes will be replaced with ”…”.

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.

Returns

LiveEventBuilder ILiveEventBuilder The LiveEventBuilder object with description set.

endTimeMs()

endTimeMs(endTimeMs: number): LiveEventBuilder
Sets the end time of the live event in the live event builder and returns an instance of the builder.

Parameters

endTimeMs
number The end time of a live event in milliseconds since epoch. This field can represent a past or future value. This field is required if eventType is SCHEDULED_EVENT.

Throws

  • IllegalStateError If the function is called after this builder instance has already built an object once.

Returns

LiveEventBuilder ILiveEventBuilder The LiveEventBuilder object with endTimeMs set.

eventType()

eventType(eventType: EventType): LiveEventBuilder
Sets the type of the live event in the live event builder and returns an instance of the builder.

Parameters

eventType
EventType The type of the live event. This field is required.

Throws

  • IllegalStateError If the function is called after this builder instance has already built an object once.

Returns

LiveEventBuilder ILiveEventBuilder The LiveEventBuilder object with eventType set.

genres()

genres(genres: string[]): LiveEventBuilder
Sets the genres of the live event in the live event builder and returns an instance of the builder.

Parameters

genres
string[] The list of genres that apply to the live event. 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 ”…”.

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.

Returns

LiveEventBuilder ILiveEventBuilder The LiveEventBuilder object with genres set.

identifier()

identifier(identifier: string): LiveEventBuilder
Sets the unique identifer of the live event in the live event builder and returns an instance of the builder.

Parameters

identifier
string The unique identifier for a specific live event. This identifier should be unique across all live events within the application package. This identifier should not change for a specific live event between updates. This field is required and has a maximum length of 8192 bytes.

Throws

  • IllegalStateError If the function is called after this builder instance has already built an object once.
  • InvalidArgumentError if the field exceeds the maximum length of 8192 bytes.
  • InvalidArgumentError if a string that is not valid UTF-8 is passed in.

Returns

LiveEventBuilder ILiveEventBuilder The LiveEventBuilder object with identifier set.

logoUrl()

logoUrl(logoUrl: string): LiveEventBuilder
Sets the logo URL of the live event in the live event builder and returns an instance of the builder.

Parameters

logoUrl
string The URL where the live event logo can be found. This field is optional. This field has a maximum length of 8192 bytes.

Throws

  • IllegalStateError If the function is called after this builder instance has already built an object once.
  • InvalidArgumentError if the field exceeds the maximum length of 8192 bytes.
  • InvalidArgumentError if a string that is not valid UTF-8 is passed in.

Returns

LiveEventBuilder ILiveEventBuilder The LiveEventBuilder object with logoUrl set.

playbackReference()

playbackReference(playbackReference: IPlaybackReference): LiveEventBuilder
Sets the playback reference of the live event in the live event builder and returns an instance of the builder.

Parameters

playbackReference
IPlaybackReference The playback reference of the live event, which describes how to start playback. This field is required.

Throws

  • IllegalStateError If the function is called after this builder instance has already built an object once.

Returns

LiveEventBuilder ILiveEventBuilder The LiveEventBuilder object with playbackReference set.

posterArtUrl()

posterArtUrl(posterArtUrl: string): LiveEventBuilder
Sets the poster art URL of the live event in the live event builder and returns an instance of the builder.

Parameters

posterArtUrl
string The URL where the poster art image can be found. This field is optional. This field has a maximum length of 8192 bytes.

Throws

  • IllegalStateError If the function is called after this builder instance has already built an object once.
  • InvalidArgumentError if the field exceeds the maximum length of 8192 bytes.
  • InvalidArgumentError if a string that is not valid UTF-8 is passed in.

Returns

LiveEventBuilder ILiveEventBuilder The LiveEventBuilder object with posterArtUrl set.

ratings()

ratings(ratings: string[]): LiveEventBuilder
Sets the ratings of the live event in the live event builder and returns an instance of the builder.

Parameters

ratings
string[] The list of strings used to indicate the level of parental guidance recommended for the particular live event. This can be any rating system used in the country or region where the live event 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 ”…”.

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.

Returns

LiveEventBuilder ILiveEventBuilder The LiveEventBuilder object with ratings set.

sortRank()

sortRank(sortRank: number): LiveEventBuilder
Optional function to set the sort rank of the live event in the live event builder and returns an instance of the builder. Live events with lower integer values for the sort rank will be displayed before live events with higher sort rank values in the row for this app. This field will be defaulted to MAX Int32 if not provided. If two or more live events have the same sort rank, they will be sorted alphabetically by their titles.

Parameters

sortRank
number The sorting rank of this live event relative to other live events.

Throws

  • IllegalStateError if the function is called after this builder instance has already built an object once.

Returns

LiveEventBuilder LiveEventBuilder The LiveEventBuilder object with sort rank set.

startTimeMs()

startTimeMs(startTimeMs: number): LiveEventBuilder
Sets the start time of the live event in the live event builder and returns an instance of the builder.

Parameters

startTimeMs
number The start time of a live event in milliseconds since epoch. This field can represent a past or future value. This field is required if eventType is SCHEDULED_EVENT.

Throws

  • IllegalStateError If the function is called after this builder instance has already built an object once.

Returns

LiveEventBuilder ILiveEventBuilder The LiveEventBuilder object with startTimeMs set.

title()

title(title: string): LiveEventBuilder
Sets the title of the live event in the live event builder and returns an instance of the builder.

Parameters

title
string The title of the live event. This field is required. The string will be truncated if its length exceeds 255 bytes and the last 3 bytes will be replaced with ”…”.

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.

Returns

LiveEventBuilder ILiveEventBuilder The LiveEventBuilder object with title set.
最后修改于 2026年8月25日