Class TemplateFieldValue
- All Implemented Interfaces:
Serializable,SdkPojo,ToCopyableBuilder<TemplateFieldValue.Builder,TemplateFieldValue>
The value of a template field. Exactly one variant is set, matching the field's type: text and RichText fields use text, image fields use ImageReference (or, on a write, CampaignAssetImage), AssetLink fields use LinkedAssetId.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic enum -
Method Summary
Modifier and TypeMethodDescriptionstatic TemplateFieldValue.Builderbuilder()final CampaignAssetImageSourceWrite only.final booleanfinal booleanequalsBySdkFields(Object obj) Indicates whether some other object is "equal to" this one by SDK fields.static TemplateFieldValuefromCampaignAssetImage(Consumer<CampaignAssetImageSource.Builder> campaignAssetImage) Create an instance of this class withcampaignAssetImage()initialized to the given value.static TemplateFieldValuefromCampaignAssetImage(CampaignAssetImageSource campaignAssetImage) Create an instance of this class withcampaignAssetImage()initialized to the given value.static TemplateFieldValuefromImageReference(String imageReference) Create an instance of this class withimageReference()initialized to the given value.static TemplateFieldValuefromLinkedAssetId(String linkedAssetId) Create an instance of this class withlinkedAssetId()initialized to the given value.static TemplateFieldValueCreate an instance of this class withtext()initialized to the given value.final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) final inthashCode()final StringImage reference (image fields).final StringThe asset anAssetLinkfield names: the id of an asset on the same campaign, of the field's category.static Class<? extends TemplateFieldValue.Builder> final Stringtext()Text value — for both text and RichText fields.Take this object and create a builder that contains all of the current property values of this object.final StringtoString()Returns a string representation of this object.type()Retrieve an enum value representing which member of this object is populated.Methods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
Method Details
-
text
Text value — for both text and RichText fields. A RichText value is a markup fragment restricted to the field's AllowedTags.
- Returns:
- Text value — for both text and RichText fields. A RichText value is a markup fragment restricted to the field's AllowedTags.
-
imageReference
Image reference (image fields).
On a write, one of exactly two forms:
- the
s3://URI of a file you staged in the Partner Central file staging bucket. It is scanned, then copied into this asset. - the URL Build with AI returned for a suggested image, unchanged. It is copied into this asset and not
scanned. Any other URL is refused with
FILE_REFERENCE_INVALID, including one a read returned: to keep the current image, omit the field; to put it on another asset, useCampaignAssetImage.
On a read, a URL the caller can fetch: an image in the asset's own storage comes back as a presigned GET that expires one hour after the read, so fetch it again with
GetCampaignAssetwhen it returns 403; an image already on DG's public CDN comes back as that stable URL. A stored reference outside this asset's storage, or not a raster image, is never signed, and the value is omitted. The signed URL serves the image as its image type, whatever the upload declared.- Returns:
- Image reference (image fields).
On a write, one of exactly two forms:
- the
s3://URI of a file you staged in the Partner Central file staging bucket. It is scanned, then copied into this asset. - the URL Build with AI returned for a suggested image, unchanged. It is copied into this asset and not
scanned. Any other URL is refused with
FILE_REFERENCE_INVALID, including one a read returned: to keep the current image, omit the field; to put it on another asset, useCampaignAssetImage.
On a read, a URL the caller can fetch: an image in the asset's own storage comes back as a presigned GET that expires one hour after the read, so fetch it again with
GetCampaignAssetwhen it returns 403; an image already on DG's public CDN comes back as that stable URL. A stored reference outside this asset's storage, or not a raster image, is never signed, and the value is omitted. The signed URL serves the image as its image type, whatever the upload declared. - the
- the
-
linkedAssetId
The asset an
AssetLinkfield names: the id of an asset on the same campaign, of the field's category. It is a prerequisite of this asset while linked, so it activates first, this asset cannot start until it is live, and it cannot be deleted.- Returns:
- The asset an
AssetLinkfield names: the id of an asset on the same campaign, of the field's category. It is a prerequisite of this asset while linked, so it activates first, this asset cannot start until it is live, and it cannot be deleted.
-
campaignAssetImage
Write only. Copies an image stored on another of your assets into this image field. The image is checked against this field's constraints and not scanned again. Also requires
partnercentral:GetCampaignAsseton the source campaign. Reads return the copy asImageReference.- Returns:
- Write only. Copies an image stored on another of your assets into this image field. The image is checked
against this field's constraints and not scanned again. Also requires
partnercentral:GetCampaignAsseton the source campaign. Reads return the copy asImageReference.
-
toBuilder
Description copied from interface:ToCopyableBuilderTake this object and create a builder that contains all of the current property values of this object.- Specified by:
toBuilderin interfaceToCopyableBuilder<TemplateFieldValue.Builder,TemplateFieldValue> - Returns:
- a builder for type T
-
builder
-
serializableBuilderClass
-
hashCode
-
equals
-
equalsBySdkFields
Description copied from interface:SdkPojoIndicates whether some other object is "equal to" this one by SDK fields. An SDK field is a modeled, non-inherited field in anSdkPojoclass, and is generated based on a service model.If an
SdkPojoclass does not have any inherited fields,equalsBySdkFieldsandequalsare essentially the same.- Specified by:
equalsBySdkFieldsin interfaceSdkPojo- Parameters:
obj- the object to be compared with- Returns:
- true if the other object equals to this object by sdk fields, false otherwise.
-
toString
-
getValueForField
-
fromText
Create an instance of this class withtext()initialized to the given value.Text value — for both text and RichText fields. A RichText value is a markup fragment restricted to the field's AllowedTags.
- Parameters:
text- Text value — for both text and RichText fields. A RichText value is a markup fragment restricted to the field's AllowedTags.
-
fromImageReference
Create an instance of this class withimageReference()initialized to the given value.Image reference (image fields).
On a write, one of exactly two forms:
- the
s3://URI of a file you staged in the Partner Central file staging bucket. It is scanned, then copied into this asset. - the URL Build with AI returned for a suggested image, unchanged. It is copied into this asset and not
scanned. Any other URL is refused with
FILE_REFERENCE_INVALID, including one a read returned: to keep the current image, omit the field; to put it on another asset, useCampaignAssetImage.
On a read, a URL the caller can fetch: an image in the asset's own storage comes back as a presigned GET that expires one hour after the read, so fetch it again with
GetCampaignAssetwhen it returns 403; an image already on DG's public CDN comes back as that stable URL. A stored reference outside this asset's storage, or not a raster image, is never signed, and the value is omitted. The signed URL serves the image as its image type, whatever the upload declared.- Parameters:
imageReference- Image reference (image fields).On a write, one of exactly two forms:
- the
s3://URI of a file you staged in the Partner Central file staging bucket. It is scanned, then copied into this asset. - the URL Build with AI returned for a suggested image, unchanged. It is copied into this asset and not
scanned. Any other URL is refused with
FILE_REFERENCE_INVALID, including one a read returned: to keep the current image, omit the field; to put it on another asset, useCampaignAssetImage.
On a read, a URL the caller can fetch: an image in the asset's own storage comes back as a presigned GET that expires one hour after the read, so fetch it again with
GetCampaignAssetwhen it returns 403; an image already on DG's public CDN comes back as that stable URL. A stored reference outside this asset's storage, or not a raster image, is never signed, and the value is omitted. The signed URL serves the image as its image type, whatever the upload declared.- the
- the
-
fromLinkedAssetId
Create an instance of this class withlinkedAssetId()initialized to the given value.The asset an
AssetLinkfield names: the id of an asset on the same campaign, of the field's category. It is a prerequisite of this asset while linked, so it activates first, this asset cannot start until it is live, and it cannot be deleted.- Parameters:
linkedAssetId- The asset anAssetLinkfield names: the id of an asset on the same campaign, of the field's category. It is a prerequisite of this asset while linked, so it activates first, this asset cannot start until it is live, and it cannot be deleted.
-
fromCampaignAssetImage
public static TemplateFieldValue fromCampaignAssetImage(CampaignAssetImageSource campaignAssetImage) Create an instance of this class withcampaignAssetImage()initialized to the given value.Write only. Copies an image stored on another of your assets into this image field. The image is checked against this field's constraints and not scanned again. Also requires
partnercentral:GetCampaignAsseton the source campaign. Reads return the copy asImageReference.- Parameters:
campaignAssetImage- Write only. Copies an image stored on another of your assets into this image field. The image is checked against this field's constraints and not scanned again. Also requirespartnercentral:GetCampaignAsseton the source campaign. Reads return the copy asImageReference.
-
fromCampaignAssetImage
public static TemplateFieldValue fromCampaignAssetImage(Consumer<CampaignAssetImageSource.Builder> campaignAssetImage) Create an instance of this class withcampaignAssetImage()initialized to the given value.Write only. Copies an image stored on another of your assets into this image field. The image is checked against this field's constraints and not scanned again. Also requires
partnercentral:GetCampaignAsseton the source campaign. Reads return the copy asImageReference.- Parameters:
campaignAssetImage- Write only. Copies an image stored on another of your assets into this image field. The image is checked against this field's constraints and not scanned again. Also requirespartnercentral:GetCampaignAsseton the source campaign. Reads return the copy asImageReference.
-
type
Retrieve an enum value representing which member of this object is populated. When this class is returned in a service response, this will beTemplateFieldValue.Type.UNKNOWN_TO_SDK_VERSIONif the service returned a member that is only known to a newer SDK version. When this class is created directly in your code, this will beTemplateFieldValue.Type.UNKNOWN_TO_SDK_VERSIONif zero members are set, andnullif more than one member is set. -
sdkFields
-
sdkFieldNameToField
- Specified by:
sdkFieldNameToFieldin interfaceSdkPojo- Returns:
- The mapping between the field name and its corresponding field.
-