Class: Google::Apis::CloudsearchV1::Context

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Context

Returns a new instance of Context.



362
363
364
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 362

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

Instance Attribute Details

#appArray<String>

[Optional] App where the card should be shown. If missing, the card will be shown in TOPAZ. Corresponds to the JSON property app

Returns:

  • (Array<String>)


297
298
299
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 297

def app
  @app
end

#day_of_weekArray<Fixnum>

[Optional] Day of week when the card should be shown, where 0 is Monday. Corresponds to the JSON property dayOfWeek

Returns:

  • (Array<Fixnum>)


302
303
304
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 302

def day_of_week
  @day_of_week
end

#end_date_secFixnum

[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

Returns:

  • (Fixnum)


308
309
310
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 308

def end_date_sec
  @end_date_sec
end

#end_day_offset_secFixnum

[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

Returns:

  • (Fixnum)


315
316
317
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 315

def end_day_offset_sec
  @end_day_offset_sec
end

#localeArray<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

Returns:

  • (Array<String>)


322
323
324
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 322

def locale
  @locale
end

#locationArray<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

Returns:

  • (Array<String>)


329
330
331
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 329

def location
  @location
end

#queryArray<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

Returns:

  • (Array<String>)


336
337
338
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 336

def query
  @query
end

#start_date_secFixnum

[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

Returns:

  • (Fixnum)


342
343
344
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 342

def start_date_sec
  @start_date_sec
end

#start_day_offset_secFixnum

[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

Returns:

  • (Fixnum)


349
350
351
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 349

def start_day_offset_sec
  @start_day_offset_sec
end

#surfaceArray<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

Returns:

  • (Array<String>)


355
356
357
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 355

def surface
  @surface
end

#typeArray<String>

[Required] Type of the card (homepage, Answer or RHS). Corresponds to the JSON property type

Returns:

  • (Array<String>)


360
361
362
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 360

def type
  @type
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



367
368
369
370
371
372
373
374
375
376
377
378
379
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 367

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