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



253
254
255
# File 'generated/google/apis/surveys_v2/classes.rb', line 253

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


216
217
218
# File 'generated/google/apis/surveys_v2/classes.rb', line 216

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)


223
224
225
# File 'generated/google/apis/surveys_v2/classes.rb', line 223

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)


231
232
233
# File 'generated/google/apis/surveys_v2/classes.rb', line 231

def country_subdivision
  @country_subdivision
end

#genderString

Optional gender to target. Corresponds to the JSON property gender

Returns:

  • (String)


236
237
238
# File 'generated/google/apis/surveys_v2/classes.rb', line 236

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


246
247
248
# File 'generated/google/apis/surveys_v2/classes.rb', line 246

def languages
  @languages
end

#population_sourceString

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

Returns:

  • (String)


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