Class: Google::Apis::SurveysV2::SurveysService
- Inherits:
-
Core::BaseService
- Object
- Core::BaseService
- Google::Apis::SurveysV2::SurveysService
- Defined in:
- generated/google/apis/surveys_v2/service.rb
Overview
Surveys API
Creates and conducts surveys, lists the surveys that an authenticated user owns, and retrieves survey results and information about specified surveys.
Instance Attribute Summary collapse
-
#key ⇒ String
API key.
-
#quota_user ⇒ String
An opaque string that represents a user for quota purposes.
-
#user_ip ⇒ String
Deprecated.
Attributes inherited from Core::BaseService
#authorization, #base_path, #batch_path, #client, #client_options, #request_options, #root_url, #upload_path
Instance Method Summary collapse
-
#delete_survey(survey_url_id, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SurveysV2::SurveysDeleteResponse
Removes a survey from view in all user GET requests.
-
#get_result(survey_url_id, results_get_request_object = nil, fields: nil, quota_user: nil, user_ip: nil, download_dest: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SurveysV2::SurveyResults
Retrieves any survey results that have been produced so far.
-
#get_survey(survey_url_id, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SurveysV2::Survey
Retrieves information about the specified survey.
-
#initialize ⇒ SurveysService
constructor
A new instance of SurveysService.
-
#insert_survey(survey_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SurveysV2::Survey
Creates a survey.
-
#list_surveys(max_results: nil, start_index: nil, token: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SurveysV2::SurveysListResponse
Lists the surveys owned by the authenticated user.
-
#start_survey(resource_id, surveys_start_request_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SurveysV2::SurveysStartResponse
Begins running a survey.
-
#stop_survey(resource_id, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SurveysV2::SurveysStopResponse
Stops a running survey.
-
#update_survey(survey_url_id, survey_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SurveysV2::Survey
Updates a survey.
Methods inherited from Core::BaseService
#batch, #batch_upload, #fetch_all, #http
Methods included from Core::Logging
Constructor Details
#initialize ⇒ SurveysService
Returns a new instance of SurveysService
49 50 51 52 |
# File 'generated/google/apis/surveys_v2/service.rb', line 49 def initialize super('https://www.googleapis.com/', 'surveys/v2/') @batch_path = 'batch/surveys/v2' end |
Instance Attribute Details
#key ⇒ String
Returns API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
38 39 40 |
# File 'generated/google/apis/surveys_v2/service.rb', line 38 def key @key end |
#quota_user ⇒ String
Returns An opaque string that represents a user for quota purposes. Must not exceed 40 characters.
43 44 45 |
# File 'generated/google/apis/surveys_v2/service.rb', line 43 def quota_user @quota_user end |
#user_ip ⇒ String
Returns Deprecated. Please use quotaUser instead.
47 48 49 |
# File 'generated/google/apis/surveys_v2/service.rb', line 47 def user_ip @user_ip end |
Instance Method Details
#delete_survey(survey_url_id, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SurveysV2::SurveysDeleteResponse
Removes a survey from view in all user GET requests.
121 122 123 124 125 126 127 128 129 130 |
# File 'generated/google/apis/surveys_v2/service.rb', line 121 def delete_survey(survey_url_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block) command = make_simple_command(:delete, 'surveys/{surveyUrlId}', ) command.response_representation = Google::Apis::SurveysV2::SurveysDeleteResponse::Representation command.response_class = Google::Apis::SurveysV2::SurveysDeleteResponse command.params['surveyUrlId'] = survey_url_id unless survey_url_id.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? command.query['userIp'] = user_ip unless user_ip.nil? execute_or_queue_command(command, &block) end |
#get_result(survey_url_id, results_get_request_object = nil, fields: nil, quota_user: nil, user_ip: nil, download_dest: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SurveysV2::SurveyResults
Retrieves any survey results that have been produced so far. Results are formatted as an Excel file. You must add "?alt=media" to the URL as an argument to get results.
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'generated/google/apis/surveys_v2/service.rb', line 81 def get_result(survey_url_id, results_get_request_object = nil, fields: nil, quota_user: nil, user_ip: nil, download_dest: nil, options: nil, &block) if download_dest.nil? command = make_simple_command(:get, 'surveys/{surveyUrlId}/results', ) else command = make_download_command(:get, 'surveys/{surveyUrlId}/results', ) command.download_dest = download_dest end command.request_representation = Google::Apis::SurveysV2::ResultsGetRequest::Representation command.request_object = results_get_request_object command.response_representation = Google::Apis::SurveysV2::SurveyResults::Representation command.response_class = Google::Apis::SurveysV2::SurveyResults command.params['surveyUrlId'] = survey_url_id unless survey_url_id.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? command.query['userIp'] = user_ip unless user_ip.nil? execute_or_queue_command(command, &block) end |
#get_survey(survey_url_id, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SurveysV2::Survey
Retrieves information about the specified survey.
154 155 156 157 158 159 160 161 162 163 |
# File 'generated/google/apis/surveys_v2/service.rb', line 154 def get_survey(survey_url_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block) command = make_simple_command(:get, 'surveys/{surveyUrlId}', ) command.response_representation = Google::Apis::SurveysV2::Survey::Representation command.response_class = Google::Apis::SurveysV2::Survey command.params['surveyUrlId'] = survey_url_id unless survey_url_id.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? command.query['userIp'] = user_ip unless user_ip.nil? execute_or_queue_command(command, &block) end |
#insert_survey(survey_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SurveysV2::Survey
Creates a survey.
186 187 188 189 190 191 192 193 194 195 196 |
# File 'generated/google/apis/surveys_v2/service.rb', line 186 def insert_survey(survey_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block) command = make_simple_command(:post, 'surveys', ) command.request_representation = Google::Apis::SurveysV2::Survey::Representation command.request_object = survey_object command.response_representation = Google::Apis::SurveysV2::Survey::Representation command.response_class = Google::Apis::SurveysV2::Survey command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? command.query['userIp'] = user_ip unless user_ip.nil? execute_or_queue_command(command, &block) end |
#list_surveys(max_results: nil, start_index: nil, token: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SurveysV2::SurveysListResponse
Lists the surveys owned by the authenticated user.
221 222 223 224 225 226 227 228 229 230 231 232 |
# File 'generated/google/apis/surveys_v2/service.rb', line 221 def list_surveys(max_results: nil, start_index: nil, token: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block) command = make_simple_command(:get, 'surveys', ) command.response_representation = Google::Apis::SurveysV2::SurveysListResponse::Representation command.response_class = Google::Apis::SurveysV2::SurveysListResponse command.query['maxResults'] = max_results unless max_results.nil? command.query['startIndex'] = start_index unless start_index.nil? command.query['token'] = token unless token.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? command.query['userIp'] = user_ip unless user_ip.nil? execute_or_queue_command(command, &block) end |
#start_survey(resource_id, surveys_start_request_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SurveysV2::SurveysStartResponse
Begins running a survey.
256 257 258 259 260 261 262 263 264 265 266 267 |
# File 'generated/google/apis/surveys_v2/service.rb', line 256 def start_survey(resource_id, surveys_start_request_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block) command = make_simple_command(:post, 'surveys/{resourceId}/start', ) command.request_representation = Google::Apis::SurveysV2::SurveysStartRequest::Representation command.request_object = surveys_start_request_object command.response_representation = Google::Apis::SurveysV2::SurveysStartResponse::Representation command.response_class = Google::Apis::SurveysV2::SurveysStartResponse command.params['resourceId'] = resource_id unless resource_id.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? command.query['userIp'] = user_ip unless user_ip.nil? execute_or_queue_command(command, &block) end |
#stop_survey(resource_id, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SurveysV2::SurveysStopResponse
Stops a running survey.
290 291 292 293 294 295 296 297 298 299 |
# File 'generated/google/apis/surveys_v2/service.rb', line 290 def stop_survey(resource_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block) command = make_simple_command(:post, 'surveys/{resourceId}/stop', ) command.response_representation = Google::Apis::SurveysV2::SurveysStopResponse::Representation command.response_class = Google::Apis::SurveysV2::SurveysStopResponse command.params['resourceId'] = resource_id unless resource_id.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? command.query['userIp'] = user_ip unless user_ip.nil? execute_or_queue_command(command, &block) end |
#update_survey(survey_url_id, survey_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SurveysV2::Survey
Updates a survey. Currently the only property that can be updated is the owners property.
325 326 327 328 329 330 331 332 333 334 335 336 |
# File 'generated/google/apis/surveys_v2/service.rb', line 325 def update_survey(survey_url_id, survey_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block) command = make_simple_command(:put, 'surveys/{surveyUrlId}', ) command.request_representation = Google::Apis::SurveysV2::Survey::Representation command.request_object = survey_object command.response_representation = Google::Apis::SurveysV2::Survey::Representation command.response_class = Google::Apis::SurveysV2::Survey command.params['surveyUrlId'] = survey_url_id unless survey_url_id.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? command.query['userIp'] = user_ip unless user_ip.nil? execute_or_queue_command(command, &block) end |