AdsApp.​SnippetOperation

An operation representing creation of a new snippet. Calling anymethod(getErrors,getResult, orisSuccessful)will cause the operation to execute and create the snippet. Tomake the script more efficient, it's recommended that you store theoperations in an array and only call these methods once you've constructedall the operations you want.

Operation interface to structured snippet extension.

Methods:

MemberTypeDescription
getErrorsString[]Returns an empty array if the operation was successful, otherwise returnsthe list of errors encountered when trying to create the Snippet.
getResultAdsApp.SnippetReturns the newly created Snippet, ornull ifthe operation was unsuccessful.
isSuccessfulbooleanReturnstrue if the operation was successful.

getErrors()

Returns an empty array if the operation was successful, otherwise returnsthe list of errors encountered when trying to create the Snippet.

Return values:

TypeDescription
String[]The errors that occurred during theSnippetOperation.

getResult()

Returns the newly created Snippet, ornull ifthe operation was unsuccessful.

Return values:

TypeDescription
AdsApp.SnippetTheSnippet created by the SnippetOperation.

isSuccessful()

Returnstrue if the operation was successful.

Return values:

TypeDescription
booleantrue if the operation was successful.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-07-11 UTC.