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.



331
332
333
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 331

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>)


266
267
268
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 266

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>)


271
272
273
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 271

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)


277
278
279
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 277

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)


284
285
286
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 284

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>)


291
292
293
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 291

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>)


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

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>)


305
306
307
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 305

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)


311
312
313
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 311

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)


318
319
320
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 318

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>)


324
325
326
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 324

def surface
  @surface
end

#typeArray<String>

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

Returns:

  • (Array<String>)


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