AdsApp.​YouTubeVideoAssetBuilder

  • The YouTubeVideoAssetBuilder is used to build new YouTube video assets.

  • The build() method creates the video asset and returns an AssetOperation.

  • The withName() method sets the name of the YouTube video asset.

  • The withYouTubeVideoId() method sets the YouTube video ID, which is a required field.

Builds new YouTube video assets.

Typical usage:

var youTubeVideoId = "123ABCabc-_";
var assetOperation = AdsApp.adAssets().newYouTubeVideoAssetBuilder()
   .withName("name")
   .withYouTubeVideoId(youTubeVideoId)
   .build();
var videoAsset = assetOperation.getResult();

Methods:

MemberTypeDescription
build() AdsApp.AssetOperation Creates a video asset.
withName(name) AdsApp.YouTubeVideoAssetBuilder Sets new YouTube video asset's name to the specified value.
withYouTubeVideoId(youTubeVideoId) AdsApp.YouTubeVideoAssetBuilder Sets YouTube video ID.
withSyntheticContentAttestation(attestation) AdsApp.YouTubeVideoAssetBuilder Declares whether or not the new YouTube video asset contains synthetic (AI-generated) content.

build()

Creates a video asset. Returns an AssetOperation that can be used to get the new video asset (or access any associated errors if the creation failed).

Return values:

TypeDescription
AdsApp.AssetOperation The asset operation.

withName(name)

Sets new YouTube video asset's name to the specified value.

Arguments:

NameTypeDescription
name String The name for the video asset.

Return values:

TypeDescription
AdsApp.YouTubeVideoAssetBuilder The video asset builder with the specified name.

withYouTubeVideoId(youTubeVideoId)

Sets YouTube video ID. This field is required.

Arguments:

NameTypeDescription
youTubeVideoId String The YouTube video ID.

Return values:

TypeDescription
AdsApp.YouTubeVideoAssetBuilder The video asset builder with the specified YouTube video ID.

withSyntheticContentAttestation(attestation)

Declares whether or not the new YouTube video asset contains synthetic (AI-generated) content.

Arguments:

NameTypeDescription
attestation String The synthetic content attestation, either "NOT_SYNTHETIC" or "IS_SYNTHETIC".

Return values:

TypeDescription
AdsApp.YouTubeVideoAssetBuilder The video asset builder with the specified synthetic content attestation.