Class: Google::Apis::ChatV1::GoogleAppsCardV1DateTimePicker
- Inherits:
-
Object
- Object
- Google::Apis::ChatV1::GoogleAppsCardV1DateTimePicker
- Includes:
- Google::Apis::Core::Hashable, Google::Apis::Core::JsonObjectSupport
- Defined in:
- lib/google/apis/chat_v1/classes.rb,
lib/google/apis/chat_v1/representations.rb,
lib/google/apis/chat_v1/representations.rb
Overview
Lets users input a date, a time, or both a date and a time. Supports form
submission validation. When Action.all_widgets_are_required is set to true
or this widget is specified in Action.required_widgets, the submission
action is blocked unless a value is selected. For an example in Google Chat
apps, see Let a user pick a date and time.
Users can input text or use the picker to select dates and times. If users
input an invalid date or time, the picker shows an error that prompts users to
input the information correctly. Google Workspace add-ons and Chat apps:
Instance Attribute Summary collapse
-
#host_app_data_source ⇒ Google::Apis::ChatV1::HostAppDataSourceMarkup
A data source from a Google Workspace application.
-
#label ⇒ String
The text that prompts users to input a date, a time, or a date and time.
-
#name ⇒ String
The name by which the
DateTimePickeris identified in a form input event. -
#on_change_action ⇒ Google::Apis::ChatV1::GoogleAppsCardV1Action
An action that describes the behavior when the form is submitted.
-
#timezone_offset_date ⇒ Fixnum
The number representing the time zone offset from UTC, in minutes.
-
#type ⇒ String
Whether the widget supports inputting a date, a time, or the date and time.
-
#value_ms_epoch ⇒ Fixnum
The default value displayed in the widget, in milliseconds since Unix epoch time.
Instance Method Summary collapse
-
#initialize(**args) ⇒ GoogleAppsCardV1DateTimePicker
constructor
A new instance of GoogleAppsCardV1DateTimePicker.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ GoogleAppsCardV1DateTimePicker
Returns a new instance of GoogleAppsCardV1DateTimePicker.
2480 2481 2482 |
# File 'lib/google/apis/chat_v1/classes.rb', line 2480 def initialize(**args) update!(**args) end |
Instance Attribute Details
#host_app_data_source ⇒ Google::Apis::ChatV1::HostAppDataSourceMarkup
A data source from a Google Workspace application. The data source populates
available items for a widget.
Corresponds to the JSON property hostAppDataSource
2432 2433 2434 |
# File 'lib/google/apis/chat_v1/classes.rb', line 2432 def host_app_data_source @host_app_data_source end |
#label ⇒ String
The text that prompts users to input a date, a time, or a date and time. For
example, if users are scheduling an appointment, use a label such as
Appointment date or Appointment date and time.
Corresponds to the JSON property label
2439 2440 2441 |
# File 'lib/google/apis/chat_v1/classes.rb', line 2439 def label @label end |
#name ⇒ String
The name by which the DateTimePicker is identified in a form input event.
For details about working with form inputs, see Receive form data.
Corresponds to the JSON property name
2446 2447 2448 |
# File 'lib/google/apis/chat_v1/classes.rb', line 2446 def name @name end |
#on_change_action ⇒ Google::Apis::ChatV1::GoogleAppsCardV1Action
An action that describes the behavior when the form is submitted. For example,
you can invoke an Apps Script script to handle the form. If the action is
triggered, the form values are sent to the server. Google Workspace add-ons
and Chat apps:
Corresponds to the JSON property onChangeAction
2454 2455 2456 |
# File 'lib/google/apis/chat_v1/classes.rb', line 2454 def on_change_action @on_change_action end |
#timezone_offset_date ⇒ Fixnum
The number representing the time zone offset from UTC, in minutes. If set, the
value_ms_epoch is displayed in the specified time zone. If unset, the value
defaults to the user's time zone setting.
Corresponds to the JSON property timezoneOffsetDate
2461 2462 2463 |
# File 'lib/google/apis/chat_v1/classes.rb', line 2461 def timezone_offset_date @timezone_offset_date end |
#type ⇒ String
Whether the widget supports inputting a date, a time, or the date and time.
Corresponds to the JSON property type
2466 2467 2468 |
# File 'lib/google/apis/chat_v1/classes.rb', line 2466 def type @type end |
#value_ms_epoch ⇒ Fixnum
The default value displayed in the widget, in milliseconds since Unix epoch
time. Specify the value based on the
type of picker (DateTimePickerType): * DATE_AND_TIME: a calendar date and
time in UTC. For example, to represent January 1, 2023 at 12:00 PM UTC, use
1672574400000. * DATE_ONLY: a calendar date at 00:00:00 UTC. For example,
to represent January 1, 2023, use 1672531200000. * TIME_ONLY: a time in
UTC. For example, to represent 12:00 PM, use 43200000 (or 12 * 60 * 60 *
1000).
Corresponds to the JSON property valueMsEpoch
2478 2479 2480 |
# File 'lib/google/apis/chat_v1/classes.rb', line 2478 def value_ms_epoch @value_ms_epoch end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
2485 2486 2487 2488 2489 2490 2491 2492 2493 |
# File 'lib/google/apis/chat_v1/classes.rb', line 2485 def update!(**args) @host_app_data_source = args[:host_app_data_source] if args.key?(:host_app_data_source) @label = args[:label] if args.key?(:label) @name = args[:name] if args.key?(:name) @on_change_action = args[:on_change_action] if args.key?(:on_change_action) @timezone_offset_date = args[:timezone_offset_date] if args.key?(:timezone_offset_date) @type = args[:type] if args.key?(:type) @value_ms_epoch = args[:value_ms_epoch] if args.key?(:value_ms_epoch) end |