Class TemplateFieldValue

java.lang.Object
software.amazon.awssdk.services.partnercentralmarketing.model.TemplateFieldValue
All Implemented Interfaces:
Serializable, SdkPojo, ToCopyableBuilder<TemplateFieldValue.Builder,TemplateFieldValue>

@Generated("software.amazon.awssdk:codegen") public final class TemplateFieldValue extends Object implements SdkPojo, Serializable, 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:
  • Method Details

    • text

      public final String 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

      public final String 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, use CampaignAssetImage.

      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 GetCampaignAsset when 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, use CampaignAssetImage.

      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 GetCampaignAsset when 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.

    • linkedAssetId

      public final String linkedAssetId()

      The asset an AssetLink field 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 AssetLink field 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

      public final CampaignAssetImageSource 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:GetCampaignAsset on the source campaign. Reads return the copy as ImageReference.

      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:GetCampaignAsset on the source campaign. Reads return the copy as ImageReference.
    • toBuilder

      public TemplateFieldValue.Builder toBuilder()
      Description copied from interface: ToCopyableBuilder
      Take this object and create a builder that contains all of the current property values of this object.
      Specified by:
      toBuilder in interface ToCopyableBuilder<TemplateFieldValue.Builder,TemplateFieldValue>
      Returns:
      a builder for type T
    • builder

      public static TemplateFieldValue.Builder builder()
    • serializableBuilderClass

      public static Class<? extends TemplateFieldValue.Builder> serializableBuilderClass()
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public final boolean equals(Object obj)
      Overrides:
      equals in class Object
    • equalsBySdkFields

      public final boolean equalsBySdkFields(Object obj)
      Description copied from interface: SdkPojo
      Indicates whether some other object is "equal to" this one by SDK fields. An SDK field is a modeled, non-inherited field in an SdkPojo class, and is generated based on a service model.

      If an SdkPojo class does not have any inherited fields, equalsBySdkFields and equals are essentially the same.

      Specified by:
      equalsBySdkFields in interface SdkPojo
      Parameters:
      obj - the object to be compared with
      Returns:
      true if the other object equals to this object by sdk fields, false otherwise.
    • toString

      public final String toString()
      Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be redacted from this string using a placeholder value.
      Overrides:
      toString in class Object
    • getValueForField

      public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz)
    • fromText

      public static TemplateFieldValue fromText(String text)
      Create an instance of this class with text() 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

      public static TemplateFieldValue fromImageReference(String imageReference)
      Create an instance of this class with imageReference() 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, use CampaignAssetImage.

      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 GetCampaignAsset when 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, use CampaignAssetImage .

      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 GetCampaignAsset when 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.

    • fromLinkedAssetId

      public static TemplateFieldValue fromLinkedAssetId(String linkedAssetId)
      Create an instance of this class with linkedAssetId() initialized to the given value.

      The asset an AssetLink field 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 an AssetLink field 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 with campaignAssetImage() 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:GetCampaignAsset on the source campaign. Reads return the copy as ImageReference.

      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 requires partnercentral:GetCampaignAsset on the source campaign. Reads return the copy as ImageReference.
    • fromCampaignAssetImage

      public static TemplateFieldValue fromCampaignAssetImage(Consumer<CampaignAssetImageSource.Builder> campaignAssetImage)
      Create an instance of this class with campaignAssetImage() 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:GetCampaignAsset on the source campaign. Reads return the copy as ImageReference.

      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 requires partnercentral:GetCampaignAsset on the source campaign. Reads return the copy as ImageReference.
    • type

      public TemplateFieldValue.Type type()
      Retrieve an enum value representing which member of this object is populated. When this class is returned in a service response, this will be TemplateFieldValue.Type.UNKNOWN_TO_SDK_VERSION if 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 be TemplateFieldValue.Type.UNKNOWN_TO_SDK_VERSION if zero members are set, and null if more than one member is set.
    • sdkFields

      public final List<SdkField<?>> sdkFields()
      Specified by:
      sdkFields in interface SdkPojo
      Returns:
      List of SdkField in this POJO. May be empty list but should never be null.
    • sdkFieldNameToField

      public final Map<String,SdkField<?>> sdkFieldNameToField()
      Specified by:
      sdkFieldNameToField in interface SdkPojo
      Returns:
      The mapping between the field name and its corresponding field.