AdsApp.​MediaBundleAssetBuilder

  • Use the MediaBundleAssetBuilder to build new media bundle assets.

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

  • The withData(data) method sets the required data for the new bundle asset.

  • The withName(name) method sets the required name for the new bundle asset.

Builds new media bundle assets.

Typical usage:

var assetBundleUrl = "http://www.example.com/example.zip";
var assetBundleBlob = UrlFetchApp.fetch(assetBundleUrl).getBlob();
var assetOperation = AdsApp.adAssets().newMediaBundleAssetBuilder()
   .withName("name")
   .withData(assetBundleBlob)
   .build();
var bundleAsset = assetOperation.getResult();

Methods:

MemberTypeDescription
build() AdsApp.AssetOperation Creates a bundle asset.
withData(data) AdsApp.MediaBundleAssetBuilder Sets new bundle asset's data to the specified value.
withName(name) AdsApp.MediaBundleAssetBuilder Sets new bundle asset's name to the specified value.
withSyntheticContentAttestation(attestation) AdsApp.MediaBundleAssetBuilder Declares whether or not the new media bundle asset contains synthetic (AI-generated) content.

build()

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

Return values:

TypeDescription
AdsApp.AssetOperation The asset operation.

withData(data)

Sets new bundle asset's data to the specified value. This field is required.

Arguments:

NameTypeDescription
data Blob.Blob The data for the asset bundle.

Return values:

TypeDescription
AdsApp.MediaBundleAssetBuilder The asset bundle builder with the specified data.

withName(name)

Sets new bundle asset's name to the specified value. This field is required.

Arguments:

NameTypeDescription
name String The name for the asset bundle.

Return values:

TypeDescription
AdsApp.MediaBundleAssetBuilder The asset bundle builder with the specified name.

withSyntheticContentAttestation(attestation)

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

Arguments:

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

Return values:

TypeDescription
AdsApp.MediaBundleAssetBuilder The media bundle asset builder with the specified synthetic content attestation.