Class: Google::Apis::ContentV2_1::InputField

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

Overview

Input field that needs to be available to the merchant. If the field is marked as required, then a value needs to be provided for a successful processing of the request.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ InputField

Returns a new instance of InputField.



5272
5273
5274
# File 'lib/google/apis/content_v2_1/classes.rb', line 5272

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

Instance Attribute Details

#checkbox_inputGoogle::Apis::ContentV2_1::InputFieldCheckboxInput

Checkbox input allows merchants to provide a boolean value. Corresponds to the html input type=checkbox. If merchant checks the box, the input value for the field is true, otherwise it is false. This type of input is often used as a confirmation that the merchant completed required steps before they are allowed to start the action. In such a case, the input field is marked as required and the button to trigger the action should stay disabled until the merchant checks the box. Corresponds to the JSON property checkboxInput



5238
5239
5240
# File 'lib/google/apis/content_v2_1/classes.rb', line 5238

def checkbox_input
  @checkbox_input
end

#choice_inputGoogle::Apis::ContentV2_1::InputFieldChoiceInput

Choice input allows merchants to select one of the offered choices. Some choices may be linked to additional input fields that should be displayed under or next to the choice option. The value for the additional input field needs to be provided only when the specific choice is selected by the merchant. For example, additional input field can be hidden or disabled until the merchant selects the specific choice. Corresponds to the JSON property choiceInput



5248
5249
5250
# File 'lib/google/apis/content_v2_1/classes.rb', line 5248

def choice_input
  @choice_input
end

#idString

Not for display but need to be sent back for the given input field. Corresponds to the JSON property id

Returns:

  • (String)


5253
5254
5255
# File 'lib/google/apis/content_v2_1/classes.rb', line 5253

def id
  @id
end

#labelGoogle::Apis::ContentV2_1::TextWithTooltip

Block of text that may contain a tooltip with more information. Corresponds to the JSON property label



5258
5259
5260
# File 'lib/google/apis/content_v2_1/classes.rb', line 5258

def label
  @label
end

#requiredBoolean Also known as: required?

Whether the field is required. The action button needs to stay disabled till values for all required fields are provided. Corresponds to the JSON property required

Returns:

  • (Boolean)


5264
5265
5266
# File 'lib/google/apis/content_v2_1/classes.rb', line 5264

def required
  @required
end

#text_inputGoogle::Apis::ContentV2_1::InputFieldTextInput

Text input allows merchants to provide a text value. Corresponds to the JSON property textInput



5270
5271
5272
# File 'lib/google/apis/content_v2_1/classes.rb', line 5270

def text_input
  @text_input
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



5277
5278
5279
5280
5281
5282
5283
5284
# File 'lib/google/apis/content_v2_1/classes.rb', line 5277

def update!(**args)
  @checkbox_input = args[:checkbox_input] if args.key?(:checkbox_input)
  @choice_input = args[:choice_input] if args.key?(:choice_input)
  @id = args[:id] if args.key?(:id)
  @label = args[:label] if args.key?(:label)
  @required = args[:required] if args.key?(:required)
  @text_input = args[:text_input] if args.key?(:text_input)
end