Class: Google::Apis::CloudsearchV1::Context
- Inherits:
-
Object
- Object
- Google::Apis::CloudsearchV1::Context
- Includes:
- Google::Apis::Core::Hashable, Google::Apis::Core::JsonObjectSupport
- Defined in:
- lib/google/apis/cloudsearch_v1/classes.rb,
lib/google/apis/cloudsearch_v1/representations.rb,
lib/google/apis/cloudsearch_v1/representations.rb
Instance Attribute Summary collapse
-
#app ⇒ Array<String>
[Optional] App where the card should be shown.
-
#day_of_week ⇒ Array<Fixnum>
[Optional] Day of week when the card should be shown, where 0 is Monday.
-
#end_date_sec ⇒ Fixnum
[Optional] Date (in seconds since epoch) when the card should stop being shown.
-
#end_day_offset_sec ⇒ Fixnum
[Optional] End time in seconds, within a day, when the card should stop being shown if it's within [start_date_sec, end_date_sec].
-
#locale ⇒ Array<String>
[Optional] The locales for which the card should be triggered (e.g., en_US and en_CA).
-
#location ⇒ Array<String>
[Optional] Text-free locations where the card should be shown.
-
#query ⇒ Array<String>
[Required only for Answer and RHS cards - will be ignored for Homepage] cards.
-
#start_date_sec ⇒ Fixnum
[Optional] Date (in seconds since epoch) when the card should start being shown.
-
#start_day_offset_sec ⇒ Fixnum
[Optional] Start time in seconds, within a day, when the card should be shown if it's within [start_date_sec, end_date_sec].
-
#surface ⇒ Array<String>
[Optional] Surface where the card should be shown in.
-
#type ⇒ Array<String>
[Required] Type of the card (homepage, Answer or RHS).
Instance Method Summary collapse
-
#initialize(**args) ⇒ Context
constructor
A new instance of Context.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ Context
Returns a new instance of Context.
331 332 333 |
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 331 def initialize(**args) update!(**args) end |
Instance Attribute Details
#app ⇒ Array<String>
[Optional] App where the card should be shown. If missing, the card will be
shown in TOPAZ.
Corresponds to the JSON property app
266 267 268 |
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 266 def app @app end |
#day_of_week ⇒ Array<Fixnum>
[Optional] Day of week when the card should be shown, where 0 is Monday.
Corresponds to the JSON property dayOfWeek
271 272 273 |
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 271 def day_of_week @day_of_week end |
#end_date_sec ⇒ Fixnum
[Optional] Date (in seconds since epoch) when the card should stop being shown.
If missing, end_date_sec will be set to Jan 1st, 2100.
Corresponds to the JSON property endDateSec
277 278 279 |
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 277 def end_date_sec @end_date_sec end |
#end_day_offset_sec ⇒ Fixnum
[Optional] End time in seconds, within a day, when the card should stop being
shown if it's within [start_date_sec, end_date_sec]. If missing, this is set
to 86400 (24 hours x 3600 sec/hour), i.e., midnight next day.
Corresponds to the JSON property endDayOffsetSec
284 285 286 |
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 284 def end_day_offset_sec @end_day_offset_sec end |
#locale ⇒ Array<String>
[Optional] The locales for which the card should be triggered (e.g., en_US and
en_CA). If missing, the card is going to show to clients regardless of their
locale.
Corresponds to the JSON property locale
291 292 293 |
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 291 def locale @locale end |
#location ⇒ Array<String>
[Optional] Text-free locations where the card should be shown. This is
expected to match the user's location in focus. If no location is specified,
the card will be shown for any location.
Corresponds to the JSON property location
298 299 300 |
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 298 def location @location end |
#query ⇒ Array<String>
[Required only for Answer and RHS cards - will be ignored for Homepage] cards.
It's the exact case-insensitive queries that will trigger the Answer or RHS
card.
Corresponds to the JSON property query
305 306 307 |
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 305 def query @query end |
#start_date_sec ⇒ Fixnum
[Optional] Date (in seconds since epoch) when the card should start being
shown. If missing, start_date_sec will be Jan 1st, 1970 UTC.
Corresponds to the JSON property startDateSec
311 312 313 |
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 311 def start_date_sec @start_date_sec end |
#start_day_offset_sec ⇒ Fixnum
[Optional] Start time in seconds, within a day, when the card should be shown
if it's within [start_date_sec, end_date_sec]. If 0, the card will be shown
from 12:00am on.
Corresponds to the JSON property startDayOffsetSec
318 319 320 |
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 318 def start_day_offset_sec @start_day_offset_sec end |
#surface ⇒ Array<String>
[Optional] Surface where the card should be shown in. If missing, the card
will be shown in any surface.
Corresponds to the JSON property surface
324 325 326 |
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 324 def surface @surface end |
#type ⇒ Array<String>
[Required] Type of the card (homepage, Answer or RHS).
Corresponds to the JSON property type
329 330 331 |
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 329 def type @type end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
336 337 338 339 340 341 342 343 344 345 346 347 348 |
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 336 def update!(**args) @app = args[:app] if args.key?(:app) @day_of_week = args[:day_of_week] if args.key?(:day_of_week) @end_date_sec = args[:end_date_sec] if args.key?(:end_date_sec) @end_day_offset_sec = args[:end_day_offset_sec] if args.key?(:end_day_offset_sec) @locale = args[:locale] if args.key?(:locale) @location = args[:location] if args.key?(:location) @query = args[:query] if args.key?(:query) @start_date_sec = args[:start_date_sec] if args.key?(:start_date_sec) @start_day_offset_sec = args[:start_day_offset_sec] if args.key?(:start_day_offset_sec) @surface = args[:surface] if args.key?(:surface) @type = args[:type] if args.key?(:type) end |