AdsApp.​Media

A Google Ads media object.

Methods:

MemberTypeDescription
getDimensions void
getEntityType String Returns the type of this entity as a String, in this case, "Media".
getFileSize long Returns the size of the media file in bytes.
getId String Returns the ID of the media.
getMimeType String Returns a MIME type identifier for the media object.
getName String Returns the name of the media object, or null if the media was created without a name.
getReferenceId void
getResourceName String Returns the resource name of the media.
getSourceUrl String Returns the URL where the original media was downloaded from, or null if the media was not obtained via download.
getType String Returns the media object's type.
getUrls AdsApp.MediaUrls Returns a MediaUrls instance for the media object if it is an image.
getYouTubeVideoId String Returns 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
String Type of this entity: "Media".

getFileSize()

Returns the size of the media file in bytes.

Return values:

TypeDescription
long The file size.

getId()

Returns the ID of the media.

Return values:

TypeDescription
String The 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
String The MIME type.

getName()

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

Return values:

TypeDescription
String The media object's name.

getReferenceId()

Returns nothing.

getResourceName()

Returns the resource name of the media.

Return values:

TypeDescription
String The 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
String The 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
String The media type.

getUrls()

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

Return values:

TypeDescription
AdsApp.MediaUrls The media URLs.

getYouTubeVideoId()

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

Return values:

TypeDescription
String