Class: Google::Apis::SurveysV2::SurveyAudience
- Inherits:
-
Object
- Object
- Google::Apis::SurveysV2::SurveyAudience
- 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
-
#ages ⇒ Array<String>
Optional list of age buckets to target.
-
#country ⇒ String
Required country code that surveys should be targeted to.
-
#country_subdivision ⇒ String
Country subdivision (states/provinces/etc) that surveys should be targeted to.
-
#gender ⇒ String
Optional gender to target.
-
#languages ⇒ Array<String>
Language code that surveys should be targeted to.
-
#mobile_app_panel_id ⇒ String
Key for predefined panel that causes survey to be sent to a predefined set of Opinion Rewards App users.
-
#population_source ⇒ String
Online population source where the respondents are sampled from.
Instance Method Summary collapse
-
#initialize(**args) ⇒ SurveyAudience
constructor
A new instance of SurveyAudience.
-
#update!(**args) ⇒ Object
Update properties of this object.
Methods included from Core::JsonObjectSupport
Methods included from Core::Hashable
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
#ages ⇒ Array<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
313 314 315 |
# File 'generated/google/apis/surveys_v2/classes.rb', line 313 def ages @ages end |
#country ⇒ String
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
320 321 322 |
# File 'generated/google/apis/surveys_v2/classes.rb', line 320 def country @country end |
#country_subdivision ⇒ String
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
328 329 330 |
# File 'generated/google/apis/surveys_v2/classes.rb', line 328 def country_subdivision @country_subdivision end |
#gender ⇒ String
Optional gender to target.
Corresponds to the JSON property gender
333 334 335 |
# File 'generated/google/apis/surveys_v2/classes.rb', line 333 def gender @gender end |
#languages ⇒ Array<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
343 344 345 |
# File 'generated/google/apis/surveys_v2/classes.rb', line 343 def languages @languages end |
#mobile_app_panel_id ⇒ String
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
350 351 352 |
# File 'generated/google/apis/surveys_v2/classes.rb', line 350 def mobile_app_panel_id @mobile_app_panel_id end |
#population_source ⇒ String
Online population source where the respondents are sampled from.
Corresponds to the JSON property populationSource
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 |