Class: Google::Apis::RetailV2beta::GoogleCloudRetailV2betaRuleReplacementAction

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/retail_v2beta/classes.rb,
lib/google/apis/retail_v2beta/representations.rb,
lib/google/apis/retail_v2beta/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) ⇒ GoogleCloudRetailV2betaRuleReplacementAction

Returns a new instance of GoogleCloudRetailV2betaRuleReplacementAction.



6858
6859
6860
# File 'lib/google/apis/retail_v2beta/classes.rb', line 6858

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>)


6846
6847
6848
# File 'lib/google/apis/retail_v2beta/classes.rb', line 6846

def query_terms
  @query_terms
end

#replacement_termString

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

Returns:

  • (String)


6851
6852
6853
# File 'lib/google/apis/retail_v2beta/classes.rb', line 6851

def replacement_term
  @replacement_term
end

#termString

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

Returns:

  • (String)


6856
6857
6858
# File 'lib/google/apis/retail_v2beta/classes.rb', line 6856

def term
  @term
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



6863
6864
6865
6866
6867
# File 'lib/google/apis/retail_v2beta/classes.rb', line 6863

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