Class: Google::Apis::SurveysV2::SurveyAudience

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
generated/google/apis/surveys_v2/classes.rb,
generated/google/apis/surveys_v2/representations.rb,
generated/google/apis/surveys_v2/representations.rb

Overview

Specifications for the target audience of a survey run through the API.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ SurveyAudience

Returns a new instance of SurveyAudience



357
358
359
# File 'generated/google/apis/surveys_v2/classes.rb', line 357

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

Instance Attribute Details

#agesArray<String>

Optional list of age buckets to target. Supported age buckets are: ['18-24', ' 25-34', '35-44', '45-54', '55-64', '65+'] Corresponds to the JSON property ages

Returns:

  • (Array<String>)


313
314
315
# File 'generated/google/apis/surveys_v2/classes.rb', line 313

def ages
  @ages
end

#countryString

Required country code that surveys should be targeted to. Accepts standard ISO 3166-1 2 character language codes. For instance, 'US' for the United States, and 'GB' for the United Kingdom. Corresponds to the JSON property country

Returns:

  • (String)


320
321
322
# File 'generated/google/apis/surveys_v2/classes.rb', line 320

def country
  @country
end

#country_subdivisionString

Country subdivision (states/provinces/etc) that surveys should be targeted to. For all countries except GB, ISO-3166-2 subdivision code is required (eg. 'US- OH' for Ohio, United States). For GB, NUTS 1 statistical region codes for the United Kingdom is required (eg. 'UK-UKC' for North East England). Corresponds to the JSON property countrySubdivision

Returns:

  • (String)


328
329
330
# File 'generated/google/apis/surveys_v2/classes.rb', line 328

def country_subdivision
  @country_subdivision
end

#genderString

Optional gender to target. Corresponds to the JSON property gender

Returns:

  • (String)


333
334
335
# File 'generated/google/apis/surveys_v2/classes.rb', line 333

def gender
  @gender
end

#languagesArray<String>

Language code that surveys should be targeted to. For instance, 'en-US'. Surveys may target bilingual users by specifying a list of language codes (for example, 'de' and 'en-US'). In that case, all languages will be used for targeting users but the survey content (which is displayed) must match the first language listed. Accepts standard BCP47 language codes. See specification. Corresponds to the JSON property languages

Returns:

  • (Array<String>)


343
344
345
# File 'generated/google/apis/surveys_v2/classes.rb', line 343

def languages
  @languages
end

#mobile_app_panel_idString

Key for predefined panel that causes survey to be sent to a predefined set of Opinion Rewards App users. You must set PopulationSource to ANDROID_APP_PANEL to use this field. Corresponds to the JSON property mobileAppPanelId

Returns:

  • (String)


350
351
352
# File 'generated/google/apis/surveys_v2/classes.rb', line 350

def mobile_app_panel_id
  @mobile_app_panel_id
end

#population_sourceString

Online population source where the respondents are sampled from. Corresponds to the JSON property populationSource

Returns:

  • (String)


355
356
357
# File 'generated/google/apis/surveys_v2/classes.rb', line 355

def population_source
  @population_source
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



362
363
364
365
366
367
368
369
370
# File 'generated/google/apis/surveys_v2/classes.rb', line 362

def update!(**args)
  @ages = args[:ages] if args.key?(:ages)
  @country = args[:country] if args.key?(:country)
  @country_subdivision = args[:country_subdivision] if args.key?(:country_subdivision)
  @gender = args[:gender] if args.key?(:gender)
  @languages = args[:languages] if args.key?(:languages)
  @mobile_app_panel_id = args[:mobile_app_panel_id] if args.key?(:mobile_app_panel_id)
  @population_source = args[:population_source] if args.key?(:population_source)
end