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
Available to use for quota purposes for server-side applications.
-
#user_ip ⇒ String
IP address of the site where the request originates.
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_mobileapppanel(panel_id, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SurveysV2::MobileAppPanel
Retrieves a MobileAppPanel that is available to the authenticated user.
-
#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_mobileapppanels(max_results: nil, start_index: nil, token: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SurveysV2::MobileAppPanelsListResponse
Lists the MobileAppPanels available to the authenticated user.
-
#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_mobileapppanel(panel_id, mobile_app_panel_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SurveysV2::MobileAppPanel
Updates a MobileAppPanel.
-
#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
51 52 53 54 |
# File 'generated/google/apis/surveys_v2/service.rb', line 51 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 Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.
44 45 46 |
# File 'generated/google/apis/surveys_v2/service.rb', line 44 def quota_user @quota_user end |
#user_ip ⇒ String
Returns IP address of the site where the request originates. Use this if you want to enforce per-user limits.
49 50 51 |
# File 'generated/google/apis/surveys_v2/service.rb', line 49 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.
239 240 241 242 243 244 245 246 247 248 |
# File 'generated/google/apis/surveys_v2/service.rb', line 239 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_mobileapppanel(panel_id, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SurveysV2::MobileAppPanel
Retrieves a MobileAppPanel that is available to the authenticated user.
80 81 82 83 84 85 86 87 88 89 |
# File 'generated/google/apis/surveys_v2/service.rb', line 80 def get_mobileapppanel(panel_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block) command = make_simple_command(:get, 'mobileAppPanels/{panelId}', ) command.response_representation = Google::Apis::SurveysV2::MobileAppPanel::Representation command.response_class = Google::Apis::SurveysV2::MobileAppPanel command.params['panelId'] = panel_id unless panel_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.
197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 |
# File 'generated/google/apis/surveys_v2/service.rb', line 197 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.
274 275 276 277 278 279 280 281 282 283 |
# File 'generated/google/apis/surveys_v2/service.rb', line 274 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.
308 309 310 311 312 313 314 315 316 317 318 |
# File 'generated/google/apis/surveys_v2/service.rb', line 308 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_mobileapppanels(max_results: nil, start_index: nil, token: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SurveysV2::MobileAppPanelsListResponse
Lists the MobileAppPanels available to the authenticated user.
116 117 118 119 120 121 122 123 124 125 126 127 |
# File 'generated/google/apis/surveys_v2/service.rb', line 116 def list_mobileapppanels(max_results: nil, start_index: nil, token: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block) command = make_simple_command(:get, 'mobileAppPanels', ) command.response_representation = Google::Apis::SurveysV2::MobileAppPanelsListResponse::Representation command.response_class = Google::Apis::SurveysV2::MobileAppPanelsListResponse 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 |
#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.
345 346 347 348 349 350 351 352 353 354 355 356 |
# File 'generated/google/apis/surveys_v2/service.rb', line 345 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.
382 383 384 385 386 387 388 389 390 391 392 393 |
# File 'generated/google/apis/surveys_v2/service.rb', line 382 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.
418 419 420 421 422 423 424 425 426 427 |
# File 'generated/google/apis/surveys_v2/service.rb', line 418 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_mobileapppanel(panel_id, mobile_app_panel_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SurveysV2::MobileAppPanel
Updates a MobileAppPanel. Currently the only property that can be updated is the owners property.
155 156 157 158 159 160 161 162 163 164 165 166 |
# File 'generated/google/apis/surveys_v2/service.rb', line 155 def update_mobileapppanel(panel_id, mobile_app_panel_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block) command = make_simple_command(:put, 'mobileAppPanels/{panelId}', ) command.request_representation = Google::Apis::SurveysV2::MobileAppPanel::Representation command.request_object = mobile_app_panel_object command.response_representation = Google::Apis::SurveysV2::MobileAppPanel::Representation command.response_class = Google::Apis::SurveysV2::MobileAppPanel command.params['panelId'] = panel_id unless panel_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.
455 456 457 458 459 460 461 462 463 464 465 466 |
# File 'generated/google/apis/surveys_v2/service.rb', line 455 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 |