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.
-
#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
253 254 255 |
# File 'generated/google/apis/surveys_v2/classes.rb', line 253 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
216 217 218 |
# File 'generated/google/apis/surveys_v2/classes.rb', line 216 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
223 224 225 |
# File 'generated/google/apis/surveys_v2/classes.rb', line 223 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
231 232 233 |
# File 'generated/google/apis/surveys_v2/classes.rb', line 231 def country_subdivision @country_subdivision end |
#gender ⇒ String
Optional gender to target.
Corresponds to the JSON property gender
236 237 238 |
# File 'generated/google/apis/surveys_v2/classes.rb', line 236 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
246 247 248 |
# File 'generated/google/apis/surveys_v2/classes.rb', line 246 def languages @languages end |
#population_source ⇒ String
Online population source where the respondents are sampled from.
Corresponds to the JSON property populationSource
251 252 253 |
# File 'generated/google/apis/surveys_v2/classes.rb', line 251 def population_source @population_source end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
258 259 260 261 262 263 264 265 |
# File 'generated/google/apis/surveys_v2/classes.rb', line 258 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) @population_source = args[:population_source] if args.key?(:population_source) end |