google-api-client 0.10.2 → 0.10.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (248) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +25 -0
  3. data/MIGRATING.md +22 -7
  4. data/README.md +4 -8
  5. data/api_names.yaml +1210 -37815
  6. data/generated/google/apis/acceleratedmobilepageurl_v1.rb +32 -0
  7. data/generated/google/apis/acceleratedmobilepageurl_v1/classes.rb +144 -0
  8. data/generated/google/apis/acceleratedmobilepageurl_v1/representations.rb +86 -0
  9. data/generated/google/apis/acceleratedmobilepageurl_v1/service.rb +90 -0
  10. data/generated/google/apis/adexchangebuyer2_v2beta1.rb +1 -1
  11. data/generated/google/apis/adexchangebuyer2_v2beta1/classes.rb +764 -764
  12. data/generated/google/apis/adexchangebuyer2_v2beta1/representations.rb +180 -180
  13. data/generated/google/apis/adexchangebuyer2_v2beta1/service.rb +421 -421
  14. data/generated/google/apis/adexchangebuyer_v1_4/classes.rb +1 -0
  15. data/generated/google/apis/admin_directory_v1/classes.rb +1 -0
  16. data/generated/google/apis/admin_reports_v1.rb +1 -1
  17. data/generated/google/apis/adsense_v1_4.rb +1 -1
  18. data/generated/google/apis/adsensehost_v4_1.rb +1 -1
  19. data/generated/google/apis/analyticsreporting_v4/classes.rb +187 -187
  20. data/generated/google/apis/analyticsreporting_v4/representations.rb +42 -42
  21. data/generated/google/apis/appengine_v1.rb +40 -0
  22. data/generated/google/apis/appengine_v1/classes.rb +2251 -0
  23. data/generated/google/apis/appengine_v1/representations.rb +858 -0
  24. data/generated/google/apis/appengine_v1/service.rb +894 -0
  25. data/generated/google/apis/bigquery_v2.rb +1 -1
  26. data/generated/google/apis/bigquery_v2/classes.rb +11 -6
  27. data/generated/google/apis/books_v1.rb +1 -1
  28. data/generated/google/apis/books_v1/classes.rb +26 -0
  29. data/generated/google/apis/books_v1/representations.rb +15 -0
  30. data/generated/google/apis/books_v1/service.rb +4 -1
  31. data/generated/google/apis/calendar_v3.rb +1 -1
  32. data/generated/google/apis/classroom_v1.rb +1 -1
  33. data/generated/google/apis/cloudbuild_v1.rb +1 -1
  34. data/generated/google/apis/cloudbuild_v1/classes.rb +638 -637
  35. data/generated/google/apis/cloudbuild_v1/representations.rb +110 -110
  36. data/generated/google/apis/cloudbuild_v1/service.rb +139 -139
  37. data/generated/google/apis/clouddebugger_v2.rb +3 -3
  38. data/generated/google/apis/clouddebugger_v2/classes.rb +131 -131
  39. data/generated/google/apis/clouddebugger_v2/representations.rb +25 -25
  40. data/generated/google/apis/clouderrorreporting_v1beta1.rb +36 -0
  41. data/generated/google/apis/clouderrorreporting_v1beta1/classes.rb +590 -0
  42. data/generated/google/apis/clouderrorreporting_v1beta1/representations.rb +252 -0
  43. data/generated/google/apis/clouderrorreporting_v1beta1/service.rb +350 -0
  44. data/generated/google/apis/cloudfunctions_v1.rb +35 -0
  45. data/generated/google/apis/cloudfunctions_v1/classes.rb +98 -0
  46. data/generated/google/apis/cloudfunctions_v1/representations.rb +57 -0
  47. data/generated/google/apis/cloudfunctions_v1/service.rb +89 -0
  48. data/generated/google/apis/cloudkms_v1/classes.rb +277 -270
  49. data/generated/google/apis/cloudkms_v1/representations.rb +73 -73
  50. data/generated/google/apis/cloudkms_v1/service.rb +194 -194
  51. data/generated/google/apis/cloudresourcemanager_v1.rb +1 -1
  52. data/generated/google/apis/cloudresourcemanager_v1/classes.rb +1147 -1144
  53. data/generated/google/apis/cloudresourcemanager_v1/representations.rb +188 -188
  54. data/generated/google/apis/cloudresourcemanager_v1/service.rb +513 -936
  55. data/generated/google/apis/cloudresourcemanager_v1beta1.rb +1 -1
  56. data/generated/google/apis/cloudresourcemanager_v1beta1/classes.rb +307 -916
  57. data/generated/google/apis/cloudresourcemanager_v1beta1/representations.rb +63 -285
  58. data/generated/google/apis/cloudresourcemanager_v1beta1/service.rb +333 -681
  59. data/generated/google/apis/cloudtrace_v1/classes.rb +38 -38
  60. data/generated/google/apis/cloudtrace_v1/representations.rb +13 -13
  61. data/generated/google/apis/cloudtrace_v1/service.rb +16 -16
  62. data/generated/google/apis/compute_beta.rb +1 -1
  63. data/generated/google/apis/compute_beta/classes.rb +32 -7
  64. data/generated/google/apis/compute_beta/representations.rb +2 -0
  65. data/generated/google/apis/compute_beta/service.rb +11 -11
  66. data/generated/google/apis/compute_v1.rb +1 -1
  67. data/generated/google/apis/compute_v1/classes.rb +95 -2
  68. data/generated/google/apis/compute_v1/representations.rb +33 -0
  69. data/generated/google/apis/dataflow_v1b3/classes.rb +3333 -3333
  70. data/generated/google/apis/dataflow_v1b3/representations.rb +759 -759
  71. data/generated/google/apis/dataflow_v1b3/service.rb +154 -154
  72. data/generated/google/apis/dataproc_v1.rb +1 -1
  73. data/generated/google/apis/dataproc_v1/classes.rb +1097 -1097
  74. data/generated/google/apis/dataproc_v1/representations.rb +200 -200
  75. data/generated/google/apis/dataproc_v1/service.rb +356 -356
  76. data/generated/google/apis/datastore_v1.rb +4 -4
  77. data/generated/google/apis/datastore_v1/classes.rb +701 -690
  78. data/generated/google/apis/datastore_v1/representations.rb +160 -160
  79. data/generated/google/apis/datastore_v1/service.rb +52 -52
  80. data/generated/google/apis/deploymentmanager_v2/classes.rb +4 -0
  81. data/generated/google/apis/doubleclicksearch_v2.rb +1 -1
  82. data/generated/google/apis/drive_v2.rb +1 -1
  83. data/generated/google/apis/drive_v2/classes.rb +158 -35
  84. data/generated/google/apis/drive_v2/representations.rb +39 -0
  85. data/generated/google/apis/drive_v2/service.rb +4 -4
  86. data/generated/google/apis/drive_v3.rb +1 -1
  87. data/generated/google/apis/drive_v3/classes.rb +162 -33
  88. data/generated/google/apis/drive_v3/representations.rb +39 -0
  89. data/generated/google/apis/drive_v3/service.rb +4 -4
  90. data/generated/google/apis/firebasedynamiclinks_v1.rb +35 -0
  91. data/generated/google/apis/firebasedynamiclinks_v1/classes.rb +466 -0
  92. data/generated/google/apis/firebasedynamiclinks_v1/representations.rb +222 -0
  93. data/generated/google/apis/firebasedynamiclinks_v1/service.rb +95 -0
  94. data/generated/google/apis/firebaserules_v1.rb +41 -0
  95. data/generated/google/apis/firebaserules_v1/classes.rb +425 -0
  96. data/generated/google/apis/firebaserules_v1/representations.rb +222 -0
  97. data/generated/google/apis/firebaserules_v1/service.rb +495 -0
  98. data/generated/google/apis/games_v1/classes.rb +4 -0
  99. data/generated/google/apis/genomics_v1.rb +7 -7
  100. data/generated/google/apis/genomics_v1/classes.rb +2336 -2335
  101. data/generated/google/apis/genomics_v1/representations.rb +387 -387
  102. data/generated/google/apis/genomics_v1/service.rb +1187 -1187
  103. data/generated/google/apis/gmail_v1/classes.rb +3 -0
  104. data/generated/google/apis/iam_v1.rb +1 -1
  105. data/generated/google/apis/iam_v1/classes.rb +123 -117
  106. data/generated/google/apis/iam_v1/representations.rb +33 -33
  107. data/generated/google/apis/iam_v1/service.rb +109 -109
  108. data/generated/google/apis/identitytoolkit_v3/classes.rb +5 -0
  109. data/generated/google/apis/kgsearch_v1/classes.rb +6 -6
  110. data/generated/google/apis/kgsearch_v1/representations.rb +1 -1
  111. data/generated/google/apis/kgsearch_v1/service.rb +4 -4
  112. data/generated/google/apis/language_v1.rb +36 -0
  113. data/generated/google/apis/language_v1/classes.rb +757 -0
  114. data/generated/google/apis/language_v1/representations.rb +338 -0
  115. data/generated/google/apis/language_v1/service.rb +185 -0
  116. data/generated/google/apis/language_v1beta1/classes.rb +407 -407
  117. data/generated/google/apis/language_v1beta1/representations.rb +103 -103
  118. data/generated/google/apis/language_v1beta1/service.rb +45 -45
  119. data/generated/google/apis/logging_v2.rb +46 -0
  120. data/generated/google/apis/logging_v2/classes.rb +1271 -0
  121. data/generated/google/apis/logging_v2/representations.rb +421 -0
  122. data/generated/google/apis/logging_v2/service.rb +1569 -0
  123. data/generated/google/apis/logging_v2beta1.rb +1 -1
  124. data/generated/google/apis/logging_v2beta1/classes.rb +886 -886
  125. data/generated/google/apis/logging_v2beta1/representations.rb +132 -132
  126. data/generated/google/apis/logging_v2beta1/service.rb +235 -235
  127. data/generated/google/apis/manufacturers_v1/classes.rb +147 -147
  128. data/generated/google/apis/manufacturers_v1/representations.rb +29 -29
  129. data/generated/google/apis/ml_v1.rb +34 -0
  130. data/generated/google/apis/ml_v1/classes.rb +1617 -0
  131. data/generated/google/apis/ml_v1/representations.rb +498 -0
  132. data/generated/google/apis/ml_v1/service.rb +769 -0
  133. data/generated/google/apis/monitoring_v3.rb +4 -4
  134. data/generated/google/apis/monitoring_v3/classes.rb +630 -630
  135. data/generated/google/apis/monitoring_v3/representations.rb +134 -134
  136. data/generated/google/apis/monitoring_v3/service.rb +240 -240
  137. data/generated/google/apis/pagespeedonline_v2/classes.rb +1 -0
  138. data/generated/google/apis/partners_v2.rb +1 -1
  139. data/generated/google/apis/partners_v2/classes.rb +639 -639
  140. data/generated/google/apis/partners_v2/representations.rb +168 -168
  141. data/generated/google/apis/partners_v2/service.rb +381 -381
  142. data/generated/google/apis/people_v1.rb +10 -10
  143. data/generated/google/apis/people_v1/classes.rb +524 -524
  144. data/generated/google/apis/people_v1/representations.rb +143 -143
  145. data/generated/google/apis/people_v1/service.rb +30 -30
  146. data/generated/google/apis/plus_domains_v1.rb +1 -1
  147. data/generated/google/apis/plus_v1.rb +1 -1
  148. data/generated/google/apis/proximitybeacon_v1beta1/classes.rb +454 -444
  149. data/generated/google/apis/proximitybeacon_v1beta1/representations.rb +90 -90
  150. data/generated/google/apis/proximitybeacon_v1beta1/service.rb +110 -110
  151. data/generated/google/apis/pubsub_v1/classes.rb +175 -173
  152. data/generated/google/apis/pubsub_v1/representations.rb +53 -53
  153. data/generated/google/apis/pubsub_v1/service.rb +210 -210
  154. data/generated/google/apis/replicapool_v1beta2/classes.rb +2 -0
  155. data/generated/google/apis/runtimeconfig_v1.rb +38 -0
  156. data/generated/google/apis/runtimeconfig_v1/classes.rb +252 -0
  157. data/generated/google/apis/runtimeconfig_v1/representations.rb +98 -0
  158. data/generated/google/apis/runtimeconfig_v1/service.rb +176 -0
  159. data/generated/google/apis/script_v1.rb +1 -1
  160. data/generated/google/apis/script_v1/classes.rb +6 -6
  161. data/generated/google/apis/script_v1/representations.rb +1 -1
  162. data/generated/google/apis/searchconsole_v1.rb +31 -0
  163. data/generated/google/apis/searchconsole_v1/classes.rb +205 -0
  164. data/generated/google/apis/searchconsole_v1/representations.rb +129 -0
  165. data/generated/google/apis/searchconsole_v1/service.rb +88 -0
  166. data/generated/google/apis/servicecontrol_v1.rb +38 -0
  167. data/generated/google/apis/servicecontrol_v1/classes.rb +1675 -0
  168. data/generated/google/apis/servicecontrol_v1/representations.rb +601 -0
  169. data/generated/google/apis/servicecontrol_v1/service.rb +337 -0
  170. data/generated/google/apis/servicemanagement_v1.rb +45 -0
  171. data/generated/google/apis/servicemanagement_v1/classes.rb +4934 -0
  172. data/generated/google/apis/servicemanagement_v1/representations.rb +1526 -0
  173. data/generated/google/apis/servicemanagement_v1/service.rb +860 -0
  174. data/generated/google/apis/serviceuser_v1.rb +42 -0
  175. data/generated/google/apis/serviceuser_v1/classes.rb +3746 -0
  176. data/generated/google/apis/serviceuser_v1/representations.rb +1041 -0
  177. data/generated/google/apis/serviceuser_v1/service.rb +214 -0
  178. data/generated/google/apis/sheets_v4.rb +3 -3
  179. data/generated/google/apis/sheets_v4/classes.rb +4390 -4390
  180. data/generated/google/apis/sheets_v4/representations.rb +381 -381
  181. data/generated/google/apis/sheets_v4/service.rb +48 -48
  182. data/generated/google/apis/slides_v1.rb +3 -3
  183. data/generated/google/apis/slides_v1/classes.rb +2860 -2860
  184. data/generated/google/apis/slides_v1/representations.rb +693 -693
  185. data/generated/google/apis/slides_v1/service.rb +30 -30
  186. data/generated/google/apis/sourcerepo_v1.rb +34 -0
  187. data/generated/google/apis/sourcerepo_v1/classes.rb +687 -0
  188. data/generated/google/apis/sourcerepo_v1/representations.rb +285 -0
  189. data/generated/google/apis/sourcerepo_v1/service.rb +291 -0
  190. data/generated/google/apis/spanner_v1.rb +35 -0
  191. data/generated/google/apis/spanner_v1/classes.rb +3294 -0
  192. data/generated/google/apis/spanner_v1/representations.rb +984 -0
  193. data/generated/google/apis/spanner_v1/service.rb +1504 -0
  194. data/generated/google/apis/speech_v1beta1.rb +1 -1
  195. data/generated/google/apis/speech_v1beta1/classes.rb +197 -196
  196. data/generated/google/apis/speech_v1beta1/representations.rb +53 -53
  197. data/generated/google/apis/speech_v1beta1/service.rb +27 -27
  198. data/generated/google/apis/storage_v1.rb +1 -1
  199. data/generated/google/apis/storage_v1/classes.rb +131 -0
  200. data/generated/google/apis/storage_v1/representations.rb +51 -0
  201. data/generated/google/apis/storage_v1/service.rb +182 -0
  202. data/generated/google/apis/storagetransfer_v1.rb +1 -1
  203. data/generated/google/apis/storagetransfer_v1/classes.rb +732 -661
  204. data/generated/google/apis/storagetransfer_v1/representations.rb +132 -132
  205. data/generated/google/apis/storagetransfer_v1/service.rb +174 -197
  206. data/generated/google/apis/surveys_v2.rb +40 -0
  207. data/generated/google/apis/surveys_v2/classes.rb +806 -0
  208. data/generated/google/apis/surveys_v2/representations.rb +347 -0
  209. data/generated/google/apis/surveys_v2/service.rb +477 -0
  210. data/generated/google/apis/tagmanager_v2.rb +52 -0
  211. data/generated/google/apis/tagmanager_v2/classes.rb +2435 -0
  212. data/generated/google/apis/tagmanager_v2/representations.rb +993 -0
  213. data/generated/google/apis/tagmanager_v2/service.rb +2865 -0
  214. data/generated/google/apis/toolresults_v1beta3.rb +34 -0
  215. data/generated/google/apis/toolresults_v1beta3/classes.rb +2160 -0
  216. data/generated/google/apis/toolresults_v1beta3/representations.rb +729 -0
  217. data/generated/google/apis/toolresults_v1beta3/service.rb +1236 -0
  218. data/generated/google/apis/tracing_v1.rb +40 -0
  219. data/generated/google/apis/tracing_v1/classes.rb +664 -0
  220. data/generated/google/apis/tracing_v1/representations.rb +279 -0
  221. data/generated/google/apis/tracing_v1/service.rb +225 -0
  222. data/generated/google/apis/vision_v1.rb +1 -1
  223. data/generated/google/apis/vision_v1/classes.rb +1223 -1222
  224. data/generated/google/apis/vision_v1/representations.rb +234 -234
  225. data/generated/google/apis/vision_v1/service.rb +10 -10
  226. data/generated/google/apis/webfonts_v1.rb +33 -0
  227. data/generated/google/apis/webfonts_v1/classes.rb +113 -0
  228. data/generated/google/apis/webfonts_v1/representations.rb +62 -0
  229. data/generated/google/apis/webfonts_v1/service.rb +102 -0
  230. data/generated/google/apis/youtube_analytics_v1.rb +1 -1
  231. data/generated/google/apis/youtube_partner_v1.rb +1 -1
  232. data/generated/google/apis/youtube_partner_v1/classes.rb +31 -0
  233. data/generated/google/apis/youtube_partner_v1/representations.rb +6 -0
  234. data/generated/google/apis/youtube_partner_v1/service.rb +41 -0
  235. data/generated/google/apis/youtube_v3/classes.rb +1 -0
  236. data/generated/google/apis/youtubereporting_v1.rb +4 -4
  237. data/generated/google/apis/youtubereporting_v1/classes.rb +76 -76
  238. data/generated/google/apis/youtubereporting_v1/representations.rb +25 -25
  239. data/generated/google/apis/youtubereporting_v1/service.rb +95 -95
  240. data/lib/google/apis/generator/annotator.rb +5 -4
  241. data/lib/google/apis/generator/templates/_class.tmpl +3 -0
  242. data/lib/google/apis/version.rb +1 -1
  243. data/samples/cli/lib/samples/adsense.rb +99 -0
  244. data/samples/cli/lib/samples/analytics.rb +18 -0
  245. data/samples/cli/lib/samples/gmail.rb +33 -0
  246. data/samples/cli/lib/samples/vision.rb +69 -0
  247. metadata +89 -4
  248. data/sync.rb +0 -71
@@ -0,0 +1,347 @@
1
+ # Copyright 2015 Google Inc.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'date'
16
+ require 'google/apis/core/base_service'
17
+ require 'google/apis/core/json_representation'
18
+ require 'google/apis/core/hashable'
19
+ require 'google/apis/errors'
20
+
21
+ module Google
22
+ module Apis
23
+ module SurveysV2
24
+
25
+ class FieldMask
26
+ class Representation < Google::Apis::Core::JsonRepresentation; end
27
+
28
+ include Google::Apis::Core::JsonObjectSupport
29
+ end
30
+
31
+ class MobileAppPanel
32
+ class Representation < Google::Apis::Core::JsonRepresentation; end
33
+
34
+ include Google::Apis::Core::JsonObjectSupport
35
+ end
36
+
37
+ class MobileAppPanelsListResponse
38
+ class Representation < Google::Apis::Core::JsonRepresentation; end
39
+
40
+ include Google::Apis::Core::JsonObjectSupport
41
+ end
42
+
43
+ class PageInfo
44
+ class Representation < Google::Apis::Core::JsonRepresentation; end
45
+
46
+ include Google::Apis::Core::JsonObjectSupport
47
+ end
48
+
49
+ class ResultsGetRequest
50
+ class Representation < Google::Apis::Core::JsonRepresentation; end
51
+
52
+ include Google::Apis::Core::JsonObjectSupport
53
+ end
54
+
55
+ class ResultsMask
56
+ class Representation < Google::Apis::Core::JsonRepresentation; end
57
+
58
+ include Google::Apis::Core::JsonObjectSupport
59
+ end
60
+
61
+ class Survey
62
+ class Representation < Google::Apis::Core::JsonRepresentation; end
63
+
64
+ include Google::Apis::Core::JsonObjectSupport
65
+ end
66
+
67
+ class SurveyAudience
68
+ class Representation < Google::Apis::Core::JsonRepresentation; end
69
+
70
+ include Google::Apis::Core::JsonObjectSupport
71
+ end
72
+
73
+ class SurveyCost
74
+ class Representation < Google::Apis::Core::JsonRepresentation; end
75
+
76
+ include Google::Apis::Core::JsonObjectSupport
77
+ end
78
+
79
+ class SurveyQuestion
80
+ class Representation < Google::Apis::Core::JsonRepresentation; end
81
+
82
+ include Google::Apis::Core::JsonObjectSupport
83
+ end
84
+
85
+ class SurveyQuestionImage
86
+ class Representation < Google::Apis::Core::JsonRepresentation; end
87
+
88
+ include Google::Apis::Core::JsonObjectSupport
89
+ end
90
+
91
+ class SurveyRejection
92
+ class Representation < Google::Apis::Core::JsonRepresentation; end
93
+
94
+ include Google::Apis::Core::JsonObjectSupport
95
+ end
96
+
97
+ class SurveyResults
98
+ class Representation < Google::Apis::Core::JsonRepresentation; end
99
+
100
+ include Google::Apis::Core::JsonObjectSupport
101
+ end
102
+
103
+ class SurveysDeleteResponse
104
+ class Representation < Google::Apis::Core::JsonRepresentation; end
105
+
106
+ include Google::Apis::Core::JsonObjectSupport
107
+ end
108
+
109
+ class SurveysListResponse
110
+ class Representation < Google::Apis::Core::JsonRepresentation; end
111
+
112
+ include Google::Apis::Core::JsonObjectSupport
113
+ end
114
+
115
+ class SurveysStartRequest
116
+ class Representation < Google::Apis::Core::JsonRepresentation; end
117
+
118
+ include Google::Apis::Core::JsonObjectSupport
119
+ end
120
+
121
+ class SurveysStartResponse
122
+ class Representation < Google::Apis::Core::JsonRepresentation; end
123
+
124
+ include Google::Apis::Core::JsonObjectSupport
125
+ end
126
+
127
+ class SurveysStopResponse
128
+ class Representation < Google::Apis::Core::JsonRepresentation; end
129
+
130
+ include Google::Apis::Core::JsonObjectSupport
131
+ end
132
+
133
+ class TokenPagination
134
+ class Representation < Google::Apis::Core::JsonRepresentation; end
135
+
136
+ include Google::Apis::Core::JsonObjectSupport
137
+ end
138
+
139
+ class FieldMask
140
+ # @private
141
+ class Representation < Google::Apis::Core::JsonRepresentation
142
+ collection :fields, as: 'fields', class: Google::Apis::SurveysV2::FieldMask, decorator: Google::Apis::SurveysV2::FieldMask::Representation
143
+
144
+ property :id, as: 'id'
145
+ end
146
+ end
147
+
148
+ class MobileAppPanel
149
+ # @private
150
+ class Representation < Google::Apis::Core::JsonRepresentation
151
+ property :country, as: 'country'
152
+ property :is_public_panel, as: 'isPublicPanel'
153
+ property :language, as: 'language'
154
+ property :mobile_app_panel_id, as: 'mobileAppPanelId'
155
+ property :name, as: 'name'
156
+ collection :owners, as: 'owners'
157
+ end
158
+ end
159
+
160
+ class MobileAppPanelsListResponse
161
+ # @private
162
+ class Representation < Google::Apis::Core::JsonRepresentation
163
+ property :page_info, as: 'pageInfo', class: Google::Apis::SurveysV2::PageInfo, decorator: Google::Apis::SurveysV2::PageInfo::Representation
164
+
165
+ property :request_id, as: 'requestId'
166
+ collection :resources, as: 'resources', class: Google::Apis::SurveysV2::MobileAppPanel, decorator: Google::Apis::SurveysV2::MobileAppPanel::Representation
167
+
168
+ property :token_pagination, as: 'tokenPagination', class: Google::Apis::SurveysV2::TokenPagination, decorator: Google::Apis::SurveysV2::TokenPagination::Representation
169
+
170
+ end
171
+ end
172
+
173
+ class PageInfo
174
+ # @private
175
+ class Representation < Google::Apis::Core::JsonRepresentation
176
+ property :result_per_page, as: 'resultPerPage'
177
+ property :start_index, as: 'startIndex'
178
+ property :total_results, as: 'totalResults'
179
+ end
180
+ end
181
+
182
+ class ResultsGetRequest
183
+ # @private
184
+ class Representation < Google::Apis::Core::JsonRepresentation
185
+ property :result_mask, as: 'resultMask', class: Google::Apis::SurveysV2::ResultsMask, decorator: Google::Apis::SurveysV2::ResultsMask::Representation
186
+
187
+ end
188
+ end
189
+
190
+ class ResultsMask
191
+ # @private
192
+ class Representation < Google::Apis::Core::JsonRepresentation
193
+ collection :fields, as: 'fields', class: Google::Apis::SurveysV2::FieldMask, decorator: Google::Apis::SurveysV2::FieldMask::Representation
194
+
195
+ property :projection, as: 'projection'
196
+ end
197
+ end
198
+
199
+ class Survey
200
+ # @private
201
+ class Representation < Google::Apis::Core::JsonRepresentation
202
+ property :audience, as: 'audience', class: Google::Apis::SurveysV2::SurveyAudience, decorator: Google::Apis::SurveysV2::SurveyAudience::Representation
203
+
204
+ property :cost, as: 'cost', class: Google::Apis::SurveysV2::SurveyCost, decorator: Google::Apis::SurveysV2::SurveyCost::Representation
205
+
206
+ property :customer_data, :base64 => true, as: 'customerData'
207
+ property :description, as: 'description'
208
+ collection :owners, as: 'owners'
209
+ collection :questions, as: 'questions', class: Google::Apis::SurveysV2::SurveyQuestion, decorator: Google::Apis::SurveysV2::SurveyQuestion::Representation
210
+
211
+ property :rejection_reason, as: 'rejectionReason', class: Google::Apis::SurveysV2::SurveyRejection, decorator: Google::Apis::SurveysV2::SurveyRejection::Representation
212
+
213
+ property :state, as: 'state'
214
+ property :survey_url_id, as: 'surveyUrlId'
215
+ property :title, as: 'title'
216
+ property :wanted_response_count, as: 'wantedResponseCount'
217
+ end
218
+ end
219
+
220
+ class SurveyAudience
221
+ # @private
222
+ class Representation < Google::Apis::Core::JsonRepresentation
223
+ collection :ages, as: 'ages'
224
+ property :country, as: 'country'
225
+ property :country_subdivision, as: 'countrySubdivision'
226
+ property :gender, as: 'gender'
227
+ collection :languages, as: 'languages'
228
+ property :mobile_app_panel_id, as: 'mobileAppPanelId'
229
+ property :population_source, as: 'populationSource'
230
+ end
231
+ end
232
+
233
+ class SurveyCost
234
+ # @private
235
+ class Representation < Google::Apis::Core::JsonRepresentation
236
+ property :cost_per_response_nanos, as: 'costPerResponseNanos'
237
+ property :currency_code, as: 'currencyCode'
238
+ property :max_cost_per_response_nanos, as: 'maxCostPerResponseNanos'
239
+ property :nanos, as: 'nanos'
240
+ end
241
+ end
242
+
243
+ class SurveyQuestion
244
+ # @private
245
+ class Representation < Google::Apis::Core::JsonRepresentation
246
+ property :answer_order, as: 'answerOrder'
247
+ collection :answers, as: 'answers'
248
+ property :has_other, as: 'hasOther'
249
+ property :high_value_label, as: 'highValueLabel'
250
+ collection :images, as: 'images', class: Google::Apis::SurveysV2::SurveyQuestionImage, decorator: Google::Apis::SurveysV2::SurveyQuestionImage::Representation
251
+
252
+ property :last_answer_position_pinned, as: 'lastAnswerPositionPinned'
253
+ property :low_value_label, as: 'lowValueLabel'
254
+ property :must_pick_suggestion, as: 'mustPickSuggestion'
255
+ property :num_stars, as: 'numStars'
256
+ property :open_text_placeholder, as: 'openTextPlaceholder'
257
+ collection :open_text_suggestions, as: 'openTextSuggestions'
258
+ property :question, as: 'question'
259
+ property :sentiment_text, as: 'sentimentText'
260
+ property :single_line_response, as: 'singleLineResponse'
261
+ collection :threshold_answers, as: 'thresholdAnswers'
262
+ property :type, as: 'type'
263
+ property :unit_of_measurement_label, as: 'unitOfMeasurementLabel'
264
+ property :video_id, as: 'videoId'
265
+ end
266
+ end
267
+
268
+ class SurveyQuestionImage
269
+ # @private
270
+ class Representation < Google::Apis::Core::JsonRepresentation
271
+ property :alt_text, as: 'altText'
272
+ property :data, :base64 => true, as: 'data'
273
+ property :url, as: 'url'
274
+ end
275
+ end
276
+
277
+ class SurveyRejection
278
+ # @private
279
+ class Representation < Google::Apis::Core::JsonRepresentation
280
+ property :explanation, as: 'explanation'
281
+ property :type, as: 'type'
282
+ end
283
+ end
284
+
285
+ class SurveyResults
286
+ # @private
287
+ class Representation < Google::Apis::Core::JsonRepresentation
288
+ property :status, as: 'status'
289
+ property :survey_url_id, as: 'surveyUrlId'
290
+ end
291
+ end
292
+
293
+ class SurveysDeleteResponse
294
+ # @private
295
+ class Representation < Google::Apis::Core::JsonRepresentation
296
+ property :request_id, as: 'requestId'
297
+ end
298
+ end
299
+
300
+ class SurveysListResponse
301
+ # @private
302
+ class Representation < Google::Apis::Core::JsonRepresentation
303
+ property :page_info, as: 'pageInfo', class: Google::Apis::SurveysV2::PageInfo, decorator: Google::Apis::SurveysV2::PageInfo::Representation
304
+
305
+ property :request_id, as: 'requestId'
306
+ collection :resources, as: 'resources', class: Google::Apis::SurveysV2::Survey, decorator: Google::Apis::SurveysV2::Survey::Representation
307
+
308
+ property :token_pagination, as: 'tokenPagination', class: Google::Apis::SurveysV2::TokenPagination, decorator: Google::Apis::SurveysV2::TokenPagination::Representation
309
+
310
+ end
311
+ end
312
+
313
+ class SurveysStartRequest
314
+ # @private
315
+ class Representation < Google::Apis::Core::JsonRepresentation
316
+ property :max_cost_per_response_nanos, as: 'maxCostPerResponseNanos'
317
+ end
318
+ end
319
+
320
+ class SurveysStartResponse
321
+ # @private
322
+ class Representation < Google::Apis::Core::JsonRepresentation
323
+ property :request_id, as: 'requestId'
324
+ property :resource, as: 'resource', class: Google::Apis::SurveysV2::Survey, decorator: Google::Apis::SurveysV2::Survey::Representation
325
+
326
+ end
327
+ end
328
+
329
+ class SurveysStopResponse
330
+ # @private
331
+ class Representation < Google::Apis::Core::JsonRepresentation
332
+ property :request_id, as: 'requestId'
333
+ property :resource, as: 'resource', class: Google::Apis::SurveysV2::Survey, decorator: Google::Apis::SurveysV2::Survey::Representation
334
+
335
+ end
336
+ end
337
+
338
+ class TokenPagination
339
+ # @private
340
+ class Representation < Google::Apis::Core::JsonRepresentation
341
+ property :next_page_token, as: 'nextPageToken'
342
+ property :previous_page_token, as: 'previousPageToken'
343
+ end
344
+ end
345
+ end
346
+ end
347
+ end
@@ -0,0 +1,477 @@
1
+ # Copyright 2015 Google Inc.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'google/apis/core/base_service'
16
+ require 'google/apis/core/json_representation'
17
+ require 'google/apis/core/hashable'
18
+ require 'google/apis/errors'
19
+
20
+ module Google
21
+ module Apis
22
+ module SurveysV2
23
+ # Surveys API
24
+ #
25
+ # Creates and conducts surveys, lists the surveys that an authenticated user
26
+ # owns, and retrieves survey results and information about specified surveys.
27
+ #
28
+ # @example
29
+ # require 'google/apis/surveys_v2'
30
+ #
31
+ # Surveys = Google::Apis::SurveysV2 # Alias the module
32
+ # service = Surveys::SurveysService.new
33
+ #
34
+ class SurveysService < Google::Apis::Core::BaseService
35
+ # @return [String]
36
+ # API key. Your API key identifies your project and provides you with API access,
37
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
38
+ attr_accessor :key
39
+
40
+ # @return [String]
41
+ # Available to use for quota purposes for server-side applications. Can be any
42
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
43
+ # Overrides userIp if both are provided.
44
+ attr_accessor :quota_user
45
+
46
+ # @return [String]
47
+ # IP address of the site where the request originates. Use this if you want to
48
+ # enforce per-user limits.
49
+ attr_accessor :user_ip
50
+
51
+ def initialize
52
+ super('https://www.googleapis.com/', 'surveys/v2/')
53
+ end
54
+
55
+ # Retrieves a MobileAppPanel that is available to the authenticated user.
56
+ # @param [String] panel_id
57
+ # External URL ID for the panel.
58
+ # @param [String] fields
59
+ # Selector specifying which fields to include in a partial response.
60
+ # @param [String] quota_user
61
+ # Available to use for quota purposes for server-side applications. Can be any
62
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
63
+ # Overrides userIp if both are provided.
64
+ # @param [String] user_ip
65
+ # IP address of the site where the request originates. Use this if you want to
66
+ # enforce per-user limits.
67
+ # @param [Google::Apis::RequestOptions] options
68
+ # Request-specific options
69
+ #
70
+ # @yield [result, err] Result & error if block supplied
71
+ # @yieldparam result [Google::Apis::SurveysV2::MobileAppPanel] parsed result object
72
+ # @yieldparam err [StandardError] error object if request failed
73
+ #
74
+ # @return [Google::Apis::SurveysV2::MobileAppPanel]
75
+ #
76
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
77
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
78
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
79
+ def get_mobileapppanel(panel_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
80
+ command = make_simple_command(:get, 'mobileAppPanels/{panelId}', options)
81
+ command.response_representation = Google::Apis::SurveysV2::MobileAppPanel::Representation
82
+ command.response_class = Google::Apis::SurveysV2::MobileAppPanel
83
+ command.params['panelId'] = panel_id unless panel_id.nil?
84
+ command.query['fields'] = fields unless fields.nil?
85
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
86
+ command.query['userIp'] = user_ip unless user_ip.nil?
87
+ execute_or_queue_command(command, &block)
88
+ end
89
+
90
+ # Lists the MobileAppPanels available to the authenticated user.
91
+ # @param [Fixnum] max_results
92
+ # @param [Fixnum] start_index
93
+ # @param [String] token
94
+ # @param [String] fields
95
+ # Selector specifying which fields to include in a partial response.
96
+ # @param [String] quota_user
97
+ # Available to use for quota purposes for server-side applications. Can be any
98
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
99
+ # Overrides userIp if both are provided.
100
+ # @param [String] user_ip
101
+ # IP address of the site where the request originates. Use this if you want to
102
+ # enforce per-user limits.
103
+ # @param [Google::Apis::RequestOptions] options
104
+ # Request-specific options
105
+ #
106
+ # @yield [result, err] Result & error if block supplied
107
+ # @yieldparam result [Google::Apis::SurveysV2::MobileAppPanelsListResponse] parsed result object
108
+ # @yieldparam err [StandardError] error object if request failed
109
+ #
110
+ # @return [Google::Apis::SurveysV2::MobileAppPanelsListResponse]
111
+ #
112
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
113
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
114
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
115
+ def list_mobileapppanels(max_results: nil, start_index: nil, token: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
116
+ command = make_simple_command(:get, 'mobileAppPanels', options)
117
+ command.response_representation = Google::Apis::SurveysV2::MobileAppPanelsListResponse::Representation
118
+ command.response_class = Google::Apis::SurveysV2::MobileAppPanelsListResponse
119
+ command.query['maxResults'] = max_results unless max_results.nil?
120
+ command.query['startIndex'] = start_index unless start_index.nil?
121
+ command.query['token'] = token unless token.nil?
122
+ command.query['fields'] = fields unless fields.nil?
123
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
124
+ command.query['userIp'] = user_ip unless user_ip.nil?
125
+ execute_or_queue_command(command, &block)
126
+ end
127
+
128
+ # Updates a MobileAppPanel. Currently the only property that can be updated is
129
+ # the owners property.
130
+ # @param [String] panel_id
131
+ # External URL ID for the panel.
132
+ # @param [Google::Apis::SurveysV2::MobileAppPanel] mobile_app_panel_object
133
+ # @param [String] fields
134
+ # Selector specifying which fields to include in a partial response.
135
+ # @param [String] quota_user
136
+ # Available to use for quota purposes for server-side applications. Can be any
137
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
138
+ # Overrides userIp if both are provided.
139
+ # @param [String] user_ip
140
+ # IP address of the site where the request originates. Use this if you want to
141
+ # enforce per-user limits.
142
+ # @param [Google::Apis::RequestOptions] options
143
+ # Request-specific options
144
+ #
145
+ # @yield [result, err] Result & error if block supplied
146
+ # @yieldparam result [Google::Apis::SurveysV2::MobileAppPanel] parsed result object
147
+ # @yieldparam err [StandardError] error object if request failed
148
+ #
149
+ # @return [Google::Apis::SurveysV2::MobileAppPanel]
150
+ #
151
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
152
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
153
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
154
+ def update_mobileapppanel(panel_id, mobile_app_panel_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
155
+ command = make_simple_command(:put, 'mobileAppPanels/{panelId}', options)
156
+ command.request_representation = Google::Apis::SurveysV2::MobileAppPanel::Representation
157
+ command.request_object = mobile_app_panel_object
158
+ command.response_representation = Google::Apis::SurveysV2::MobileAppPanel::Representation
159
+ command.response_class = Google::Apis::SurveysV2::MobileAppPanel
160
+ command.params['panelId'] = panel_id unless panel_id.nil?
161
+ command.query['fields'] = fields unless fields.nil?
162
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
163
+ command.query['userIp'] = user_ip unless user_ip.nil?
164
+ execute_or_queue_command(command, &block)
165
+ end
166
+
167
+ # Retrieves any survey results that have been produced so far. Results are
168
+ # formatted as an Excel file. You must add "?alt=media" to the URL as an
169
+ # argument to get results.
170
+ # @param [String] survey_url_id
171
+ # External URL ID for the survey.
172
+ # @param [Google::Apis::SurveysV2::ResultsGetRequest] results_get_request_object
173
+ # @param [String] fields
174
+ # Selector specifying which fields to include in a partial response.
175
+ # @param [String] quota_user
176
+ # Available to use for quota purposes for server-side applications. Can be any
177
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
178
+ # Overrides userIp if both are provided.
179
+ # @param [String] user_ip
180
+ # IP address of the site where the request originates. Use this if you want to
181
+ # enforce per-user limits.
182
+ # @param [IO, String] download_dest
183
+ # IO stream or filename to receive content download
184
+ # @param [Google::Apis::RequestOptions] options
185
+ # Request-specific options
186
+ #
187
+ # @yield [result, err] Result & error if block supplied
188
+ # @yieldparam result [Google::Apis::SurveysV2::SurveyResults] parsed result object
189
+ # @yieldparam err [StandardError] error object if request failed
190
+ #
191
+ # @return [Google::Apis::SurveysV2::SurveyResults]
192
+ #
193
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
194
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
195
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
196
+ 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)
197
+ if download_dest.nil?
198
+ command = make_simple_command(:get, 'surveys/{surveyUrlId}/results', options)
199
+ else
200
+ command = make_download_command(:get, 'surveys/{surveyUrlId}/results', options)
201
+ command.download_dest = download_dest
202
+ end
203
+ command.request_representation = Google::Apis::SurveysV2::ResultsGetRequest::Representation
204
+ command.request_object = results_get_request_object
205
+ command.response_representation = Google::Apis::SurveysV2::SurveyResults::Representation
206
+ command.response_class = Google::Apis::SurveysV2::SurveyResults
207
+ command.params['surveyUrlId'] = survey_url_id unless survey_url_id.nil?
208
+ command.query['fields'] = fields unless fields.nil?
209
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
210
+ command.query['userIp'] = user_ip unless user_ip.nil?
211
+ execute_or_queue_command(command, &block)
212
+ end
213
+
214
+ # Removes a survey from view in all user GET requests.
215
+ # @param [String] survey_url_id
216
+ # External URL ID for the survey.
217
+ # @param [String] fields
218
+ # Selector specifying which fields to include in a partial response.
219
+ # @param [String] quota_user
220
+ # Available to use for quota purposes for server-side applications. Can be any
221
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
222
+ # Overrides userIp if both are provided.
223
+ # @param [String] user_ip
224
+ # IP address of the site where the request originates. Use this if you want to
225
+ # enforce per-user limits.
226
+ # @param [Google::Apis::RequestOptions] options
227
+ # Request-specific options
228
+ #
229
+ # @yield [result, err] Result & error if block supplied
230
+ # @yieldparam result [Google::Apis::SurveysV2::SurveysDeleteResponse] parsed result object
231
+ # @yieldparam err [StandardError] error object if request failed
232
+ #
233
+ # @return [Google::Apis::SurveysV2::SurveysDeleteResponse]
234
+ #
235
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
236
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
237
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
238
+ def delete_survey(survey_url_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
239
+ command = make_simple_command(:delete, 'surveys/{surveyUrlId}', options)
240
+ command.response_representation = Google::Apis::SurveysV2::SurveysDeleteResponse::Representation
241
+ command.response_class = Google::Apis::SurveysV2::SurveysDeleteResponse
242
+ command.params['surveyUrlId'] = survey_url_id unless survey_url_id.nil?
243
+ command.query['fields'] = fields unless fields.nil?
244
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
245
+ command.query['userIp'] = user_ip unless user_ip.nil?
246
+ execute_or_queue_command(command, &block)
247
+ end
248
+
249
+ # Retrieves information about the specified survey.
250
+ # @param [String] survey_url_id
251
+ # External URL ID for the survey.
252
+ # @param [String] fields
253
+ # Selector specifying which fields to include in a partial response.
254
+ # @param [String] quota_user
255
+ # Available to use for quota purposes for server-side applications. Can be any
256
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
257
+ # Overrides userIp if both are provided.
258
+ # @param [String] user_ip
259
+ # IP address of the site where the request originates. Use this if you want to
260
+ # enforce per-user limits.
261
+ # @param [Google::Apis::RequestOptions] options
262
+ # Request-specific options
263
+ #
264
+ # @yield [result, err] Result & error if block supplied
265
+ # @yieldparam result [Google::Apis::SurveysV2::Survey] parsed result object
266
+ # @yieldparam err [StandardError] error object if request failed
267
+ #
268
+ # @return [Google::Apis::SurveysV2::Survey]
269
+ #
270
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
271
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
272
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
273
+ def get_survey(survey_url_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
274
+ command = make_simple_command(:get, 'surveys/{surveyUrlId}', options)
275
+ command.response_representation = Google::Apis::SurveysV2::Survey::Representation
276
+ command.response_class = Google::Apis::SurveysV2::Survey
277
+ command.params['surveyUrlId'] = survey_url_id unless survey_url_id.nil?
278
+ command.query['fields'] = fields unless fields.nil?
279
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
280
+ command.query['userIp'] = user_ip unless user_ip.nil?
281
+ execute_or_queue_command(command, &block)
282
+ end
283
+
284
+ # Creates a survey.
285
+ # @param [Google::Apis::SurveysV2::Survey] survey_object
286
+ # @param [String] fields
287
+ # Selector specifying which fields to include in a partial response.
288
+ # @param [String] quota_user
289
+ # Available to use for quota purposes for server-side applications. Can be any
290
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
291
+ # Overrides userIp if both are provided.
292
+ # @param [String] user_ip
293
+ # IP address of the site where the request originates. Use this if you want to
294
+ # enforce per-user limits.
295
+ # @param [Google::Apis::RequestOptions] options
296
+ # Request-specific options
297
+ #
298
+ # @yield [result, err] Result & error if block supplied
299
+ # @yieldparam result [Google::Apis::SurveysV2::Survey] parsed result object
300
+ # @yieldparam err [StandardError] error object if request failed
301
+ #
302
+ # @return [Google::Apis::SurveysV2::Survey]
303
+ #
304
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
305
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
306
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
307
+ def insert_survey(survey_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
308
+ command = make_simple_command(:post, 'surveys', options)
309
+ command.request_representation = Google::Apis::SurveysV2::Survey::Representation
310
+ command.request_object = survey_object
311
+ command.response_representation = Google::Apis::SurveysV2::Survey::Representation
312
+ command.response_class = Google::Apis::SurveysV2::Survey
313
+ command.query['fields'] = fields unless fields.nil?
314
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
315
+ command.query['userIp'] = user_ip unless user_ip.nil?
316
+ execute_or_queue_command(command, &block)
317
+ end
318
+
319
+ # Lists the surveys owned by the authenticated user.
320
+ # @param [Fixnum] max_results
321
+ # @param [Fixnum] start_index
322
+ # @param [String] token
323
+ # @param [String] fields
324
+ # Selector specifying which fields to include in a partial response.
325
+ # @param [String] quota_user
326
+ # Available to use for quota purposes for server-side applications. Can be any
327
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
328
+ # Overrides userIp if both are provided.
329
+ # @param [String] user_ip
330
+ # IP address of the site where the request originates. Use this if you want to
331
+ # enforce per-user limits.
332
+ # @param [Google::Apis::RequestOptions] options
333
+ # Request-specific options
334
+ #
335
+ # @yield [result, err] Result & error if block supplied
336
+ # @yieldparam result [Google::Apis::SurveysV2::SurveysListResponse] parsed result object
337
+ # @yieldparam err [StandardError] error object if request failed
338
+ #
339
+ # @return [Google::Apis::SurveysV2::SurveysListResponse]
340
+ #
341
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
342
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
343
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
344
+ def list_surveys(max_results: nil, start_index: nil, token: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
345
+ command = make_simple_command(:get, 'surveys', options)
346
+ command.response_representation = Google::Apis::SurveysV2::SurveysListResponse::Representation
347
+ command.response_class = Google::Apis::SurveysV2::SurveysListResponse
348
+ command.query['maxResults'] = max_results unless max_results.nil?
349
+ command.query['startIndex'] = start_index unless start_index.nil?
350
+ command.query['token'] = token unless token.nil?
351
+ command.query['fields'] = fields unless fields.nil?
352
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
353
+ command.query['userIp'] = user_ip unless user_ip.nil?
354
+ execute_or_queue_command(command, &block)
355
+ end
356
+
357
+ # Begins running a survey.
358
+ # @param [String] resource_id
359
+ # @param [Google::Apis::SurveysV2::SurveysStartRequest] surveys_start_request_object
360
+ # @param [String] fields
361
+ # Selector specifying which fields to include in a partial response.
362
+ # @param [String] quota_user
363
+ # Available to use for quota purposes for server-side applications. Can be any
364
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
365
+ # Overrides userIp if both are provided.
366
+ # @param [String] user_ip
367
+ # IP address of the site where the request originates. Use this if you want to
368
+ # enforce per-user limits.
369
+ # @param [Google::Apis::RequestOptions] options
370
+ # Request-specific options
371
+ #
372
+ # @yield [result, err] Result & error if block supplied
373
+ # @yieldparam result [Google::Apis::SurveysV2::SurveysStartResponse] parsed result object
374
+ # @yieldparam err [StandardError] error object if request failed
375
+ #
376
+ # @return [Google::Apis::SurveysV2::SurveysStartResponse]
377
+ #
378
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
379
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
380
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
381
+ def start_survey(resource_id, surveys_start_request_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
382
+ command = make_simple_command(:post, 'surveys/{resourceId}/start', options)
383
+ command.request_representation = Google::Apis::SurveysV2::SurveysStartRequest::Representation
384
+ command.request_object = surveys_start_request_object
385
+ command.response_representation = Google::Apis::SurveysV2::SurveysStartResponse::Representation
386
+ command.response_class = Google::Apis::SurveysV2::SurveysStartResponse
387
+ command.params['resourceId'] = resource_id unless resource_id.nil?
388
+ command.query['fields'] = fields unless fields.nil?
389
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
390
+ command.query['userIp'] = user_ip unless user_ip.nil?
391
+ execute_or_queue_command(command, &block)
392
+ end
393
+
394
+ # Stops a running survey.
395
+ # @param [String] resource_id
396
+ # @param [String] fields
397
+ # Selector specifying which fields to include in a partial response.
398
+ # @param [String] quota_user
399
+ # Available to use for quota purposes for server-side applications. Can be any
400
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
401
+ # Overrides userIp if both are provided.
402
+ # @param [String] user_ip
403
+ # IP address of the site where the request originates. Use this if you want to
404
+ # enforce per-user limits.
405
+ # @param [Google::Apis::RequestOptions] options
406
+ # Request-specific options
407
+ #
408
+ # @yield [result, err] Result & error if block supplied
409
+ # @yieldparam result [Google::Apis::SurveysV2::SurveysStopResponse] parsed result object
410
+ # @yieldparam err [StandardError] error object if request failed
411
+ #
412
+ # @return [Google::Apis::SurveysV2::SurveysStopResponse]
413
+ #
414
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
415
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
416
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
417
+ def stop_survey(resource_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
418
+ command = make_simple_command(:post, 'surveys/{resourceId}/stop', options)
419
+ command.response_representation = Google::Apis::SurveysV2::SurveysStopResponse::Representation
420
+ command.response_class = Google::Apis::SurveysV2::SurveysStopResponse
421
+ command.params['resourceId'] = resource_id unless resource_id.nil?
422
+ command.query['fields'] = fields unless fields.nil?
423
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
424
+ command.query['userIp'] = user_ip unless user_ip.nil?
425
+ execute_or_queue_command(command, &block)
426
+ end
427
+
428
+ # Updates a survey. Currently the only property that can be updated is the
429
+ # owners property.
430
+ # @param [String] survey_url_id
431
+ # External URL ID for the survey.
432
+ # @param [Google::Apis::SurveysV2::Survey] survey_object
433
+ # @param [String] fields
434
+ # Selector specifying which fields to include in a partial response.
435
+ # @param [String] quota_user
436
+ # Available to use for quota purposes for server-side applications. Can be any
437
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
438
+ # Overrides userIp if both are provided.
439
+ # @param [String] user_ip
440
+ # IP address of the site where the request originates. Use this if you want to
441
+ # enforce per-user limits.
442
+ # @param [Google::Apis::RequestOptions] options
443
+ # Request-specific options
444
+ #
445
+ # @yield [result, err] Result & error if block supplied
446
+ # @yieldparam result [Google::Apis::SurveysV2::Survey] parsed result object
447
+ # @yieldparam err [StandardError] error object if request failed
448
+ #
449
+ # @return [Google::Apis::SurveysV2::Survey]
450
+ #
451
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
452
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
453
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
454
+ def update_survey(survey_url_id, survey_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
455
+ command = make_simple_command(:put, 'surveys/{surveyUrlId}', options)
456
+ command.request_representation = Google::Apis::SurveysV2::Survey::Representation
457
+ command.request_object = survey_object
458
+ command.response_representation = Google::Apis::SurveysV2::Survey::Representation
459
+ command.response_class = Google::Apis::SurveysV2::Survey
460
+ command.params['surveyUrlId'] = survey_url_id unless survey_url_id.nil?
461
+ command.query['fields'] = fields unless fields.nil?
462
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
463
+ command.query['userIp'] = user_ip unless user_ip.nil?
464
+ execute_or_queue_command(command, &block)
465
+ end
466
+
467
+ protected
468
+
469
+ def apply_command_defaults(command)
470
+ command.query['key'] = key unless key.nil?
471
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
472
+ command.query['userIp'] = user_ip unless user_ip.nil?
473
+ end
474
+ end
475
+ end
476
+ end
477
+ end