Class: Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaRuleReplacementAction

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/retail_v2alpha/classes.rb,
lib/google/apis/retail_v2alpha/representations.rb,
lib/google/apis/retail_v2alpha/representations.rb

Overview

Replaces a term in the query. Multiple replacement candidates can be specified. All query_terms will be replaced with the replacement term. Example: Replace "gShoe" with "google shoe".

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudRetailV2alphaRuleReplacementAction

Returns a new instance of GoogleCloudRetailV2alphaRuleReplacementAction.



3583
3584
3585
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 3583

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#query_termsArray<String>

Terms from the search query. Will be replaced by replacement term. Can specify up to 100 terms. Corresponds to the JSON property queryTerms

Returns:

  • (Array<String>)


3571
3572
3573
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 3571

def query_terms
  @query_terms
end

#replacement_termString

Term that will be used for replacement. Corresponds to the JSON property replacementTerm

Returns:

  • (String)


3576
3577
3578
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 3576

def replacement_term
  @replacement_term
end

#termString

Will be [deprecated = true] post migration; Corresponds to the JSON property term

Returns:

  • (String)


3581
3582
3583
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 3581

def term
  @term
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



3588
3589
3590
3591
3592
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 3588

def update!(**args)
  @query_terms = args[:query_terms] if args.key?(:query_terms)
  @replacement_term = args[:replacement_term] if args.key?(:replacement_term)
  @term = args[:term] if args.key?(:term)
end