AdsApp.​Media

A Google Ads media object.

Methods:

MemberTypeDescription
getDimensionsvoid
getEntityTypeStringReturns the type of this entity as a String, in this case, "Media".
getFileSizelongReturns the size of the media file in bytes.
getIdStringReturns the ID of the media.
getMimeTypeStringReturns a MIME type identifier for the media object.
getNameStringReturns the name of the media object, or null if the media was created without a name.
getReferenceIdvoid
getResourceNameStringReturns the resource name of the media.
getSourceUrlStringReturns the URL where the original media was downloaded from, or null if the media was not obtained via download.
getTypeStringReturns the media object's type.
getUrlsAdsApp.MediaUrlsReturns a MediaUrls instance for the media object if it is an image.
getYouTubeVideoIdStringReturns the YouTube video ID if this media is a YouTube video, or null otherwise.

getDimensions()

Returns nothing.

getEntityType()

Returns the type of this entity as a String, in this case, "Media".

Return values:

TypeDescription
StringType of this entity: "Media".

getFileSize()

Returns the size of the media file in bytes.

Return values:

TypeDescription
longThe file size.

getId()

Returns the ID of the media.

Return values:

TypeDescription
StringThe ID of the media.

getMimeType()

Returns a MIME type identifier for the media object.

For example, this returns IMAGE_PNG for the image/png MIME type. See the API documentation for all possible values.

Return values:

TypeDescription
StringThe MIME type.

getName()

Returns the name of the media object, or null if the media was created without a name.

Return values:

TypeDescription
StringThe media object's name.

getReferenceId()

Returns nothing.

getResourceName()

Returns the resource name of the media.

Return values:

TypeDescription
StringThe resource name of the media.

getSourceUrl()

Returns the URL where the original media was downloaded from, or null if the media was not obtained via download.

Return values:

TypeDescription
StringThe source URL.

getType()

Returns the media object's type. This is one of AUDIO, DYNAMIC_IMAGE, ICON, IMAGE, STANDARD_ICON, VIDEO, or MEDIA_BUNDLE.

Return values:

TypeDescription
StringThe media type.

getUrls()

Returns a MediaUrls instance for the media object if it is an image.

Return values:

TypeDescription
AdsApp.MediaUrlsThe media URLs.

getYouTubeVideoId()

Returns the YouTube video ID if this media is a YouTube video, or null otherwise.

Return values:

TypeDescription
String