Class ServingConfig.MediaConfig.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<ServingConfig.MediaConfig.Builder>
com.google.cloud.discoveryengine.v1beta.ServingConfig.MediaConfig.Builder
All Implemented Interfaces:
ServingConfig.MediaConfigOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
Enclosing class:
ServingConfig.MediaConfig

public static final class ServingConfig.MediaConfig.Builder extends com.google.protobuf.GeneratedMessage.Builder<ServingConfig.MediaConfig.Builder> implements ServingConfig.MediaConfigOrBuilder
 Specifies the configurations needed for Media Discovery. Currently we
 support:

 * `demote_content_watched`: Threshold for watched content demotion.
 Customers can specify if using watched content demotion or use viewed
 detail page. Using the content watched demotion, customers need to specify
 the watched minutes or percentage exceeds the threshold, the content will
 be demoted in the recommendation result.
 * `promote_fresh_content`: cutoff days for fresh content promotion.
 Customers can specify if using content freshness promotion. If the content
 was published within the cutoff days, the content will be promoted in the
 recommendation result.
 Can only be set if
 [SolutionType][google.cloud.discoveryengine.v1beta.SolutionType] is
 [SOLUTION_TYPE_RECOMMENDATION][google.cloud.discoveryengine.v1beta.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
 
Protobuf type google.cloud.discoveryengine.v1beta.ServingConfig.MediaConfig
  • Method Details

    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage.Builder<ServingConfig.MediaConfig.Builder>
    • clear

      Specified by:
      clear in interface com.google.protobuf.Message.Builder
      Specified by:
      clear in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clear in class com.google.protobuf.GeneratedMessage.Builder<ServingConfig.MediaConfig.Builder>
    • getDescriptorForType

      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
      Specified by:
      getDescriptorForType in interface com.google.protobuf.Message.Builder
      Specified by:
      getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
      Overrides:
      getDescriptorForType in class com.google.protobuf.GeneratedMessage.Builder<ServingConfig.MediaConfig.Builder>
    • getDefaultInstanceForType

      public ServingConfig.MediaConfig getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
    • build

      public ServingConfig.MediaConfig build()
      Specified by:
      build in interface com.google.protobuf.Message.Builder
      Specified by:
      build in interface com.google.protobuf.MessageLite.Builder
    • buildPartial

      public ServingConfig.MediaConfig buildPartial()
      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.Builder
    • mergeFrom

      public ServingConfig.MediaConfig.Builder mergeFrom(com.google.protobuf.Message other)
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<ServingConfig.MediaConfig.Builder>
    • mergeFrom

    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessage.Builder<ServingConfig.MediaConfig.Builder>
    • mergeFrom

      public ServingConfig.MediaConfig.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Specified by:
      mergeFrom in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<ServingConfig.MediaConfig.Builder>
      Throws:
      IOException
    • getDemoteContentWatchedCase

      public ServingConfig.MediaConfig.DemoteContentWatchedCase getDemoteContentWatchedCase()
      Specified by:
      getDemoteContentWatchedCase in interface ServingConfig.MediaConfigOrBuilder
    • clearDemoteContentWatched

      public ServingConfig.MediaConfig.Builder clearDemoteContentWatched()
    • hasContentWatchedPercentageThreshold

      public boolean hasContentWatchedPercentageThreshold()
       Specifies the content watched percentage threshold for demotion.
       Threshold value must be between [0, 1.0] inclusive.
       
      float content_watched_percentage_threshold = 2;
      Specified by:
      hasContentWatchedPercentageThreshold in interface ServingConfig.MediaConfigOrBuilder
      Returns:
      Whether the contentWatchedPercentageThreshold field is set.
    • getContentWatchedPercentageThreshold

      public float getContentWatchedPercentageThreshold()
       Specifies the content watched percentage threshold for demotion.
       Threshold value must be between [0, 1.0] inclusive.
       
      float content_watched_percentage_threshold = 2;
      Specified by:
      getContentWatchedPercentageThreshold in interface ServingConfig.MediaConfigOrBuilder
      Returns:
      The contentWatchedPercentageThreshold.
    • setContentWatchedPercentageThreshold

      public ServingConfig.MediaConfig.Builder setContentWatchedPercentageThreshold(float value)
       Specifies the content watched percentage threshold for demotion.
       Threshold value must be between [0, 1.0] inclusive.
       
      float content_watched_percentage_threshold = 2;
      Parameters:
      value - The contentWatchedPercentageThreshold to set.
      Returns:
      This builder for chaining.
    • clearContentWatchedPercentageThreshold

      public ServingConfig.MediaConfig.Builder clearContentWatchedPercentageThreshold()
       Specifies the content watched percentage threshold for demotion.
       Threshold value must be between [0, 1.0] inclusive.
       
      float content_watched_percentage_threshold = 2;
      Returns:
      This builder for chaining.
    • hasContentWatchedSecondsThreshold

      public boolean hasContentWatchedSecondsThreshold()
       Specifies the content watched minutes threshold for demotion.
       
      float content_watched_seconds_threshold = 5;
      Specified by:
      hasContentWatchedSecondsThreshold in interface ServingConfig.MediaConfigOrBuilder
      Returns:
      Whether the contentWatchedSecondsThreshold field is set.
    • getContentWatchedSecondsThreshold

      public float getContentWatchedSecondsThreshold()
       Specifies the content watched minutes threshold for demotion.
       
      float content_watched_seconds_threshold = 5;
      Specified by:
      getContentWatchedSecondsThreshold in interface ServingConfig.MediaConfigOrBuilder
      Returns:
      The contentWatchedSecondsThreshold.
    • setContentWatchedSecondsThreshold

      public ServingConfig.MediaConfig.Builder setContentWatchedSecondsThreshold(float value)
       Specifies the content watched minutes threshold for demotion.
       
      float content_watched_seconds_threshold = 5;
      Parameters:
      value - The contentWatchedSecondsThreshold to set.
      Returns:
      This builder for chaining.
    • clearContentWatchedSecondsThreshold

      public ServingConfig.MediaConfig.Builder clearContentWatchedSecondsThreshold()
       Specifies the content watched minutes threshold for demotion.
       
      float content_watched_seconds_threshold = 5;
      Returns:
      This builder for chaining.
    • getDemotionEventType

      public String getDemotionEventType()
       Specifies the event type used for demoting recommendation result.
       Currently supported values:
      
       * `view-item`: Item viewed.
       * `media-play`: Start/resume watching a video, playing a song, etc.
       * `media-complete`: Finished or stopped midway through a video, song,
       etc.
      
       If unset, watch history demotion will not be applied. Content freshness
       demotion will still be applied.
       
      string demotion_event_type = 1;
      Specified by:
      getDemotionEventType in interface ServingConfig.MediaConfigOrBuilder
      Returns:
      The demotionEventType.
    • getDemotionEventTypeBytes

      public com.google.protobuf.ByteString getDemotionEventTypeBytes()
       Specifies the event type used for demoting recommendation result.
       Currently supported values:
      
       * `view-item`: Item viewed.
       * `media-play`: Start/resume watching a video, playing a song, etc.
       * `media-complete`: Finished or stopped midway through a video, song,
       etc.
      
       If unset, watch history demotion will not be applied. Content freshness
       demotion will still be applied.
       
      string demotion_event_type = 1;
      Specified by:
      getDemotionEventTypeBytes in interface ServingConfig.MediaConfigOrBuilder
      Returns:
      The bytes for demotionEventType.
    • setDemotionEventType

      public ServingConfig.MediaConfig.Builder setDemotionEventType(String value)
       Specifies the event type used for demoting recommendation result.
       Currently supported values:
      
       * `view-item`: Item viewed.
       * `media-play`: Start/resume watching a video, playing a song, etc.
       * `media-complete`: Finished or stopped midway through a video, song,
       etc.
      
       If unset, watch history demotion will not be applied. Content freshness
       demotion will still be applied.
       
      string demotion_event_type = 1;
      Parameters:
      value - The demotionEventType to set.
      Returns:
      This builder for chaining.
    • clearDemotionEventType

      public ServingConfig.MediaConfig.Builder clearDemotionEventType()
       Specifies the event type used for demoting recommendation result.
       Currently supported values:
      
       * `view-item`: Item viewed.
       * `media-play`: Start/resume watching a video, playing a song, etc.
       * `media-complete`: Finished or stopped midway through a video, song,
       etc.
      
       If unset, watch history demotion will not be applied. Content freshness
       demotion will still be applied.
       
      string demotion_event_type = 1;
      Returns:
      This builder for chaining.
    • setDemotionEventTypeBytes

      public ServingConfig.MediaConfig.Builder setDemotionEventTypeBytes(com.google.protobuf.ByteString value)
       Specifies the event type used for demoting recommendation result.
       Currently supported values:
      
       * `view-item`: Item viewed.
       * `media-play`: Start/resume watching a video, playing a song, etc.
       * `media-complete`: Finished or stopped midway through a video, song,
       etc.
      
       If unset, watch history demotion will not be applied. Content freshness
       demotion will still be applied.
       
      string demotion_event_type = 1;
      Parameters:
      value - The bytes for demotionEventType to set.
      Returns:
      This builder for chaining.
    • getDemoteContentWatchedPastDays

      public int getDemoteContentWatchedPastDays()
       Optional. Specifies the number of days to look back for demoting watched
       content. If set to zero or unset, defaults to the maximum of 365 days.
       
      int32 demote_content_watched_past_days = 37 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getDemoteContentWatchedPastDays in interface ServingConfig.MediaConfigOrBuilder
      Returns:
      The demoteContentWatchedPastDays.
    • setDemoteContentWatchedPastDays

      public ServingConfig.MediaConfig.Builder setDemoteContentWatchedPastDays(int value)
       Optional. Specifies the number of days to look back for demoting watched
       content. If set to zero or unset, defaults to the maximum of 365 days.
       
      int32 demote_content_watched_past_days = 37 [(.google.api.field_behavior) = OPTIONAL];
      Parameters:
      value - The demoteContentWatchedPastDays to set.
      Returns:
      This builder for chaining.
    • clearDemoteContentWatchedPastDays

      public ServingConfig.MediaConfig.Builder clearDemoteContentWatchedPastDays()
       Optional. Specifies the number of days to look back for demoting watched
       content. If set to zero or unset, defaults to the maximum of 365 days.
       
      int32 demote_content_watched_past_days = 37 [(.google.api.field_behavior) = OPTIONAL];
      Returns:
      This builder for chaining.
    • getContentFreshnessCutoffDays

      public int getContentFreshnessCutoffDays()
       Specifies the content freshness used for recommendation result.
       Contents will be demoted if contents were published for more than content
       freshness cutoff days.
       
      int32 content_freshness_cutoff_days = 4;
      Specified by:
      getContentFreshnessCutoffDays in interface ServingConfig.MediaConfigOrBuilder
      Returns:
      The contentFreshnessCutoffDays.
    • setContentFreshnessCutoffDays

      public ServingConfig.MediaConfig.Builder setContentFreshnessCutoffDays(int value)
       Specifies the content freshness used for recommendation result.
       Contents will be demoted if contents were published for more than content
       freshness cutoff days.
       
      int32 content_freshness_cutoff_days = 4;
      Parameters:
      value - The contentFreshnessCutoffDays to set.
      Returns:
      This builder for chaining.
    • clearContentFreshnessCutoffDays

      public ServingConfig.MediaConfig.Builder clearContentFreshnessCutoffDays()
       Specifies the content freshness used for recommendation result.
       Contents will be demoted if contents were published for more than content
       freshness cutoff days.
       
      int32 content_freshness_cutoff_days = 4;
      Returns:
      This builder for chaining.