Class: Google::Apis::DiscoveryengineV1beta::GoogleCloudDiscoveryengineV1betaCustomAttribute

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

Overview

A custom attribute that is not explicitly modeled in a resource, e.g. UserEvent.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudDiscoveryengineV1betaCustomAttribute

Returns a new instance of GoogleCloudDiscoveryengineV1betaCustomAttribute.



8099
8100
8101
# File 'lib/google/apis/discoveryengine_v1beta/classes.rb', line 8099

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

Instance Attribute Details

#numbersArray<Float>

The numerical values of this custom attribute. For example, [2.3, 15.4] when the key is "lengths_cm". Exactly one of CustomAttribute.text or CustomAttribute.numbers should be set. Otherwise, an INVALID_ARGUMENT error is returned. Corresponds to the JSON property numbers

Returns:

  • (Array<Float>)


8088
8089
8090
# File 'lib/google/apis/discoveryengine_v1beta/classes.rb', line 8088

def numbers
  @numbers
end

#textArray<String>

The textual values of this custom attribute. For example, ["yellow", "green"] when the key is "color". Empty string is not allowed. Otherwise, an INVALID_ARGUMENT error is returned. Exactly one of CustomAttribute.text or CustomAttribute.numbers should be set. Otherwise, an INVALID_ARGUMENT error is returned. Corresponds to the JSON property text

Returns:

  • (Array<String>)


8097
8098
8099
# File 'lib/google/apis/discoveryengine_v1beta/classes.rb', line 8097

def text
  @text
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



8104
8105
8106
8107
# File 'lib/google/apis/discoveryengine_v1beta/classes.rb', line 8104

def update!(**args)
  @numbers = args[:numbers] if args.key?(:numbers)
  @text = args[:text] if args.key?(:text)
end